summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scilab/Scilab.sln16
-rw-r--r--scilab/Scilab_f2c.sln15
-rw-r--r--scilab/modules/Makefile.am1
-rw-r--r--scilab/modules/Makefile.in1
-rw-r--r--scilab/modules/parameters/.gitignore4
-rw-r--r--scilab/modules/parameters/LibScilab_Import.def9
-rw-r--r--scilab/modules/parameters/Localization_Import.def7
-rw-r--r--scilab/modules/parameters/Makefile.am24
-rw-r--r--scilab/modules/parameters/Makefile.in227
-rw-r--r--scilab/modules/parameters/Scilab_windows_Import.def7
-rw-r--r--scilab/modules/parameters/includes/parameters.h192
-rw-r--r--scilab/modules/parameters/parameters.iss5
-rw-r--r--scilab/modules/parameters/parameters.vcproj461
-rw-r--r--scilab/modules/parameters/parameters_header.def8
-rw-r--r--scilab/modules/parameters/src/c/DllmainParameters.c33
-rw-r--r--scilab/modules/parameters/src/c/parameters.c1138
-rw-r--r--scilab/modules/parameters/src/c/parameters.rc97
17 files changed, 2215 insertions, 30 deletions
diff --git a/scilab/Scilab.sln b/scilab/Scilab.sln
index d8496a5..33fc0dc 100644
--- a/scilab/Scilab.sln
+++ b/scilab/Scilab.sln
@@ -1089,6 +1089,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types-Ant", "modules\types\
1089EndProject 1089EndProject
1090Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rename-vc-files", "Visual-Studio-settings\rename-vc-files\rename-vc-files.vcproj", "{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}" 1090Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rename-vc-files", "Visual-Studio-settings\rename-vc-files\rename-vc-files.vcproj", "{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}"
1091EndProject 1091EndProject
1092Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parameters", "modules\parameters\parameters.vcproj", "{A09E8584-0713-48A5-97BA-ACED0F3728F8}"
1093 ProjectSection(ProjectDependencies) = postProject
1094 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
1095 {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
1096 {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
1097 {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
1098 EndProjectSection
1099EndProject
1092Global 1100Global
1093 GlobalSection(SolutionConfigurationPlatforms) = preSolution 1101 GlobalSection(SolutionConfigurationPlatforms) = preSolution
1094 Debug|Win32 = Debug|Win32 1102 Debug|Win32 = Debug|Win32
@@ -2201,6 +2209,14 @@ Global
2201 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.Build.0 = Release|Win32 2209 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.Build.0 = Release|Win32
2202 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.ActiveCfg = Release|x64 2210 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.ActiveCfg = Release|x64
2203 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.Build.0 = Release|x64 2211 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.Build.0 = Release|x64
2212 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.ActiveCfg = Debug|Win32
2213 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.Build.0 = Debug|Win32
2214 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.ActiveCfg = Debug|x64
2215 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.Build.0 = Debug|x64
2216 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.ActiveCfg = Release|Win32
2217 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.Build.0 = Release|Win32
2218 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.ActiveCfg = Release|x64
2219 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.Build.0 = Release|x64
2204 EndGlobalSection 2220 EndGlobalSection
2205 GlobalSection(SolutionProperties) = preSolution 2221 GlobalSection(SolutionProperties) = preSolution
2206 HideSolutionNode = FALSE 2222 HideSolutionNode = FALSE
diff --git a/scilab/Scilab_f2c.sln b/scilab/Scilab_f2c.sln
index 1fe0ccc..5e548aa 100644
--- a/scilab/Scilab_f2c.sln
+++ b/scilab/Scilab_f2c.sln
@@ -1090,6 +1090,13 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types-Ant", "modules\types\
1090EndProject 1090EndProject
1091Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rename-vc-files", "Visual-Studio-settings\rename-vc-files\rename-vc-files.vcproj", "{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}" 1091Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rename-vc-files", "Visual-Studio-settings\rename-vc-files\rename-vc-files.vcproj", "{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}"
1092EndProject 1092EndProject
1093Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parameters", "modules\parameters\parameters.vcproj", "{A09E8584-0713-48A5-97BA-ACED0F3728F8}"
1094 ProjectSection(ProjectDependencies) = postProject
1095 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
1096 {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
1097 {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
1098 EndProjectSection
1099EndProject
1093Global 1100Global
1094 GlobalSection(SolutionConfigurationPlatforms) = preSolution 1101 GlobalSection(SolutionConfigurationPlatforms) = preSolution
1095 Debug|Win32 = Debug|Win32 1102 Debug|Win32 = Debug|Win32
@@ -2204,6 +2211,14 @@ Global
2204 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.Build.0 = Release|Win32 2211 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.Build.0 = Release|Win32
2205 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.ActiveCfg = Release|x64 2212 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.ActiveCfg = Release|x64
2206 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.Build.0 = Release|x64 2213 {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.Build.0 = Release|x64
2214 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.ActiveCfg = Debug|Win32
2215 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.Build.0 = Debug|Win32
2216 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.ActiveCfg = Debug|x64
2217 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.Build.0 = Debug|x64
2218 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.ActiveCfg = Release|Win32
2219 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.Build.0 = Release|Win32
2220 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.ActiveCfg = Release|x64
2221 {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.Build.0 = Release|x64
2207 EndGlobalSection 2222 EndGlobalSection
2208 GlobalSection(SolutionProperties) = preSolution 2223 GlobalSection(SolutionProperties) = preSolution
2209 HideSolutionNode = FALSE 2224 HideSolutionNode = FALSE
diff --git a/scilab/modules/Makefile.am b/scilab/modules/Makefile.am
index 9647c96..dd122b8 100644
--- a/scilab/modules/Makefile.am
+++ b/scilab/modules/Makefile.am
@@ -152,6 +152,7 @@ NO_GUI_LIBS += $(top_builddir)/modules/hdf5/libscihdf5-forceload-disable.la
152endif 152endif
153ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \ 153ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \
154 $(top_builddir)/modules/mexlib/libmex.la \ 154 $(top_builddir)/modules/mexlib/libmex.la \
155 $(top_builddir)/modules/parameters/libsciparameters.la \
155 $(top_builddir)/modules/boolean/libsciboolean.la \ 156 $(top_builddir)/modules/boolean/libsciboolean.la \
156 $(top_builddir)/modules/cacsd/libscicacsd.la \ 157 $(top_builddir)/modules/cacsd/libscicacsd.la \
157 $(top_builddir)/modules/core/libscicore.la \ 158 $(top_builddir)/modules/core/libscicore.la \
diff --git a/scilab/modules/Makefile.in b/scilab/modules/Makefile.in
index 7e6f420..cd34418 100644
--- a/scilab/modules/Makefile.in
+++ b/scilab/modules/Makefile.in
@@ -483,6 +483,7 @@ NO_GUI_LIBS = $(top_builddir)/modules/gui/libscigui-disable.la \
483# HDF5 is here because it needs the JVM (see bug #5481) 483# HDF5 is here because it needs the JVM (see bug #5481)
484ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \ 484ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \
485 $(top_builddir)/modules/mexlib/libmex.la \ 485 $(top_builddir)/modules/mexlib/libmex.la \
486 $(top_builddir)/modules/parameters/libsciparameters.la \
486 $(top_builddir)/modules/boolean/libsciboolean.la \ 487 $(top_builddir)/modules/boolean/libsciboolean.la \
487 $(top_builddir)/modules/cacsd/libscicacsd.la \ 488 $(top_builddir)/modules/cacsd/libscicacsd.la \
488 $(top_builddir)/modules/core/libscicore.la \ 489 $(top_builddir)/modules/core/libscicore.la \
diff --git a/scilab/modules/parameters/.gitignore b/scilab/modules/parameters/.gitignore
new file mode 100644
index 0000000..43d6d39
--- /dev/null
+++ b/scilab/modules/parameters/.gitignore
@@ -0,0 +1,4 @@
1#
2#generated .def files (windows)
3#
4parameters_export.def
diff --git a/scilab/modules/parameters/LibScilab_Import.def b/scilab/modules/parameters/LibScilab_Import.def
new file mode 100644
index 0000000..58cb582
--- /dev/null
+++ b/scilab/modules/parameters/LibScilab_Import.def
@@ -0,0 +1,9 @@
1LIBRARY LibScilab.dll
2
3
4EXPORTS
5vstk_
6iop_
7com_
8stack_
9freeArrayOfString
diff --git a/scilab/modules/parameters/Localization_Import.def b/scilab/modules/parameters/Localization_Import.def
new file mode 100644
index 0000000..27f6e9b
--- /dev/null
+++ b/scilab/modules/parameters/Localization_Import.def
@@ -0,0 +1,7 @@
1 LIBRARY scilocalization.dll
2
3
4EXPORTS
5 to_wide_string
6 wide_string_to_UTF8
7 IsValidUTF8 \ No newline at end of file
diff --git a/scilab/modules/parameters/Makefile.am b/scilab/modules/parameters/Makefile.am
index 3b42454..af9a7cd 100644
--- a/scilab/modules/parameters/Makefile.am
+++ b/scilab/modules/parameters/Makefile.am
@@ -7,6 +7,30 @@
7# are also available at 7# are also available at
8# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 8# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 9
10### SOURCES ###
11
12PARAMETERS_C_SOURCES = src/c/parameters.c
13
14libsciparameters_la_CFLAGS=-I$(srcdir)/includes/ \
15-I$(srcdir)/src/c/ \
16-I$(top_srcdir)/modules/api_scilab/includes \
17-I$(top_srcdir)/modules/core/includes \
18-I$(top_srcdir)/libs/MALLOC/includes/ \
19-I$(top_srcdir)/modules/output_stream/includes/ \
20-I$(top_srcdir)/modules/localization/includes
21
22pkglib_LTLIBRARIES = libsciparameters.la
23
24libsciparameters_la_LDFLAGS = -version-info $(SCILAB_LIBRARY_VERSION)
25
26libsciparameters_la_SOURCES = $(PARAMETERS_C_SOURCES)
27
28# For the code check (splint)
29CHECK_SRC= $(libsciparameters_la_SOURCES)
30INCLUDE_FLAGS = $(libsciparameters_la_CFLAGS)
31
32libsciparameters_la_LIBADD = $(top_builddir)/modules/api_scilab/libsciapi_scilab.la
33
10#### Target ###### 34#### Target ######
11modulename=parameters 35modulename=parameters
12 36
diff --git a/scilab/modules/parameters/Makefile.in b/scilab/modules/parameters/Makefile.in
index 4f75c15..7cf48f5 100644
--- a/scilab/modules/parameters/Makefile.in
+++ b/scilab/modules/parameters/Makefile.in
@@ -24,6 +24,8 @@
24# are also available at 24# are also available at
25# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 25# http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
26 26
27### SOURCES ###
28
27# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 29# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
28# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr> 30# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr>
29# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr> 31# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr>
@@ -40,6 +42,7 @@
40### Target, variable, suffixes which are supposed to be usefull in every makefile.am 42### Target, variable, suffixes which are supposed to be usefull in every makefile.am
41########## 43##########
42 44
45
43VPATH = @srcdir@ 46VPATH = @srcdir@
44pkgdatadir = $(datadir)/@PACKAGE@ 47pkgdatadir = $(datadir)/@PACKAGE@
45pkgincludedir = $(includedir)/@PACKAGE@ 48pkgincludedir = $(includedir)/@PACKAGE@
@@ -84,8 +87,6 @@ mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
84CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h 87CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h
85CONFIG_CLEAN_FILES = 88CONFIG_CLEAN_FILES =
86CONFIG_CLEAN_VPATH_FILES = 89CONFIG_CLEAN_VPATH_FILES =
87SOURCES =
88DIST_SOURCES =
89am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; 90am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
90am__vpath_adj = case $$p in \ 91am__vpath_adj = case $$p in \
91 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ 92 $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -107,9 +108,37 @@ am__nobase_list = $(am__nobase_strip_setup); \
107am__base_list = \ 108am__base_list = \
108 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ 109 sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
109 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' 110 sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
110am__installdirs = "$(DESTDIR)$(libparameters_la_etcdir)" \ 111am__installdirs = "$(DESTDIR)$(pkglibdir)" \
112 "$(DESTDIR)$(libparameters_la_etcdir)" \
111 "$(DESTDIR)$(libparameters_la_rootdir)" 113 "$(DESTDIR)$(libparameters_la_rootdir)"
114LTLIBRARIES = $(pkglib_LTLIBRARIES)
115libsciparameters_la_DEPENDENCIES = \
116 $(top_builddir)/modules/api_scilab/libsciapi_scilab.la
117am__objects_1 = libsciparameters_la-parameters.lo
118am_libsciparameters_la_OBJECTS = $(am__objects_1)
119libsciparameters_la_OBJECTS = $(am_libsciparameters_la_OBJECTS)
120libsciparameters_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
121 $(LIBTOOLFLAGS) --mode=link $(CCLD) \
122 $(libsciparameters_la_CFLAGS) $(CFLAGS) \
123 $(libsciparameters_la_LDFLAGS) $(LDFLAGS) -o $@
124DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
125depcomp = $(SHELL) $(top_srcdir)/config/depcomp
126am__depfiles_maybe = depfiles
127am__mv = mv -f
128COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
129 $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
130LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
131 --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
132 $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
133CCLD = $(CC)
134LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
135 --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
136 $(LDFLAGS) -o $@
137SOURCES = $(libsciparameters_la_SOURCES)
138DIST_SOURCES = $(libsciparameters_la_SOURCES)
112DATA = $(libparameters_la_etc_DATA) $(libparameters_la_root_DATA) 139DATA = $(libparameters_la_etc_DATA) $(libparameters_la_root_DATA)
140ETAGS = etags
141CTAGS = ctags
113DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 142DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
114ACLOCAL = @ACLOCAL@ 143ACLOCAL = @ACLOCAL@
115ALL_LINGUAS = @ALL_LINGUAS@ 144ALL_LINGUAS = @ALL_LINGUAS@
@@ -351,6 +380,23 @@ target_alias = @target_alias@
351top_build_prefix = @top_build_prefix@ 380top_build_prefix = @top_build_prefix@
352top_builddir = @top_builddir@ 381top_builddir = @top_builddir@
353top_srcdir = @top_srcdir@ 382top_srcdir = @top_srcdir@
383PARAMETERS_C_SOURCES = src/c/parameters.c
384libsciparameters_la_CFLAGS = -I$(srcdir)/includes/ \
385-I$(srcdir)/src/c/ \
386-I$(top_srcdir)/modules/api_scilab/includes \
387-I$(top_srcdir)/modules/core/includes \
388-I$(top_srcdir)/libs/MALLOC/includes/ \
389-I$(top_srcdir)/modules/output_stream/includes/ \
390-I$(top_srcdir)/modules/localization/includes
391
392pkglib_LTLIBRARIES = libsciparameters.la
393libsciparameters_la_LDFLAGS = -version-info $(SCILAB_LIBRARY_VERSION)
394libsciparameters_la_SOURCES = $(PARAMETERS_C_SOURCES)
395
396# For the code check (splint)
397CHECK_SRC = $(libsciparameters_la_SOURCES)
398INCLUDE_FLAGS = $(libsciparameters_la_CFLAGS)
399libsciparameters_la_LIBADD = $(top_builddir)/modules/api_scilab/libsciapi_scilab.la
354 400
355#### Target ###### 401#### Target ######
356modulename = parameters 402modulename = parameters
@@ -428,7 +474,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
428all: all-am 474all: all-am
429 475
430.SUFFIXES: 476.SUFFIXES:
431.SUFFIXES: .sci .bin 477.SUFFIXES: .sci .bin .c .lo .o .obj
432$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps) 478$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
433 @for dep in $?; do \ 479 @for dep in $?; do \
434 case '$(am__configure_deps)' in \ 480 case '$(am__configure_deps)' in \
@@ -459,6 +505,75 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
459$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) 505$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
460 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 506 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
461$(am__aclocal_m4_deps): 507$(am__aclocal_m4_deps):
508install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)
509 @$(NORMAL_INSTALL)
510 test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"
511 @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
512 list2=; for p in $$list; do \
513 if test -f $$p; then \
514 list2="$$list2 $$p"; \
515 else :; fi; \
516 done; \
517 test -z "$$list2" || { \
518 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \
519 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \
520 }
521
522uninstall-pkglibLTLIBRARIES:
523 @$(NORMAL_UNINSTALL)
524 @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \
525 for p in $$list; do \
526 $(am__strip_dir) \
527 echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \
528 $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \
529 done
530
531clean-pkglibLTLIBRARIES:
532 -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)
533 @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \
534 dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
535 test "$$dir" != "$$p" || dir=.; \
536 echo "rm -f \"$${dir}/so_locations\""; \
537 rm -f "$${dir}/so_locations"; \
538 done
539libsciparameters.la: $(libsciparameters_la_OBJECTS) $(libsciparameters_la_DEPENDENCIES)
540 $(libsciparameters_la_LINK) -rpath $(pkglibdir) $(libsciparameters_la_OBJECTS) $(libsciparameters_la_LIBADD) $(LIBS)
541
542mostlyclean-compile:
543 -rm -f *.$(OBJEXT)
544
545distclean-compile:
546 -rm -f *.tab.c
547
548@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libsciparameters_la-parameters.Plo@am__quote@
549
550.c.o:
551@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
552@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
553@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
554@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
555@am__fastdepCC_FALSE@ $(COMPILE) -c $<
556
557.c.obj:
558@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
559@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
560@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
561@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
562@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
563
564.c.lo:
565@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
566@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
567@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
568@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
569@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
570
571libsciparameters_la-parameters.lo: src/c/parameters.c
572@am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsciparameters_la_CFLAGS) $(CFLAGS) -MT libsciparameters_la-parameters.lo -MD -MP -MF $(DEPDIR)/libsciparameters_la-parameters.Tpo -c -o libsciparameters_la-parameters.lo `test -f 'src/c/parameters.c' || echo '$(srcdir)/'`src/c/parameters.c
573@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/libsciparameters_la-parameters.Tpo $(DEPDIR)/libsciparameters_la-parameters.Plo
574@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='src/c/parameters.c' object='libsciparameters_la-parameters.lo' libtool=yes @AMDEPBACKSLASH@
575@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
576@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libsciparameters_la_CFLAGS) $(CFLAGS) -c -o libsciparameters_la-parameters.lo `test -f 'src/c/parameters.c' || echo '$(srcdir)/'`src/c/parameters.c
462 577
463mostlyclean-libtool: 578mostlyclean-libtool:
464 -rm -f *.lo 579 -rm -f *.lo
@@ -505,12 +620,58 @@ uninstall-libparameters_la_rootDATA:
505 test -n "$$files" || exit 0; \ 620 test -n "$$files" || exit 0; \
506 echo " ( cd '$(DESTDIR)$(libparameters_la_rootdir)' && rm -f" $$files ")"; \ 621 echo " ( cd '$(DESTDIR)$(libparameters_la_rootdir)' && rm -f" $$files ")"; \
507 cd "$(DESTDIR)$(libparameters_la_rootdir)" && rm -f $$files 622 cd "$(DESTDIR)$(libparameters_la_rootdir)" && rm -f $$files
623
624ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
625 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
626 unique=`for i in $$list; do \
627 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
628 done | \
629 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
630 END { if (nonempty) { for (i in files) print i; }; }'`; \
631 mkid -fID $$unique
508tags: TAGS 632tags: TAGS
509TAGS:
510 633
634TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
635 $(TAGS_FILES) $(LISP)
636 set x; \
637 here=`pwd`; \
638 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
639 unique=`for i in $$list; do \
640 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
641 done | \
642 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
643 END { if (nonempty) { for (i in files) print i; }; }'`; \
644 shift; \
645 if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
646 test -n "$$unique" || unique=$$empty_fix; \
647 if test $$# -gt 0; then \
648 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
649 "$$@" $$unique; \
650 else \
651 $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
652 $$unique; \
653 fi; \
654 fi
511ctags: CTAGS 655ctags: CTAGS
512CTAGS: 656CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
513 657 $(TAGS_FILES) $(LISP)
658 list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
659 unique=`for i in $$list; do \
660 if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
661 done | \
662 $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
663 END { if (nonempty) { for (i in files) print i; }; }'`; \
664 test -z "$(CTAGS_ARGS)$$unique" \
665 || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
666 $$unique
667
668GTAGS:
669 here=`$(am__cd) $(top_builddir) && pwd` \
670 && $(am__cd) $(top_srcdir) \
671 && gtags -i $(GTAGS_ARGS) "$$here"
672
673distclean-tags:
674 -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
514 675
515distdir: $(DISTFILES) 676distdir: $(DISTFILES)
516 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ 677 @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -545,9 +706,9 @@ distdir: $(DISTFILES)
545check-am: all-am 706check-am: all-am
546 $(MAKE) $(AM_MAKEFLAGS) check-local 707 $(MAKE) $(AM_MAKEFLAGS) check-local
547check: check-am 708check: check-am
548all-am: Makefile $(DATA) all-local 709all-am: Makefile $(LTLIBRARIES) $(DATA) all-local
549installdirs: 710installdirs:
550 for dir in "$(DESTDIR)$(libparameters_la_etcdir)" "$(DESTDIR)$(libparameters_la_rootdir)"; do \ 711 for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libparameters_la_etcdir)" "$(DESTDIR)$(libparameters_la_rootdir)"; do \
551 test -z "$$dir" || $(MKDIR_P) "$$dir"; \ 712 test -z "$$dir" || $(MKDIR_P) "$$dir"; \
552 done 713 done
553install: install-am 714install: install-am
@@ -577,11 +738,14 @@ maintainer-clean-generic:
577 @echo "it deletes files that may require special tools to rebuild." 738 @echo "it deletes files that may require special tools to rebuild."
578clean: clean-am 739clean: clean-am
579 740
580clean-am: clean-generic clean-libtool clean-local mostlyclean-am 741clean-am: clean-generic clean-libtool clean-local \
742 clean-pkglibLTLIBRARIES mostlyclean-am
581 743
582distclean: distclean-am 744distclean: distclean-am
745 -rm -rf ./$(DEPDIR)
583 -rm -f Makefile 746 -rm -f Makefile
584distclean-am: clean-am distclean-generic distclean-local 747distclean-am: clean-am distclean-compile distclean-generic \
748 distclean-local distclean-tags
585 749
586dvi: dvi-am 750dvi: dvi-am
587 751
@@ -602,7 +766,7 @@ install-dvi: install-dvi-am
602 766
603install-dvi-am: 767install-dvi-am:
604 768
605install-exec-am: 769install-exec-am: install-pkglibLTLIBRARIES
606 770
607install-html: install-html-am 771install-html: install-html-am
608 772
@@ -625,12 +789,14 @@ install-ps-am:
625installcheck-am: 789installcheck-am:
626 790
627maintainer-clean: maintainer-clean-am 791maintainer-clean: maintainer-clean-am
792 -rm -rf ./$(DEPDIR)
628 -rm -f Makefile 793 -rm -f Makefile
629maintainer-clean-am: distclean-am maintainer-clean-generic 794maintainer-clean-am: distclean-am maintainer-clean-generic
630 795
631mostlyclean: mostlyclean-am 796mostlyclean: mostlyclean-am
632 797
633mostlyclean-am: mostlyclean-generic mostlyclean-libtool 798mostlyclean-am: mostlyclean-compile mostlyclean-generic \
799 mostlyclean-libtool
634 800
635pdf: pdf-am 801pdf: pdf-am
636 802
@@ -641,25 +807,30 @@ ps: ps-am
641ps-am: 807ps-am:
642 808
643uninstall-am: uninstall-libparameters_la_etcDATA \ 809uninstall-am: uninstall-libparameters_la_etcDATA \
644 uninstall-libparameters_la_rootDATA 810 uninstall-libparameters_la_rootDATA \
811 uninstall-pkglibLTLIBRARIES
645 812
646.MAKE: check-am install-am install-strip 813.MAKE: check-am install-am install-strip
647 814
648.PHONY: all all-am all-local check check-am check-local clean \ 815.PHONY: CTAGS GTAGS all all-am all-local check check-am check-local \
649 clean-generic clean-libtool clean-local distclean \ 816 clean clean-generic clean-libtool clean-local \
650 distclean-generic distclean-libtool distclean-local distdir \ 817 clean-pkglibLTLIBRARIES ctags distclean distclean-compile \
651 dvi dvi-am html html-am info info-am install install-am \ 818 distclean-generic distclean-libtool distclean-local \
652 install-data install-data-am install-data-local install-dvi \ 819 distclean-tags distdir dvi dvi-am html html-am info info-am \
653 install-dvi-am install-exec install-exec-am install-html \ 820 install install-am install-data install-data-am \
654 install-html-am install-html-local install-info \ 821 install-data-local install-dvi install-dvi-am install-exec \
655 install-info-am install-libparameters_la_etcDATA \ 822 install-exec-am install-html install-html-am \
823 install-html-local install-info install-info-am \
824 install-libparameters_la_etcDATA \
656 install-libparameters_la_rootDATA install-man install-pdf \ 825 install-libparameters_la_rootDATA install-man install-pdf \
657 install-pdf-am install-ps install-ps-am install-strip \ 826 install-pdf-am install-pkglibLTLIBRARIES install-ps \
658 installcheck installcheck-am installdirs maintainer-clean \ 827 install-ps-am install-strip installcheck installcheck-am \
659 maintainer-clean-generic mostlyclean mostlyclean-generic \ 828 installdirs maintainer-clean maintainer-clean-generic \
660 mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am \ 829 mostlyclean mostlyclean-compile mostlyclean-generic \
661 uninstall-libparameters_la_etcDATA \ 830 mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
662 uninstall-libparameters_la_rootDATA 831 uninstall-am uninstall-libparameters_la_etcDATA \
832 uninstall-libparameters_la_rootDATA \
833 uninstall-pkglibLTLIBRARIES
663 834
664 835
665# This target enables tests for Scilab 836# This target enables tests for Scilab
diff --git a/scilab/modules/parameters/Scilab_windows_Import.def b/scilab/modules/parameters/Scilab_windows_Import.def
new file mode 100644
index 0000000..af2ead7
--- /dev/null
+++ b/scilab/modules/parameters/Scilab_windows_Import.def
@@ -0,0 +1,7 @@
1LIBRARY scilab_windows.dll
2
3
4EXPORTS
5 strdup_windows
6 wstrdup_windows
7 \ No newline at end of file
diff --git a/scilab/modules/parameters/includes/parameters.h b/scilab/modules/parameters/includes/parameters.h
new file mode 100644
index 0000000..5c7cca7
--- /dev/null
+++ b/scilab/modules/parameters/includes/parameters.h
@@ -0,0 +1,192 @@
1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010 - DIGITEO - Yann COLLETTE
4 *
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 */
11
12#ifndef PARAMETERS_H
13#define PARAMETERS_H
14
15#include "api_scilab.h"
16
17enum type_check {
18 CHECK_NONE,
19 CHECK_SIZE,
20 CHECK_MIN,
21 CHECK_MAX,
22 CHECK_BOTH,
23 CHECK_VALUES};
24
25/**
26 * Get a pointer to an existing plist
27 * @param[in] _iVar position on the stack
28 * @param[out] _piAddress variable address
29 * @return a SciErr structure
30 */
31SciErr initPList(void* _pvCtx, int _iVar, int ** _piAddress);
32
33/**
34 * Check that a pointer points to an existing plist
35 * @param[in] _piAddress variable address
36 * @return !0 if it's a plist 0 otherwise
37 */
38int checkPList(void* _pvCtx, int * _piAddress);
39
40/**
41 * Check that a label exists in a plist
42 * @param[in] _piAddress variable address
43 * @param[in] _pstLabel the label to be checked
44 * @return the position of the label in the plist -1 otherwise
45 */
46int hasLabelInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel);
47
48/**
49 * Check that a label is partially matched in a plist
50 * @param[in] _piAddress variable address
51 * @param[in] _pstLabel the label to be checked
52 * @return the position of the label in the plist -1 otherwise
53 */
54int hasPartialLabelInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel);
55
56/**
57 * Get a C int associated to a label from a plist
58 * @param[in] _piAddress variable address
59 * @param[in] _pstLabel the label to be checked
60 * @param[out] _piValue the value stored in the plist
61 * @param[out] _piFound !-1 if the label has been found -1 otherwise
62 * @param[in] _iDefaultValue the value returned in '_piValue' if the label has not been found
63 * @param[in] _iLog display information messages during type_check
64 * @param[in] check a type of checking in the value returned in '_piValue'
65 * @return a SciErr structure
66 */
67SciErr getIntInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, int * _piValue, int * _piFound,
68 int _iDefaultValue, int _iLog, enum type_check check, ...);
69
70/**
71 * Get a C double associated to a label from a plist
72 * @param[in] _piAddress variable address
73 * @param[in] _pstLabel the label to be checked
74 * @param[out] _pdblValue the value stored in the plist
75 * @param[out] _piFound !-1 if the label has been found -1 otherwise
76 * @param[in] _dblDefaultValue the value returned in '_pdblValue' if the label has not been found
77 * @param[in] _iLog display information messages during type_check
78 * @param[in] check a type of checking in the value returned in '_pdblValue'
79 * @return a SciErr structure
80 */
81SciErr getDoubleInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, double * _pdblValue, int * _piFound,
82 double _dblDefaultValue, int _iLog, enum type_check check, ...);
83
84/**
85 * Get a C string associated to a label from a plist
86 * @param[in] _piAddress variable address
87 * @param[in] _pstLabel the label to be checked
88 * @param[out] _pstValue the value stored in the plist
89 * @param[out] _piFound !-1 if the label has been found -1 otherwise
90 * @param[in] _pstDefaultValue the value returned in '_pstValue' if the label has not been found
91 * @param[in] _iLog display information messages during type_check
92 * @param[in] check a type of checking in the value returned in '_pstValue'
93 * @return a SciErr structure
94 */
95SciErr getStringInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, char ** _pstValue, int * _piFound,
96 const char * _pstDefaultValue, int _iLog, enum type_check check, ...);
97
98/**
99 * Get a C column vector of int associated to a label from a plist
100 * @param[in] _piAddress variable address
101 * @param[in] _pstLabel the label to be checked
102 * @param[out] _piValue the value stored in the plist
103 * @param[out] _piFound !-1 if the label has been found -1 otherwise
104 * @param[in] _iDefaultValue the value returned in '_piValue' if the label has not been found
105 * @param[in] _iDefaultSize the size of the vector of int that must be returned
106 * @param[out] _piSize the size of the vector of int that has been read
107 * @param[in] _iLog display information messages during type_check
108 * @param[in] check a type of checking in the value returned in '_piValue'
109 * @return a SciErr structure
110 */
111SciErr getColVectorOfIntInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, int * _piValue, int * _piFound,
112 int _iDefaultValue, int _iDefaultSize, int * _piSize, int _iLog, enum type_check check, ...);
113
114/**
115 * Get a C column vector of double associated to a label from a plist
116 * @param[in] _piAddress variable address
117 * @param[in] _pstLabel the label to be checked
118 * @param[out] _pdblValue the value stored in the plist
119 * @param[out] _piFound !-1 if the label has been found -1 otherwise
120 * @param[in] _dblDefaultValue the value returned in '_pdblValue' if the label has not been found
121 * @param[in] _iDefaultSize the size of the vector of int that must be returned
122 * @param[out] _piSize the size of the vector of int that has been read
123 * @param[in] _iLog display information messages during type_check
124 * @param[in] check a type of checking in the value returned in '_pdblValue'
125 * @return a SciErr structure
126 */
127SciErr getColVectorOfDoubleInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, double * _pdblValue, int * _piFound,
128 double _dblDefaultValue, int _iDefaultSize, int * _piSize, int _iLog, enum type_check check, ...);
129
130/**
131 * Create a plist
132 * @param[in] _iVar the position on the stack of the plist
133 * @param[in] _piAddress variable address
134 * @param[in] _pstLabelNames a vector of labels for the plist
135 * @param[in] _iNbParams the number of labels
136 * @return a SciErr structure
137 */
138SciErr createPList(void* _pvCtx, int _iVar, int ** _piAddress, char ** _pstLabelNames, int _iNbParams);
139
140/**
141 * Store a C int value in a plist and associates it to the given label
142 * @param[in] _iVar the position on the stack of the plist
143 * @param[in] _piAddress variable address
144 * @param[in] _pstLabelName the label to which the value must be associated
145 * @param[in] _iValue the value to be stored in the plist
146 * @return a SciErr structure
147 */
148SciErr createIntInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iValue);
149
150/**
151 * Store a C double value in a plist and associates it to the given label
152 * @param[in] _iVar the position on the stack of the plist
153 * @param[in] _piAddress variable address
154 * @param[in] _pstLabelName the label to which the value must be associated
155 * @param[in] _dblValue the value to be stored in the plist
156 * @return a SciErr structure
157 */
158SciErr createDoubleInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, double _dblValue);
159
160/**
161 * Store a C string value in a plist and associates it to the given label
162 * @param[in] _iVar the position on the stack of the plist
163 * @param[in] _piAddress variable address
164 * @param[in] _pstLabelName the label to which the value must be associated
165 * @param[in] _pstValue the value to be stored in the plist
166 * @return a SciErr structure
167 */
168SciErr createStringInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, char * _pstValue);
169
170/**
171 * Store a C column vector of int values in a plist and associates it to the given label
172 * @param[in] _iVar the position on the stack of the plist
173 * @param[in] _piAddress variable address
174 * @param[in] _pstLabelName the label to which the value must be associated
175 * @param[in] _iNbValues the size of the vector to be stored in the plist
176 * @param[in] _piValue the value to be stored in the plist
177 * @return a SciErr structure
178 */
179SciErr createColVectorOfIntInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iNbValues, int * _piValue);
180
181/**
182 * Store a C column vector of double values in a plist and associates it to the given label
183 * @param[in] _iVar the position on the stack of the plist
184 * @param[in] _piAddress variable address
185 * @param[in] _pstLabelName the label to which the value must be associated
186 * @param[in] _iNbValues the size of the vector to be stored in the plist
187 * @param[in] _pdblValue the value to be stored in the plist
188 * @return a SciErr structure
189 */
190SciErr createColVectorOfDoubleInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iNbValues, double * _pdblValue);
191
192#endif
diff --git a/scilab/modules/parameters/parameters.iss b/scilab/modules/parameters/parameters.iss
index 2c06b47..41018ba 100644
--- a/scilab/modules/parameters/parameters.iss
+++ b/scilab/modules/parameters/parameters.iss
@@ -1,7 +1,5 @@
1; ============================================================================== 1; ==============================================================================
2; Script d'installation Inno Setup pour scilab 2; Script d'installation Inno Setup pour scilab
3; Version TRUNK
4; Copyright INRIA 2008
5; ============================================================================== 3; ==============================================================================
6; 4;
7;------------------------------------------------------------------------------- 5;-------------------------------------------------------------------------------
@@ -10,6 +8,9 @@
10; 8;
11#define PARAMETERS "parameters" 9#define PARAMETERS "parameters"
12; 10;
11Source: bin\parameters.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}
12Source: modules\{#PARAMETERS}\includes\parameters.h; DestDir: {app}\modules\{#PARAMETERS}\includes; Components: {#COMPN_SCILAB}
13;
13Source: modules\{#PARAMETERS}\VERSION.xml; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB} 14Source: modules\{#PARAMETERS}\VERSION.xml; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB}
14Source: modules\{#PARAMETERS}\readme.txt; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB} 15Source: modules\{#PARAMETERS}\readme.txt; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB}
15Source: modules\{#PARAMETERS}\license.txt; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB} 16Source: modules\{#PARAMETERS}\license.txt; DestDir: {app}\modules\{#PARAMETERS}; Components: {#COMPN_SCILAB}
diff --git a/scilab/modules/parameters/parameters.vcproj b/scilab/modules/parameters/parameters.vcproj
new file mode 100644
index 0000000..43b3e56
--- /dev/null
+++ b/scilab/modules/parameters/parameters.vcproj
@@ -0,0 +1,461 @@
1<?xml version="1.0" encoding="Windows-1252"?>
2<VisualStudioProject
3 ProjectType="Visual C++"
4 Version="9,00"
5 Name="parameters"
6 ProjectGUID="{A09E8584-0713-48A5-97BA-ACED0F3728F8}"
7 RootNamespace="parameters"
8 Keyword="Win32Proj"
9 TargetFrameworkVersion="0"
10 >
11 <Platforms>
12 <Platform
13 Name="Win32"
14 />
15 <Platform
16 Name="x64"
17 />
18 </Platforms>
19 <ToolFiles>
20 </ToolFiles>
21 <Configurations>
22 <Configuration
23 Name="Debug|Win32"
24 OutputDirectory="$(SolutionDir)$(ConfigurationName)"
25 IntermediateDirectory="$(ConfigurationName)"
26 ConfigurationType="2"
27 CharacterSet="2"
28 >
29 <Tool
30 Name="VCPreBuildEventTool"
31 />
32 <Tool
33 Name="VCCustomBuildTool"
34 />
35 <Tool
36 Name="VCXMLDataGeneratorTool"
37 />
38 <Tool
39 Name="VCWebServiceProxyGeneratorTool"
40 />
41 <Tool
42 Name="VCMIDLTool"
43 />
44 <Tool
45 Name="VCCLCompilerTool"
46 AdditionalOptions=""
47 Optimization="0"
48 AdditionalIncludeDirectories="includes;src/c;../core/includes;../api_scilab/includes;../../libs/MALLOC/includes;../output_stream/includes;../localization/includes;../../libs/intl;../windows_tools/includes"
49 PreprocessorDefinitions="FORDLL;_DEBUG;_WINDOWS;_USRDLL;PARAMETERS_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
50 MinimalRebuild="true"
51 BasicRuntimeChecks="0"
52 RuntimeLibrary="3"
53 UsePrecompiledHeader="0"
54 WarningLevel="3"
55 Detect64BitPortabilityProblems="false"
56 DebugInformationFormat="3"
57 />
58 <Tool
59 Name="VCManagedResourceCompilerTool"
60 />
61 <Tool
62 Name="VCResourceCompilerTool"
63 />
64 <Tool
65 Name="VCPreLinkEventTool"
66 Description="Make dependencies"
67 CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do ..\..\..\bin\dumpexts -o %%~nf.def -n parameters.dll %%f &gt;nul&#x0D;&#x0A;copy *.def parameterstmp.def &gt;nul&#x0D;&#x0A;copy ..\parameters_header.def+parameterstmp.def ..\parameters_export.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
68 />
69 <Tool
70 Name="VCLinkerTool"
71 AdditionalDependencies="LibScilab.lib scilocalization.lib scilab_windows.lib"
72 OutputFile="../../bin/$(ProjectName).dll"
73 LinkIncremental="1"
74 ModuleDefinitionFile="parameters_export.def"
75 GenerateDebugInformation="true"
76 SubSystem="2"
77 RandomizedBaseAddress="1"
78 DataExecutionPrevention="0"
79 ImportLibrary="../../bin/$(ProjectName).lib"
80 TargetMachine="1"
81 CLRUnmanagedCodeCheck="true"
82 />
83 <Tool
84 Name="VCALinkTool"
85 />
86 <Tool
87 Name="VCManifestTool"
88 />
89 <Tool
90 Name="VCXDCMakeTool"
91 />
92 <Tool
93 Name="VCBscMakeTool"
94 />
95 <Tool
96 Name="VCFxCopTool"
97 />
98 <Tool
99 Name="VCAppVerifierTool"
100 />
101 <Tool
102 Name="VCPostBuildEventTool"
103 />
104 </Configuration>
105 <Configuration
106 Name="Debug|x64"
107 OutputDirectory="$(SolutionDir)$(ConfigurationName)"
108 IntermediateDirectory="$(ConfigurationName)"
109 ConfigurationType="2"
110 CharacterSet="2"
111 >
112 <Tool
113 Name="VCPreBuildEventTool"
114 />
115 <Tool
116 Name="VCCustomBuildTool"
117 />
118 <Tool
119 Name="VCXMLDataGeneratorTool"
120 />
121 <Tool
122 Name="VCWebServiceProxyGeneratorTool"
123 />
124 <Tool
125 Name="VCMIDLTool"
126 TargetEnvironment="3"
127 />
128 <Tool
129 Name="VCCLCompilerTool"
130 Optimization="0"
131 AdditionalIncludeDirectories="includes;src/c;../core/includes;../api_scilab/includes;../../libs/MALLOC/includes;../output_stream/includes;../localization/includes;../../libs/intl;../windows_tools/includes"
132 PreprocessorDefinitions="FORDLL;_DEBUG;_WINDOWS;_USRDLL;PARAMETERS_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
133 MinimalRebuild="true"
134 BasicRuntimeChecks="0"
135 RuntimeLibrary="3"
136 UsePrecompiledHeader="0"
137 WarningLevel="3"
138 Detect64BitPortabilityProblems="false"
139 DebugInformationFormat="3"
140 />
141 <Tool
142 Name="VCManagedResourceCompilerTool"
143 />
144 <Tool
145 Name="VCResourceCompilerTool"
146 />
147 <Tool
148 Name="VCPreLinkEventTool"
149 Description="Make dependencies"
150 CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do ..\..\..\bin\dumpexts -o %%~nf.def -n parameters.dll %%f &gt;nul&#x0D;&#x0A;copy *.def parameterstmp.def &gt;nul&#x0D;&#x0A;copy ..\parameters_header.def+parameterstmp.def ..\parameters_export.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
151 />
152 <Tool
153 Name="VCLinkerTool"
154 AdditionalDependencies="LibScilab.lib scilocalization.lib scilab_windows.lib"
155 OutputFile="../../bin/$(ProjectName).dll"
156 LinkIncremental="1"
157 ModuleDefinitionFile="parameters_export.def"
158 GenerateDebugInformation="true"
159 SubSystem="2"
160 RandomizedBaseAddress="1"
161 DataExecutionPrevention="0"
162 ImportLibrary="../../bin/$(ProjectName).lib"
163 TargetMachine="17"
164 CLRUnmanagedCodeCheck="true"
165 />
166 <Tool
167 Name="VCALinkTool"
168 />
169 <Tool
170 Name="VCManifestTool"
171 />
172 <Tool
173 Name="VCXDCMakeTool"
174 />
175 <Tool
176 Name="VCBscMakeTool"
177 />
178 <Tool
179 Name="VCFxCopTool"
180 />
181 <Tool
182 Name="VCAppVerifierTool"
183 />
184 <Tool
185 Name="VCPostBuildEventTool"
186 />
187 </Configuration>
188 <Configuration
189 Name="Release|Win32"
190 OutputDirectory="$(SolutionDir)$(ConfigurationName)"
191 IntermediateDirectory="$(ConfigurationName)"
192 ConfigurationType="2"
193 CharacterSet="2"
194 WholeProgramOptimization="0"
195 >
196 <Tool
197 Name="VCPreBuildEventTool"
198 />
199 <Tool
200 Name="VCCustomBuildTool"
201 />
202 <Tool
203 Name="VCXMLDataGeneratorTool"
204 />
205 <Tool
206 Name="VCWebServiceProxyGeneratorTool"
207 />
208 <Tool
209 Name="VCMIDLTool"
210 />
211 <Tool
212 Name="VCCLCompilerTool"
213 AdditionalOptions=""
214 InlineFunctionExpansion="1"
215 FavorSizeOrSpeed="1"
216 WholeProgramOptimization="false"
217 AdditionalIncludeDirectories="includes;src/c;../core/includes;../api_scilab/includes;../../libs/MALLOC/includes;../output_stream/includes;../localization/includes;../../libs/intl;../windows_tools/includes"
218 PreprocessorDefinitions="FORDLL;NDEBUG;_WINDOWS;_USRDLL;PARAMETERS_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
219 StringPooling="true"
220 RuntimeLibrary="2"
221 EnableFunctionLevelLinking="true"
222 EnableEnhancedInstructionSet="0"
223 UsePrecompiledHeader="0"
224 WarningLevel="3"
225 Detect64BitPortabilityProblems="false"
226 DebugInformationFormat="0"
227 />
228 <Tool
229 Name="VCManagedResourceCompilerTool"
230 />
231 <Tool
232 Name="VCResourceCompilerTool"
233 />
234 <Tool
235 Name="VCPreLinkEventTool"
236 Description="Make dependencies"
237 CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do ..\..\..\bin\dumpexts -o %%~nf.def -n parameters.dll %%f &gt;nul&#x0D;&#x0A;copy *.def parameterstmp.def &gt;nul&#x0D;&#x0A;copy ..\parameters_header.def+parameterstmp.def ..\parameters_export.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
238 />
239 <Tool
240 Name="VCLinkerTool"
241 AdditionalDependencies="LibScilab.lib scilocalization.lib scilab_windows.lib"
242 OutputFile="../../bin/$(ProjectName).dll"
243 LinkIncremental="1"
244 ModuleDefinitionFile="parameters_export.def"
245 GenerateDebugInformation="false"
246 SubSystem="2"
247 OptimizeReferences="2"
248 EnableCOMDATFolding="2"
249 LinkTimeCodeGeneration="0"
250 RandomizedBaseAddress="1"
251 DataExecutionPrevention="0"
252 ImportLibrary="../../bin/$(ProjectName).lib"
253 TargetMachine="1"
254 CLRUnmanagedCodeCheck="true"
255 />
256 <Tool
257 Name="VCALinkTool"
258 />
259 <Tool
260 Name="VCManifestTool"
261 />
262 <Tool
263 Name="VCXDCMakeTool"
264 />
265 <Tool
266 Name="VCBscMakeTool"
267 />
268 <Tool
269 Name="VCFxCopTool"
270 />
271 <Tool
272 Name="VCAppVerifierTool"
273 />
274 <Tool
275 Name="VCPostBuildEventTool"
276 />
277 </Configuration>
278 <Configuration
279 Name="Release|x64"
280 OutputDirectory="$(SolutionDir)$(ConfigurationName)"
281 IntermediateDirectory="$(ConfigurationName)"
282 ConfigurationType="2"
283 CharacterSet="2"
284 WholeProgramOptimization="0"
285 >
286 <Tool
287 Name="VCPreBuildEventTool"
288 />
289 <Tool
290 Name="VCCustomBuildTool"
291 />
292 <Tool
293 Name="VCXMLDataGeneratorTool"
294 />
295 <Tool
296 Name="VCWebServiceProxyGeneratorTool"
297 />
298 <Tool
299 Name="VCMIDLTool"
300 TargetEnvironment="3"
301 />
302 <Tool
303 Name="VCCLCompilerTool"
304 InlineFunctionExpansion="1"
305 FavorSizeOrSpeed="1"
306 WholeProgramOptimization="false"
307 AdditionalIncludeDirectories="includes;src/c;../core/includes;../api_scilab/includes;../../libs/MALLOC/includes;../output_stream/includes;../localization/includes;../../libs/intl;../windows_tools/includes"
308 PreprocessorDefinitions="FORDLL;NDEBUG;_WINDOWS;_USRDLL;PARAMETERS_EXPORTS;_CRT_SECURE_NO_DEPRECATE"
309 StringPooling="true"
310 RuntimeLibrary="2"
311 EnableFunctionLevelLinking="true"
312 EnableEnhancedInstructionSet="0"
313 UsePrecompiledHeader="0"
314 WarningLevel="3"
315 Detect64BitPortabilityProblems="false"
316 DebugInformationFormat="0"
317 />
318 <Tool
319 Name="VCManagedResourceCompilerTool"
320 />
321 <Tool
322 Name="VCResourceCompilerTool"
323 />
324 <Tool
325 Name="VCPreLinkEventTool"
326 Description="Make dependencies"
327 CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Localization_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilocalization.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)Scilab_windows_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)scilab_windows.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do ..\..\..\bin\dumpexts -o %%~nf.def -n parameters.dll %%f &gt;nul&#x0D;&#x0A;copy *.def parameterstmp.def &gt;nul&#x0D;&#x0A;copy ..\parameters_header.def+parameterstmp.def ..\parameters_export.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"
328 />
329 <Tool
330 Name="VCLinkerTool"
331 AdditionalDependencies="LibScilab.lib scilocalization.lib scilab_windows.lib"
332 OutputFile="../../bin/$(ProjectName).dll"
333 LinkIncremental="1"
334 ModuleDefinitionFile="parameters_export.def"
335 GenerateDebugInformation="false"
336 SubSystem="2"
337 OptimizeReferences="2"
338 EnableCOMDATFolding="2"
339 LinkTimeCodeGeneration="0"
340 RandomizedBaseAddress="1"
341 DataExecutionPrevention="0"
342 ImportLibrary="../../bin/$(ProjectName).lib"
343 TargetMachine="17"
344 CLRUnmanagedCodeCheck="true"
345 />
346 <Tool
347 Name="VCALinkTool"
348 />
349 <Tool
350 Name="VCManifestTool"
351 />
352 <Tool
353 Name="VCXDCMakeTool"
354 />
355 <Tool
356 Name="VCBscMakeTool"
357 />
358 <Tool
359 Name="VCFxCopTool"
360 />
361 <Tool
362 Name="VCAppVerifierTool"
363 />
364 <Tool
365 Name="VCPostBuildEventTool"
366 />
367 </Configuration>
368 </Configurations>
369 <References>
370 </References>
371 <Files>
372 <Filter
373 Name="Source Files"
374 Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
375 UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
376 >
377 <File
378 RelativePath=".\src\c\DllmainParameters.c"
379 >
380 </File>
381 <File
382 RelativePath=".\src\c\parameters.c"
383 >
384 </File>
385 </Filter>
386 <Filter
387 Name="Header Files"
388 Filter="h;hpp;hxx;hm;inl;inc;xsd"
389 UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
390 >
391 <File
392 RelativePath=".\includes\parameters.h"
393 >
394 </File>
395 </Filter>
396 <Filter
397 Name="Resource Files"
398 Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"
399 UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
400 >
401 <File
402 RelativePath=".\src\c\parameters.rc"
403 >
404 </File>
405 </Filter>
406 <Filter
407 Name="localization"
408 >
409 </Filter>
410 <Filter
411 Name="Libraries Dependencies"
412 >
413 <Filter
414 Name="Imports"
415 >
416 <File
417 RelativePath=".\LibScilab_Import.def"
418 >
419 </File>
420 <File
421 RelativePath=".\Localization_Import.def"
422 >
423 </File>
424 <File
425 RelativePath=".\Scilab_windows_Import.def"
426 >
427 </File>
428 </Filter>
429 <Filter
430 Name="Export"
431 >
432 <File
433 RelativePath=".\parameters_export.def"
434 >
435 </File>
436 <File
437 RelativePath=".\parameters_header.def"
438 >
439 </File>
440 </Filter>
441 </Filter>
442 <File
443 RelativePath="..\..\bin\blasplus.lib"
444 >
445 </File>
446 <File
447 RelativePath=".\Makefile.am"
448 >
449 </File>
450 <File
451 RelativePath=".\parameters.iss"
452 >
453 </File>
454 <File
455 RelativePath=".\version.xml"
456 >
457 </File>
458 </Files>
459 <Globals>
460 </Globals>
461</VisualStudioProject>
diff --git a/scilab/modules/parameters/parameters_header.def b/scilab/modules/parameters/parameters_header.def
new file mode 100644
index 0000000..e775fbb
--- /dev/null
+++ b/scilab/modules/parameters/parameters_header.def
@@ -0,0 +1,8 @@
1LIBRARY parameters.dll
2
3
4
5EXPORTS
6; ---------------------------------------
7; parameters explicit export (SEP 35)
8; ---------------------------------------
diff --git a/scilab/modules/parameters/src/c/DllmainParameters.c b/scilab/modules/parameters/src/c/DllmainParameters.c
new file mode 100644
index 0000000..ed9f54f
--- /dev/null
+++ b/scilab/modules/parameters/src/c/DllmainParameters.c
@@ -0,0 +1,33 @@
1/*
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010 - DIGITEO - Allan CORNET
4 *
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 *
11 */
12/*--------------------------------------------------------------------------*/
13#include <windows.h>
14/*--------------------------------------------------------------------------*/
15#pragma comment(lib,"../../bin/libintl.lib")
16/*--------------------------------------------------------------------------*/
17int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
18{
19 switch (reason)
20 {
21 case DLL_PROCESS_ATTACH:
22 break;
23 case DLL_PROCESS_DETACH:
24 break;
25 case DLL_THREAD_ATTACH:
26 break;
27 case DLL_THREAD_DETACH:
28 break;
29 }
30 return 1;
31}
32/*--------------------------------------------------------------------------*/
33
diff --git a/scilab/modules/parameters/src/c/parameters.c b/scilab/modules/parameters/src/c/parameters.c
new file mode 100644
index 0000000..be4804f
--- /dev/null
+++ b/scilab/modules/parameters/src/c/parameters.c
@@ -0,0 +1,1138 @@
1/*
2* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3* Copyright (C) 2010 - DIGITEO - Yann COLLETTE
4*
5* This file must be used under the terms of the CeCILL.
6* This source file is licensed as described in the file COPYING, which
7* you should have received as part of this distribution. The terms
8* are also available at
9* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10*/
11/*--------------------------------------------------------------------------*/
12#include <string.h>
13#include <stdarg.h>
14/*--------------------------------------------------------------------------*/
15#include "parameters.h"
16#include "stack-c.h"
17#include "MALLOC.h"
18#include "freeArrayOfString.h"
19#include "Scierror.h"
20#include "sciprint.h"
21#include "api_scilab.h"
22#include "localization.h"
23#ifdef _MSC_VER
24#include "strdup_windows.h"
25#endif
26/*--------------------------------------------------------------------------*/
27static int commonFindLabel(void* _pvCtx, int * _piAddress, char const * const _pstLabelToFind);
28static int commonFindLabelPartial(void* _pvCtx, int * _piAddress, char const * const _pstLabelToFind);
29/*--------------------------------------------------------------------------*/
30SciErr initPList(void* _pvCtx, int _iVar, int ** _piAddress)
31{
32 SciErr _SciErr;
33 _SciErr.iErr = 0;
34 _SciErr.iMsgCount = 0;
35 _SciErr = getVarAddressFromPosition(_pvCtx, _iVar, _piAddress);
36 return _SciErr;
37}
38/*--------------------------------------------------------------------------*/
39int checkPList(void* _pvCtx, int * _piAddress)
40{
41 int nb_param = 0, i = 0, var_type = 0;
42 int m_label = 0, n_label = 0;
43 int * len_label = NULL;
44 char ** label_list = NULL;
45 int result = 0;
46 SciErr _SciErr;
47
48 _SciErr.iErr = 0;
49 _SciErr.iMsgCount = 0;
50
51 _SciErr = getVarType(_pvCtx, _piAddress, &var_type);
52 if (var_type != sci_mlist)
53 {
54 return 0;
55 }
56
57 _SciErr = getListItemNumber(_pvCtx, _piAddress, &nb_param);
58
59 if (nb_param != 0)
60 {
61 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, NULL, NULL);
62
63 len_label = (int *)MALLOC(m_label * n_label * sizeof(int));
64 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, NULL);
65
66 label_list = (char **)MALLOC(m_label*n_label*sizeof(char *));
67 for(i = 0; i < n_label * m_label; i++)
68 {
69 label_list[i] = (char *)MALLOC((len_label[i]+1)*sizeof(char));
70 }
71 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, label_list);
72 if (strcmp(label_list[0], "plist") != 0)
73 {
74 if (len_label)
75 {
76 FREE(len_label);
77 len_label = NULL;
78 }
79 freeArrayOfString(label_list, m_label * n_label);
80
81 return 0;
82 }
83
84 if (len_label)
85 {
86 FREE(len_label);
87 len_label = NULL;
88 }
89 freeArrayOfString(label_list, m_label * n_label);
90 }
91
92 result = 1;
93
94 return result;
95}
96/*--------------------------------------------------------------------------*/
97int hasPartialLabelInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel)
98{
99 SciErr _SciErr;
100 _SciErr.iErr = 0;
101 _SciErr.iMsgCount = 0;
102
103 return commonFindLabelPartial(_pvCtx, _piAddress, _pstLabel);
104}
105/*--------------------------------------------------------------------------*/
106int hasLabelInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel)
107{
108 SciErr _SciErr;
109 _SciErr.iErr = 0;
110 _SciErr.iMsgCount = 0;
111
112 return commonFindLabel(_pvCtx, _piAddress, _pstLabel);
113}
114/*--------------------------------------------------------------------------*/
115SciErr getIntInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, int * _piValue, int * _piFound,
116 int _iDefaultValue, int _iLog, enum type_check _eCheck, ...)
117{
118 int pos_label = 0, i = 0;
119 int m_tmp = 0, n_tmp = 0;
120 double * tmp_dbl = NULL;
121 SciErr _SciErr;
122
123 _SciErr.iErr = 0;
124 _SciErr.iMsgCount = 0;
125
126 pos_label = commonFindLabel(_pvCtx, _piAddress, _pstLabel);
127 *_piFound = pos_label;
128
129 if (pos_label != -1)
130 {
131 _SciErr = getMatrixOfDoubleInList(_pvCtx, _piAddress, pos_label+1, &m_tmp, &n_tmp, &tmp_dbl);
132 if (!_SciErr.iErr)
133 {
134 *_piValue = (int)tmp_dbl[0];
135 } else
136 {
137 if (_iLog)
138 {
139 sciprint(_("%s: wrong parameter type. %s expected. Return default value %d.\n"), "getIntInPList","int",_iDefaultValue);
140 }
141 *_piValue = _iDefaultValue;
142 }
143 }
144 else
145 {
146 if (_iLog)
147 {
148 sciprint(_("%s: parameter not found. Return default value %d.\n"), "getIntInPList",_iDefaultValue);
149 }
150 *_piValue = _iDefaultValue;
151 }
152
153 /* Now check parameters */
154
155 if (_eCheck!=CHECK_NONE)
156 {
157 va_list vl;
158 int nb_value_to_check = 0;
159 int value_to_check = 0;
160 int check_res = 0;
161
162 va_start(vl, _eCheck);
163
164 switch(_eCheck)
165 {
166 case CHECK_MIN:
167 value_to_check = va_arg(vl, int);
168 va_end(vl);
169 if (value_to_check > *_piValue)
170 {
171 if ((*_piFound!=-1)&&(_iLog))
172 {
173 sciprint(_("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
174 }
175 *_piValue = _iDefaultValue;
176 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
177 return _SciErr;
178 }
179 break;
180 case CHECK_MAX:
181 value_to_check = va_arg(vl, int);
182 va_end(vl);
183 if (value_to_check < *_piValue)
184 {
185 if ((*_piFound != -1) && (_iLog))
186 {
187 sciprint(_("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
188 }
189 *_piValue = _iDefaultValue;
190 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
191 return _SciErr;
192 }
193 break;
194 case CHECK_BOTH:
195 // First value is the min bound
196 value_to_check = va_arg(vl, int);
197 if (value_to_check > *_piValue)
198 {
199 if ((*_piFound != -1) && (_iLog))
200 {
201 sciprint(_("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
202 }
203 *_piValue = _iDefaultValue;
204 va_end(vl);
205 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
206 return _SciErr;
207 }
208 // Second value is the max bound
209 value_to_check = va_arg(vl, int);
210 va_end(vl);
211 if (value_to_check < *_piValue)
212 {
213 if ((*_piFound != -1) && (_iLog))
214 {
215 sciprint(_("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
216 }
217 *_piValue = _iDefaultValue;
218 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getIntInPList", _pstLabel, value_to_check, *_piValue);
219 return _SciErr;
220 }
221 break;
222 case CHECK_VALUES:
223 // First parameters is int and contains the number of values to check
224 nb_value_to_check = va_arg(vl, int);
225 check_res = 0;
226 for(i = 0; i < nb_value_to_check; i++)
227 {
228 value_to_check = va_arg(vl, int);
229 check_res = check_res || (value_to_check == *_piValue);
230 }
231
232 if (!check_res)
233 {
234 if ((*_piFound != -1) && (_iLog))
235 {
236 sciprint(_("%s: wrong value for parameter %s: value %d\n"), "getIntInPList", _pstLabel, *_piValue);
237 sciprint(_("%s: awaited parameters: "), "getIntInPList");
238 va_start(vl, _eCheck);
239 nb_value_to_check = va_arg(vl, int);
240 for(i = 0; i < nb_value_to_check; i++)
241 {
242 value_to_check = va_arg(vl,int);
243 sciprint(" %d", value_to_check);
244 }
245 sciprint("\n");
246 }
247
248 *_piValue = _iDefaultValue;
249
250 va_end(vl);
251 addErrorMessage(&_SciErr, 999, _("%s: wrong value for parameter %s: value %d\n"), "getIntInPList", _pstLabel, *_piValue);
252 return _SciErr;
253 }
254
255 va_end(vl);
256 break;
257 }
258 }
259 return _SciErr;
260}
261/*--------------------------------------------------------------------------*/
262SciErr getDoubleInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, double * _pdblValue, int * _piFound,
263 double _dblDefaultValue, int _iLog, enum type_check _eCheck, ...)
264{
265 int pos_label = 0, i = 0;
266 int m_tmp = 0, n_tmp = 0;
267 double * tmp_values = NULL;
268 SciErr _SciErr;
269
270 _SciErr.iErr = 0;
271 _SciErr.iMsgCount = 0;
272
273 pos_label = commonFindLabel(_pvCtx, _piAddress, _pstLabel);
274 *_piFound = pos_label;
275
276 if (pos_label != -1)
277 {
278 _SciErr = getMatrixOfDoubleInList(_pvCtx, _piAddress, pos_label+1, &m_tmp, &n_tmp, &tmp_values);
279 if (!_SciErr.iErr)
280 {
281 *_pdblValue = tmp_values[0];
282 } else
283 {
284 if (_iLog)
285 {
286 sciprint(_("%s: wrong parameter type. %s expected. Return default value %f.\n"), "getDoubleInPList","double",_dblDefaultValue);
287 }
288 *_pdblValue = _dblDefaultValue;
289 }
290 }
291 else
292 {
293 if (_iLog)
294 {
295 sciprint(_("%s: parameter not found. Return default value %f.\n"), "getDoubleInPList",_dblDefaultValue);
296 }
297 *_pdblValue = _dblDefaultValue;
298 }
299
300 /* Now check parameters */
301
302 if (_eCheck != CHECK_NONE)
303 {
304 va_list vl;
305 int nb_value_to_check = 0;
306 double value_to_check = 0;
307 int check_res = 0;
308
309 va_start(vl, _eCheck);
310
311 switch(_eCheck)
312 {
313 case CHECK_MIN:
314 value_to_check = va_arg(vl, double);
315 va_end(vl);
316 if (value_to_check > *_pdblValue)
317 {
318 if ((*_piFound != -1) && (_iLog))
319 {
320 sciprint(_("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
321 }
322 *_pdblValue = _dblDefaultValue;
323 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
324 return _SciErr;
325 }
326 break;
327 case CHECK_MAX:
328 value_to_check = va_arg(vl, double);
329 va_end(vl);
330 if (value_to_check < *_pdblValue)
331 {
332 if ((*_piFound != -1) && (_iLog))
333 {
334 sciprint(_("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
335 }
336 *_pdblValue = _dblDefaultValue;
337 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
338 return _SciErr;
339 }
340 break;
341 case CHECK_BOTH:
342 /* First value is the min bound */
343 value_to_check = va_arg(vl, double);
344 if (value_to_check > *_pdblValue)
345 {
346 if ((*_piFound != -1) && (_iLog))
347 {
348 sciprint(_("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
349 }
350 *_pdblValue = _dblDefaultValue;
351 va_end(vl);
352 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
353 return _SciErr;
354 }
355 /* Second value is the max bound */
356 value_to_check = va_arg(vl, double);
357 va_end(vl);
358 if (value_to_check < *_pdblValue)
359 {
360 if ((*_piFound != -1) && (_iLog))
361 {
362 sciprint(_("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
363 }
364 *_pdblValue = _dblDefaultValue;
365 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
366 return _SciErr;
367 }
368 break;
369 case CHECK_VALUES:
370 /* First parameters is int and contains the number of values to check */
371 nb_value_to_check = va_arg(vl, int);
372 check_res = 0;
373 for(i = 0; i < nb_value_to_check; i++)
374 {
375 value_to_check = va_arg(vl, double);
376 check_res = check_res || (value_to_check == *_pdblValue);
377 }
378
379 if (!check_res)
380 {
381 if ((*_piFound != -1) && (_iLog))
382 {
383 sciprint(_("%s: wrong value for parameter %s: value %f\n"), "getDoubleInPList", _pstLabel, *_pdblValue);
384 sciprint(_("%s: awaited parameters: "), "getDoubleInPList");
385 va_start(vl, _eCheck);
386 nb_value_to_check = va_arg(vl,int);
387 for(i = 0; i < nb_value_to_check; i++)
388 {
389 value_to_check = va_arg(vl, double);
390 sciprint(" %f", value_to_check);
391 }
392 sciprint("\n");
393 }
394
395 *_pdblValue = _dblDefaultValue;
396
397 va_end(vl);
398 addErrorMessage(&_SciErr, 999, _("%s: wrong value for parameter %s: value %f\n"), "getDoubleInPList", _pstLabel, *_pdblValue);
399 return _SciErr;
400 }
401
402 va_end(vl);
403 break;
404 }
405 }
406
407 return _SciErr;
408}
409/*--------------------------------------------------------------------------*/
410SciErr getStringInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, char ** _pstValue, int * _piFound,
411 const char * _pstDefaultValue, int _iLog, enum type_check _eCheck, ...)
412{
413 int pos_label = 0, i = 0;
414 int m_label = 0, n_label = 0;
415 int * len_label = NULL;
416 char ** label_list = NULL;
417 SciErr _SciErr;
418
419 _SciErr.iErr = 0;
420 _SciErr.iMsgCount = 0;
421
422 pos_label = commonFindLabel(_pvCtx, _piAddress, _pstLabel);
423 *_piFound = pos_label;
424
425 if (pos_label != -1)
426 {
427 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, pos_label+1, &m_label, &n_label, NULL, NULL);
428 len_label = (int *)MALLOC(m_label * n_label * sizeof(int));
429 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, pos_label+1, &m_label, &n_label, len_label, NULL);
430 label_list = (char **)MALLOC(m_label * n_label * sizeof(char *));
431 for(i = 0; i < n_label * m_label; i++)
432 {
433 label_list[i] = (char *)MALLOC((len_label[i] + 1) * sizeof(char));
434 }
435 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, pos_label+1, &m_label, &n_label, len_label, label_list);
436
437 if (!_SciErr.iErr)
438 {
439 if (label_list[0])
440 {
441 *_pstValue = strdup(label_list[0]);
442 }
443 else
444 {
445 if (_iLog)
446 {
447 sciprint(_("%s: wrong parameter type. %s expected. Return default value %s.\n"), "getStringInPList","string",_pstDefaultValue);
448 }
449 *_pstValue = strdup(_pstDefaultValue);
450 }
451 }
452 else
453 {
454 if (_iLog)
455 {
456 sciprint(_("%s: parameter not found. Return default value %s.\n"), "getStringInPList", _pstDefaultValue);
457 }
458 *_pstValue = strdup(_pstDefaultValue);
459 }
460
461 if (len_label)
462 {
463 FREE(len_label);
464 len_label = NULL;
465 }
466 freeArrayOfString(label_list, m_label * n_label);
467 }
468 else
469 {
470 *_pstValue = strdup(_pstDefaultValue);
471 }
472
473 /* Now check parameters */
474
475 if (_eCheck != CHECK_NONE)
476 {
477 va_list vl;
478 int nb_value_to_check = 0;
479 char * value_to_check = 0;
480 int check_res = 0;
481
482 va_start(vl, _eCheck);
483
484 switch(_eCheck)
485 {
486 case CHECK_VALUES:
487 /* First parameters is int and contains the number of values to check */
488 nb_value_to_check = va_arg(vl, int);
489 check_res = 0;
490 for(i = 0; i < nb_value_to_check; i++)
491 {
492 value_to_check = va_arg(vl, char *);
493 check_res = check_res || (strcmp(value_to_check, *_pstValue) == 0);
494 }
495
496 if (!check_res)
497 {
498 if ((*_piFound != -1) && (_iLog))
499 {
500 sciprint(_("%s: wrong value for parameter %s: value %s\n"), "getStringInPList", _pstLabel, *_pstValue);
501 sciprint(_("%s: awaited parameters: "), "getStringInPList");
502 va_start(vl, _eCheck);
503 nb_value_to_check = va_arg(vl, int);
504 for(i = 0; i < nb_value_to_check; i++)
505 {
506 value_to_check = va_arg(vl, char *);
507 sciprint(" \"%s\"", value_to_check);
508 }
509 sciprint("\n");
510 }
511
512 if (*_pstValue)
513 {
514 FREE(*_pstValue);
515 *_pstValue = NULL;
516 }
517
518 *_pstValue = strdup(_pstDefaultValue);
519
520 va_end(vl);
521 addErrorMessage(&_SciErr, 999, _("%s: wrong value for parameter %s: value %s\n"), "getStringInPList", _pstLabel, *_pstValue);
522 return _SciErr;
523 }
524
525 va_end(vl);
526 break;
527 }
528 }
529
530 return _SciErr;
531}
532/*--------------------------------------------------------------------------*/
533/* get vector of double / integers */
534SciErr getColVectorOfIntInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, int * _piValue, int * _piFound,
535 int _iDefaultValue, int _iDefaultSize, int * _piSize, int _iLog, enum type_check _eCheck, ...)
536{
537 int pos_label = 0, i = 0;
538 int m_tmp = 0, n_tmp = 0;
539 double * tmp_dbl = 0;
540 SciErr _SciErr;
541
542 _SciErr.iErr = 0;
543 _SciErr.iMsgCount = 0;
544
545 *_piSize = -1;
546
547 pos_label = commonFindLabel(_pvCtx, _piAddress, _pstLabel);
548 *_piFound = pos_label;
549
550 if (pos_label != -1)
551 {
552 _SciErr = getMatrixOfDoubleInList(_pvCtx, _piAddress, pos_label+1, &m_tmp, &n_tmp, &tmp_dbl);
553 if (!_SciErr.iErr)
554 {
555 *_piSize = m_tmp * n_tmp;
556 *_piValue = (int)tmp_dbl[0];
557 }
558 else
559 {
560 if (_iLog)
561 {
562 sciprint(_("%s: wrong parameter type. %s expected. Return default value %d.\n"), "getColVectorOfIntInPList","int",_iDefaultValue);
563 }
564 *_piSize = _iDefaultSize;
565 *_piValue = _iDefaultValue;
566 }
567 }
568 else
569 {
570 if (_iLog)
571 {
572 sciprint(_("%s: parameter not found. Return default value %d.\n"), "getColVectorOfIntInPList",_iDefaultValue);
573 }
574 *_piSize = _iDefaultSize;
575 *_piValue = _iDefaultValue;
576 }
577
578 /* Now check parameters */
579
580 if (_eCheck!=CHECK_NONE)
581 {
582 va_list vl;
583 int nb_value_to_check = 0;
584 int value_to_check = 0;
585 int check_res = 0;
586
587 va_start(vl, _eCheck);
588
589 switch(_eCheck)
590 {
591 case CHECK_SIZE:
592 value_to_check = va_arg(vl, int);
593 va_end(vl);
594 if (value_to_check != *_piSize)
595 {
596 if ((*_piFound != -1) && (_iLog))
597 {
598 sciprint(_("%s: wrong size for parameter %s: %d requested, got %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piSize);
599 }
600 *_piValue = _iDefaultValue;
601 addErrorMessage(&_SciErr, 999, _("%s: wrong size for parameter %s: %d requested, got %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piSize);
602 return _SciErr;
603 }
604 break;
605 case CHECK_MIN:
606 value_to_check = va_arg(vl, int);
607 va_end(vl);
608 if (value_to_check > *_piValue)
609 {
610 if ((*_piFound != -1) && (_iLog))
611 {
612 sciprint(_("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
613 }
614 *_piValue = _iDefaultValue;
615 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
616 return _SciErr;
617 }
618 break;
619 case CHECK_MAX:
620 value_to_check = va_arg(vl, int);
621 va_end(vl);
622 if (value_to_check < *_piValue)
623 {
624 if ((*_piFound != -1) && (_iLog))
625 {
626 sciprint(_("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
627 }
628 *_piValue = _iDefaultValue;
629 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
630 return _SciErr;
631 }
632 break;
633 case CHECK_BOTH:
634 /* First value is the min bound */
635 value_to_check = va_arg(vl, int);
636 if (value_to_check > *_piValue)
637 {
638 if ((*_piFound != -1) && (_iLog))
639 {
640 sciprint(_("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
641 }
642 *_piValue = _iDefaultValue;
643 va_end(vl);
644 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
645 return _SciErr;
646 }
647 /* Second value is the max bound */
648 value_to_check = va_arg(vl, int);
649 va_end(vl);
650 if (value_to_check < *_piValue)
651 {
652 if ((*_piFound != -1) && (_iLog))
653 {
654 sciprint(_("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
655 }
656 *_piValue = _iDefaultValue;
657 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %d, value %d\n"), "getColVectorOfIntInPList", _pstLabel, value_to_check, *_piValue);
658 return _SciErr;
659 }
660 break;
661 case CHECK_VALUES:
662 /* First parameters is int and contains the number of values to check */
663 nb_value_to_check = va_arg(vl, int);
664 check_res = 0;
665 for( i = 0; i < nb_value_to_check; i++)
666 {
667 value_to_check = va_arg(vl, int);
668 check_res = check_res || (value_to_check == *_piValue);
669 }
670
671 if (!check_res)
672 {
673 if ((*_piFound != -1) && (_iLog))
674 {
675 sciprint(_("%s: wrong value for parameter %s: value %d\n"), "getColVectorOfIntInPList", _pstLabel, *_piValue);
676 sciprint(_("%s: awaited parameters: "), "getColVectorOfIntInPList");
677 va_start(vl, _eCheck);
678 nb_value_to_check = va_arg(vl, int);
679 for( i = 0; i < nb_value_to_check; i++)
680 {
681 value_to_check = va_arg(vl, int);
682 sciprint(" %d", value_to_check);
683 }
684 sciprint("\n");
685 }
686
687 *_piValue = _iDefaultValue;
688
689 va_end(vl);
690 addErrorMessage(&_SciErr, 999, _("%s: wrong value for parameter %s: value %d\n"), "getColVectorOfIntInPList", _pstLabel, *_piValue);
691 return _SciErr;
692 }
693
694 va_end(vl);
695 break;
696 }
697 }
698
699 return _SciErr;
700}
701
702SciErr getColVectorOfDoubleInPList(void* _pvCtx, int * _piAddress, const char * _pstLabel, double * _pdblValue, int * _piFound,
703 double _dblDefaultValue, int _iDefaultSize, int * _piSize, int _iLog, enum type_check _eCheck, ...)
704{
705 int pos_label = 0, i = 0;
706 int m_label = 0, n_label = 0;
707 int m_tmp = 0, n_tmp = 0;
708 int * len_label = NULL;
709 double * tmp_values = NULL;
710 char ** label_list = NULL;
711 SciErr _SciErr;
712
713 _SciErr.iErr = 0;
714 _SciErr.iMsgCount = 0;
715
716 *_piSize = -1;
717
718 pos_label = commonFindLabel(_pvCtx, _piAddress, _pstLabel);
719 *_piFound = pos_label;
720
721 if (len_label)
722 {
723 FREE(len_label);
724 len_label = NULL;
725 }
726 freeArrayOfString(label_list, m_label * n_label);
727
728 if (pos_label != -1)
729 {
730 _SciErr = getMatrixOfDoubleInList(_pvCtx, _piAddress, pos_label+1, &m_tmp, &n_tmp, &tmp_values);
731 if (!_SciErr.iErr)
732 {
733 *_piSize = m_tmp*n_tmp;
734 *_pdblValue = tmp_values[0];
735 }
736 else
737 {
738 if (_iLog)
739 {
740 sciprint(_("%s: wrong parameter type. %s expected. Return default value %f.\n"), "getColVectorOfDoubleInPList","double",_dblDefaultValue);
741 }
742 *_piSize = _iDefaultSize;
743 *_pdblValue = _dblDefaultValue;
744 }
745 }
746 else
747 {
748 if (_iLog)
749 {
750 sciprint(_("%s: parameter not found. Return default value %f.\n"), "getColVectorOfDoubleInPList",_dblDefaultValue);
751 }
752 *_piSize = _iDefaultSize;
753 *_pdblValue = _dblDefaultValue;
754 }
755
756 /* Now check parameters */
757
758 if (_eCheck!=CHECK_NONE)
759 {
760 va_list vl;
761 int nb_value_to_check = 0;
762 double value_to_check = 0;
763 int check_res = 0;
764
765 va_start(vl, _eCheck);
766
767 switch(_eCheck)
768 {
769 case CHECK_SIZE:
770 value_to_check = va_arg(vl, double);
771 va_end(vl);
772 if (value_to_check != *_piSize)
773 {
774 if ((*_piFound != -1) && (_iLog))
775 {
776 sciprint(_("%s: wrong size for parameter %s: %d requested, got %d\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_piSize);
777 }
778 *_pdblValue = _dblDefaultValue;
779 addErrorMessage(&_SciErr, 999, _("%s: wrong size for parameter %s: %d requested, got %d\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_piSize);
780 return _SciErr;
781 }
782 break;
783 case CHECK_MIN:
784 value_to_check = va_arg(vl, double);
785 va_end(vl);
786 if (value_to_check > *_pdblValue)
787 {
788 if ((*_piFound != -1) && (_iLog))
789 {
790 sciprint(_("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
791 }
792 *_pdblValue = _dblDefaultValue;
793 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
794 return _SciErr;
795 }
796 break;
797 case CHECK_MAX:
798 value_to_check = va_arg(vl, double);
799 va_end(vl);
800 if (value_to_check < *_pdblValue)
801 {
802 if ((*_piFound != -1) && (_iLog))
803 {
804 sciprint(_("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
805 }
806 *_pdblValue = _dblDefaultValue;
807 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
808 return _SciErr;
809 }
810 break;
811 case CHECK_BOTH:
812 /* First value is the min bound */
813 value_to_check = va_arg(vl, double);
814 if (value_to_check > *_pdblValue)
815 {
816 if ((*_piFound != -1) && (_iLog))
817 {
818 sciprint(_("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
819 }
820 *_pdblValue = _dblDefaultValue;
821 va_end(vl);
822 addErrorMessage(&_SciErr, 999, _("%s: wrong min bound for parameter %s: min bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
823 return _SciErr;
824 }
825 /* Second value is the max bound */
826 value_to_check = va_arg(vl, double);
827 va_end(vl);
828 if (value_to_check < *_pdblValue)
829 {
830 if ((*_piFound != -1) && (_iLog))
831 {
832 sciprint(_("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
833 }
834 *_pdblValue = _dblDefaultValue;
835 addErrorMessage(&_SciErr, 999, _("%s: wrong max bound for parameter %s: max bound %f, value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, value_to_check, *_pdblValue);
836 return _SciErr;
837 }
838 break;
839 case CHECK_VALUES:
840 /* First parameters is int and contains the number of values to check */
841 nb_value_to_check = va_arg(vl,int);
842 check_res = 0;
843 for(i = 0; i < nb_value_to_check; i++)
844 {
845 value_to_check = va_arg(vl, double);
846 check_res = check_res || (value_to_check == *_pdblValue);
847 }
848 if (!check_res)
849 {
850 if ((*_piFound != -1) && (_iLog))
851 {
852 sciprint(_("%s: wrong value for parameter %s: value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, *_pdblValue);
853 sciprint(_("%s: awaited parameters: "), "getColVectorOfDoubleInPList");
854 va_start(vl, _eCheck);
855 nb_value_to_check = va_arg(vl,int);
856 for( i = 0; i < nb_value_to_check; i++)
857 {
858 value_to_check = va_arg(vl,double);
859 sciprint(" %f", value_to_check);
860 }
861 sciprint("\n");
862 }
863
864 *_pdblValue = _dblDefaultValue;
865
866 va_end(vl);
867 addErrorMessage(&_SciErr, 999, _("%s: wrong value for parameter %s: value %f\n"), "getColVectorOfDoubleInPList", _pstLabel, *_pdblValue);
868 return _SciErr;
869 }
870 va_end(vl);
871 break;
872 }
873 }
874
875 return _SciErr;
876}
877/*--------------------------------------------------------------------------*/
878SciErr createPList(void* _pvCtx, int _iVar, int ** _piAddress, char ** _pstLabelNames, int _iNbParams)
879{
880 SciErr _SciErr;
881 int i = 0;
882 char ** label_list = NULL;
883
884 _SciErr.iErr = 0;
885 _SciErr.iMsgCount = 0;
886
887 _SciErr = createMList(_pvCtx, _iVar, _iNbParams+1, _piAddress);
888 label_list = (char **)MALLOC((_iNbParams + 1) * sizeof(char *));
889 label_list[0] = strdup("plist");
890
891 for(i = 1; i <= _iNbParams; i++)
892 {
893 label_list[i] = strdup(_pstLabelNames[i-1]);
894 }
895
896 _SciErr = createMatrixOfStringInList(_pvCtx, _iVar, *_piAddress, 1, 1, _iNbParams+1, label_list);
897
898 if (label_list)
899 {
900 freeArrayOfString(label_list, _iNbParams + 1);
901 }
902
903 return _SciErr;
904}
905/*--------------------------------------------------------------------------*/
906SciErr createIntInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iValue)
907{
908 int itemPos = -1;
909 double tmp_val[1];
910 SciErr _SciErr;
911
912 _SciErr.iErr = 0;
913 _SciErr.iMsgCount = 0;
914
915 itemPos = commonFindLabel(_pvCtx, _piAddress, _pstLabelName) + 1;
916
917#ifdef DEBUG
918 sciprint("DEBUG: addIntInPList - itemPos = %d _pstLabelName = %s\n", itemPos, _pstLabelName);
919#endif
920
921 tmp_val[0] = (double)_iValue;
922 _SciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, _piAddress, itemPos, 1, 1, tmp_val);
923
924 return _SciErr;
925}
926/*--------------------------------------------------------------------------*/
927SciErr createDoubleInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, double _dblValue)
928{
929 int itemPos = -1;
930 double tmp_val[1];
931 SciErr _SciErr;
932
933 _SciErr.iErr = 0;
934 _SciErr.iMsgCount = 0;
935
936 itemPos = commonFindLabel(_pvCtx, _piAddress, _pstLabelName) + 1;
937
938#ifdef DEBUG
939 sciprint("DEBUG: addDoubleInPList - itemPos = %d _pstLabelName = %s\n", itemPos, _pstLabelName);
940#endif
941
942 tmp_val[0] = _dblValue;
943 _SciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, _piAddress, itemPos, 1, 1, tmp_val);
944
945 return _SciErr;
946}
947/*--------------------------------------------------------------------------*/
948SciErr createStringInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, char * _pstValue)
949{
950 int itemPos = -1;
951 char * tmp_val[1];
952 SciErr _SciErr;
953
954 _SciErr.iErr = 0;
955 _SciErr.iMsgCount = 0;
956
957 itemPos = commonFindLabel(_pvCtx, _piAddress, _pstLabelName) + 1;
958
959#ifdef DEBUG
960 sciprint("DEBUG: addStringInPList - itemPos = %d _pstLabelName = %s\n", itemPos, _pstLabelName);
961#endif
962
963 tmp_val[0] = strdup(_pstValue);
964 _SciErr = createMatrixOfStringInList(_pvCtx, _iVar, _piAddress, itemPos, 1, 1, tmp_val);
965
966 if (tmp_val[0])
967 {
968 FREE(tmp_val[0]);
969 tmp_val[0] = NULL;
970
971 }
972
973 return _SciErr;
974}
975/*--------------------------------------------------------------------------*/
976SciErr createColVectorOfIntInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iNbValues, int * _piValue)
977{
978 int itemPos = -1, i = 0;
979 double * tmp_val = NULL;
980 SciErr _SciErr;
981
982 _SciErr.iErr = 0;
983 _SciErr.iMsgCount = 0;
984
985 itemPos = commonFindLabel(_pvCtx, _piAddress, _pstLabelName) + 1;
986
987#ifdef DEBUG
988 sciprint("DEBUG: addVectorOfIntInPList - itemPos = %d _pstLabelName = %s\n", itemPos, _pstLabelName);
989#endif
990
991 tmp_val = (double *)MALLOC(_iNbValues * sizeof(double));
992 for(i = 0; i < _iNbValues; i++)
993 {
994 tmp_val[i] = (double)_piValue[i];
995 }
996 _SciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, _piAddress, itemPos, _iNbValues, 1, tmp_val);
997
998 if (tmp_val)
999 {
1000 FREE(tmp_val);
1001 tmp_val = NULL;
1002 }
1003
1004 return _SciErr;
1005}
1006/*--------------------------------------------------------------------------*/
1007SciErr createColVectorOfDoubleInPList(void* _pvCtx, int _iVar, int * _piAddress, char * _pstLabelName, int _iNbValues, double * _pdblValue)
1008{
1009 int itemPos = -1;
1010 SciErr _SciErr;
1011
1012 _SciErr.iErr = 0;
1013 _SciErr.iMsgCount = 0;
1014
1015 itemPos = commonFindLabel(_pvCtx, _piAddress, _pstLabelName) + 1;
1016
1017#ifdef DEBUG
1018 sciprint("DEBUG: addVectorOfDoubleInPList - itemPos = %d _pstLabelName = %s\n", itemPos, _pstLabelName);
1019#endif
1020
1021 _SciErr = createMatrixOfDoubleInList(_pvCtx, _iVar, _piAddress, itemPos, _iNbValues, 1, _pdblValue);
1022
1023 return _SciErr;
1024}
1025/*--------------------------------------------------------------------------*/
1026/* Utility functions */
1027static int commonFindLabelPartial(void* _pvCtx, int * _piAddress, char const * const _pstLabelToFind)
1028{
1029 int Pos = -1, i = 0;
1030 int m_label = 0, n_label = 0;
1031 int * len_label = NULL;
1032 char ** label_list = NULL;
1033 SciErr _SciErr;
1034
1035 _SciErr.iErr = 0;
1036 _SciErr.iMsgCount = 0;
1037
1038 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, NULL, NULL);
1039 len_label = (int *)MALLOC(m_label * n_label * sizeof(int));
1040 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, NULL);
1041 label_list = (char **)MALLOC(m_label * n_label * sizeof(char *));
1042
1043 for(i = 0; i < n_label * m_label; i++)
1044 {
1045 label_list[i] = (char *)MALLOC((len_label[i] + 1) * sizeof(char));
1046 }
1047 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, label_list);
1048
1049 if (label_list != NULL)
1050 {
1051 for(i = 0; i < m_label * n_label; i++)
1052 {
1053 /* A bug in scilab: if the mlist contains only the type, the C API returns m_label*n_label==2 !! */
1054 if (label_list[i] != NULL)
1055 {
1056 if (strncmp(label_list[i], _pstLabelToFind, strlen(_pstLabelToFind)) == 0)
1057 {
1058 Pos = i;
1059
1060 if (len_label)
1061 {
1062 FREE(len_label);
1063 len_label = NULL;
1064 }
1065 freeArrayOfString(label_list, m_label * n_label);
1066
1067 return Pos;
1068 }
1069 }
1070 }
1071 }
1072
1073 if (len_label)
1074 {
1075 FREE(len_label);
1076 len_label = NULL;
1077 }
1078 freeArrayOfString(label_list, m_label * n_label);
1079
1080 return Pos;
1081}
1082/*--------------------------------------------------------------------------*/
1083static int commonFindLabel(void* _pvCtx, int * _piAddress, char const * const _pstLabelToFind)
1084{
1085 int Pos = -1, i = 0;
1086 int m_label = 0, n_label = 0;
1087 int * len_label = NULL;
1088 char ** label_list = NULL;
1089 SciErr _SciErr;
1090
1091 _SciErr.iErr = 0;
1092 _SciErr.iMsgCount = 0;
1093
1094 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, NULL, NULL);
1095 len_label = (int *)MALLOC(m_label * n_label * sizeof(int));
1096 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, NULL);
1097 label_list = (char **)MALLOC(m_label * n_label * sizeof(char *));
1098 for(i = 0; i < n_label * m_label; i++)
1099 {
1100 label_list[i] = (char *)MALLOC((len_label[i] + 1) * sizeof(char));
1101 }
1102 _SciErr = getMatrixOfStringInList(_pvCtx, _piAddress, 1, &m_label, &n_label, len_label, label_list);
1103
1104 if (label_list != NULL)
1105 {
1106 for(i = 0; i < m_label * n_label; i++)
1107 {
1108 /* A bug in scilab: if the mlist contains only the type, the C API returns m_label*n_label==2 !! */
1109 if (label_list[i] != NULL)
1110 {
1111 if (strcmp(label_list[i], (char *)_pstLabelToFind) == 0)
1112 {
1113 Pos = i;
1114
1115 if (len_label)
1116 {
1117 FREE(len_label);
1118 len_label = NULL;
1119 }
1120 freeArrayOfString(label_list, m_label * n_label);
1121
1122 return Pos;
1123 }
1124 }
1125 }
1126 }
1127
1128 if (len_label)
1129 {
1130 FREE(len_label);
1131 len_label = NULL;
1132 }
1133 freeArrayOfString(label_list, m_label * n_label);
1134
1135 return Pos;
1136}
1137/*--------------------------------------------------------------------------*/
1138
diff --git a/scilab/modules/parameters/src/c/parameters.rc b/scilab/modules/parameters/src/c/parameters.rc
new file mode 100644
index 0000000..cdc7184
--- /dev/null
+++ b/scilab/modules/parameters/src/c/parameters.rc
@@ -0,0 +1,97 @@
1// Microsoft Visual C++ generated resource script.
2//
3
4
5#define APSTUDIO_READONLY_SYMBOLS
6/////////////////////////////////////////////////////////////////////////////
7//
8// Generated from the TEXTINCLUDE 2 resource.
9//
10//#include "afxres.h"
11#define APSTUDIO_HIDDEN_SYMBOLS
12#include "windows.h"
13/////////////////////////////////////////////////////////////////////////////
14#undef APSTUDIO_READONLY_SYMBOLS
15
16/////////////////////////////////////////////////////////////////////////////
17// French (France) resources
18
19#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
20#ifdef _WIN32
21LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
22#pragma code_page(1252)
23#endif //_WIN32
24
25#ifdef APSTUDIO_INVOKED
26/////////////////////////////////////////////////////////////////////////////
27//
28// TEXTINCLUDE
29//
30
311 TEXTINCLUDE
32BEGIN
33 "resource.h\0"
34END
35
36
373 TEXTINCLUDE
38BEGIN
39 "\r\n"
40 "\0"
41END
42
43#endif // APSTUDIO_INVOKED
44
45
46/////////////////////////////////////////////////////////////////////////////
47//
48// Version
49//
50
51VS_VERSION_INFO VERSIONINFO
52 FILEVERSION 5,3,0,0
53 PRODUCTVERSION 5,3,0,0
54 FILEFLAGSMASK 0x17L
55#ifdef _DEBUG
56 FILEFLAGS 0x1L
57#else
58 FILEFLAGS 0x0L
59#endif
60 FILEOS 0x4L
61 FILETYPE 0x0L
62 FILESUBTYPE 0x0L
63BEGIN
64 BLOCK "StringFileInfo"
65 BEGIN
66 BLOCK "040c04b0"
67 BEGIN
68 VALUE "FileDescription", "parameters module"
69 VALUE "FileVersion", "5, 3, 0, 0"
70 VALUE "InternalName", "parameters module"
71 VALUE "LegalCopyright", "Copyright (C) 2010"
72 VALUE "OriginalFilename", "parameters.dll"
73 VALUE "ProductName", " parameters"
74 VALUE "ProductVersion", "5, 3, 0, 0"
75 END
76 END
77 BLOCK "VarFileInfo"
78 BEGIN
79 VALUE "Translation", 0x40c, 1200
80 END
81END
82
83#endif // French (France) resources
84/////////////////////////////////////////////////////////////////////////////
85
86
87
88#ifndef APSTUDIO_INVOKED
89/////////////////////////////////////////////////////////////////////////////
90//
91// Generated from the TEXTINCLUDE 3 resource.
92//
93
94
95/////////////////////////////////////////////////////////////////////////////
96#endif // not APSTUDIO_INVOKED
97