Merge remote branch 'origin/sas' into YaSp 23/623/1
Bruno JOFRET [Mon, 17 May 2010 15:29:37 +0000 (17:29 +0200)]
Conflicts:
scilab/Scilab.sln
scilab/configure
scilab/modules/Makefile.in
scilab/modules/boolean/sci_gateway/c/sci_or.c
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/sci_gateway/c/gw_core.c
scilab/modules/core/sci_gateway/c/sci_newfun.c
scilab/modules/elementary_functions/sci_gateway/c/sci_isreal.c
scilab/modules/elementary_functions/sci_gateway/c/sci_number_properties.c
scilab/modules/elementary_functions/sci_gateway/c/sci_rand.c
scilab/modules/elementary_functions/sci_gateway/c/sci_size.c
scilab/modules/elementary_functions/sci_gateway/c/sci_testmatrix.c
scilab/modules/elementary_functions/sci_gateway/c/sci_tril.c
scilab/modules/elementary_functions/sci_gateway/c/sci_triu.c
scilab/modules/fileio/includes/gw_fileio.h
scilab/modules/fileio/sci_gateway/c/gw_fileio.c
scilab/modules/fileio/sci_gateway/c/sci_basename.c
scilab/modules/fileio/sci_gateway/c/sci_chdir.c
scilab/modules/fileio/sci_gateway/c/sci_copyfile.c
scilab/modules/fileio/sci_gateway/c/sci_fileparts.c
scilab/modules/fileio/sci_gateway/c/sci_isdir.c
scilab/modules/fileio/sci_gateway/c/sci_isfile.c
scilab/modules/fileio/sci_gateway/c/sci_movefile.c
scilab/modules/fileio/sci_gateway/c/sci_pathconvert.c
scilab/modules/functions/sci_gateway/c/sci_exec.c
scilab/modules/functions/sci_gateway/c/sci_execstr.c
scilab/modules/functions/sci_gateway/c/sci_lib.c
scilab/modules/functions/sci_gateway/c/sci_whereis.c
scilab/modules/hdf5/sci_gateway/c/gw_hdf5.c
scilab/modules/hdf5/sci_gateway/cpp/sci_export_to_hdf5.cpp
scilab/modules/hdf5/sci_gateway/cpp/sci_import_from_hdf5.cpp
scilab/modules/integer/tests/unit_tests/inttype.tst
scilab/modules/io/Makefile.am
scilab/modules/io/Makefile.in
scilab/modules/io/includes/gw_io.h
scilab/modules/io/sci_gateway/c/gw_io.c
scilab/modules/io/sci_gateway/c/sci_file.c
scilab/modules/io/sci_gateway/c/sci_getenv.c
scilab/modules/io/sci_gateway/c/sci_setenv.c
scilab/modules/localization/includes/localization.h
scilab/modules/output_stream/sci_gateway/c/gw_output_stream.c
scilab/modules/output_stream/sci_gateway/cpp/sci_diary.cpp
scilab/modules/parameters/Makefile.in
scilab/modules/sound/sci_gateway/c/gw_sound.c
scilab/modules/sound/sci_gateway/c/sci_PlaySound.c
scilab/modules/sound/sci_gateway/c/sci_beep.c
scilab/modules/string/sci_gateway/c/gw_string.c
scilab/modules/string/sci_gateway/c/sci_isalphanum.c
scilab/modules/string/sci_gateway/c/sci_isascii.c
scilab/modules/string/sci_gateway/c/sci_isdigit.c
scilab/modules/string/sci_gateway/c/sci_length.c
scilab/modules/string/sci_gateway/c/sci_strsplit.c
scilab/modules/string/sci_gateway/c/sci_strsubst.c
scilab/modules/types/Makefile.am
scilab/modules/types/Makefile.in
scilab/modules/windows_tools/sci_gateway/c/gw_windows_tools.c
scilab/modules/windows_tools/sci_gateway/c/sci_dos.c
scilab/modules/xpad/sci_gateway/cpp/sci_xpad.cpp

Change-Id: I2a746501e63caaa413dc680230ae444f71fd03e4

153 files changed:
1  2 
scilab/.gitignore
scilab/Scilab.sln
scilab/bin/scilab
scilab/configure
scilab/configure.ac
scilab/contrib/Makefile.in
scilab/libs/MALLOC/Makefile.in
scilab/libs/Makefile.in
scilab/libs/doublylinkedlist/Makefile.in
scilab/libs/dynamiclibrary/Makefile.in
scilab/libs/hashtable/Makefile.in
scilab/libs/libst/Makefile.in
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/action_binding/Makefile.in
scilab/modules/api_scilab/Makefile.am
scilab/modules/api_scilab/Makefile.in
scilab/modules/api_scilab/src/cpp/api_common.cpp
scilab/modules/arnoldi/Makefile.in
scilab/modules/atoms/Makefile.in
scilab/modules/boolean/Makefile.am
scilab/modules/boolean/Makefile.in
scilab/modules/cacsd/Makefile.in
scilab/modules/call_scilab/Makefile.in
scilab/modules/compatibility_functions/Makefile.in
scilab/modules/completion/Makefile.in
scilab/modules/console/Makefile.in
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/includes/gw_core.h
scilab/modules/core/sci_gateway/c/gw_core.c
scilab/modules/core/sci_gateway/c/sci_exit.c
scilab/modules/core/sci_gateway/c/sci_getversion.c
scilab/modules/core/sci_gateway/c/sci_newfun.c
scilab/modules/core/sci_gateway/c/sci_typename.c
scilab/modules/core/src/c/getdynamicDebugInfo_Windows.c
scilab/modules/data_structures/Makefile.in
scilab/modules/demo_tools/Makefile.in
scilab/modules/development_tools/Makefile.in
scilab/modules/differential_equations/Makefile.in
scilab/modules/double/Makefile.in
scilab/modules/dynamic_link/Makefile.in
scilab/modules/elementary_functions/Makefile.am
scilab/modules/elementary_functions/Makefile.in
scilab/modules/elementary_functions/sci_gateway/c/sci_atan.c
scilab/modules/elementary_functions/sci_gateway/c/sci_clean.c
scilab/modules/elementary_functions/sci_gateway/c/sci_cumprod.c
scilab/modules/elementary_functions/sci_gateway/c/sci_cumsum.c
scilab/modules/elementary_functions/sci_gateway/c/sci_diag.c
scilab/modules/elementary_functions/sci_gateway/c/sci_dsearch.c
scilab/modules/elementary_functions/sci_gateway/c/sci_expm.c
scilab/modules/elementary_functions/sci_gateway/c/sci_frexp.c
scilab/modules/elementary_functions/sci_gateway/c/sci_kron.c
scilab/modules/elementary_functions/sci_gateway/c/sci_log.c
scilab/modules/elementary_functions/sci_gateway/c/sci_log1p.c
scilab/modules/elementary_functions/sci_gateway/c/sci_matrix.c
scilab/modules/elementary_functions/sci_gateway/c/sci_maxi.c
scilab/modules/elementary_functions/sci_gateway/c/sci_nearfloat.c
scilab/modules/elementary_functions/sci_gateway/c/sci_number_properties.c
scilab/modules/elementary_functions/sci_gateway/c/sci_size.c
scilab/modules/elementary_functions/sci_gateway/c/sci_sum.c
scilab/modules/fftw/Makefile.in
scilab/modules/fileio/Makefile.in
scilab/modules/fileio/includes/gw_fileio.h
scilab/modules/fileio/sci_gateway/c/sci_basename.c
scilab/modules/fileio/sci_gateway/c/sci_chdir.c
scilab/modules/fileio/sci_gateway/c/sci_copyfile.c
scilab/modules/fileio/sci_gateway/c/sci_fileparts.c
scilab/modules/fileio/sci_gateway/c/sci_isdir.c
scilab/modules/fileio/sci_gateway/c/sci_isfile.c
scilab/modules/fileio/sci_gateway/c/sci_mgetl.c
scilab/modules/fileio/sci_gateway/c/sci_movefile.c
scilab/modules/fileio/sci_gateway/c/sci_pathconvert.c
scilab/modules/functions/Makefile.am
scilab/modules/functions/Makefile.in
scilab/modules/functions/sci_gateway/c/sci_exec.c
scilab/modules/functions/sci_gateway/c/sci_execstr.c
scilab/modules/functions/sci_gateway/c/sci_lib.c
scilab/modules/functions/src/c/getmacroslist.c
scilab/modules/genetic_algorithms/Makefile.in
scilab/modules/graph/Makefile.in
scilab/modules/graphic_export/Makefile.in
scilab/modules/graphics/Makefile.am
scilab/modules/graphics/Makefile.in
scilab/modules/gui/Makefile.in
scilab/modules/hdf5/Makefile.in
scilab/modules/hdf5/sci_gateway/cpp/sci_export_to_hdf5.cpp
scilab/modules/hdf5/sci_gateway/cpp/sci_import_from_hdf5.cpp
scilab/modules/helptools/Makefile.am
scilab/modules/helptools/Makefile.in
scilab/modules/history_manager/Makefile.in
scilab/modules/integer/Makefile.am
scilab/modules/integer/Makefile.in
scilab/modules/interpolation/Makefile.in
scilab/modules/intersci/Makefile.in
scilab/modules/io/Makefile.am
scilab/modules/io/Makefile.in
scilab/modules/io/includes/gw_io.h
scilab/modules/io/sci_gateway/c/gw_io.c
scilab/modules/io/sci_gateway/c/sci_file.c
scilab/modules/io/sci_gateway/c/sci_getenv.c
scilab/modules/io/sci_gateway/c/sci_setenv.c
scilab/modules/javasci/Makefile.in
scilab/modules/jvm/Makefile.in
scilab/modules/linear_algebra/Makefile.in
scilab/modules/localization/Makefile.in
scilab/modules/localization/includes/localization.h
scilab/modules/m2sci/Makefile.in
scilab/modules/maple2scilab/Makefile.in
scilab/modules/matio/Makefile.in
scilab/modules/matio/sci_gateway/c/sci_matfile_varreadnext.c
scilab/modules/mexlib/Makefile.in
scilab/modules/operations/Makefile.in
scilab/modules/optimization/Makefile.in
scilab/modules/output_stream/Makefile.am
scilab/modules/output_stream/Makefile.in
scilab/modules/output_stream/sci_gateway/cpp/sci_diary.cpp
scilab/modules/overloading/Makefile.in
scilab/modules/parameters/Makefile.in
scilab/modules/parse/Makefile.in
scilab/modules/polynomials/Makefile.in
scilab/modules/pvm/Makefile.in
scilab/modules/randlib/Makefile.in
scilab/modules/renderer/Makefile.in
scilab/modules/scicos/Makefile.in
scilab/modules/scicos_blocks/Makefile.in
scilab/modules/shell/Makefile.in
scilab/modules/signal_processing/Makefile.in
scilab/modules/simulated_annealing/Makefile.in
scilab/modules/sound/Makefile.in
scilab/modules/sound/sci_gateway/c/sci_PlaySound.c
scilab/modules/sound/sci_gateway/c/sci_beep.c
scilab/modules/sparse/Makefile.in
scilab/modules/special_functions/Makefile.in
scilab/modules/spreadsheet/Makefile.in
scilab/modules/statistics/Makefile.in
scilab/modules/string/Makefile.in
scilab/modules/string/sci_gateway/c/sci_isalphanum.c
scilab/modules/string/sci_gateway/c/sci_isascii.c
scilab/modules/string/sci_gateway/c/sci_isdigit.c
scilab/modules/string/sci_gateway/c/sci_length.c
scilab/modules/string/sci_gateway/c/sci_strsplit.c
scilab/modules/string/sci_gateway/c/sci_strsubst.c
scilab/modules/symbolic/Makefile.in
scilab/modules/tclsci/Makefile.in
scilab/modules/texmacs/Makefile.in
scilab/modules/time/Makefile.in
scilab/modules/types/Makefile.am
scilab/modules/types/Makefile.in
scilab/modules/umfpack/Makefile.in
scilab/modules/windows_tools/Makefile.in
scilab/modules/xcos/Makefile.in
scilab/modules/xpad/Makefile.in

Simple merge
@@@ -1265,19 -1102,20 +1281,34 @@@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C
                {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC} = {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC}
        EndProjectSection
  EndProject
 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "integer_gw", "modules\integer\src\cpp\integer_gw.vcproj", "{215274D7-05EC-4D1E-B7BB-B2C957DA960B}"
 +      ProjectSection(ProjectDependencies) = postProject
 +              {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F} = {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F}
 +              {C7865CAA-EC7C-41EB-8324-2B81C384CA20} = {C7865CAA-EC7C-41EB-8324-2B81C384CA20}
 +              {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
 +              {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF} = {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF}
 +      EndProjectSection
 +EndProject
 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "matio_gw", "modules\matio\sci_gateway\cpp\matio_gw.vcproj", "{764FAC09-369D-4C11-A0FF-CE097D9A4FAF}"
 +      ProjectSection(ProjectDependencies) = postProject
 +              {7757B22F-9512-4380-9E40-EFD50575028D} = {7757B22F-9512-4380-9E40-EFD50575028D}
 +              {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F} = {2C60033B-0DBD-4CA4-80D3-176C9BE9CE2F}
 +              {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF} = {64E090DA-DCB5-4F4D-93D7-E88DDEC9C2EF}
++EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "types-Ant", "modules\types\src\java\types-JAVA.vcproj", "{ABCB724E-8534-4420-AC12-7C33A606ABA3}"
+       ProjectSection(ProjectDependencies) = postProject
+               {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+               {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+       EndProjectSection
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "rename-vc-files", "Visual-Studio-settings\rename-vc-files\rename-vc-files.vcproj", "{DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}"
+ EndProject
+ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parameters", "modules\parameters\parameters.vcproj", "{A09E8584-0713-48A5-97BA-ACED0F3728F8}"
+       ProjectSection(ProjectDependencies) = postProject
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
+               {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+               {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
+               {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
        EndProjectSection
  EndProject
  Global
                {968FD6C1-5845-4B22-B61E-F6DE987D47AD}.Release|Win32.Build.0 = Release|Win32
                {968FD6C1-5845-4B22-B61E-F6DE987D47AD}.Release|x64.ActiveCfg = Release|x64
                {968FD6C1-5845-4B22-B61E-F6DE987D47AD}.Release|x64.Build.0 = Release|x64
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Debug|Win32.ActiveCfg = Debug|Win32
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Debug|Win32.Build.0 = Debug|Win32
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Debug|x64.ActiveCfg = Debug|x64
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Debug|x64.Build.0 = Debug|x64
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Release|Win32.ActiveCfg = Release|Win32
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Release|Win32.Build.0 = Release|Win32
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Release|x64.ActiveCfg = Release|x64
 +              {215274D7-05EC-4D1E-B7BB-B2C957DA960B}.Release|x64.Build.0 = Release|x64
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Debug|Win32.ActiveCfg = Debug|Win32
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Debug|Win32.Build.0 = Debug|Win32
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Debug|x64.ActiveCfg = Debug|x64
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Debug|x64.Build.0 = Debug|x64
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Release|Win32.ActiveCfg = Release|Win32
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Release|Win32.Build.0 = Release|Win32
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Release|x64.ActiveCfg = Release|x64
 +              {764FAC09-369D-4C11-A0FF-CE097D9A4FAF}.Release|x64.Build.0 = Release|x64
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Debug|Win32.ActiveCfg = Debug|Win32
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Debug|Win32.Build.0 = Debug|Win32
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Debug|x64.ActiveCfg = Debug|x64
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Debug|x64.Build.0 = Debug|x64
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Release|Win32.ActiveCfg = Release|Win32
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Release|Win32.Build.0 = Release|Win32
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Release|x64.ActiveCfg = Release|x64
+               {ABCB724E-8534-4420-AC12-7C33A606ABA3}.Release|x64.Build.0 = Release|x64
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Debug|Win32.ActiveCfg = Debug|Win32
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Debug|Win32.Build.0 = Debug|Win32
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Debug|x64.ActiveCfg = Debug|x64
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Debug|x64.Build.0 = Debug|x64
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.ActiveCfg = Release|Win32
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|Win32.Build.0 = Release|Win32
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.ActiveCfg = Release|x64
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}.Release|x64.Build.0 = Release|x64
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.ActiveCfg = Debug|Win32
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|Win32.Build.0 = Debug|Win32
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.ActiveCfg = Debug|x64
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Debug|x64.Build.0 = Debug|x64
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.ActiveCfg = Release|Win32
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.Build.0 = Release|Win32
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.ActiveCfg = Release|x64
+               {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
Simple merge
@@@ -10230,7 -9944,7 +10236,7 @@@ $as_echo_n "checking type of jvm... " >
      if test "x$ac_java_jvm_name" = "x" ; then
  
      cat << \EOF > conftest.java
- // #line 10233 "configure"
 -// #line 9947 "configure"
++// #line 10239 "configure"
  import gnu.java.io.EncodingManager;
  
  public class conftest {
@@@ -10288,7 -10008,7 +10300,7 @@@ $as_echo_n "checking java API version..
  
  
      cat << \EOF > conftest.java
- // #line 10291 "configure"
 -// #line 10011 "configure"
++// #line 10303 "configure"
  import java.nio.charset.Charset;
  
  public class conftest {
  
  
      cat << \EOF > conftest.java
- // #line 10330 "configure"
 -// #line 10056 "configure"
++// #line 10348 "configure"
  import java.lang.StringBuilder;
  
  public class conftest {
@@@ -11580,7 -11312,7 +11604,7 @@@ $as_echo_n "checking jgraphx... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 11583 "configure"
 -// #line 11315 "configure"
++// #line 11607 "configure"
  import com.mxgraph.model.mxCell;
  
  public class conftest {
@@@ -11667,7 -11405,7 +11697,7 @@@ $as_echo_n "checking minimal version (1
     export ac_java_classpath="$JGRAPHX:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 11670 "configure"
 -// #line 11408 "configure"
++// #line 11700 "configure"
  import com.mxgraph.view.mxGraph;
  
  public class conftest {
@@@ -11731,7 -11477,7 +11769,7 @@@ $as_echo_n "checking flexdock... " >&6
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 11734 "configure"
 -// #line 11480 "configure"
++// #line 11772 "configure"
  import org.flexdock.docking.DockingManager;
  
  public class conftest {
@@@ -11832,7 -11584,7 +11876,7 @@@ $as_echo_n "checking looks... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 11835 "configure"
 -// #line 11587 "configure"
++// #line 11879 "configure"
  import com.jgoodies.looks.common.RenderingUtils;
  
  public class conftest {
@@@ -11933,7 -11691,7 +11983,7 @@@ $as_echo_n "checking jgoodies-looks... 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 11936 "configure"
 -// #line 11694 "configure"
++// #line 11986 "configure"
  import com.jgoodies.looks.common.RenderingUtils;
  
  public class conftest {
@@@ -12035,7 -11799,7 +12091,7 @@@ $as_echo_n "checking skinlf... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12038 "configure"
 -// #line 11802 "configure"
++// #line 12094 "configure"
  import com.l2fprod.util.AccessUtils;
  
  public class conftest {
@@@ -12136,7 -11906,7 +12198,7 @@@ $as_echo_n "checking jogl... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12139 "configure"
 -// #line 11909 "configure"
++// #line 12201 "configure"
  import javax.media.opengl.glu.GLUnurbs;
  
  public class conftest {
@@@ -12340,7 -12116,7 +12408,7 @@@ $as_echo_n "checking gluegen-rt... " >&
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12343 "configure"
 -// #line 12119 "configure"
++// #line 12411 "configure"
  import com.sun.gluegen.runtime.CPU;
  
  public class conftest {
@@@ -12496,7 -12278,7 +12570,7 @@@ $as_echo_n "checking jhall... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12499 "configure"
 -// #line 12281 "configure"
++// #line 12573 "configure"
  import javax.help.JHelp;
  
  public class conftest {
@@@ -12597,7 -12385,7 +12677,7 @@@ $as_echo_n "checking javahelp2... " >&6
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12600 "configure"
 -// #line 12388 "configure"
++// #line 12680 "configure"
  import javax.help.JHelp;
  
  public class conftest {
@@@ -12699,7 -12493,7 +12785,7 @@@ $as_echo_n "checking jrosetta-API... " 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12702 "configure"
 -// #line 12496 "configure"
++// #line 12788 "configure"
  import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
  
  public class conftest {
@@@ -12800,7 -12600,7 +12892,7 @@@ $as_echo_n "checking jrosetta-engine..
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12803 "configure"
 -// #line 12603 "configure"
++// #line 12895 "configure"
  import com.artenum.rosetta.core.action.AbstractConsoleAction;
  
  public class conftest {
@@@ -12903,7 -12709,7 +13001,7 @@@ $as_echo_n "checking jeuclid-core... " 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 12906 "configure"
 -// #line 12712 "configure"
++// #line 13004 "configure"
  import net.sourceforge.jeuclid.LayoutContext;
  
  public class conftest {
@@@ -13006,7 -12818,7 +13110,7 @@@ $as_echo_n "checking fop... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13009 "configure"
 -// #line 12821 "configure"
++// #line 13113 "configure"
  import org.apache.fop.pdf.PDFInfo;
  
  public class conftest {
@@@ -13107,7 -12925,7 +13217,7 @@@ $as_echo_n "checking batik-all... " >&6
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13110 "configure"
 -// #line 12928 "configure"
++// #line 13220 "configure"
  import org.apache.batik.parser.Parser;
  
  public class conftest {
@@@ -13208,7 -13032,7 +13324,7 @@@ $as_echo_n "checking batik... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13211 "configure"
 -// #line 13035 "configure"
++// #line 13327 "configure"
  import org.apache.batik.parser.Parser;
  
  public class conftest {
@@@ -13289,6 -13119,63 +13411,63 @@@ $as_echo "$as_me: WARNING: Could not fi
                                fi
  
  
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.7) of batik" >&5
+ $as_echo_n "checking minimal version (1.7) of batik... " >&6; }
+    saved_ac_java_classpath=$ac_java_classpath
+    export ac_java_classpath="$BATIK:$ac_java_classpath"
+     cat << \EOF > conftest.java
 -// #line 13128 "configure"
++// #line 13420 "configure"
+ import org.apache.batik.Version;
+ public class conftest {
+     public static void main(String[] argv) {
+         String minVersion="1.7";
+                             System.out.println(Version.getVersion());
+                                                       if (minVersion.compareTo(Version.getVersion()) > 0) {
+                                                               System.exit(-1);
+                                                               }
+     }
+ }
+ EOF
+     CLASSPATH=$ac_java_classpath
+     export CLASSPATH
+     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
+     if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5) ; then
+        if test ""yes"" = "no"; then
+            echo "yes" >&5
+                  echo "yes"
+          else
+                  cmd="$JAVA conftest"
+                  if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5); then
+                  echo "yes" >&5
+                          echo "yes"
+                       else
+                       echo "configure: failed program was:" >&5
+                               cat conftest.java >&5
+                 if test -s conftest.java.output; then
+                    STDOUT=`cat conftest.java.output`
+                 fi
+                       echo "configure: CLASSPATH was $CLASSPATH" >&5
+                         as_fn_error "Wrong version of batik. Expected at least 1.7. Found $STDOUT" "$LINENO" 5
+                                               fi
+               fi
+         if test -f conftest.java.output; then
+            rm conftest.java.output
+         fi
+     else
+         echo "configure: failed program was:" >&5
+         cat conftest.java >&5
+         echo "configure: CLASSPATH was $CLASSPATH" >&5
+           as_fn_error "Wrong version of batik. Expected at least 1.7. Found $STDOUT" "$LINENO" 5
+             fi
+    ac_java_classpath=$saved_ac_java_classpath
                                # Commons I/O library
  
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking commons-io" >&5
@@@ -13310,7 -13197,7 +13489,7 @@@ $as_echo_n "checking commons-io... " >&
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13313 "configure"
 -// #line 13200 "configure"
++// #line 13492 "configure"
  import org.apache.commons.io.output.CountingOutputStream;
  
  public class conftest {
@@@ -13411,7 -13304,7 +13596,7 @@@ $as_echo_n "checking xmlgraphics-common
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13414 "configure"
 -// #line 13307 "configure"
++// #line 13599 "configure"
  import org.apache.xmlgraphics.util.Service;
  
  public class conftest {
@@@ -13512,7 -13411,7 +13703,7 @@@ $as_echo_n "checking avalon-framework..
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13515 "configure"
 -// #line 13414 "configure"
++// #line 13706 "configure"
  import org.apache.avalon.framework.configuration.ConfigurationException;
  
  public class conftest {
@@@ -13613,7 -13518,7 +13810,7 @@@ $as_echo_n "checking xml-apis-ext... " 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13616 "configure"
 -// #line 13521 "configure"
++// #line 13813 "configure"
  import org.w3c.dom.svg.SVGDocument;
  
  public class conftest {
@@@ -13714,7 -13625,7 +13917,7 @@@ $as_echo_n "checking xml-commons-apis-e
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13717 "configure"
 -// #line 13628 "configure"
++// #line 13920 "configure"
  import org.w3c.dom.svg.SVGDocument;
  
  public class conftest {
@@@ -13923,7 -13736,7 +14028,7 @@@ $as_echo_n "checking commons-logging..
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 13926 "configure"
 -// #line 13739 "configure"
++// #line 14031 "configure"
  import org.apache.commons.logging.LogFactory;
  
  public class conftest {
@@@ -14024,7 -13843,7 +14135,7 @@@ $as_echo_n "checking jlatexmath... " >&
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14027 "configure"
 -// #line 13846 "configure"
++// #line 14138 "configure"
  import org.scilab.forge.jlatexmath.TeXFormula;
  
  public class conftest {
@@@ -14111,7 -13936,7 +14228,7 @@@ $as_echo_n "checking minimal version (0
     export ac_java_classpath="$JLATEXMATH:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14114 "configure"
 -// #line 13939 "configure"
++// #line 14231 "configure"
  import org.scilab.forge.jlatexmath.TeXFormula;
  
  public class conftest {
@@@ -14181,7 -14014,7 +14306,7 @@@ $as_echo_n "checking checkstyle... " >&
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14184 "configure"
 -// #line 14017 "configure"
++// #line 14309 "configure"
  import com.puppycrawl.tools.checkstyle.CheckStyleTask;
  
  public class conftest {
@@@ -14282,7 -14121,7 +14413,7 @@@ $as_echo_n "checking commons-beanutils.
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14285 "configure"
 -// #line 14124 "configure"
++// #line 14416 "configure"
  import org.apache.commons.beanutils.Converter;
  
  public class conftest {
@@@ -14383,7 -14228,7 +14520,7 @@@ $as_echo_n "checking antlr... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14386 "configure"
 -// #line 14231 "configure"
++// #line 14523 "configure"
  import antlr.TokenStreamException;
  
  public class conftest {
@@@ -14484,7 -14335,7 +14627,7 @@@ $as_echo_n "checking testng... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14487 "configure"
 -// #line 14338 "configure"
++// #line 14630 "configure"
  import org.testng.TestNG;
  
  public class conftest {
@@@ -14585,7 -14442,7 +14734,7 @@@ $as_echo_n "checking qdox... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14588 "configure"
 -// #line 14445 "configure"
++// #line 14737 "configure"
  import com.thoughtworks.qdox.tools.QDoxTester;
  
  public class conftest {
@@@ -14686,7 -14549,7 +14841,7 @@@ $as_echo_n "checking bsh... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14689 "configure"
 -// #line 14552 "configure"
++// #line 14844 "configure"
  import bsh.Console;
  
  public class conftest {
@@@ -14787,7 -14656,7 +14948,7 @@@ $as_echo_n "checking junit... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 14790 "configure"
 -// #line 14659 "configure"
++// #line 14951 "configure"
  import junit.framework.Assert;
  
  public class conftest {
@@@ -18437,9 -18313,118 +18605,118 @@@ if test $HDF5_ENABLE = yes -a "$with_sc
     if test "$MACOSX" = 1; then
          echo "Check of the presence of libjhdf5.jnilib disabled under Mac OS X"
     else
-       LDFLAGS_save=$LDFLAGS
+      # HDF5 java lib
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking jhdf5" >&5
+ $as_echo_n "checking jhdf5... " >&6; }
+       PACKAGE_JAR_FILE=
+       found_jar=no
+       saved_ac_java_classpath=$ac_java_classpath
+       DEFAULT_JAR_DIR="/usr/share/java/ /usr/lib/java/ /usr/share/java /usr/share/java/jar /opt/java/lib /usr/local/java /usr/local/java/jar /usr/local/share/java /usr/local/share/java/jar /usr/local/lib/java $(ls -d /usr/share/java/*/ 2>/dev/null) $(ls -d /usr/lib64/*/ 2>/dev/null) $(ls -d /usr/lib/*/ 2>/dev/null)  $(ls -d /usr/share/*/lib/ 2>/dev/null)"
+     for jardir in "`pwd`/thirdparty" "`pwd`/jar" $DEFAULT_JAR_DIR "$_user_libdir"; do
+       for jar in "$jardir/jhdf5.jar" "$jardir/libjhdf5.jar" "$jardir/libjhdf5-java.jar" "$jardir/jhdf5*.jar"; do
+ #     jar=`echo $jar|sed -e 's/ /\\ /'`
+ #     echo "protected $jar"
+ #     jar_resolved=`ls $jar 2>/dev/null`
+ #     echo "looking for $jar_resolved"
+ # TODO check the behaviour when spaces
+       jars_resolved=`ls $jar 2>/dev/null`
+       for jar_resolved in $jars_resolved; do # If several jars matches
+         if test -e "$jar_resolved"; then
+           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
+     cat << \EOF > conftest.java
 -// #line 18339 "configure"
++// #line 18631 "configure"
+ import ncsa.hdf.hdf5lib.HDF5Constants;
+ public class conftest {
+     public static void main(String[] argv) {
+     }
+ }
+ EOF
+     CLASSPATH=$ac_java_classpath
+     export CLASSPATH
+     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
+     if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5) ; then
+        if test ""no"" = "no"; then
+            echo "yes" >&5
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
+ $as_echo "$jar_resolved" >&6; }
+             found_jar=yes
+             PACKAGE_JAR_FILE=$jar_resolved
+             break
+          else
+                  cmd="$JAVA conftest"
+                  if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5); then
+                  echo "yes" >&5
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: $jar_resolved" >&5
+ $as_echo "$jar_resolved" >&6; }
+             found_jar=yes
+             PACKAGE_JAR_FILE=$jar_resolved
+             break
+                       else
+                       echo "configure: failed program was:" >&5
+                               cat conftest.java >&5
+                 if test -s conftest.java.output; then
+                    STDOUT=`cat conftest.java.output`
+                 fi
+                       echo "configure: CLASSPATH was $CLASSPATH" >&5
+             ac_java_classpath=$saved_ac_java_classpath
+                                               fi
+               fi
+         if test -f conftest.java.output; then
+            rm conftest.java.output
+         fi
+     else
+         echo "configure: failed program was:" >&5
+         cat conftest.java >&5
+         echo "configure: CLASSPATH was $CLASSPATH" >&5
+             ac_java_classpath=$saved_ac_java_classpath
+             fi
+         fi
+         done
+         # If ls returns several results and the first one is OK, stop the search
+       if test "$found_jar" = "yes"; then
+         break
+       fi
+       done
+         # If found, no need to search in other directory
+       if test "$found_jar" = "yes"; then
+         break
+       fi
+     done
+     if test "$found_jar" = "no"; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ $as_echo "no" >&6; }
+         if test "" = "yes"; then
+               { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Could not find or use the Java package/jar jhdf5 used by HDF5 Java library (looking for package ncsa.hdf.hdf5lib.HDF5Constants)" >&5
+ $as_echo "$as_me: WARNING: Could not find or use the Java package/jar jhdf5 used by HDF5 Java library (looking for package ncsa.hdf.hdf5lib.HDF5Constants)" >&2;}
+         else
+                 as_fn_error "Could not find or use the Java package/jar jhdf5 used by HDF5 Java library (looking for package ncsa.hdf.hdf5lib.HDF5Constants)" "$LINENO" 5
+         fi
+     fi
+      JHDF5=$PACKAGE_JAR_FILE
+      LDFLAGS_save=$LDFLAGS
     # Provide known paths where distribs/OS can store JNI libs
-        LDFLAGS="-L/usr/lib/jni -L/usr/lib64/jni/ -L$SCI_SRCDIR/bin/ -L$SCI_SRCDIR/thirdparty/  -lpthread $HDF5_LIBS"
+         LDFLAGS="-L/usr/lib/jni -L/usr/lib64/jni/ -L$SCI_SRCDIR/bin/ -L$SCI_SRCDIR/thirdparty/  -lpthread $HDF5_LIBS"
     # -lpthread because of packaging bug in jhdf5
        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for h5JNIFatalError in -ljhdf5" >&5
  $as_echo_n "checking for h5JNIFatalError in -ljhdf5... " >&6; }
  fi
  
        LDFLAGS=$LDFLAGS_save
+       LD_LIBRARY_PATH_save=$LD_LIBRARY_PATH
+       LD_LIBRARY_PATH="/usr/lib/jni:/usr/lib64/jni/:$SCI_SRCDIR/bin/:$SCI_SRCDIR/thirdparty/:$with_hdf5_library"
+       export LD_LIBRARY_PATH
+     { $as_echo "$as_me:${as_lineno-$LINENO}: checking minimal version (1.8.4) of hdf5" >&5
+ $as_echo_n "checking minimal version (1.8.4) of hdf5... " >&6; }
+    saved_ac_java_classpath=$ac_java_classpath
+    export ac_java_classpath="$JHDF5:$ac_java_classpath"
+     cat << \EOF > conftest.java
 -// #line 18483 "configure"
++// #line 18775 "configure"
+ import ncsa.hdf.hdf5lib.H5;
+ public class conftest {
+     public static void main(String[] argv) {
+         String minVersion="1.8.4";
+                             int[] vers = new int[3];
+                 try { H5.H5get_libversion(vers); }
+                 catch (Throwable ex) {System.exit(-1);}
+                 String ver = vers[0] + "."+ vers[1] +"."+vers[2];
+                             System.out.println(ver);
+                                                       if (minVersion.compareTo(ver) > 0) {
+                                                               System.exit(-1);
+                                                               }
+     }
+ }
+ EOF
+     CLASSPATH=$ac_java_classpath
+     export CLASSPATH
+     cmd="$JAVAC ${JAVAC_FLAGS} conftest.java"
+     if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5) ; then
+        if test ""yes"" = "no"; then
+            echo "yes" >&5
+                  echo "yes"
+          else
+                  cmd="$JAVA conftest"
+                  if (echo $cmd >&5 ; eval $cmd >&conftest.java.output 2>&5); then
+                  echo "yes" >&5
+                          echo "yes"
+                       else
+                       echo "configure: failed program was:" >&5
+                               cat conftest.java >&5
+                 if test -s conftest.java.output; then
+                    STDOUT=`cat conftest.java.output`
+                 fi
+                       echo "configure: CLASSPATH was $CLASSPATH" >&5
+                         as_fn_error "Wrong version of hdf5. Expected at least 1.8.4. Found $STDOUT" "$LINENO" 5
+                                               fi
+               fi
+         if test -f conftest.java.output; then
+            rm conftest.java.output
+         fi
+     else
+         echo "configure: failed program was:" >&5
+         cat conftest.java >&5
+         echo "configure: CLASSPATH was $CLASSPATH" >&5
+           as_fn_error "Wrong version of hdf5. Expected at least 1.8.4. Found $STDOUT" "$LINENO" 5
+             fi
+    ac_java_classpath=$saved_ac_java_classpath
+       unset LD_LIBRARY_PATH
+       LD_LIBRARY_PATH=$LD_LIBRARY_PATH_save
      fi
  fi #HDF5_ENABLE
  
  #################
@@@ -22961,7 -23014,7 +23306,7 @@@ CPPFLAGS="$CPPFLAGS -I$CHK_TCL_INCLUDE_
  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later" >&5
  $as_echo_n "checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later... " >&6; }
  cat > conftest.$ac_ext <<EOF
- #line 22964 "configure"
 -#line 23017 "configure"
++#line 23309 "configure"
  #include "confdefs.h"
  
  #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@@ -23273,7 -23326,7 +23618,7 @@@ CPPFLAGS="$CPPFLAGS $TCL_INC_PATH -I$CH
  $as_echo_n "checking if tk is version $CHK_TK_MAJOR.$CHK_TK_MINOR or later... " >&6; }
  
  cat > conftest.$ac_ext <<EOF
- #line 23276 "configure"
 -#line 23329 "configure"
++#line 23621 "configure"
  #include "confdefs.h"
  
  #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@@ -23857,7 -23910,7 +24202,7 @@@ $as_echo_n "checking saxon... " >&6; 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 23860 "configure"
 -// #line 23913 "configure"
++// #line 24205 "configure"
  import com.icl.saxon.Loader;
  
  public class conftest {
@@@ -23958,7 -24017,7 +24309,7 @@@ $as_echo_n "checking jlatexmath-fop... 
            export ac_java_classpath="$jar_resolved:$ac_java_classpath"
  
      cat << \EOF > conftest.java
- // #line 23961 "configure"
 -// #line 24020 "configure"
++// #line 24312 "configure"
  import org.scilab.forge.jlatexmath.fop.JLaTeXMathObj;
  
  public class conftest {
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
- #line 30231 "configure"
 -#line 30296 "configure"
++#line 30588 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
    lt_status=$lt_dlunknown
    cat > conftest.$ac_ext <<_LT_EOF
- #line 30337 "configure"
 -#line 30402 "configure"
++#line 30694 "configure"
  #include "confdefs.h"
  
  #if HAVE_DLFCN_H
  #
  if test "$enable_stop_on_warning" = yes; then
     CFLAGS="$CFLAGS -Werror -O0"
-    CXXFLAGS="$CXXFLAGS -Werror -O0"
+    CPPFLAGS="$CPPFLAGS -Werror -O0"
  fi
  
- ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/abstractSyntaxTree/Makefile modules/parse/Makefile modules/symbol/Makefile modules/types/Makefile modules/functions_manager/Makefile modules/system_env/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/operations/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/xpad/Makefile modules/graph/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
 -ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/operations/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/xpad/Makefile modules/graph/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
++ac_config_files="$ac_config_files libs/MALLOC/Makefile libs/dynamiclibrary/Makefile libs/doublylinkedlist/Makefile libs/hashtable/Makefile libs/libst/Makefile contrib/Makefile modules/abstractSyntaxTree/Makefile modules/parse/Makefile modules/symbol/Makefile modules/functions_manager/Makefile modules/system_env/Makefile modules/helptools/Makefile modules/helptools/macros/xmlfiletohtml.sci modules/data_structures/Makefile modules/differential_equations/Makefile modules/optimization/Makefile modules/elementary_functions/Makefile modules/special_functions/Makefile modules/io/Makefile modules/shell/Makefile modules/completion/Makefile modules/history_manager/Makefile modules/jvm/Makefile modules/sound/Makefile modules/statistics/Makefile modules/mexlib/Makefile modules/sparse/Makefile modules/linear_algebra/Makefile modules/polynomials/Makefile modules/symbolic/Makefile modules/signal_processing/Makefile modules/arnoldi/Makefile modules/interpolation/Makefile modules/intersci/Makefile modules/localization/Makefile modules/cacsd/Makefile modules/boolean/Makefile modules/integer/Makefile modules/double/Makefile modules/fileio/Makefile modules/spreadsheet/Makefile modules/string/Makefile modules/time/Makefile modules/graphics/Makefile modules/graphic_export/Makefile modules/renderer/Makefile modules/action_binding/Makefile modules/gui/Makefile modules/pvm/Makefile modules/randlib/Makefile modules/tclsci/Makefile modules/windows_tools/Makefile modules/core/Makefile modules/api_scilab/Makefile modules/call_scilab/Makefile modules/types/Makefile modules/hdf5/Makefile modules/fftw/Makefile modules/umfpack/Makefile modules/scicos/Makefile modules/scicos_blocks/Makefile modules/functions/Makefile modules/dynamic_link/Makefile modules/overloading/Makefile modules/javasci/Makefile modules/maple2scilab/Makefile modules/m2sci/Makefile modules/compatibility_functions/Makefile modules/texmacs/Makefile modules/development_tools/Makefile modules/output_stream/Makefile modules/console/Makefile modules/demo_tools/Makefile modules/genetic_algorithms/Makefile modules/simulated_annealing/Makefile modules/parameters/Makefile modules/matio/Makefile modules/operations/Makefile modules/atoms/Makefile modules/xcos/Makefile modules/xpad/Makefile modules/graph/Makefile modules/Makefile libs/Makefile Makefile scilab.pc etc/modules.xml etc/classpath.xml etc/jvm_options.xml scilab-lib.properties scilab-lib-doc.properties"
  
  
  # Detection of the module for the future version of Scilab 6
      "libs/hashtable/Makefile") CONFIG_FILES="$CONFIG_FILES libs/hashtable/Makefile" ;;
      "libs/libst/Makefile") CONFIG_FILES="$CONFIG_FILES libs/libst/Makefile" ;;
      "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
 +    "modules/abstractSyntaxTree/Makefile") CONFIG_FILES="$CONFIG_FILES modules/abstractSyntaxTree/Makefile" ;;
 +    "modules/parse/Makefile") CONFIG_FILES="$CONFIG_FILES modules/parse/Makefile" ;;
 +    "modules/symbol/Makefile") CONFIG_FILES="$CONFIG_FILES modules/symbol/Makefile" ;;
-     "modules/types/Makefile") CONFIG_FILES="$CONFIG_FILES modules/types/Makefile" ;;
 +    "modules/functions_manager/Makefile") CONFIG_FILES="$CONFIG_FILES modules/functions_manager/Makefile" ;;
 +    "modules/system_env/Makefile") CONFIG_FILES="$CONFIG_FILES modules/system_env/Makefile" ;;
      "modules/helptools/Makefile") CONFIG_FILES="$CONFIG_FILES modules/helptools/Makefile" ;;
      "modules/helptools/macros/xmlfiletohtml.sci") CONFIG_FILES="$CONFIG_FILES modules/helptools/macros/xmlfiletohtml.sci" ;;
      "modules/data_structures/Makefile") CONFIG_FILES="$CONFIG_FILES modules/data_structures/Makefile" ;;
@@@ -1622,12 -1579,6 +1609,11 @@@ libs/doublylinkedlist/Makefil
  libs/hashtable/Makefile
  libs/libst/Makefile
  contrib/Makefile
 +modules/abstractSyntaxTree/Makefile
 +modules/parse/Makefile
 +modules/symbol/Makefile
- modules/types/Makefile
 +modules/functions_manager/Makefile
 +modules/system_env/Makefile
  modules/helptools/Makefile
  modules/helptools/macros/xmlfiletohtml.sci
  modules/data_structures/Makefile
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -81,16 -79,13 +81,17 @@@ demo_tools 
  genetic_algorithms \
  simulated_annealing \
  parameters \
 -matio \
  atoms \
+ types \
  hdf5 \
 -graph\
 +graph \
  xcos \
 -xpad 
 +xpad \
 +system_env \
 +abstractSyntaxTree \
 +symbol \
 +parse \
 +types
  
  #umfpack
  
@@@ -152,19 -152,18 +152,19 @@@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARG
  ETAGS = etags
  CTAGS = ctags
  DIST_SUBDIRS = core operations output_stream action_binding arnoldi \
 -      elementary_functions string api_scilab dynamic_link fileio \
 -      history_manager spreadsheet tclsci localization renderer shell \
 -      completion console graphic_export gui jvm graphics \
 -      optimization symbolic randlib statistics special_functions \
 -      interpolation linear_algebra integer data_structures mexlib \
 -      differential_equations cacsd polynomials boolean double pvm io \
 -      intersci signal_processing call_scilab sound time sparse \
 -      windows_tools functions overloading maple2scilab m2sci texmacs \
 -      development_tools compatibility_functions helptools fftw \
 -      umfpack demo_tools genetic_algorithms simulated_annealing \
 -      parameters matio atoms types hdf5 graph xcos xpad \
 -      scicos_blocks scicos . javasci
 +      elementary_functions matio functions_manager string api_scilab \
 +      dynamic_link fileio history_manager spreadsheet tclsci \
 +      localization renderer shell completion console graphic_export \
 +      gui jvm graphics optimization symbolic randlib statistics \
 +      special_functions interpolation linear_algebra integer \
 +      data_structures mexlib differential_equations cacsd \
 +      polynomials boolean double pvm io intersci signal_processing \
 +      call_scilab sound time sparse windows_tools functions \
 +      overloading maple2scilab m2sci texmacs development_tools \
 +      compatibility_functions helptools fftw umfpack demo_tools \
-       genetic_algorithms simulated_annealing parameters atoms hdf5 \
-       graph xcos xpad system_env abstractSyntaxTree symbol parse \
-       types scicos_blocks scicos . javasci
++      genetic_algorithms simulated_annealing parameters atoms types \
++      hdf5 graph xcos xpad system_env abstractSyntaxTree symbol \
++      parse scicos_blocks scicos . javasci
  DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
  am__relativize = \
    dir0=`pwd`; \
@@@ -441,19 -434,18 +441,19 @@@ yacc_present = @yacc_present
  # core is the main module of Scilab. All the compilation deps has been removed
  # since it already linked almost the whole world
  SUBDIRS = core operations output_stream action_binding arnoldi \
 -      elementary_functions string api_scilab dynamic_link fileio \
 -      history_manager spreadsheet tclsci localization renderer shell \
 -      completion console graphic_export gui jvm graphics \
 -      optimization symbolic randlib statistics special_functions \
 -      interpolation linear_algebra integer data_structures mexlib \
 -      differential_equations cacsd polynomials boolean double pvm io \
 -      intersci signal_processing core call_scilab interpolation \
 -      sound time randlib sparse windows_tools functions overloading \
 -      maple2scilab m2sci texmacs development_tools \
 -      compatibility_functions helptools fftw umfpack demo_tools \
 -      genetic_algorithms simulated_annealing parameters matio atoms \
 -      types hdf5 graph xcos xpad $(am__append_1) scicos . \
 +      elementary_functions matio functions_manager string api_scilab \
 +      dynamic_link fileio history_manager spreadsheet tclsci \
 +      localization renderer shell completion console graphic_export \
 +      gui jvm graphics optimization symbolic randlib statistics \
 +      special_functions interpolation linear_algebra integer \
 +      data_structures mexlib differential_equations cacsd \
 +      polynomials boolean double pvm io intersci signal_processing \
 +      core call_scilab interpolation sound time randlib sparse \
 +      windows_tools functions overloading maple2scilab m2sci texmacs \
 +      development_tools compatibility_functions helptools fftw \
 +      umfpack demo_tools genetic_algorithms simulated_annealing \
-       parameters atoms hdf5 graph xcos xpad system_env \
++      parameters atoms types hdf5 graph xcos xpad system_env \
 +      abstractSyntaxTree symbol parse types $(am__append_1) scicos . \
        $(am__append_2)
  
  #### Basic files ####
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -1,14 -1,9 +1,15 @@@
- ##########
- ### Sylvestre Ledru <sylvestre.ledru@inria.fr>
- ### INRIA - Scilab 2006
- ##########
+ # Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ # Copyright (C) 2006 - INRIA - Sylvestre LEDRU
+ #
+ # This file is distributed under the same license as the Scilab package.
  
 +
 +BOOLEAN_CPP_SOURCES = \
 +      src/cpp/boolean_gw.cpp
 +
 +
 +
  BOOLEAN_C_SOURCES = src/c/matboolean.c \
  src/c/vect_or.c \
  src/c/vect_and.c
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -83,8 -83,15 +83,11 @@@ src/c/typename.c 
  src/c/inittypenames.c \
  src/c/funcprot.c \
  src/c/eqid.c \
- src/c/dynamic_tclsci.c
+ src/c/exitCodeValue.c \
+ src/c/getversion.c \
+ src/c/dynamic_tclsci.c \
+ src/c/storeCommand.c
  
 -CORE_CPP_SOURCES = src/cpp/hashtable_core.cpp \
 -src/cpp/namstr.cpp \
 -src/cpp/search_functions.cpp
 -
  if USE_DYNAMIC_STACK
  CORE_C_SOURCES += src/c/scimem64.c
  endif
@@@ -187,11 -193,6 +189,12 @@@ src/fortran/stacki2d.f 
  src/fortran/stackc2i.f \
  src/fortran/isinstring.f
  
 +CORE_CPP_SOURCES = \
 +src/cpp/core_gw.cpp \
- src/cpp/hashtable_core.cpp
++src/cpp/hashtable_core.cpp \
++src/cpp/namstr.cpp \
++src/cpp/search_functions.cpp
 +
  if USE_DYNAMIC_STACK
  CORE_FORTRAN_SOURCES += src/fortran/relocstack.f
  endif
@@@ -150,9 -150,12 +150,11 @@@ am__libscicore_la_SOURCES_DIST = src/c/
        src/c/predef.c src/c/transposeMatrix.c \
        src/c/recursionFunction.c src/c/typename.c \
        src/c/inittypenames.c src/c/funcprot.c src/c/eqid.c \
-       src/c/dynamic_tclsci.c src/c/scimem64.c src/fortran/clunit.f \
-       src/fortran/getlin.f src/fortran/allowptr.f \
-       src/fortran/isany.f src/fortran/hmcreate.f src/fortran/nextj.f \
+       src/c/exitCodeValue.c src/c/getversion.c \
+       src/c/dynamic_tclsci.c src/c/storeCommand.c src/c/scimem64.c \
 -      src/cpp/hashtable_core.cpp src/cpp/namstr.cpp \
 -      src/cpp/search_functions.cpp src/fortran/clunit.f \
 -      src/fortran/getlin.f src/fortran/allowptr.f \
 -      src/fortran/isany.f src/fortran/hmcreate.f src/fortran/nextj.f \
++      src/fortran/clunit.f src/fortran/getlin.f \
++      src/fortran/allowptr.f src/fortran/isany.f \
++      src/fortran/hmcreate.f src/fortran/nextj.f \
        src/fortran/setgetmode.f src/fortran/showstack.f \
        src/fortran/misops.f src/fortran/iseye.f src/fortran/chkvar.f \
        src/fortran/setippty.f src/fortran/compil.f \
        src/fortran/putid.f src/fortran/itosci.f \
        src/fortran/stackr2d.f src/fortran/stacki2d.f \
        src/fortran/stackc2i.f src/fortran/isinstring.f \
 -      src/fortran/relocstack.f sci_gateway/c/sci_stacksize.c \
 +      src/fortran/relocstack.f src/cpp/core_gw.cpp \
-       src/cpp/hashtable_core.cpp sci_gateway/c/sci_stacksize.c \
++      src/cpp/hashtable_core.cpp src/cpp/namstr.cpp \
++      src/cpp/search_functions.cpp sci_gateway/c/sci_stacksize.c \
        sci_gateway/c/sci_resume.c sci_gateway/c/sci_mtlb_mode.c \
        sci_gateway/c/sci_banner.c sci_gateway/c/sci_where.c \
        sci_gateway/c/sci_errcatch.c sci_gateway/c/sci_getos.c \
@@@ -282,10 -283,13 +284,11 @@@ am__objects_2 = libscicore_la-inffic.l
        libscicore_la-transposeMatrix.lo \
        libscicore_la-recursionFunction.lo libscicore_la-typename.lo \
        libscicore_la-inittypenames.lo libscicore_la-funcprot.lo \
-       libscicore_la-eqid.lo libscicore_la-dynamic_tclsci.lo \
-       $(am__objects_1)
+       libscicore_la-eqid.lo libscicore_la-exitCodeValue.lo \
+       libscicore_la-getversion.lo libscicore_la-dynamic_tclsci.lo \
+       libscicore_la-storeCommand.lo $(am__objects_1)
 -am__objects_3 = libscicore_la-hashtable_core.lo \
 -      libscicore_la-namstr.lo libscicore_la-search_functions.lo
 -@USE_DYNAMIC_STACK_TRUE@am__objects_4 = relocstack.lo
 -am__objects_5 = clunit.lo getlin.lo allowptr.lo isany.lo hmcreate.lo \
 +@USE_DYNAMIC_STACK_TRUE@am__objects_3 = relocstack.lo
 +am__objects_4 = clunit.lo getlin.lo allowptr.lo isany.lo hmcreate.lo \
        nextj.lo setgetmode.lo showstack.lo misops.lo iseye.lo \
        chkvar.lo setippty.lo compil.lo funnam.lo isnum.lo cmdstr.lo \
        logops.lo atome.lo hndlops.lo cmplxt.lo skpins.lo folhp.lo \
        intstr.lo createref.lo btof.lo matzs.lo getnum.lo btofm.lo \
        getsym.lo findequal.lo stackg.lo find.lo israt.lo setlnb.lo \
        mrknmd.lo stackgl.lo allops.lo mname.lo command.lo ref2val.lo \
-       namstr.lo stack.lo isbrk.lo majmin.lo xerbla.lo dtosci.lo \
-       bexec.lo varfunptr.lo getfun.lo savlod.lo error.lo cvdm.lo \
-       tradsl.lo mkindx.lo whatln.lo errmgr.lo defmat.lo mklist.lo \
-       sigbas.lo indxg.lo matz.lo istrue.lo inisci.lo ptover.lo \
-       getfunction.lo stackp.lo dbasin.lo macro.lo extlarg.lo \
-       getstr.lo cvwm.lo storeglobal.lo lst2vars.lo basnms.lo matc.lo \
-       ptrback.lo getch.lo ftob.lo seteol.lo basin.lo clause.lo \
-       compcl.lo termf.lo expsum.lo copyvar.lo putid.lo itosci.lo \
-       stackr2d.lo stacki2d.lo stackc2i.lo isinstring.lo \
-       $(am__objects_3)
+       stack.lo isbrk.lo majmin.lo xerbla.lo dtosci.lo bexec.lo \
+       varfunptr.lo getfun.lo savlod.lo error.lo cvdm.lo tradsl.lo \
+       mkindx.lo whatln.lo errmgr.lo defmat.lo mklist.lo sigbas.lo \
+       indxg.lo matz.lo istrue.lo inisci.lo ptover.lo getfunction.lo \
+       stackp.lo dbasin.lo macro.lo extlarg.lo getstr.lo cvwm.lo \
+       storeglobal.lo lst2vars.lo basnms.lo matc.lo ptrback.lo \
+       getch.lo ftob.lo seteol.lo basin.lo clause.lo compcl.lo \
+       termf.lo expsum.lo copyvar.lo putid.lo itosci.lo stackr2d.lo \
 -      stacki2d.lo stackc2i.lo isinstring.lo $(am__objects_4)
++      stacki2d.lo stackc2i.lo isinstring.lo $(am__objects_3)
 +am__objects_5 = libscicore_la-core_gw.lo \
-       libscicore_la-hashtable_core.lo
++      libscicore_la-hashtable_core.lo libscicore_la-namstr.lo \
++      libscicore_la-search_functions.lo
  am__objects_6 = libscicore_la-sci_stacksize.lo \
        libscicore_la-sci_resume.lo libscicore_la-sci_mtlb_mode.lo \
        libscicore_la-sci_banner.lo libscicore_la-sci_where.lo \
@@@ -659,7 -654,12 +662,8 @@@ CORE_C_SOURCES = src/c/inffic.c src/c/c
        src/c/predef.c src/c/transposeMatrix.c \
        src/c/recursionFunction.c src/c/typename.c \
        src/c/inittypenames.c src/c/funcprot.c src/c/eqid.c \
-       src/c/dynamic_tclsci.c $(am__append_1)
+       src/c/exitCodeValue.c src/c/getversion.c \
+       src/c/dynamic_tclsci.c src/c/storeCommand.c $(am__append_1)
 -CORE_CPP_SOURCES = src/cpp/hashtable_core.cpp \
 -src/cpp/namstr.cpp \
 -src/cpp/search_functions.cpp
 -
  CORE_FORTRAN_SOURCES = src/fortran/clunit.f src/fortran/getlin.f \
        src/fortran/allowptr.f src/fortran/isany.f \
        src/fortran/hmcreate.f src/fortran/nextj.f \
        src/fortran/stackr2d.f src/fortran/stacki2d.f \
        src/fortran/stackc2i.f src/fortran/isinstring.f \
        $(am__append_2)
 +CORE_CPP_SOURCES = \
 +src/cpp/core_gw.cpp \
- src/cpp/hashtable_core.cpp
++src/cpp/hashtable_core.cpp \
++src/cpp/namstr.cpp \
++src/cpp/search_functions.cpp
 +
  GATEWAY_C_SOURCES = sci_gateway/c/sci_stacksize.c \
  sci_gateway/c/sci_resume.c \
  sci_gateway/c/sci_mtlb_mode.c \
@@@ -53,7 -57,7 +53,6 @@@ int C2F(sci_isglobal)(char *fname,unsig
  int C2F(sci_gstacksize)(char *fname,unsigned long fname_len);
  int C2F(sci_intppty)(char *fname,unsigned long fname_len);
  int C2F(sci_lasterror)(char *fname,unsigned long fname_len);
- int C2F(sci_getversion)(char *fname,unsigned long fname_len);
 -int sci_getversion(char *fname,unsigned long fname_len);
  int C2F(sci_macr2tree)(char *fname,unsigned long fname_len);
  int C2F(sci_getos)(char *fname,unsigned long fname_len);
  int C2F(sci_banner)(char *fname,unsigned long fname_len);
@@@ -71,16 -75,7 +70,16 @@@ int C2F(sci_getvariablesonstack)(char *
  int C2F(sci_readgateway)(char *fname,unsigned long fname_len);
  int C2F(sci_exit)(char *fname,unsigned long fname_len);
  int C2F(sci_comp)(char *fname,unsigned long fname_len);
 +
 +
 +int C2F(sci_typename)(char *fname,int* _piKey);
 +int C2F(sci_funcprot)(char *fname,int* _piKey);
 +int C2F(sci_newfun)(char *fname, int* _piKey);
 +
 +//Yasp
 +int sci_type(char *fname, int* _piKey);
 +int sci_getdebuginfo(char *fname, int* _piKey);
++int sci_getversion(char *fname, int* _piKey);
  /*--------------------------------------------------------------------------*/ 
  #endif /*  __GW_CORE__ */
  /*--------------------------------------------------------------------------*/
  /*--------------------------------------------------------------------------*/
  int C2F(sci_exit)(char *fname,unsigned long fname_len)
  {
-       int twenty = 20;
-       int zero = 0;
-       int exitCode = 0;
++// FIXME : Rewrite me for YaSp
++#ifdef __REWRITE_ME_FOR_YASP__
+       SciErr sciErr;
  
-       /* if special compilation mode skip commands */
-       if ( C2F(com).comp[2] == 1 )
+       CheckLhs(1,1);
+       CheckRhs(0,1);
+       if (Rhs == 0)
+       {
+               setExitCodeValue(0);
+       }
+       else
        {
-               C2F(com).fin = 0;
-               C2F(com).fun = 0;
+               int iExit = 0;
+               int m1 = 0, n1 = 0;
+               int iType1 = 0;
+               int *piAddressVarOne = NULL;
+               double *pdVarOne = NULL;
  
-               LhsVar(1) = 0;
-               C2F(putlhsvar)();
+               /* get Address of inputs */
+               sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
+               if(sciErr.iErr)
+               {
+                       printError(&sciErr, 0);
+                       return 0;
+               }
  
-               return 0;
-       }
+               sciErr = getVarType(pvApiCtx, piAddressVarOne, &iType1);
+               if(sciErr.iErr)
+               {
+                       printError(&sciErr, 0);
+                       return 0;
+               }
  
-       /* compilation exit:<20> */
-       if (C2F(compil)(&twenty, &zero, &zero, &zero, &zero)) 
-       {
-               return 0;
-       }
+               /* check input type */
+               if ( iType1 != sci_matrix )
+               {
+                       Scierror(999,_("%s: Wrong type for input argument #%d: A scalar expected.\n"),fname,1);
+                       return 0;
+               }
  
-       Rhs = Max(0, Rhs);
-       CheckRhs(0,1);
+               sciErr = getMatrixOfDouble(pvApiCtx, piAddressVarOne,&m1,&n1,&pdVarOne);
+               if(sciErr.iErr)
+               {
+                       printError(&sciErr, 0);
+                       return 0;
+               }
  
-       if (Rhs == 1)
-       {
-               if ( VarType(1) == sci_matrix )
+               if( n1 != 1 || m1 != 1)
                {
-                       int m1 = 0, n1 = 0, l1 = 0;
-                       GetRhsVar(1, MATRIX_OF_DOUBLE_DATATYPE, &m1, &n1, &l1);
-                       if ( (m1 == n1) && (n1 == 1) )
-                       {
-                               double dexitcode = *stk(l1);
-                               exitCode = (int) dexitcode;
+                       Scierror(999,_("%s: Wrong size for input argument #%d: A scalar expected.\n"),fname,1);
+                       return 0;
+               }
+               iExit = (int) *pdVarOne;
  
-                               if (dexitcode != (double)exitCode)
-                               {
-                                       Scierror(999,_("%s: Wrong value for input argument #%d: A int expected.\n"),fname,1);
-                                       return 0;
-                               }
-                       }
-                       else
-                       {
-                               Scierror(999,_("%s: Wrong size for input argument #%d: A scalar expected.\n"),fname,1);
-                               return 0;
-                       }
+               if (*pdVarOne != (double)iExit)
+               {
+                       Scierror(999,_("%s: Wrong value for input argument #%d: A integer expected.\n"),fname,1);
+                       return 0;
                }
+               setExitCodeValue(iExit);
        }
  
-       LhsVar(1) = 0;
-       C2F(putlhsvar)();
+       // this value do quit in scirun
+       C2F(com).fun = -999;
  
-       ExitWithCodeFromScilab(exitCode);
+       LhsVar(1) = 0; 
+       C2F(putlhsvar)();
  
++#endif /* !__REWRITE_ME_FOR_YASP__ */
 +
        return 0;
  }
  /*--------------------------------------------------------------------------*/
  /*--------------------------------------------------------------------------*/
  #define VERSION_STRING "string_info"
  /*--------------------------------------------------------------------------*/
- int C2F(sci_getversion)(char *fname,unsigned long fname_len)
 -static int getversion_no_rhs(char *fname);
 -static int getversion_one_rhs(char *fname);
 -static int getversion_two_rhs(char *fname);
++static int getversion_no_rhs(char *fname, int* _piKey);
++static int getversion_one_rhs(char *fname, int* _piKey);
++static int getversion_two_rhs(char *fname, int* _piKey);
+ /*--------------------------------------------------------------------------*/
 -int sci_getversion(char *fname, unsigned long fname_len)
++int sci_getversion(char *fname, int* _piKey)
  {
-       Rhs=Max(0,Rhs);
+       Rhs = Max(0,Rhs);
  
        CheckRhs(0,2);
-       CheckLhs(1,2);
-       if ( Rhs == 0 )
+       
+       if (Rhs == 0)
        {
-               getversion_no_rhs();
+               CheckLhs(1,2);
 -              getversion_no_rhs(fname);
++              getversion_no_rhs(fname, _piKey);
        }
-       else if ( Rhs == 1)
+       else if (Rhs == 1)
        {
-               getversion_one_rhs();
+               CheckLhs(1,1);
 -              getversion_one_rhs(fname);
++              getversion_one_rhs(fname, _piKey);
        }
        else /* Rhs == 2 */
        {
-               getversion_two_rhs();
+               CheckLhs(1,1);
 -              getversion_two_rhs(fname);
++              getversion_two_rhs(fname, _piKey);
        }
        return 0;
  }
  /*--------------------------------------------------------------------------*/
- static int getversion_no_rhs(void)
 -int getversion_no_rhs(char *fname)
++int getversion_no_rhs(char *fname, int* _piKey)
  {
-       static char Version[]=SCI_VERSION;
-       static int n1,m1;
-       char *v = Version ;
-       n1=1;
-       CreateVarFromPtr( Rhs+1,STRING_DATATYPE,(m1=(int)strlen(Version), &m1),&n1,&v);
-       LhsVar(1) = Rhs+1;
-       if (Lhs==2)
+       char *version = getScilabVersionAsString();
+       if (version)
        {
-               static char *Str[12];
-               static int irep,nbuf;
-               char tk[]="tk";
-               char pvm[]="pvm";
-               char modelicac[]="modelicac";
-               #ifdef WITH_ATLAS
-               char atlas[]="atlas";
-               #endif
-               #ifdef NDEBUG
-               char releasemode[]="release";
-               #else
-               char debugmode[]="debug";
-               #endif
-               #ifdef __TIME__
-                       char TimeBuild[]=__TIME__;
-               #endif
-               #ifdef __DATE__
-                       char DateBuild[]=__DATE__;
-               #endif
-               n1=0;
-               C2F(getcomp)( C2F(cha1).buf,&nbuf,128);
-               Str[n1]=C2F(cha1).buf;
-               n1++;
-               if (with_module("pvm"))
-               {
-                       Str[n1] = pvm;
-                       n1++;
-               }
-               if (withtk())
-               {
-                       Str[n1]=tk;
-                       n1++;
-               }
 -              createSingleString(pvApiCtx, Rhs + 1, version);
++              createSingleString(_piKey, Rhs + 1, version);
+               LhsVar(1) = Rhs + 1;
+               FREE(version);
+               version = NULL;
+       }
+       else
+       {
+               Scierror(999,_("%s: Memory allocation error.\n"), fname);
+               return 0;
+       }
  
-               C2F(withmodelicac)(&irep);
-               if (irep)
-               {
-                       Str[n1]=modelicac;
-                       n1++;
-               }
+       if (Lhs == 2)
+       {
+               int sizeOptions = 0;
+               char **ScilabOptions = getScilabVersionOptions(&sizeOptions);
  
-               #ifdef WITH_ATLAS
+               if (ScilabOptions)
                {
-                       Str[n1]=atlas;
-                       n1++;
-               }
-               #endif
+                       SciErr sciErr;
+                       int m = 1;
+                       int n = sizeOptions;
 -                      sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, m, n, ScilabOptions);
++                      sciErr = createMatrixOfString(_piKey, Rhs + 2, m, n, ScilabOptions);
+                       freeArrayOfString(ScilabOptions, sizeOptions);
  
-               #ifdef _MSC_VER
-                       #ifdef _DEBUG
-                       {
-                       Str[n1]=debugmode;
-                       n1++;
-                       }
-                       #else
-                       {
-                               Str[n1]=releasemode;
-                               n1++;
-                       }
-                       #endif
-               #else
-                       #ifdef NDEBUG
+                       if(sciErr.iErr)
                        {
-                               Str[n1]=releasemode;
-                               n1++;
-                       }
-                       #else
-                       {
-                               Str[n1]=debugmode;
-                               n1++;
+                               printError(&sciErr, 0);
+                               return 0;
                        }
-                       #endif
-               #endif
  
-               #ifdef __TIME__
-               {
-                       Str[n1]=DateBuild;
-                       n1++;
+                       LhsVar(2) = Rhs + 2;
                }
-               #endif
-               #ifdef __DATE__
+               else
                {
-                       Str[n1]=TimeBuild;
-                       n1++;
+                       Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                       return 0;
                }
-               #endif
-               m1=1;
-               CreateVarFromPtr(Rhs+ 2,MATRIX_OF_STRING_DATATYPE, &m1, &n1, Str);
-               LhsVar(2) = Rhs+2;
        }
+       
        C2F(putlhsvar)();
  
        return 0;
  }
  /*--------------------------------------------------------------------------*/
- static int getversion_one_rhs(void)
 -int getversion_one_rhs(char *fname)
++int getversion_one_rhs(char *fname, int* _piKey)
  {
-       if (Lhs == 2)
+       SciErr sciErr;
+       int *piAddressVarOne = NULL;
 -      sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
++      sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
+       if(sciErr.iErr)
        {
-               Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",2);
+               printError(&sciErr, 0);
                return 0;
        }
  
-       if (GetType(1) == sci_strings)
 -      if (isStringType(pvApiCtx, piAddressVarOne))
++      if (isStringType(_piKey, piAddressVarOne))
        {
-               static int l1,n1,m1;
-               char *Param=NULL;
-               int *VERSIONMATRIX=NULL;
-               GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-               Param=cstk(l1);
+               char *modulename = NULL;
  
-               VERSIONMATRIX=(int *)MALLOC( (4)*sizeof(int) );
-               if (strcmp(Param,"scilab") == 0)
 -              if (!isScalar(pvApiCtx, piAddressVarOne))
++              if (!isScalar(_piKey, piAddressVarOne))
                {
-                       VERSIONMATRIX[0]=(int)SCI_VERSION_MAJOR;
-                       VERSIONMATRIX[1]=(int)SCI_VERSION_MINOR;
-                       VERSIONMATRIX[2]=(int)SCI_VERSION_MAINTENANCE;
-                       VERSIONMATRIX[3]=(int)SCI_VERSION_TIMESTAMP;
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
+                       return 0;
                }
-               else if (with_module(Param))
 -              if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0)
++              if (getAllocatedSingleString(_piKey, piAddressVarOne, &modulename) == 0)
                {
-                       char versionstring[1024];
+                       if (modulename)
+                       {
+                               if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
+                               {
+                                       int versionSize = 0;
+                                       int *version = getModuleVersion(modulename, &versionSize);
+                                       if (version)
+                                       {
+                                               int m = 1;
+                                               int n = versionSize;
+                                               double *versionAsDouble = (double*)MALLOC(sizeof(double) * versionSize);
+                                               if (versionAsDouble)
+                                               {
+                                                       int i = 0;
+                                                       for (i = 0; i < versionSize; i++)
+                                                       {
+                                                               versionAsDouble[i] = (double)version[i];
+                                                       }
+                                                       FREE(version);
+                                                       version = NULL;
+                                                       freeAllocatedSingleString(modulename);
+                                                       modulename = NULL;
 -                                                      sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m, n, versionAsDouble);
++                                                      sciErr = createMatrixOfDouble(_piKey, Rhs + 1, m, n, versionAsDouble);
+                                                       FREE(versionAsDouble);
+                                                       versionAsDouble = NULL;
+                                                       if(sciErr.iErr)
+                                                       {
+                                                               printError(&sciErr, 0);
+                                                               return 0;
+                                                       }
+                                                       LhsVar(1) = Rhs + 1;
+                                                       C2F(putlhsvar)();
+                                               }
+                                               else
+                                               {
+                                                       Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                                                       return 0;
+                                               }
+                                       }
+                                       else
+                                       {
+                                               Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
+                                               freeAllocatedSingleString(modulename);
+                                               modulename = NULL;
+                                               return 0;
+                                       }
+                               }
+                               else
+                               {
+                                       Scierror(999,_("%s: Wrong module name %s.\n"), fname , modulename);
  
-                       int version_module_major=0;
-                       int version_module_minor=0;
-                       int version_module_maintenance=0;
-                       int version_module_revision=0;
+                                       freeAllocatedSingleString(modulename);
+                                       modulename = NULL;
  
-                       if (getversionmodule(Param,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision))
-                       {
-                               VERSIONMATRIX[0]=version_module_major;
-                               VERSIONMATRIX[1]=version_module_minor;
-                               VERSIONMATRIX[2]=version_module_maintenance;
-                               VERSIONMATRIX[3]=version_module_revision;
+                                       return 0;
+                               }
+                               freeAllocatedSingleString(modulename);
+                               modulename = NULL;
                        }
                        else
                        {
        return 0;
  }
  /*--------------------------------------------------------------------------*/
- static int getversion_two_rhs(void)
 -int getversion_two_rhs(char *fname)
++int getversion_two_rhs(char *fname, int* _piKey)
  {
-       if (Lhs == 2)
+       SciErr sciErr;
+       int *piAddressVarOne = NULL;
+       int *piAddressVarTwo = NULL;
 -      sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
++      sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
+       if(sciErr.iErr)
        {
-               Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",2);
+               printError(&sciErr, 0);
                return 0;
        }
  
-       if ( (GetType(1) == sci_strings) && (GetType(2) == sci_strings) )
 -      sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);
++      sciErr = getVarAddressFromPosition(_piKey, 2, &piAddressVarTwo);
+       if(sciErr.iErr)
        {
-               static int l2,n2,m2;
-               char *ParamRhs2=NULL;
+               printError(&sciErr, 0);
+               return 0;
+       }
  
-               GetRhsVar(2,STRING_DATATYPE,&m2,&n2,&l2);
-               ParamRhs2=cstk(l2);
 -      if (isStringType(pvApiCtx, piAddressVarOne) && isStringType(pvApiCtx, piAddressVarTwo))
++      if (isStringType(_piKey, piAddressVarOne) && isStringType(_piKey, piAddressVarTwo))
+       {
+               char *modulename = NULL;
+               char *optionname = NULL;
  
-               if (strcmp(ParamRhs2,VERSION_STRING)==0)
 -              if (!isScalar(pvApiCtx, piAddressVarOne))
++              if (!isScalar(_piKey, piAddressVarOne))
                {
-                       static int l1,n1,m1;
-                       char *ParamRhs1=NULL;
-                       GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-                       ParamRhs1=cstk(l1);
-                       if (strcmp(ParamRhs1,"scilab") == 0)
-                       {
-                               char *output=NULL ;
-                               output = strdup(SCI_VERSION_STRING);
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
+                       return 0;
+               }
  
-                               n1=1;
-                               CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output);
-                               if (output) {FREE(output);output=NULL;}
 -              if (!isScalar(pvApiCtx, piAddressVarTwo))
++              if (!isScalar(_piKey, piAddressVarTwo))
+               {
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
+                       return 0;
+               }
  
-                               LhsVar(1) = Rhs+1;
-                               C2F(putlhsvar)();
-                               return 0;
-                       }
-                       else if (with_module(ParamRhs1))
 -              if ( (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0) &&
 -                      (getAllocatedSingleString(pvApiCtx, piAddressVarTwo, &optionname) == 0) )
++              if ( (getAllocatedSingleString(_piKey, piAddressVarOne, &modulename) == 0) &&
++                      (getAllocatedSingleString(_piKey, piAddressVarTwo, &optionname) == 0) )
+               {
+                       if ( (modulename) && (optionname) )
                        {
-                               #define LineMax 1024
-                               char versionstring[LineMax];
-                               int version_module_major=0;
-                               int version_module_minor=0;
-                               int version_module_maintenance=0;
-                               int version_module_revision=0;
-                               if (getversionmodule(ParamRhs1,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision))
+                               if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
                                {
-                                       char *output = NULL ;
-                                       output = strdup(versionstring);
-                                       n1=1;
-                                       CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output);
-                                       if (output) {FREE(output);output=NULL;}
-                                       LhsVar(1) = Rhs+1;
-                                       C2F(putlhsvar)();
-                                       return 0;
+                                       if ( strcmp(optionname, VERSION_STRING) == 0)
+                                       {
+                                               char *versionInfo = getModuleVersionInfoAsString(modulename);
+                                               if (versionInfo)
+                                               {
 -                                                      createSingleString(pvApiCtx, Rhs + 1, versionInfo);
++                                                      createSingleString(_piKey, Rhs + 1, versionInfo);
+                                                       
+                                                       FREE(versionInfo);
+                                                       versionInfo = NULL;
+                                                       LhsVar(1) = Rhs + 1;
+                                                       C2F(putlhsvar)();
+                                               }
+                                               else
+                                               {
+                                                       Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
+                                                       freeAllocatedSingleString(modulename);
+                                                       modulename = NULL;
+                                                       freeAllocatedSingleString(optionname);
+                                                       optionname = NULL;
+                                                       return 0;
+                                               }
+                                       }
+                                       else
+                                       {
+                                               freeAllocatedSingleString(modulename);
+                                               modulename = NULL;
+                                               freeAllocatedSingleString(optionname);
+                                               optionname = NULL;
+                                               Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"), fname, 2, VERSION_STRING);
+                                               return 0;
+                                       }
                                }
                                else
                                {
Simple merge
Simple merge
@@@ -106,9 -106,9 +106,9 @@@ int sci_dsearch(char *fname, int* _piKe
                return 0;
        }
  
 -      if(isVarComplex(pvApiCtx, piAddr1) || isVarComplex(pvApiCtx, piAddr2))
 +      if(isVarComplex(_piKey, piAddr1) || isVarComplex(_piKey, piAddr2))
        {
-               Error(202);
+               SciError(202);
                return 0;
        }
        else
@@@ -278,8 -275,8 +278,8 @@@ static int getMode(int* _piKey, int _iP
        }
        else
        {
-               Error(89);
+               SciError(89);
        }
 -      return sciErr;
 +      return 0;
  }
  /*--------------------------------------------------------------------------*/
@@@ -59,9 -58,9 +59,9 @@@ int sci_frexp(char *fname, int* _piKey
                return 0;
        }
  
 -      if(isVarComplex(pvApiCtx, piAddr))
 +      if(isVarComplex(_piKey, piAddr))
        {
-               Error(9999);
+               SciError(9999);
                sciprint(_("%s: real data only.\n"), fname);
        }
  
@@@ -56,9 -55,9 +56,9 @@@ int sci_log1p(char *fname, int* _piKey
                return 0;
        }
  
 -      if(isVarComplex(pvApiCtx, piAddr))
 +      if(isVarComplex(_piKey, piAddr))
        {
-               Error(43);
+               SciError(43);
                return 0;
        }
        else
@@@ -109,9 -107,9 +109,9 @@@ int sci_scimatrix(char *fname, int* _pi
                        return 0;
                }
  
 -              if(isVarComplex(pvApiCtx, piAddr2))
 +              if(isVarComplex(_piKey, piAddr2))
                {
-                       Error(32);
+                       SciError(32);
                        return 0;
                }
  
                        return 0;
                }
  
 -              if(isVarComplex(pvApiCtx, piAddr3) || isVarComplex(pvApiCtx, piAddr2))
 +              if(isVarComplex(_piKey, piAddr3) || isVarComplex(_piKey, piAddr2))
                {
-                       Error(32);
+                       SciError(32);
                        return 0;
                }
  
@@@ -225,10 -220,10 +225,10 @@@ SciErr compare_double_inside(int* _piKe
  
        sciErr.iErr                                             = 0;
  
 -      if(isVarComplex(pvApiCtx, _piAddress))
 +      if(isVarComplex(_piKey, _piAddress))
        {
                Err = 1;
-               Error(202);
+               SciError(202);
                return sciErr;
        }
  
@@@ -470,10 -465,10 +470,10 @@@ static SciErr compare_double(int* _piKe
                int iRhsRows    = 0;
                int iRhsCols    = 0;
  
 -              if(isVarComplex(pvApiCtx, _piAddr[i]))
 +              if(isVarComplex(_piKey, _piAddr[i]))
                {
                        Err = i;
-                       Error(202);
+                       SciError(202);
                        return sciErr;
                }
  
@@@ -75,10 -73,10 +75,10 @@@ int sci_size(char *fname, int* _piKey
        case sci_mlist :
                if(Rhs != 1)
                {
-                       Error(39);
+                       SciError(39);
                        return 0;
                }
 -              sciErr = size_list(piAddr);
 +              sciErr = size_list(_piKey, piAddr);
                break;
        case sci_matrix :
        case sci_poly :
@@@ -211,19 -158,19 +211,19 @@@ int sum_matrix(int* _piKey, int* _piAdd
        switch(_iMode)
        {
        case BY_ROWS :
 -              iReturnRows     = 1;
 -              iReturnCols     = iCols;
 +              iRowsOut        = 1;
 +              iColsOut        = iCols;
                break;
        case BY_COLS :
 -              iReturnRows     = iRows;
 -              iReturnCols     = 1;
 +              iRowsOut        = iRows;
 +              iColsOut        = 1;
                break;
        case BY_ALL :
 -              iReturnRows     = 1;
 -              iReturnCols     = 1;
 +              iRowsOut        = 1;
 +              iColsOut        = 1;
                break;
        default :
-               Error(17);
+               SciError(17);
                return 0;
        }
  
Simple merge
Simple merge
@@@ -51,16 -53,13 +51,17 @@@ FILEIO_IMPEXP int sci_fileinfo(char *fn
  FILEIO_IMPEXP int sci_newest(char *fname,unsigned long fname_len);
  FILEIO_IMPEXP int sci_getrelativefilename(char *fname, unsigned long l);
  FILEIO_IMPEXP int sci_get_absolute_file_path(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_copyfile(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_isfile(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_fileparts(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_movefile(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_basename(char *fname,unsigned long fname_len);
 -FILEIO_IMPEXP int sci_pathconvert(char *fname,unsigned long fname_len);
+ FILEIO_IMPEXP int sci_mgetl(char *fname,unsigned long fname_len);
 +
 +//YaSp
 +FILEIO_IMPEXP int sci_isdir(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_chdir(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_copyfile(char *fname,int* _piKey);
 +FILEIO_IMPEXP int sci_fileparts(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_movefile(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_basename(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_pathconvert(char *fname, int* _piKey);
 +FILEIO_IMPEXP int sci_isfile(char *fname, int* _piKey);
  /*--------------------------------------------------------------------------*/ 
  #endif /* __GW_FILEIO_H__ */
  /*--------------------------------------------------------------------------*/
index 0000000,3c800a2..97fa506
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,302 +1,302 @@@
+ /*
+  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+  * Copyright (C) 2006 - INRIA - Allan CORNET
+  * Copyright (C) 2010 - DIGITEO - Allan CORNET
+  * 
+  * This file must be used under the terms of the CeCILL.
+  * This source file is licensed as described in the file COPYING, which
+  * you should have received as part of this distribution.  The terms
+  * are also available at    
+  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+  *
+  */
+ /*--------------------------------------------------------------------------*/
+ #include "gw_io.h"
+ #include "stack-c.h"
+ #include "localization.h"
+ #include "Scierror.h"
+ #include "api_scilab.h"
+ #include "mgetl.h"
+ #include "mopen.h"
+ #include "mclose.h"
+ #include "expandPathVariable.h"
+ #include "filesmanagement.h"
+ #include "freeArrayOfString.h"
+ #include "BOOL.h"
+ /*--------------------------------------------------------------------------*/
 -int sci_mgetl(char *fname,unsigned long fname_len)
++int sci_mgetl(char *fname,int* _piKey)
+ {
+     SciErr sciErr;
+     int *piAddressVarOne = NULL;
+     int numberOfLinesToRead = -1;
+     Rhs = Max(0, Rhs);
+     CheckRhs(1, 2);
+     CheckLhs(1, 1);
+     if (Rhs == 2)
+     {
+         int *piAddressVarTwo = NULL;
 -        sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);
++        sciErr = getVarAddressFromPosition(_piKey, 2, &piAddressVarTwo);
+         if(sciErr.iErr)
+         {
+             printError(&sciErr, 0);
+             return 0;
+         }
 -        if ( isDoubleType(pvApiCtx, piAddressVarTwo) )
++        if ( isDoubleType(_piKey, piAddressVarTwo) )
+         {
+             double dValue = 0.;
 -            if (!isScalar(pvApiCtx, piAddressVarTwo))
++            if (!isScalar(_piKey, piAddressVarTwo))
+             {
+                 Scierror(999,_("%s: Wrong size for input argument #%d: Integer expected.\n"), fname, 2);
+                 return 0;
+             }
 -            if ( getScalarDouble(pvApiCtx, piAddressVarTwo, &dValue) == 0)
++            if ( getScalarDouble(_piKey, piAddressVarTwo, &dValue) == 0)
+             {
+                 numberOfLinesToRead = (int)dValue;
+             }
+             else
+             {
+                 Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                 return 0;
+             }
+         }
+         else
+         {
+             Scierror(999,_("%s: Wrong type for input argument #%d: Integer expected.\n"), fname, 2);
+             return 0;
+         }
+     }
 -    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
++    sciErr = getVarAddressFromPosition(_piKey, 1, &piAddressVarOne);
+     if(sciErr.iErr)
+     {
+         printError(&sciErr, 0);
+         return 0;
+     }
 -    if ( isStringType(pvApiCtx, piAddressVarOne) || isDoubleType(pvApiCtx, piAddressVarOne) )
++    if ( isStringType(_piKey, piAddressVarOne) || isDoubleType(_piKey, piAddressVarOne) )
+     {
+         char **wcReadedStrings = NULL;
+         int numberOfLinesReaded = 0;
+         int fileDescriptor = -1;
+         int iErrorMgetl = 0;
+         BOOL bCloseFile = FALSE;
 -        if (!isScalar(pvApiCtx, piAddressVarOne))
++        if (!isScalar(_piKey, piAddressVarOne))
+         {
+             Scierror(999,_("%s: Wrong size for input argument #%d: String or logical unit expected.\n"), fname, 1);
+             return 0;
+         }
 -        if (isStringType(pvApiCtx, piAddressVarOne))
++        if (isStringType(_piKey, piAddressVarOne))
+         {
+             char *fileName = NULL;
 -            if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &fileName) == 0)
++            if (getAllocatedSingleString(_piKey, piAddressVarOne, &fileName) == 0)
+             {
+                 char *expandedFileName = expandPathVariable(fileName);
+                 freeAllocatedSingleString(fileName);
+                 fileName = NULL;
+                 if (IsAlreadyOpenedInScilab(expandedFileName))
+                 {
+                     int fd = GetIdFromFilename(expandedFileName);
+                     fileDescriptor = fd;
+                     if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                     bCloseFile = FALSE;
+                 }
+                 else
+                 {
+                     #define READ_ONLY_TEXT_MODE "rt"
+                     int fd = 0;
+                     int f_swap = 0;
+                     double res = 0.0;
+                     int ierr = 0;
+                     C2F(mopen)(&fd, expandedFileName, READ_ONLY_TEXT_MODE, &f_swap, &res, &ierr);
+                     bCloseFile = TRUE;
+                     switch (ierr)
+                     {
+                         case MOPEN_NO_ERROR:
+                             fileDescriptor = fd;
+                             if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                             break;
+                         case MOPEN_NO_MORE_LOGICAL_UNIT:
+                             {
+                                 Scierror(66, _("%s: Too many files opened!\n"), fname);
+                                 if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                                 return 0;
+                             }
+                             break;
+                         case MOPEN_CAN_NOT_OPEN_FILE:
+                             {
+                                 Scierror(999, _("%s: Cannot open file %s.\n"), fname, expandedFileName);
+                                 if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                                 return 0;
+                             }
+                             break;
+                         case MOPEN_NO_MORE_MEMORY:
+                             {
+                                 if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                                 Scierror(999, _("%s: No more memory.\n"), fname);
+                                 return 0;
+                             }
+                             break;
+                         case MOPEN_INVALID_FILENAME:
+                             {
+                                 Scierror(999, _("%s: invalid filename %s.\n"), fname, expandedFileName);
+                                 if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                                 return 0;
+                             }
+                             break;
+                         case MOPEN_INVALID_STATUS: default:
+                             {
+                                 if (expandedFileName) {FREE(expandedFileName); expandedFileName = NULL;}
+                                 Scierror(999, _("%s: invalid status.\n"), fname);
+                                 return 0;
+                             }
+                             break;
+                     }
+                 }
+             }
+             else
+             {
+                 Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                 return 0;
+             }
+         }
+         else /* double */
+         {
+             double dValue = 0.;
 -            if ( !getScalarDouble(pvApiCtx, piAddressVarOne, &dValue) )
++            if ( !getScalarDouble(_piKey, piAddressVarOne, &dValue) )
+             {
+                 FILE *fd = NULL;
+                 fileDescriptor = (int)dValue;
+                 if ((fileDescriptor == STDIN_ID) || (fileDescriptor == STDOUT_ID))
+                 {
+                     SciError(244);
+                     return 0;
+                 }
+                 fd = GetFileOpenedInScilab(fileDescriptor);
+                 if (fd == NULL)
+                 {
+                     Scierror(245,_("%s: No input file associated to logical unit %d.\n"), fname, fileDescriptor);
+                     return 0;
+                 }
+             }
+             else
+             {
+                 Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                 return 0;
+             }
+         }
+         wcReadedStrings = mgetl(fileDescriptor, numberOfLinesToRead, &numberOfLinesReaded, &iErrorMgetl);
+         if (bCloseFile)
+         {
+             double dErrClose = 0.;
+             C2F(mclose)(&fileDescriptor, &dErrClose);
+             bCloseFile = FALSE;
+         }
+         switch(iErrorMgetl)
+         {
+             case MGETL_NO_ERROR:
+             {
+                 if (numberOfLinesReaded == 0)
+                 {
 -                    if (createEmptyMatrix(pvApiCtx, Rhs + 1) != 0)
++                    if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
+                     {
+                         Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                         return 0;
+                     }
+                 }
+                 else
+                 {
+                     int m = numberOfLinesReaded;
+                     int n = 1;
 -                    sciErr = createMatrixOfString(pvApiCtx, Rhs + 1, m, n, wcReadedStrings);
++                    sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
+                     if(sciErr.iErr)
+                     {
+                         printError(&sciErr, 0);
+                         return 0;
+                     }
+                 }
+                 freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+                 wcReadedStrings = NULL;
+             }
+             break;
+             case MGETL_EOF:
+             {
+                 if (numberOfLinesReaded == 0)
+                 {
 -                    if (createEmptyMatrix(pvApiCtx, Rhs + 1) != 0)
++                    if (createEmptyMatrix(_piKey, Rhs + 1) != 0)
+                     {
+                         Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                         return 0;
+                     }
+                 }
+                 else
+                 {
+                     int m = numberOfLinesReaded;
+                     int n = 1;
 -                    sciErr = createMatrixOfString(pvApiCtx, Rhs + 1, m, n, wcReadedStrings);
++                    sciErr = createMatrixOfString(_piKey, Rhs + 1, m, n, wcReadedStrings);
+                     if(sciErr.iErr)
+                     {
+                         printError(&sciErr, 0);
+                         return 0;
+                     }
+                     freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+                     wcReadedStrings = NULL;
+                 }
+             }
+             break;
+             case MGETL_MEMORY_ALLOCATION_ERROR:
+             {
+                 if (wcReadedStrings)
+                 {
+                     freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+                     wcReadedStrings = NULL;
+                 }
+                 Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                 return 0;
+             }
+             break;
+             case MGETL_ERROR:
+             {
+                 if (wcReadedStrings)
+                 {
+                     freeArrayOfString(wcReadedStrings, numberOfLinesReaded);
+                     wcReadedStrings = NULL;
+                 }
+                 Scierror(999,_("%s: error.\n"), fname);
+                 return 0;
+             }
+             break;
+         }
+         LhsVar(1) = Rhs + 1;
+         C2F(putlhsvar)();
+     }
+     else
+     {
+         Scierror(999,_("%s: Wrong type for input argument #%d: String or logical unit expected.\n"), fname, 1);
+     }
+     return 0;
+ }
+ /*--------------------------------------------------------------------------*/
Simple merge
Simple merge
@@@ -21,87 -31,237 +31,242 @@@ static int cmpstr( const void *a ,cons
  /*--------------------------------------------------------------------------*/
  char **getmacroslist(int *sizearray)
  {
-       char **dictionary = NULL;
-       int sizedictionary = getsizemacroslist();
-       *sizearray = 0;
-       if (sizedictionary > 0)
-       {
-               int sizelibraries = 0;
-               char **libraries = getlibrarieslist(&sizelibraries);
-               dictionary = (char**)MALLOC(sizeof(char*)*sizedictionary);
-               if (dictionary)
-               {
-                       int m = 0;
-                       if (libraries)
-                       {
-                               int i = 0;
-                               for (i = 0;i < sizelibraries; i++)
-                               {
-                                       int j = 0;
-                                       char **macros = NULL;
-                                       int sizemacros = 0;
-                                       macros = getlistmacrosfromlibrary(libraries[i],&sizemacros);
-                                       if (macros)
-                                       {
-                                               for (j=0;j<sizemacros;j++)
-                                               {
-                                                       dictionary[m] = macros[j];
-                                                       m++;
-                                               }
-                                               FREE(macros);
-                                               macros = NULL;
-                                       }
-                               }
-                               *sizearray = sizedictionary;
-                       }
-               }
-               else
-               {
-                       *sizearray = 0;
-               }
-               freeArrayOfString(libraries, sizelibraries);
-       }
-       return dictionary;
+     char **macroslist = NULL;
++// FIXME : Rewrite me for YaSp
++#ifdef __REWRITE_ME_FOR_YASP__
+     char **macrosonstack = NULL;
+     int sizemacrosonstack = 0;
+     char **macrosinlibraries = NULL;
+     int sizemacrosinlibraries = 0;
+     *sizearray = 0;
+     macrosonstack = getmacrosonstacklist(&sizemacrosonstack);
+     macrosinlibraries = getmacrosinlibrarieslist(&sizemacrosinlibraries);
+     if (macrosinlibraries || macrosonstack)
+     {
+         int nbMacros = sizemacrosonstack + sizemacrosinlibraries;
+         if (sizemacrosonstack)
+         {
+             macroslist = (char**)REALLOC(macrosinlibraries, sizeof(char*) * nbMacros);
+             if (macroslist)
+             {
+                 int i = 0;
+                 int j = 0;
+                 for (i = sizemacrosinlibraries; i < nbMacros; i++)
+                 {
+                     macroslist[i] = strdup(macrosonstack[j++]);
+                 }
+                 qsort(macroslist, nbMacros, sizeof(char*), cmpstr);
+                 RemoveDuplicateStrings(macroslist, &nbMacros);
+                 macroslist = (char**)REALLOC(macroslist, sizeof(char*) * nbMacros);
+                 *sizearray = nbMacros;
+             }
+             else
+             {
+                 macroslist = macrosinlibraries;
+                 *sizearray = sizemacrosinlibraries;
+             }
+         }
+         else
+         {
+             macroslist = macrosinlibraries;
+             *sizearray = sizemacrosinlibraries;
+         }
+     }
+     if (macrosonstack)
+     {
+         freeArrayOfString(macrosonstack, sizemacrosonstack);
+         macrosonstack = NULL;
+     }
++#endif /* !__REWRITE_ME_FOR_YASP__ */
+     return macroslist;
+ }
+ /*--------------------------------------------------------------------------*/
+ static char **getmacrosonstacklist(int *sizearray)
+ {
+     char **macroslist = NULL;
 -
++// FIXME : Rewrite me for YaSp
++#ifdef __REWRITE_ME_FOR_YASP__
+     char **localvariables = NULL;
+     int sizelocalvariables = 0;
+     *sizearray = 0;
+     localvariables = getLocalVariablesName(&sizelocalvariables, FALSE);
+     if (localvariables)
+     {
+         int i = 0;
+         int nbMacros = 0;
+         for (i = 0; i < sizelocalvariables; i++)
+         {
+             int iType = 0;
+             SciErr sciErr = getNamedVarType(pvApiCtx, localvariables[i], &iType);
+             if (!sciErr.iErr)
+             {
+                 if (iType == sci_c_function) nbMacros++;
+             }
+         }
+         if (nbMacros)
+         {
+             macroslist = (char**)MALLOC(sizeof(char*) * nbMacros);
+         }
+         
+         if (macroslist)
+         {
+             nbMacros = 0;
+             for (i = 0; i < sizelocalvariables; i++)
+             {
+                 int iType = 0;
+                 SciErr sciErr = getNamedVarType(pvApiCtx, localvariables[i], &iType);
+                 if (!sciErr.iErr)
+                 {
+                     if (iType == sci_c_function) 
+                     {
+                         macroslist[nbMacros++] = strdup(localvariables[i]);
+                     }
+                 }
+             }
+             *sizearray = nbMacros;
+         }
+         freeArrayOfString(localvariables, sizelocalvariables);
+         localvariables = NULL;
+     }
++#endif /* !__REWRITE_ME_FOR_YASP__ */
+     return macroslist;
+ }
+ /*--------------------------------------------------------------------------*/
+ static char **getmacrosinlibrarieslist(int *sizearray)
+ {
+     char **dictionary = NULL;
+     int sizedictionary = getsizemacrosinlibrarieslist();
+     *sizearray = 0;
+     if (sizedictionary > 0)
+     {
+         int sizelibraries = 0;
+         char **libraries = getlibrarieslist(&sizelibraries);
+         dictionary = (char**)MALLOC(sizeof(char*)*sizedictionary);
+         if (dictionary)
+         {
+             int m = 0;
+             if (libraries)
+             {
+                 int i = 0;
+                 for (i = 0;i < sizelibraries; i++)
+                 {
+                     int j = 0;
+                     char **macros = NULL;
+                     int sizemacros = 0;
+                     macros = getlistmacrosfromlibrary(libraries[i],&sizemacros);
+                     if (macros)
+                     {
+                         for (j=0;j<sizemacros;j++)
+                         {
+                             dictionary[m] = macros[j];
+                             m++;
+                         }
+                         FREE(macros);
+                         macros = NULL;
+                     }
+                 }
+                 *sizearray = sizedictionary;
+             }
+         }
+         else
+         {
+             *sizearray = 0;
+         }
+         freeArrayOfString(libraries, sizelibraries);
+     }
+     return dictionary;
  }
  /*--------------------------------------------------------------------------*/
- static int getsizemacroslist(void)
+ static int getsizemacrosinlibrarieslist(void)
  {
-       int sizedictionary = 0;
-       int sizelibraries = 0;
-       char **libraries = getlibrarieslist(&sizelibraries);
-       if (libraries)
-       {
-               int i = 0;
-               for (i = 0;i < sizelibraries; i++)
-               {
-                       if (libraries[i])
-                       {
-                               char **macros = NULL;
-                               int sizemacros = 0;
-                               macros = getlistmacrosfromlibrary(libraries[i],&sizemacros);
-                               if (macros)
-                               {
-                                       sizedictionary = sizedictionary + sizemacros;
-                                       freeArrayOfString(macros, sizemacros);
-                               }
-                               FREE(libraries[i]);
-                               libraries[i] = NULL;
-                       }
-                       
-               }
-               FREE(libraries);
-               libraries = NULL;
-       }
-       return sizedictionary;
+     int sizedictionary = 0;
+     int sizelibraries = 0;
+     char **libraries = getlibrarieslist(&sizelibraries);
+     if (libraries)
+     {
+         int i = 0;
+         for (i = 0;i < sizelibraries; i++)
+         {
+             if (libraries[i])
+             {
+                 char **macros = NULL;
+                 int sizemacros = 0;
+                 macros = getlistmacrosfromlibrary(libraries[i],&sizemacros);
+                 if (macros)
+                 {
+                     sizedictionary = sizedictionary + sizemacros;
+                     freeArrayOfString(macros, sizemacros);
+                 }
+                 FREE(libraries[i]);
+                 libraries[i] = NULL;
+             }
+         }
+         FREE(libraries);
+         libraries = NULL;
+     }
+     return sizedictionary;
  }
  /*--------------------------------------------------------------------------*/
+ static void RemoveDuplicateStrings(char **Strings,int *SizeStrings)
+ {
+     int fin = 0, i = 0;
+     int newsize = *SizeStrings;
+     for(fin = *SizeStrings - 1; fin > 0; fin--)
+     {
+         int Sorted = FALSE;
+         for(i = 0; i < fin; i++)
+         {
+             if (Strings[i])
+             {
+                 if(strcmp(Strings[i], Strings[i+1]) == 0)
+                 {
+                     FREE(Strings[i + 1]);
+                     Strings[i + 1] = NULL;
+                     Sorted = TRUE;
+                     newsize--;
+                 }
+             }
+             else
+             {
+                 Strings[i] = Strings[i+1];
+                 Strings[i+1] = NULL;
+                 Sorted = TRUE;
+             }
+         }
+         if (!Sorted)
+         {
+             break;
+         }
+     }
+     *SizeStrings = newsize;
+ }
+ /*--------------------------------------------------------------------------*/ 
+ static int cmpstr( const void *a ,const void *b)
+ {
+     return strcmp(*(const char **)a, *(const char **)b );
+ }
+ /*--------------------------------------------------------------------------*/ 
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
@@@ -55,709 -57,708 +57,709 @@@ int extractVarNameList(int* _piKey, in
  
  static char fname[]                   = "export_to_hdf5";
  /*--------------------------------------------------------------------------*/
 -int sci_export_to_hdf5(char *fname,unsigned long fname_len)
 +int sci_export_to_hdf5(char *fname, int* _piKey)
  {
-       int iRet                                                = 0;
-       int iNbVar                                      = 0;
-       int iLen                                                = 0;
-       int** piAddrList                = NULL;
-       char* pstFilename               = NULL;
-       char** pstNameList      = NULL;
-       bool bExport                            = false;
+     int iRet            = 0;
+     int iNbVar          = 0;
+     int iLen            = 0;
+     int** piAddrList    = NULL;
+     char* pstFilename   = NULL;
+     char** pstNameList        = NULL;
+     bool bExport        = false;
  
-       SciErr sciErr;
+     SciErr sciErr;
  
-       CheckLhs(1,1);//output parameter
+     CheckLhs(1,1);//output parameter
  
  #ifndef _MSC_VER
-       forceJHDF5load();
+     forceJHDF5load();
  #endif
  
 -    /*get input data*/
 -    if(Rhs < 2)
 -    {
 -        Scierror(999,_("%s: Wrong number of input argument(s): At most %d expected.\n"), fname, 2);
 -        return 0;
 -    }
 -
 -    pstNameList = (char**)MALLOC(sizeof(char*) * Rhs);
 -    iNbVar = extractVarNameList(1, Rhs, pstNameList);
 -    if(iNbVar == 0)
 -    {
 -        FREE(pstNameList);
 -        return 0;
 -    }
 -
 -    piAddrList = (int**)MALLOC(sizeof(int*) * (iNbVar - 1));
 -    for(int i = 0 ; i < Rhs - 1 ; i++)
 -    {
 -        sciErr = getVarAddressFromName(pvApiCtx, pstNameList[i + 1], &piAddrList[i]);
 -        if(sciErr.iErr)
 -        {
 -            // i+1 = i for filename + 1 because starting arg number is 1 for human being
 -            Scierror(999,_("%s: Wrong value for input argument #%d: Defined variable expected.\n"), fname, i + 2);
 -            printError(&sciErr, 0);
 -            return 0;
 -        }
 -    }
 -
 -    iLevel = 0;
 -    // open hdf5 file
 -    int iH5File = createHDF5File(pstNameList[0]);
 -
 -    if(iH5File < 0)
 -    {
 -        if(iH5File == -2)
 -        {
 -            Scierror(999, _("%s: Wrong value for input argument #%d: \"%s\" is a directory"), fname, 1, pstNameList[0]);
 -        }
 -        else
 -        {
 -            Scierror(999,_("%s: Cannot open file %s.\n"), fname, pstNameList[0]);
 -        }
 -
 -        return 0;
 -    }
 -
 -    // export data
 -    for(int i = 0 ; i < Rhs - 1; i++)
 -    {
 -        bExport = export_data(iH5File, piAddrList[i], pstNameList[i + 1]);
 -        if(bExport == false)
 -        {
 -            break;
 -        }
 -    }
 -
 -    //close hdf5 file
 -    closeHDF5File(iH5File);
 -
 -    //create boolean return value
 -    int *piReturn = NULL;
 -    sciErr = allocMatrixOfBoolean(pvApiCtx, Rhs + 1, 1, 1, &piReturn);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    if(bExport == true)
 -    {
 -        piReturn[0] = 1;
 -    }
 -    else
 -    {
 -        piReturn[0] = 0;
 -    }
 -
 -    LhsVar(1) = Rhs + 1;
 -    PutLhsVar();
 -    return 0;
 +      /*get input data*/
 +      if(Rhs < 2)
 +      {
 +              Scierror(999,_("%s: Wrong number of input argument(s): At most %d expected.\n"), fname, 2);
 +              return 0;
 +      }
 +
 +      pstNameList = (char**)MALLOC(sizeof(char*) * Rhs);
 +      iNbVar = extractVarNameList(_piKey, 1, Rhs, pstNameList);
 +      if(iNbVar == 0)
 +      {
 +              FREE(pstNameList);
 +              return 0;
 +      }
 +
 +      piAddrList = (int**)MALLOC(sizeof(int*) * (iNbVar - 1));
 +      for(int i = 0 ; i < Rhs - 1 ; i++)
 +      {
 +              sciErr = getVarAddressFromName(_piKey, pstNameList[i + 1], &piAddrList[i]);
 +              if(sciErr.iErr)
 +              {
 +                      // i+1 = i for filename + 1 because starting arg number is 1 for human being
 +                      Scierror(999,_("%s: Wrong value for input argument #%d: Defined variable expected.\n"), fname, i + 2);
 +                      printError(&sciErr, 0);
 +                      return 0;
 +              }
 +      }
 +
 +      iLevel = 0;
 +      //open hdf5 file
 +      int iH5File = createHDF5File(pstNameList[0]); 
 +
 +      if(iH5File < 0)
 +      {
 +              Scierror(999,_("%s: Cannot open file %s.\n"), fname, pstNameList[0]);
 +              return 0;
 +      }
 +
 +      // export data
 +      for(int i = 0 ; i < Rhs - 1; i++)
 +      {
 +              bExport = export_data(_piKey, piAddrList[i], iH5File, pstNameList[i + 1]);
 +              if(bExport == false)
 +              {
 +                      break;
 +              }
 +      }
 +
 +      //close hdf5 file
 +      closeHDF5File(iH5File);
 +
 +      //create boolean return value
 +      int *piReturn = NULL;
 +      sciErr = allocMatrixOfBoolean(_piKey, Rhs + 1, 1, 1, &piReturn);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      if(bExport == true)
 +      {
 +              piReturn[0] = 1;
 +      }
 +      else
 +      {
 +              piReturn[0] = 0;
 +      }
 +
 +      LhsVar(1) = Rhs + 1;
 +      PutLhsVar();
 +      return 0;
  }
  
 -static bool export_data(int _iH5File, int* _piVar, char* _pstName)
 +static bool export_data(int* _piKey, int* _piVar, int _iH5File, char* _pstName)
  {
 -    bool bReturn = false;
 -    int iType = 0;
 -
 -    SciErr sciErr = getVarType(pvApiCtx, _piVar, &iType);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    switch(iType)
 -    {
 -    case sci_matrix :
 -        {
 -            bReturn = export_double(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_poly :
 -        {
 -            bReturn = export_poly(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_boolean :
 -        {
 -            bReturn = export_boolean(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_sparse :
 -        {
 -            bReturn = export_sparse(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_boolean_sparse :
 -        {
 -            bReturn = export_boolean_sparse(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_matlab_sparse :
 -        {
 -            bReturn = export_matlab_sparse(_piVar, _pstName);
 -            break;
 -        }
 -    case sci_ints :
 -        {
 -            bReturn = export_ints(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_handles :
 -        {
 -            bReturn = export_handles(_piVar, _pstName);
 -            break;
 -        }
 -    case sci_strings :
 -        {
 -            bReturn = export_strings(_iH5File, _piVar, _pstName);
 -            break;
 -        }
 -    case sci_u_function :
 -        {
 -            bReturn = export_u_function(_piVar, _pstName);
 -            break;
 -        }
 -    case sci_c_function :
 -        {
 -            bReturn = export_c_function(_piVar, _pstName);
 -            break;
 -        }
 -    case sci_lib :
 -        {
 -            bReturn = export_lib(_piVar, _pstName);
 -            break;
 -        }
 -    case sci_list :
 -    case sci_tlist :
 -    case sci_mlist :
 -        {
 -            bReturn = export_list(_iH5File, _piVar, _pstName, iType);
 -            break;
 -        }
 -    case sci_lufact_pointer :
 -        {
 -            bReturn = export_lufact_pointer(_piVar, _pstName);
 -            break;
 -        }
 -    }
 -    return bReturn;
 +      bool bReturn = false;
 +      int iType = 0;
 +      
 +      SciErr sciErr = getVarType(_piKey, _piVar, &iType);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
 +
 +      switch(iType)
 +      {
 +      case sci_matrix :
 +              {
 +                      bReturn = export_double(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_poly :
 +              {
 +                      bReturn = export_poly(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_boolean :
 +              {
 +                      bReturn = export_boolean(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_sparse :
 +              {
 +                      bReturn = export_sparse(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_boolean_sparse :
 +              {
 +                      bReturn = export_boolean_sparse(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_matlab_sparse :
 +              {
 +                      bReturn = export_matlab_sparse(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      case sci_ints :
 +              {
 +                      bReturn = export_ints(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_handles :
 +              {
 +                      bReturn = export_handles(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      case sci_strings :
 +              {
 +                      bReturn = export_strings(_piKey, _piVar, _iH5File, _pstName);
 +                      break;
 +              }
 +      case sci_u_function :
 +              {
 +                      bReturn = export_u_function(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      case sci_c_function :
 +              {
 +                      bReturn = export_c_function(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      case sci_lib :
 +              {
 +                      bReturn = export_lib(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      case sci_list :
 +      case sci_tlist :
 +      case sci_mlist :
 +              {
 +                      bReturn = export_list(_piKey, _piVar, _iH5File, _pstName, iType);
 +                      break;
 +              }
 +      case sci_lufact_pointer :
 +              {
 +                      bReturn = export_lufact_pointer(_piKey, _piVar, _pstName);
 +                      break;
 +              }
 +      }
 +      return bReturn;
  }
  
 -static bool export_list(int _iH5File, int *_piVar, char* _pstName, int _iVarType)
 +static bool export_list(int* _piKey, int *_piVar, int _iH5File, char* _pstName, int _iVarType)
  {
 -    int iRet = 0;
 -    bool bReturn = false;
 -    int iItemNumber = 0;
 -    SciErr sciErr = getListItemNumber(pvApiCtx, _piVar, &iItemNumber);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -
 -    //create groupe name
 -    char* pstGroupName        = createGroupName(_pstName);
 -
 -    char pstMsg[256];
 -    sprintf(pstMsg, "list (%d)", iItemNumber);
 -    print_type(pstMsg);
 -
 -    iLevel++;
 -    //open list
 -    void *pvList = openList(_iH5File, pstGroupName, iItemNumber);
 -    for(int i = 0 ; i < iItemNumber ; i++)
 -    {
 -        int *piNewVar = NULL;
 -        getListItemAddress(pvApiCtx, _piVar, i + 1, &piNewVar);//1 indexed
 -        if(piNewVar == NULL)
 -        {
 -            Scierror(999,_("Item not found.\n"));
 -            return 0;
 -        }
 -
 -        char* pstPathName             = createPathName(pstGroupName, i);
 -        bReturn                                                       = export_data(_iH5File, piNewVar, pstPathName);
 -        iRet = addItemInList(_iH5File, pvList, i, pstPathName);
 -
 -        FREE(pstPathName);
 -        if(bReturn == false || iRet)
 -            return false;
 -    }
 -    iLevel--;
 -    closeList(_iH5File, pvList, _pstName, iItemNumber, _iVarType);
 -    FREE(pstGroupName);
 -    //close list
 -    return true;
 +      int iRet = 0;
 +      bool bReturn = false;
 +      int iItemNumber = 0;
 +      SciErr sciErr = getListItemNumber(_piKey, _piVar, &iItemNumber);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
 +
 +
 +      //create groupe name
 +      char* pstGroupName      = createGroupName(_pstName);
 +
 +      char pstMsg[256];
 +      sprintf(pstMsg, "list (%d)", iItemNumber);
 +      print_type(pstMsg);
 +
 +      iLevel++;
 +      //open list
 +      void *pvList = openList(_iH5File, pstGroupName, iItemNumber);
 +      for(int i = 0 ; i < iItemNumber ; i++)
 +      {
 +              int *piNewVar = NULL;
 +              getListItemAddress(_piKey, _piVar, i + 1, &piNewVar);//1 indexed
 +              if(piNewVar == NULL)
 +              {
 +                      Scierror(999,_("Item not found.\n"));
 +                      return 0;
 +              }
 +
 +              char* pstPathName               = createPathName(pstGroupName, i);
 +              bReturn                                                 = export_data(_piKey, piNewVar, _iH5File, pstPathName);
 +              iRet = addItemInList(_iH5File, pvList, i, pstPathName);
 +
 +              FREE(pstPathName);
 +              if(bReturn == false || iRet)
 +                      return false;
 +      }
 +      iLevel--;
 +      closeList(_iH5File, pvList, _pstName, iItemNumber, _iVarType);
 +      FREE(pstGroupName);
 +      //close list
 +      return true;
  }
  
 -static bool export_double(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_double(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                                  = 0;
 -    int iComplex                      = isVarComplex(pvApiCtx, _piVar);
 -    int iRows                                 = 0;
 -    int iCols                                 = 0;
 -    int iType = 0;
 -    double *pdblReal  = NULL;
 -    double *pdblImg           = NULL;
 -
 -    SciErr sciErr = getVarType(pvApiCtx, _piVar, &iType);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    if(iType != sci_matrix)
 -    {
 -        return false;
 -    }
 -
 -    if(iComplex)
 -    {
 -        sciErr = getComplexMatrixOfDouble(pvApiCtx, _piVar, &iRows, &iCols, &pdblReal, &pdblImg);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writeDoubleComplexMatrix(_iH5File, _pstName, iRows, iCols, pdblReal, pdblImg);
 -    }
 -    else
 -    {
 -        sciErr = getMatrixOfDouble(pvApiCtx, _piVar, &iRows, &iCols, &pdblReal);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writeDoubleMatrix(_iH5File, _pstName, iRows, iCols, pdblReal);
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "double (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -    return true;
 +      int iRet                                        = 0;
 +      int iComplex                    = isVarComplex(_piKey, _piVar);
 +      int iRows                                       = 0;
 +      int iCols                                       = 0;
 +      int iType = 0;
 +      double *pdblReal        = NULL;
 +      double *pdblImg         = NULL;
 +      
 +      SciErr sciErr = getVarType(_piKey, _piVar, &iType);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
 +
 +      if(iType != sci_matrix)
 +      {
 +              return false;
 +      }
 +
 +      if(iComplex)
 +      {
 +              sciErr = getComplexMatrixOfDouble(_piKey, _piVar, &iRows, &iCols, &pdblReal, &pdblImg);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writeDoubleComplexMatrix(_iH5File, _pstName, iRows, iCols, pdblReal, pdblImg);
 +      }
 +      else
 +      {
 +              sciErr = getMatrixOfDouble(_piKey, _piVar, &iRows, &iCols, &pdblReal);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writeDoubleMatrix(_iH5File, _pstName, iRows, iCols, pdblReal);
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "double (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +      return true;
  }
  
 -static bool export_poly(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_poly(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                                          = 0;
 -    int iRows                                         = 0;
 -    int iCols                                         = 0;
 -    int* piNbCoef                             = NULL;
 -    double** pdblReal         = NULL;
 -    double** pdblImg          = NULL;
 -    char pstVarName[64]       = {0};
 -    int iVarNameLen                   = 0;
 -
 -    SciErr sciErr = getPolyVariableName(pvApiCtx, _piVar, pstVarName, &iVarNameLen);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    if(isVarComplex(pvApiCtx, _piVar))
 -    {
 -        sciErr = getComplexMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, NULL, NULL, NULL);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
 -        sciErr = getComplexMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, piNbCoef, NULL, NULL);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        pdblReal = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 -        pdblImg = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 -        for(int i = 0 ; i < iRows * iCols ; i++)
 -        {
 -            pdblReal[i] = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 -            pdblImg[i]        = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 -        }
 -        sciErr = getComplexMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, piNbCoef, pdblReal, pdblImg);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writePolyComplexMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 -    }
 -    else
 -    {
 -        sciErr = getMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, NULL, NULL);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
 -        sciErr = getMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, piNbCoef, NULL);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        pdblReal = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 -        for(int i = 0 ; i < iRows * iCols ; i++)
 -        {
 -            pdblReal[i] = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 -        }
 -        sciErr = getMatrixOfPoly(pvApiCtx, _piVar, &iRows, &iCols, piNbCoef, pdblReal);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writePolyMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "poly (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -
 -    if(pdblReal)
 -    {
 -        for(int i = 0 ; i < iRows * iCols ; i++)
 -        {
 -            FREE(pdblReal[i]);
 -        }
 -        FREE(pdblReal);
 -    }
 -
 -    if(pdblImg)
 -    {
 -        for(int i = 0 ; i < iRows * iCols ; i++)
 -        {
 -            FREE(pdblImg[i]);
 -        }
 -        FREE(pdblImg);
 -    }
 -
 -    FREE(piNbCoef);
 -    return true;
 +      int iRet                                                = 0;
 +      int iRows                                               = 0;
 +      int iCols                                               = 0;
 +      int* piNbCoef                           = NULL;
 +      double** pdblReal               = NULL;
 +      double** pdblImg                = NULL;
 +      char *pstVarName                = NULL;
 +      int iVarNameLen                 = 0;
 +
 +      SciErr sciErr = getPolyVariableName(_piKey, _piVar, pstVarName, &iVarNameLen);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      pstVarName = (char*)MALLOC(sizeof(char) * (iVarNameLen + 1));
 +
 +      sciErr = getPolyVariableName(_piKey, _piVar, pstVarName, &iVarNameLen);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      if(isVarComplex(_piKey, _piVar))
 +      {
 +              sciErr = getComplexMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, NULL, NULL, NULL);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
 +              sciErr = getComplexMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, piNbCoef, NULL, NULL);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              pdblReal = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 +              pdblImg = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 +              for(int i = 0 ; i < iRows * iCols ; i++)
 +              {
 +                      pdblReal[i] = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 +                      pdblImg[i]      = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 +              }
 +              sciErr = getComplexMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, piNbCoef, pdblReal, pdblImg);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writePolyComplexMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 +      }
 +      else
 +      {
 +              sciErr = getMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, NULL, NULL);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
 +              sciErr = getMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, piNbCoef, NULL);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              pdblReal = (double**)MALLOC(sizeof(double*) * iRows * iCols);
 +              for(int i = 0 ; i < iRows * iCols ; i++)
 +              {
 +                      pdblReal[i] = (double*)MALLOC(sizeof(double) * piNbCoef[i]);// for null termination
 +              }
 +              sciErr = getMatrixOfPoly(_piKey, _piVar, &iRows, &iCols, piNbCoef, pdblReal);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writePolyMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "poly (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +
 +      if(pdblReal)
 +      {
 +              for(int i = 0 ; i < iRows * iCols ; i++)
 +              {
 +                      FREE(pdblReal[i]);
 +              }
 +              FREE(pdblReal);
 +      }
 +
 +      if(pdblImg)
 +      {
 +              for(int i = 0 ; i < iRows * iCols ; i++)
 +              {
 +                      FREE(pdblImg[i]);
 +              }
 +              FREE(pdblImg);
 +      }
 +
 +      FREE(piNbCoef);
 +      return true;
  }
  
 -static bool export_boolean(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_boolean(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRows                                 = 0;
 -    int iCols                                 = 0;
 -    int *piData                               = NULL;
 -
 -    //for error management
 -    SciErr sciErr = getMatrixOfBoolean(pvApiCtx, _piVar, &iRows, &iCols, &piData);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    int iRet = writeBooleanMatrix(_iH5File, _pstName, iRows, iCols, piData);
 -    if(iRet)
 -    {
 -        //Msg ??
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "bool (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -    return true;
 +      int iRows                                       = 0;
 +      int iCols                                       = 0;
 +      int *piData                             = NULL;
 +
 +      //for error management
 +      SciErr sciErr = getMatrixOfBoolean(_piKey, _piVar, &iRows, &iCols, &piData);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      int iRet = writeBooleanMatrix(_iH5File, _pstName, iRows, iCols, piData);
 +      if(iRet)
 +      {
 +              //Msg ??
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "bool (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +      return true;
  }
  
 -static bool export_boolean_sparse(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_boolean_sparse(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                                          = 0;
 -    int iRows                                         = 0;
 -    int iCols                                         = 0;
 -    int iNbItem                                       = 0;
 -    int* piNbCoef                             = NULL;
 -    int* piNbItemRow          = NULL;
 -    int* piColPos                             = NULL;
 -
 -    SciErr sciErr = getBooleanSparseMatrix(pvApiCtx, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    iRet = writeBooleanSparseMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 -    if(iRet)
 -    {
 -        //Msg ??
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "boolean sparse (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -    return true;
 +      int iRet                                                = 0;
 +      int iRows                                               = 0;
 +      int iCols                                               = 0;
 +      int iNbItem                                     = 0;
 +      int* piNbCoef                           = NULL;
 +      int* piNbItemRow                = NULL;
 +      int* piColPos                           = NULL;
 +
 +      SciErr sciErr = getBooleanSparseMatrix(_piKey, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
 +
 +      iRet = writeBooleanSparseMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 +      if(iRet)
 +      {
 +              //Msg ??
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "boolean sparse (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +      return true;
  }
  
 -static bool export_sparse(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_sparse(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                                          = 0;
 -    int iRows                                         = 0;
 -    int iCols                                         = 0;
 -    int iNbItem                                       = 0;
 -    int* piNbCoef                             = NULL;
 -    int* piNbItemRow          = NULL;
 -    int* piColPos                             = NULL;
 -    double* pdblReal          = NULL;
 -    double* pdblImg           = NULL;
 -    SciErr sciErr;
 -
 -    if(isVarComplex(pvApiCtx, _piVar))
 -    {
 -        sciErr = getComplexSparseMatrix(pvApiCtx, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writeSparseComplexMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 -    }
 -    else
 -    {
 -        sciErr = getSparseMatrix(pvApiCtx, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -
 -        iRet = writeSparseMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "sparse (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -    return true;
 +      int iRet                                                = 0;
 +      int iRows                                               = 0;
 +      int iCols                                               = 0;
 +      int iNbItem                                     = 0;
 +      int* piNbCoef                           = NULL;
 +      int* piNbItemRow                = NULL;
 +      int* piColPos                           = NULL;
 +      double* pdblReal                = NULL;
 +      double* pdblImg         = NULL;
 +      SciErr sciErr;
 +
 +      if(isVarComplex(_piKey, _piVar))
 +      {
 +              sciErr = getComplexSparseMatrix(_piKey, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writeSparseComplexMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 +      }
 +      else
 +      {
 +              sciErr = getSparseMatrix(_piKey, _piVar, &iRows, &iCols, &iNbItem, &piNbItemRow, &piColPos, &pdblReal);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +
 +              iRet = writeSparseMatrix(_iH5File, _pstName, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "sparse (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +      return true;
  }
  
 -static bool export_matlab_sparse(int *_piVar, char* _pstName)
 +static bool export_matlab_sparse(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
 -static bool export_ints(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_ints(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                                  = 0;
 -    int iRows                                 = 0;
 -    int iCols                                 = 0;
 -    void *piData                      = NULL;
 -    int iPrec                                 = 0;
 -
 -    SciErr sciErr = getMatrixOfIntegerPrecision(pvApiCtx, _piVar, &iPrec);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    switch(iPrec)
 -    {
 -    case SCI_INT8 :
 -        sciErr = getMatrixOfInteger8(pvApiCtx, _piVar, &iRows, &iCols, (char**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeInterger8Matrix(_iH5File, _pstName, iRows, iCols, (char*)piData);
 -        break;
 -    case SCI_UINT8 :
 -        sciErr = getMatrixOfUnsignedInteger8(pvApiCtx, _piVar, &iRows, &iCols, (unsigned char**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeUnsignedInterger8Matrix(_iH5File, _pstName, iRows, iCols, (unsigned char*)piData);
 -        break;
 -    case SCI_INT16 : 
 -        sciErr = getMatrixOfInteger16(pvApiCtx, _piVar, &iRows, &iCols, (short**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeInterger16Matrix(_iH5File, _pstName, iRows, iCols, (short*)piData);
 -        break;
 -    case SCI_UINT16 :
 -        sciErr = getMatrixOfUnsignedInteger16(pvApiCtx, _piVar, &iRows, &iCols, (unsigned short**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeUnsignedInterger16Matrix(_iH5File, _pstName, iRows, iCols, (unsigned short*)piData);
 -        break;
 -    case SCI_INT32 : 
 -        sciErr = getMatrixOfInteger32(pvApiCtx, _piVar, &iRows, &iCols, (int**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeInterger32Matrix(_iH5File, _pstName, iRows, iCols, (int*)piData);
 -        break;
 -    case SCI_UINT32 :
 -        sciErr = getMatrixOfUnsignedInteger32(pvApiCtx, _piVar, &iRows, &iCols, (unsigned int**)&piData);
 -        if(sciErr.iErr)
 -        {
 -            printError(&sciErr, 0);
 -            return false;
 -        }
 -        iRet = writeUnsignedInterger32Matrix(_iH5File, _pstName, iRows, iCols, (unsigned int*)piData);
 -        break;
 -    case SCI_INT64 : 
 -        //sciErr = getMatrixOfInteger64(_piVar, &iRows, &iCols, (long long**)&piData);
 -        //if(sciErr.iErr)
 -        //{
 -        //    printError(&sciErr, 0);
 -        //    return false;
 -        //}
 -        //iRet = writeInterger64Matrix(_iH5File, _pstName, iRows, iCols, (long long*)piData);
 -        //break;
 -    case SCI_UINT64 : 
 -        //sciErr = getMatrixOfUnsignedInteger64(_piVar, &iRows, &iCols, (unsigned long long**)&piData);
 -        //if(sciErr.iErr)
 -        //{
 -        //    printError(&sciErr, 0);
 -        //    return false;
 -        //}
 -        //iRet = writeUnsignedInterger64Matrix(_iH5File, _pstName, iRows, iCols, (unsigned long long*)piData);
 -        //break;
 -    default : 
 -        return 1;
 -        break;
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "int%d (%d x %d)", 8*iPrec, iRows, iCols);
 -    print_type(pstMsg);
 -    return true;
 +      int iRet                                        = 0;
 +      int iRows                                       = 0;
 +      int iCols                                       = 0;
 +      void *piData                    = NULL;
 +      int iPrec                                       = 0;
 +
 +      SciErr sciErr = getMatrixOfIntegerPrecision(_piKey, _piVar, &iPrec);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      switch(iPrec)
 +      {
 +      case SCI_INT8 :
 +              sciErr = getMatrixOfInteger8(_piKey, _piVar, &iRows, &iCols, (char**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeInterger8Matrix(_iH5File, _pstName, iRows, iCols, (char*)piData);
 +              break;
 +      case SCI_UINT8 :
 +              sciErr = getMatrixOfUnsignedInteger8(_piKey, _piVar, &iRows, &iCols, (unsigned char**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeUnsignedInterger8Matrix(_iH5File, _pstName, iRows, iCols, (unsigned char*)piData);
 +              break;
 +      case SCI_INT16 : 
 +              sciErr = getMatrixOfInteger16(_piKey, _piVar, &iRows, &iCols, (short**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeInterger16Matrix(_iH5File, _pstName, iRows, iCols, (short*)piData);
 +              break;
 +      case SCI_UINT16 :
 +              sciErr = getMatrixOfUnsignedInteger16(_piKey, _piVar, &iRows, &iCols, (unsigned short**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeUnsignedInterger16Matrix(_iH5File, _pstName, iRows, iCols, (unsigned short*)piData);
 +              break;
 +      case SCI_INT32 : 
 +              sciErr = getMatrixOfInteger32(_piKey, _piVar, &iRows, &iCols, (int**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeInterger32Matrix(_iH5File, _pstName, iRows, iCols, (int*)piData);
 +              break;
 +      case SCI_UINT32 :
 +              sciErr = getMatrixOfUnsignedInteger32(_piKey, _piVar, &iRows, &iCols, (unsigned int**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeUnsignedInterger32Matrix(_iH5File, _pstName, iRows, iCols, (unsigned int*)piData);
 +              break;
 +      case SCI_INT64 : 
 +              sciErr = getMatrixOfInteger64(_piKey, _piVar, &iRows, &iCols, (long long**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeInterger64Matrix(_iH5File, _pstName, iRows, iCols, (long long*)piData);
 +              break;
 +      case SCI_UINT64 : 
 +              sciErr = getMatrixOfUnsignedInteger64(_piKey, _piVar, &iRows, &iCols, (unsigned long long**)&piData);
 +              if(sciErr.iErr)
 +              {
 +                      printError(&sciErr, 0);
 +                      return false;
 +              }
 +              iRet = writeUnsignedInterger64Matrix(_iH5File, _pstName, iRows, iCols, (unsigned long long*)piData);
 +              break;
 +      default : 
 +              return 1;
 +              break;
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "int%d (%d x %d)", 8*iPrec, iRows, iCols);
 +      print_type(pstMsg);
 +      return true;
  }
  
 -static bool export_handles(int *_piVar, char* _pstName)
 +static bool export_handles(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
 -static bool export_strings(int _iH5File, int *_piVar, char* _pstName)
 +static bool export_strings(int* _piKey, int *_piVar, int _iH5File, char* _pstName)
  {
 -    int iRet                          = 0;
 -    int iRows                         = 0;
 -    int iCols                         = 0;
 -    int* piLen                        = NULL;
 -    char** pstData    = NULL;
 -
 -
 -    SciErr sciErr = getMatrixOfString(pvApiCtx, _piVar, &iRows, &iCols, NULL, NULL);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    piLen = (int*)MALLOC(iRows * iCols * sizeof(int));
 -    sciErr = getMatrixOfString(pvApiCtx, _piVar, &iRows, &iCols, piLen, NULL);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    pstData = (char**)MALLOC(sizeof(char*) * iRows * iCols);
 -    for(int i = 0 ; i < iRows * iCols ; i++)
 -    {
 -        pstData[i] = (char*)MALLOC(sizeof(char) * (piLen[i] + 1));// for null termination
 -    }
 -    sciErr = getMatrixOfString(pvApiCtx, _piVar, &iRows, &iCols, piLen, pstData);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 -
 -    iRet = writeStringMatrix(_iH5File, _pstName, iRows, iCols, pstData);
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    char pstMsg[512];
 -    sprintf(pstMsg, "string (%d x %d)", iRows, iCols);
 -    print_type(pstMsg);
 -
 -    freeArrayOfString(pstData, iRows * iCols);
 -    return true;
 +      int iRet                                = 0;
 +      int iRows                               = 0;
 +      int iCols                               = 0;
 +      int* piLen                      = NULL;
 +      char** pstData  = NULL;
 +
 +
 +      SciErr sciErr = getMatrixOfString(_piKey, _piVar, &iRows, &iCols, NULL, NULL);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      piLen = (int*)MALLOC(iRows * iCols * sizeof(int));
 +      sciErr = getMatrixOfString(_piKey, _piVar, &iRows, &iCols, piLen, NULL);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      pstData = (char**)MALLOC(sizeof(char*) * iRows * iCols);
 +      for(int i = 0 ; i < iRows * iCols ; i++)
 +      {
 +              pstData[i] = (char*)MALLOC(sizeof(char) * (piLen[i] + 1));// for null termination
 +      }
 +      sciErr = getMatrixOfString(_piKey, _piVar, &iRows, &iCols, piLen, pstData);
 +      if(sciErr.iErr)
 +      {
 +              printError(&sciErr, 0);
 +              return false;
 +      }
 +
 +      iRet = writeStringMatrix(_iH5File, _pstName, iRows, iCols, pstData);
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      char pstMsg[512];
 +      sprintf(pstMsg, "string (%d x %d)", iRows, iCols);
 +      print_type(pstMsg);
 +
 +      freeArrayOfString(pstData, iRows * iCols);
 +      return true;
  }
  
 -static bool export_u_function(int *_piVar, char* _pstName)
 +static bool export_u_function(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
 -static bool export_c_function(int *_piVar, char* _pstName)
 +static bool export_c_function(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
 -static bool export_lib(int *_piVar, char* _pstName)
 +static bool export_lib(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
 -static bool export_lufact_pointer(int *_piVar, char* _pstName)
 +static bool export_lufact_pointer(int* _piKey, int *_piVar, char* _pstName)
  {
-       print_type(_pstName);
-       return true;
+     print_type(_pstName);
+     return true;
  }
  
  void print_type(char* _pstType)
@@@ -41,996 -39,997 +41,996 @@@ static int iCloseList = 0
  
  void print_tree(char* _pstMsg);
  
 -static bool import_data(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_double(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_string(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_integer(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_sparse(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_boolean_sparse(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_poly(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 -static bool import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress, char* _pstVarname);
 -
 -int sci_import_from_hdf5(char *fname,unsigned long fname_len)
 +static bool import_data(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_double(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_string(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_boolean(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_integer(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_sparse(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_boolean_sparse(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_poly(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
 +static bool import_list(int* _piKey, int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress, char* _pstVarname);
 +
 +int sci_import_from_hdf5(char *fname, int* _piKey)
  {
-       CheckRhs(1,2);
-       CheckLhs(1,1);
-       int iRows                                               = 0;
-       int iCols                                               = 0;
-       int iLen                                                = 0;
-       int iType                                               = 0;
-       int* piAddr                                     = NULL;
-       char *pstVarName                = NULL;
-       bool bImport                            = false;
-       SciErr sciErr;
+     CheckRhs(1,2);
+     CheckLhs(1,1);
+     int iRows                                         = 0;
+     int iCols                                         = 0;
+     int iLen                                          = 0;
+     int iType                                         = 0;
+     int* piAddr                                       = NULL;
+     char *pstVarName          = NULL;
+     bool bImport                              = false;
+     SciErr sciErr;
  
  #ifndef _MSC_VER
-       forceJHDF5load();
+     forceJHDF5load();
  #endif
  
 -    iCloseList = 0;
 -    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    sciErr = getVarDimension(pvApiCtx, piAddr, &iRows, &iCols);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    if(iRows != 1 || iCols != 1)
 -    {
 -        Scierror(999,_("%s: Wrong size for input argument #%d: A string expected.\n"),fname,2);
 -    }
 -
 -    sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, &iLen, NULL);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    pstVarName = (char*)MALLOC((iLen + 1) * sizeof(char));
 -    sciErr = getMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, &iLen, &pstVarName);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    //open hdf5 file
 -    int iFile = openHDF5File(pstVarName);
 -
 -    if(iFile < 0)
 -    {
 -        Scierror(999, "Unable to open file: %s", pstVarName);
 -        return 0;
 -    }
 -
 -    int iNbItem = 0;
 -    iNbItem = getVariableNames(iFile, NULL);
 -    char** pstVarNameList = (char**)MALLOC(sizeof(char*) * iNbItem);
 -    iNbItem = getVariableNames(iFile, pstVarNameList);
 -
 -    //import all data
 -    for(int i = 0 ; i < iNbItem ; i++)
 -    {
 -        int iDataSetId = getDataSetIdFromName(iFile, pstVarNameList[i]);
 -        if(iDataSetId == 0)
 -        {
 -            return 0;
 -        }
 -
 -        bImport = import_data(iDataSetId, 0, NULL, pstVarNameList[i]);
 -        if(bImport == false)
 -        {
 -            break;
 -        }
 -
 -    }
 -
 -    //close the file
 -    closeHDF5File(iFile);
 -
 -    FREE(pstVarName);
 -
 -    int *piReturn = NULL;
 -    sciErr = allocMatrixOfBoolean(pvApiCtx, Rhs + 1, 1, 1, &piReturn);
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return 0;
 -    }
 -
 -    if(bImport == true)
 -    {
 -        piReturn[0] = 1;
 -    }
 -    else
 -    {
 -        piReturn[0] = 0;
 -    }
 -
 -    LhsVar(1) = Rhs + 1;
 -    PutLhsVar();
 -
 -    //        printf("End gateway !!!\n");
 -    return 0;
 +      iCloseList = 0;
 +      sciErr = getVarAddressFromPosition(_piKey, 1, &piAddr);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      sciErr = getVarDimension(_piKey, piAddr, &iRows, &iCols);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      if(iRows != 1 || iCols != 1)
 +      {
 +              Scierror(999,_("%s: Wrong size for input argument #%d: A string expected.\n"),fname,2);
 +      }
 +
 +      sciErr = getMatrixOfString(_piKey, piAddr, &iRows, &iCols, &iLen, NULL);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      pstVarName = (char*)MALLOC((iLen + 1) * sizeof(char));
 +      sciErr = getMatrixOfString(_piKey, piAddr, &iRows, &iCols, &iLen, &pstVarName);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      //open hdf5 file
 +      int iFile = openHDF5File(pstVarName);
 +      if(iFile < 0)
 +      {
 +              Scierror(999, "Unable to open file: %s", pstVarName);
 +              return 0;
 +      }
 +
 +      int iNbItem = 0;
 +      iNbItem = getVariableNames(iFile, NULL);
 +      char** pstVarNameList = (char**)MALLOC(sizeof(char*) * iNbItem);
 +      iNbItem = getVariableNames(iFile, pstVarNameList);
 +
 +      //import all data
 +      for(int i = 0 ; i < iNbItem ; i++)
 +      {
 +              int iDataSetId = getDataSetIdFromName(iFile, pstVarNameList[i]);
 +              if(iDataSetId == 0)
 +              {
 +                      return 0;
 +              }
 +
 +              bImport = import_data(_piKey, iDataSetId, 0, NULL, pstVarNameList[i]);
 +              if(bImport == false)
 +              {
 +                      break;
 +              }
 +
 +      }
 +
 +      //close the file
 +      closeHDF5File(iFile);
 +
 +      FREE(pstVarName);
 +
 +      int *piReturn = NULL;
 +      sciErr = allocMatrixOfBoolean(_piKey, Rhs + 1, 1, 1, &piReturn);
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return 0;
 +      }
 +
 +      if(bImport == true)
 +      {
 +              piReturn[0] = 1;
 +      }
 +      else
 +      {
 +              piReturn[0] = 0;
 +      }
 +
 +      LhsVar(1) = Rhs + 1;
 +      PutLhsVar();
 +
 +//    printf("End gateway !!!\n");
 +      return 0;
  }
  
 -static bool import_data(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_data(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    bool bRet = false;
 -    //get var type
 -    int iVarType = getScilabTypeFromDataSet(_iDatasetId);
 -    switch(iVarType)
 -    {
 -    case sci_matrix :
 -        {
 -            bRet = import_double(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_strings :
 -        {
 -            bRet = import_string(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_list :
 -    case sci_tlist :
 -    case sci_mlist :
 -        {
 -            bRet = import_list(_iDatasetId, iVarType, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_boolean :
 -        {
 -            bRet = import_boolean(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_poly :
 -        {
 -            bRet = import_poly(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_ints:
 -        {
 -            bRet = import_integer(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_sparse :
 -        {
 -            bRet = import_sparse(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    case sci_boolean_sparse :
 -        {
 -            bRet = import_boolean_sparse(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
 -            break;
 -        }
 -    default : 
 -        {
 +      bool bRet = false;
 +      //get var type
 +      int iVarType = getScilabTypeFromDataSet(_iDatasetId);
 +      switch(iVarType)
 +      {
 +      case sci_matrix :
 +              {
 +                      bRet = import_double(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_strings :
 +              {
 +                      bRet = import_string(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_list :
 +      case sci_tlist :
 +      case sci_mlist :
 +              {
 +                      bRet = import_list(_piKey, _iDatasetId, iVarType, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_boolean :
 +              {
 +                      bRet = import_boolean(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_poly :
 +              {
 +                      bRet = import_poly(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_ints:
 +              {
 +                      bRet = import_integer(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_sparse :
 +              {
 +                      bRet = import_sparse(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      case sci_boolean_sparse :
 +              {
 +                      bRet = import_boolean_sparse(_piKey, _iDatasetId, _iItemPos, _piAddress, _pstVarname);
 +                      break;
 +              }
 +      default : 
 +              {
  #ifdef PRINT_DEBUG
-                       char pstMsg[512];
-                       sprintf(pstMsg, "Unknown type : %d", iVarType);
-                       print_tree(pstMsg);
+             char pstMsg[512];
+             sprintf(pstMsg, "Unknown type : %d", iVarType);
+             print_tree(pstMsg);
  #endif
-               }
-       }
+         }
+     }
  
-       return bRet;
+     return bRet;
  }
  
 -static bool import_double(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_double(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
-       int iRet                                                = 0;
-       double *pdblReal                = NULL;
-       double *pdblImg                 = NULL;
-       int     iRows                                           = 0;
-       int iCols                                               = 0;
-       int iComplex                            = 0;
-       SciErr sciErr;
+     int iRet                                          = 0;
+     double *pdblReal          = NULL;
+     double *pdblImg                   = NULL;
+     int       iRows                                           = 0;
+     int iCols                                         = 0;
+     int iComplex                              = 0;
+     SciErr sciErr;
  
  #ifdef TIME_DEBUG
-       LARGE_INTEGER iStart, iEnd, iFreq;
-       QueryPerformanceFrequency(&iFreq);
-       QueryPerformanceCounter(&iStart);
+     LARGE_INTEGER iStart, iEnd, iFreq;
+     QueryPerformanceFrequency(&iFreq);
+     QueryPerformanceCounter(&iStart);
  #endif
  
 -    iRet                              = getDatasetDims(_iDatasetId, &iRows, &iCols);
 -    iComplex          = isComplexData(_iDatasetId);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    if(iRows * iCols != 0)
 -    {
 -        if(iComplex)
 -        {
 -            pdblReal  = (double *) MALLOC(iRows * iCols * sizeof(double));
 -            pdblImg           = (double *) MALLOC(iRows * iCols * sizeof(double));
 -            iRet                      = readDoubleComplexMatrix(_iDatasetId, iRows, iCols, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            pdblReal  = (double *) MALLOC(iRows * iCols * sizeof(double));
 -            iRet                      = readDoubleMatrix(_iDatasetId, iRows, iCols, pdblReal);
 -        }
 -        if(iRet)
 -        {
 -            return false;
 -        }
 -    }
 -
 -    if(_piAddress == NULL)
 -    {
 -        if(iComplex)
 -        {
 -            sciErr            = createNamedComplexMatrixOfDouble(pvApiCtx, _pstVarname, iRows, iCols, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr            = createNamedMatrixOfDouble(pvApiCtx, _pstVarname, iRows, iCols, pdblReal);
 -        }
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        if(iComplex)
 -        {
 -            sciErr            = createComplexMatrixOfDoubleInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr            = createMatrixOfDoubleInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pdblReal);
 -        }
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      iRet                            = getDatasetDims(_iDatasetId, &iRows, &iCols);
 +      iComplex                = isComplexData(_iDatasetId);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      if(iRows * iCols != 0)
 +      {
 +              if(iComplex)
 +              {
 +                      pdblReal        = (double *) MALLOC(iRows * iCols * sizeof(double));
 +                      pdblImg         = (double *) MALLOC(iRows * iCols * sizeof(double));
 +                      iRet                    = readDoubleComplexMatrix(_iDatasetId, iRows, iCols, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      pdblReal        = (double *) MALLOC(iRows * iCols * sizeof(double));
 +                      iRet                    = readDoubleMatrix(_iDatasetId, iRows, iCols, pdblReal);
 +              }
 +              if(iRet)
 +              {
 +                      return false;
 +              }
 +      }
 +
 +      if(_piAddress == NULL)
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr          = createNamedComplexMatrixOfDouble(_piKey, _pstVarname, iRows, iCols, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr          = createNamedMatrixOfDouble(_piKey, _pstVarname, iRows, iCols, pdblReal);
 +              }
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr          = createComplexMatrixOfDoubleInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr          = createMatrixOfDoubleInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pdblReal);
 +              }
 +      }
 +
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
  
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "double_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "double_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
  
-       if(pdblReal)
-       {
-               FREE(pdblReal);
-       }
+     if(pdblReal)
+     {
+         FREE(pdblReal);
+     }
  
-       if(pdblImg)
-       {
-               FREE(pdblImg);
-       }
+     if(pdblImg)
+     {
+         FREE(pdblImg);
+     }
  
-       if(iRet)
-       {
-               return false;
-       }
+     if(iRet)
+     {
+         return false;
+     }
  
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iEnd);
-       double dblTime  =((iEnd.QuadPart - iStart.QuadPart) * 1000.0) / iFreq.QuadPart;
-       printf("Total Double : %0.3f ms\n\n", dblTime);
+     QueryPerformanceCounter(&iEnd);
+     double dblTime    =((iEnd.QuadPart - iStart.QuadPart) * 1000.0) / iFreq.QuadPart;
+     printf("Total Double : %0.3f ms\n\n", dblTime);
  #endif
  
-       return true;
+     return true;
  }
  
 -static bool import_string(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_string(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
-       int iRet                                                = 0;
-       int i                                                           = 0;
-       int     iRows                                           = 0;
-       int iCols                                               = 0;
-       char **pstData                  = NULL;
-       SciErr sciErr;
+     int iRet                                          = 0;
+     int i                                                             = 0;
+     int       iRows                                           = 0;
+     int iCols                                         = 0;
+     char **pstData                    = NULL;
+     SciErr sciErr;
  
  #ifdef TIME_DEBUG
-       LARGE_INTEGER iStart1, iEnd1, iStart2, iEnd2, iStart3, iEnd3, iFreq;
+     LARGE_INTEGER iStart1, iEnd1, iStart2, iEnd2, iStart3, iEnd3, iFreq;
  
-       QueryPerformanceFrequency(&iFreq);
-       QueryPerformanceCounter(&iStart1);
+     QueryPerformanceFrequency(&iFreq);
+     QueryPerformanceCounter(&iStart1);
  #endif
-       iRet = getDatasetDims(_iDatasetId, &iRows, &iCols);
-       if(iRet)
-       {
-               return false;
-       }
+     iRet = getDatasetDims(_iDatasetId, &iRows, &iCols);
+     if(iRet)
+     {
+         return false;
+     }
  
  
-       pstData = (char **) MALLOC(iRows * iCols * sizeof(char*));
+     pstData = (char **) MALLOC(iRows * iCols * sizeof(char*));
  
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iStart1);
+     QueryPerformanceCounter(&iStart1);
  #endif
  
-       iRet = readStringMatrix(_iDatasetId, iRows, iCols, pstData);
-       if(iRet)
-       {
-               return false;
-       }
+     iRet = readStringMatrix(_iDatasetId, iRows, iCols, pstData);
+     if(iRet)
+     {
+         return false;
+     }
  
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iEnd1);
+     QueryPerformanceCounter(&iEnd1);
  #endif
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iStart2);
+     QueryPerformanceCounter(&iStart2);
  #endif
  
 -    if(_piAddress == NULL)
 -    {
 -        sciErr = createNamedMatrixOfString(pvApiCtx, _pstVarname, iRows, iCols, pstData);
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        sciErr = createMatrixOfStringInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pstData);
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      if(_piAddress == NULL)
 +      {
 +              sciErr = createNamedMatrixOfString(_piKey, _pstVarname, iRows, iCols, pstData);
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              sciErr = createMatrixOfStringInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pstData);
 +      }
 +
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
  
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iEnd2);
-       QueryPerformanceCounter(&iStart3);
+     QueryPerformanceCounter(&iEnd2);
+     QueryPerformanceCounter(&iStart3);
  #endif
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "string_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "string_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
-       for(i = 0 ; i < iRows * iCols ; i++)
-       {
-               FREE(pstData[i]);
-       }
-       FREE(pstData);
+     for(i = 0 ; i < iRows * iCols ; i++)
+     {
+         FREE(pstData[i]);
+     }
+     FREE(pstData);
  
-       if(iRet)
-       {
-               return false;
-       }
+     if(iRet)
+     {
+         return false;
+     }
  
  #ifdef TIME_DEBUG
-       QueryPerformanceCounter(&iEnd3);
-       //double dblTime        =((iEnd1.QuadPart - iStart1.QuadPart) * 1000.0) / iFreq.QuadPart;
-       //printf("HDF5 : %0.3f ms\n", dblTime);
-       //dblTime       =((iEnd2.QuadPart - iStart2.QuadPart) * 1000.0) / iFreq.QuadPart;
-       //printf("Stack : %0.3f ms\n", dblTime);
-       //dblTime       =((iEnd3.QuadPart - iStart3.QuadPart) * 1000.0) / iFreq.QuadPart;
-       //printf("Clear : %0.3f ms\n", dblTime);
-       double dblTime  =((iEnd3.QuadPart - iStart1.QuadPart) * 1000.0) / iFreq.QuadPart;
-       printf("Total String: %0.3f ms\n\n", dblTime);
+     QueryPerformanceCounter(&iEnd3);
+     //double dblTime  =((iEnd1.QuadPart - iStart1.QuadPart) * 1000.0) / iFreq.QuadPart;
+     //printf("HDF5 : %0.3f ms\n", dblTime);
+     //dblTime =((iEnd2.QuadPart - iStart2.QuadPart) * 1000.0) / iFreq.QuadPart;
+     //printf("Stack : %0.3f ms\n", dblTime);
+     //dblTime =((iEnd3.QuadPart - iStart3.QuadPart) * 1000.0) / iFreq.QuadPart;
+     //printf("Clear : %0.3f ms\n", dblTime);
+     double dblTime    =((iEnd3.QuadPart - iStart1.QuadPart) * 1000.0) / iFreq.QuadPart;
+     printf("Total String: %0.3f ms\n\n", dblTime);
  #endif
-       return true;
+     return true;
  }
  
 -static bool import_integer(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_integer(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    int iRet                                          = 0;
 -    int       iRows                                           = 0;
 -    int iCols                                         = 0;
 -    int iPrec                                         = 0;
 -    SciErr sciErr;
 -
 -    iRet = getDatasetDims(_iDatasetId, &iRows, &iCols);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    iRet                                                              = getDatasetPrecision(_iDatasetId, &iPrec);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    switch(iPrec)
 -    {
 -    case SCI_INT8 : 
 -        {
 -            char* pcData      = NULL;
 -            pcData = (char*)MALLOC(sizeof(char) * iRows * iCols);
 -            iRet = readInterger8Matrix(_iDatasetId, iRows, iCols, pcData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfInteger8(pvApiCtx, _pstVarname, iRows, iCols, pcData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfInteger8InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pcData);
 -            }
 -        }
 -        break;
 -    case SCI_UINT8 : 
 -        {
 -            unsigned char* pucData    = NULL;
 -            pucData = (unsigned char*)MALLOC(sizeof(unsigned char) * iRows * iCols);
 -            iRet = readUnsignedInterger8Matrix(_iDatasetId, iRows, iCols, pucData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfUnsignedInteger8(pvApiCtx, _pstVarname, iRows, iCols, pucData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfUnsignedInteger8InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pucData);
 -            }
 -        }
 -        break;
 -    case SCI_INT16 : 
 -        {
 -            short* psData     = NULL;
 -            psData = (short*)MALLOC(sizeof(short) * iRows * iCols);
 -            iRet = readInterger16Matrix(_iDatasetId, iRows, iCols, psData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfInteger16(pvApiCtx, _pstVarname, iRows, iCols, psData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfInteger16InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, psData);
 -            }
 -        }
 -        break;
 -    case SCI_UINT16 : 
 -        {
 -            unsigned short* pusData   = NULL;
 -            pusData = (unsigned short*)MALLOC(sizeof(unsigned short) * iRows * iCols);
 -            iRet = readUnsignedInterger16Matrix(_iDatasetId, iRows, iCols, pusData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfUnsignedInteger16(pvApiCtx, _pstVarname, iRows, iCols, pusData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfUnsignedInteger16InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pusData);
 -            }
 -        }
 -        break;
 -    case SCI_INT32 : 
 -        {
 -            int* piData       = NULL;
 -            piData = (int*)MALLOC(sizeof(int) * iRows * iCols);
 -            iRet = readInterger32Matrix(_iDatasetId, iRows, iCols, piData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfInteger32(pvApiCtx, _pstVarname, iRows, iCols, piData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfInteger32InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, piData);
 -            }
 -        }
 -        break;
 -    case SCI_UINT32 : 
 -        {
 -            unsigned int* puiData     = NULL;
 -            puiData = (unsigned int*)MALLOC(sizeof(unsigned int) * iRows * iCols);
 -            iRet = readUnsignedInterger32Matrix(_iDatasetId, iRows, iCols, puiData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfUnsignedInteger32(pvApiCtx, _pstVarname, iRows, iCols, puiData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfUnsignedInteger32InNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, puiData);
 -            }
 -        }
 -        break;
 -    case SCI_INT64 : 
 -        {
 +      int iRet                                                = 0;
 +      int     iRows                                           = 0;
 +      int iCols                                               = 0;
 +      int iPrec                                               = 0;
 +      SciErr sciErr;
 +
 +      iRet = getDatasetDims(_iDatasetId, &iRows, &iCols);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      iRet                                                            = getDatasetPrecision(_iDatasetId, &iPrec);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      switch(iPrec)
 +      {
 +      case SCI_INT8 : 
 +              {
 +                      char* pcData    = NULL;
 +                      pcData = (char*)MALLOC(sizeof(char) * iRows * iCols);
 +                      iRet = readInterger8Matrix(_iDatasetId, iRows, iCols, pcData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfInteger8(_piKey, _pstVarname, iRows, iCols, pcData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfInteger8InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pcData);
 +                      }
 +              }
 +              break;
 +      case SCI_UINT8 : 
 +              {
 +                      unsigned char* pucData  = NULL;
 +                      pucData = (unsigned char*)MALLOC(sizeof(unsigned char) * iRows * iCols);
 +                      iRet = readUnsignedInterger8Matrix(_iDatasetId, iRows, iCols, pucData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfUnsignedInteger8(_piKey, _pstVarname, iRows, iCols, pucData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfUnsignedInteger8InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pucData);
 +                      }
 +              }
 +              break;
 +      case SCI_INT16 : 
 +              {
 +                      short* psData   = NULL;
 +                      psData = (short*)MALLOC(sizeof(short) * iRows * iCols);
 +                      iRet = readInterger16Matrix(_iDatasetId, iRows, iCols, psData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfInteger16(_piKey, _pstVarname, iRows, iCols, psData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfInteger16InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, psData);
 +                      }
 +              }
 +              break;
 +      case SCI_UINT16 : 
 +              {
 +                      unsigned short* pusData = NULL;
 +                      pusData = (unsigned short*)MALLOC(sizeof(unsigned short) * iRows * iCols);
 +                      iRet = readUnsignedInterger16Matrix(_iDatasetId, iRows, iCols, pusData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfUnsignedInteger16(_piKey, _pstVarname, iRows, iCols, pusData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfUnsignedInteger16InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pusData);
 +                      }
 +              }
 +              break;
 +      case SCI_INT32 : 
 +              {
 +                      int* piData     = NULL;
 +                      piData = (int*)MALLOC(sizeof(int) * iRows * iCols);
 +                      iRet = readInterger32Matrix(_iDatasetId, iRows, iCols, piData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfInteger32(_piKey, _pstVarname, iRows, iCols, piData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfInteger32InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, piData);
 +                      }
 +              }
 +              break;
 +      case SCI_UINT32 : 
 +              {
 +                      unsigned int* puiData   = NULL;
 +                      puiData = (unsigned int*)MALLOC(sizeof(unsigned int) * iRows * iCols);
 +                      iRet = readUnsignedInterger32Matrix(_iDatasetId, iRows, iCols, puiData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfUnsignedInteger32(_piKey, _pstVarname, iRows, iCols, puiData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfUnsignedInteger32InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, puiData);
 +                      }
 +              }
 +              break;
 +      case SCI_INT64 : 
 +              {
  #ifdef __SCILAB_INT64__
 -            long long* pllData        = NULL;
 -            pllData = (long long*)MALLOC(sizeof(long long) * iRows * iCols);
 -            iRet = readInterger64Matrix(_iDatasetId, iRows, iCols, pllData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfInteger64( _pstVarname, iRows, iCols, pllData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfInteger64InNamedList(_pstVarname, _piAddress, _iItemPos, iRows, iCols, pllData);
 -            }
 +                      long long* pllData      = NULL;
 +                      pllData = (long long*)MALLOC(sizeof(long long) * iRows * iCols);
 +                      iRet = readInterger64Matrix(_iDatasetId, iRows, iCols, pllData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfInteger64(_piKey, _pstVarname, iRows, iCols, pllData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfInteger64InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pllData);
 +                      }
  #else
-                       return false;
+             return false;
  #endif
-               }
-               break;
-       case SCI_UINT64 : 
-               {
+         }
+         break;
+     case SCI_UINT64 : 
+         {
  #ifdef __SCILAB_INT64__
 -            unsigned long long* pullData      = NULL;
 -            pullData = (unsigned long long*)MALLOC(sizeof(unsigned long long) * iRows * iCols);
 -            iRet = readUnsignedInterger64Matrix(_iDatasetId, iRows, iCols, pullData);
 -            if(iRet)
 -            {
 -                return false;
 -            }
 -
 -            if(_piAddress == NULL)
 -            {
 -                sciErr = createNamedMatrixOfUnsignedInteger64( _pstVarname, iRows, iCols, pullData);
 -            }
 -            else
 -            {
 -                sciErr = createMatrixOfUnsignedInteger64InNamedList(_pstVarname, _piAddress, _iItemPos, iRows, iCols, pullData);
 -            }
 +                      unsigned long long* pullData    = NULL;
 +                      pullData = (unsigned long long*)MALLOC(sizeof(unsigned long long) * iRows * iCols);
 +                      iRet = readUnsignedInterger64Matrix(_iDatasetId, iRows, iCols, pullData);
 +                      if(iRet)
 +                      {
 +                              return false;
 +                      }
 +
 +                      if(_piAddress == NULL)
 +                      {
 +                              sciErr = createNamedMatrixOfUnsignedInteger64(_piKey, _pstVarname, iRows, iCols, pullData);
 +                      }
 +                      else
 +                      {
 +                              sciErr = createMatrixOfUnsignedInteger64InNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, pullData);
 +                      }
  #else
-                       return false;
+             return false;
  #endif
-               }
-               break;
-       default :
-               return false;
-       }
+         }
+         break;
+     default :
+         return false;
+     }
  
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "integer_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "integer_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
  
-       if(sciErr.iErr)
-       {
-                       printError(&sciErr, 0);
-                       return false;
-       }
+     if(sciErr.iErr)
+     {
+         printError(&sciErr, 0);
+         return false;
+     }
  
-       return true;
+     return true;
  }
  
 -static bool import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_boolean(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    int iRet                                          = 0;
 -    int* piData                                       = NULL;
 -    int       iRows                                           = 0;
 -    int iCols                                         = 0;
 -    SciErr sciErr;
 -
 -    iRet                              = getDatasetDims(_iDatasetId, &iRows, &iCols);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    if(iRows * iCols != 0)
 -    {
 -        piData                = (int *) MALLOC(iRows * iCols * sizeof(int));
 -        iRet                  = readBooleanMatrix(_iDatasetId, iRows, iCols, piData);
 -        if(iRet)
 -        {
 -            return false;
 -        }
 -    }
 -
 -    if(_piAddress == NULL)
 -    {
 -        sciErr = createNamedMatrixOfBoolean(pvApiCtx, _pstVarname, iRows, iCols, piData);
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        sciErr = createMatrixOfBooleanInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, piData);
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      int iRet                                                = 0;
 +      int* piData                                     = NULL;
 +      int     iRows                                           = 0;
 +      int iCols                                               = 0;
 +      SciErr sciErr;
 +
 +      iRet                            = getDatasetDims(_iDatasetId, &iRows, &iCols);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      if(iRows * iCols != 0)
 +      {
 +              piData          = (int *) MALLOC(iRows * iCols * sizeof(int));
 +              iRet                    = readBooleanMatrix(_iDatasetId, iRows, iCols, piData);
 +              if(iRet)
 +              {
 +                      return false;
 +              }
 +      }
 +
 +      if(_piAddress == NULL)
 +      {
 +              sciErr = createNamedMatrixOfBoolean(_piKey, _pstVarname, iRows, iCols, piData);
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              sciErr = createMatrixOfBooleanInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, piData);
 +      }
 +
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
  
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "boolean_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "boolean_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
  
-       if(piData)
-       {
-               FREE(piData);
-       }
+     if(piData)
+     {
+         FREE(piData);
+     }
  
-       if(iRet)
-       {
-               return false;
-       }
+     if(iRet)
+     {
+         return false;
+     }
  
-       return true;
+     return true;
  }
  
 -static bool import_poly(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_poly(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    int iRet                                          = 0;
 -    int i                                                             = 0;
 -    int       iRows                                           = 0;
 -    int iCols                                         = 0;
 -    int iComplex                              = 0;
 -    char pstVarName[64]       = {0};
 -    double **pdblReal         = NULL;
 -    double **pdblImg          = NULL;
 -    int *piNbCoef                             = NULL;
 -    SciErr sciErr;
 -
 -    iRet                              = getDatasetDims(_iDatasetId, &iRows, &iCols);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    iComplex          = isComplexData(_iDatasetId);
 -
 -
 -    if(iComplex)
 -    {
 -        piNbCoef              = (int*)MALLOC(iRows * iCols * sizeof(int));
 -        pdblReal              = (double**)MALLOC(iRows * iCols * sizeof(double*));
 -        pdblImg                       = (double**)MALLOC(iRows * iCols * sizeof(double*));
 -        iRet                          = readPolyComplexMatrix(_iDatasetId, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 -    }
 -    else
 -    {
 -        piNbCoef              = (int*)MALLOC(iRows * iCols * sizeof(int));
 -        pdblReal              = (double**)MALLOC(iRows * iCols * sizeof(double*));
 -        iRet                          = readPolyMatrix(_iDatasetId, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    if(_piAddress == NULL)
 -    {
 -        if(iComplex)
 -        {
 -            sciErr = createNamedComplexMatrixOfPoly(pvApiCtx, _pstVarname, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr = createNamedMatrixOfPoly(pvApiCtx, _pstVarname, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 -        }
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        if(iComplex)
 -        {
 -            sciErr = createComplexMatrixOfPolyInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr = createMatrixOfPolyInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 -        }
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      int iRet                                                = 0;
 +      int i                                                           = 0;
 +      int     iRows                                           = 0;
 +      int iCols                                               = 0;
 +      int iComplex                            = 0;
 +      char pstVarName[64]     = {0};
 +      double **pdblReal               = NULL;
 +      double **pdblImg                = NULL;
 +      int *piNbCoef                           = NULL;
 +      SciErr sciErr;
 +
 +      iRet                            = getDatasetDims(_iDatasetId, &iRows, &iCols);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      iComplex                = isComplexData(_iDatasetId);
 +
 +
 +      if(iComplex)
 +      {
 +              piNbCoef                = (int*)MALLOC(iRows * iCols * sizeof(int));
 +              pdblReal                = (double**)MALLOC(iRows * iCols * sizeof(double*));
 +              pdblImg                 = (double**)MALLOC(iRows * iCols * sizeof(double*));
 +              iRet                            = readPolyComplexMatrix(_iDatasetId, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 +      }
 +      else
 +      {
 +              piNbCoef                = (int*)MALLOC(iRows * iCols * sizeof(int));
 +              pdblReal                = (double**)MALLOC(iRows * iCols * sizeof(double*));
 +              iRet                            = readPolyMatrix(_iDatasetId, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      if(_piAddress == NULL)
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr = createNamedComplexMatrixOfPoly(_piKey, _pstVarname, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr = createNamedMatrixOfPoly(_piKey, _pstVarname, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 +              }
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr = createComplexMatrixOfPolyInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr = createMatrixOfPolyInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal);
 +              }
 +      }
 +
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
  
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "poly_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "poly_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
  
-       for(i = 0 ; i < iRows * iCols ; i++)
-       {
-               FREE(pdblReal[i]);
-       }
-       FREE(pdblReal);
-       FREE(piNbCoef);
+     for(i = 0 ; i < iRows * iCols ; i++)
+     {
+         FREE(pdblReal[i]);
+     }
+     FREE(pdblReal);
+     FREE(piNbCoef);
  
-       if(iRet)
-       {
-               return false;
-       }
+     if(iRet)
+     {
+         return false;
+     }
  
-       return true;
+     return true;
  }
  
 -static bool import_sparse(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_sparse(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    int iRet                                          = 0;
 -    int i                                                             = 0;
 -    int       iRows                                           = 0;
 -    int iCols                                         = 0;
 -    int iComplex                              = 0;
 -    double *pdblReal          = NULL;
 -    double *pdblImg                   = NULL;
 -    int iNbItem                                       = 0;
 -    int* piNbItemRow          = NULL;
 -    int* piColPos                             = NULL;
 -    SciErr sciErr;
 -
 -    iRet                                                              = getSparseDimension(_iDatasetId, &iRows, &iCols, &iNbItem);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    iComplex                                          = isComplexData(_iDatasetId);
 -
 -
 -    if(iComplex)
 -    {
 -        piNbItemRow                           = (int*)MALLOC(iRows * sizeof(int));
 -        piColPos                                      = (int*)MALLOC(iNbItem * sizeof(int));
 -        pdblReal                                      = (double*)MALLOC(iNbItem * sizeof(double));
 -        pdblImg                                               = (double*)MALLOC(iNbItem * sizeof(double));
 -        iRet                                                  = readSparseComplexMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 -    }
 -    else
 -    {
 -        piNbItemRow                           = (int*)MALLOC(iRows * sizeof(int));
 -        piColPos                                      = (int*)MALLOC(iNbItem * sizeof(int));
 -        pdblReal                                      = (double*)MALLOC(iNbItem * sizeof(double));
 -        iRet                                                  = readSparseMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 -    }
 -
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    if(_piAddress == NULL)
 -    {
 -        if(iComplex)
 -        {
 -            sciErr = createNamedComplexSparseMatrix(pvApiCtx, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr = createNamedSparseMatrix(pvApiCtx, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 -        }
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        if(iComplex)
 -        {
 -            sciErr = createComplexSparseMatrixInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 -        }
 -        else
 -        {
 -            sciErr = createSparseMatrixInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 -        }
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      int iRet                                                = 0;
 +      int i                                                           = 0;
 +      int     iRows                                           = 0;
 +      int iCols                                               = 0;
 +      int iComplex                            = 0;
 +      double *pdblReal                = NULL;
 +      double *pdblImg                 = NULL;
 +      int iNbItem                                     = 0;
 +      int* piNbItemRow                = NULL;
 +      int* piColPos                           = NULL;
 +      SciErr sciErr;
 +
 +      iRet                                                            = getSparseDimension(_iDatasetId, &iRows, &iCols, &iNbItem);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      iComplex                                                = isComplexData(_iDatasetId);
 +
 +
 +      if(iComplex)
 +      {
 +              piNbItemRow                             = (int*)MALLOC(iRows * sizeof(int));
 +              piColPos                                        = (int*)MALLOC(iNbItem * sizeof(int));
 +              pdblReal                                        = (double*)MALLOC(iNbItem * sizeof(double));
 +              pdblImg                                         = (double*)MALLOC(iNbItem * sizeof(double));
 +              iRet                                                    = readSparseComplexMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 +      }
 +      else
 +      {
 +              piNbItemRow                             = (int*)MALLOC(iRows * sizeof(int));
 +              piColPos                                        = (int*)MALLOC(iNbItem * sizeof(int));
 +              pdblReal                                        = (double*)MALLOC(iNbItem * sizeof(double));
 +              iRet                                                    = readSparseMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 +      }
 +
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      if(_piAddress == NULL)
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr = createNamedComplexSparseMatrix(_piKey, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr = createNamedSparseMatrix(_piKey, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 +              }
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              if(iComplex)
 +              {
 +                      sciErr = createComplexSparseMatrixInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal, pdblImg);
 +              }
 +              else
 +              {
 +                      sciErr = createSparseMatrixInNamedList(_piKey, _pstVarname, _piAddress, _iItemPos, iRows, iCols, iNbItem, piNbItemRow, piColPos, pdblReal);
 +              }
 +      }
 +
 +      if(sciErr.iErr)
 +      {
 +                      printError(&sciErr, 0);
 +                      return false;
 +      }
  
  #ifdef PRINT_DEBUG
-       char pstMsg[512];
-       sprintf(pstMsg, "sparse_%d (%d x %d)", _iItemPos, iRows, iCols);
-       print_tree(pstMsg);
+     char pstMsg[512];
+     sprintf(pstMsg, "sparse_%d (%d x %d)", _iItemPos, iRows, iCols);
+     print_tree(pstMsg);
  #endif
  
-       FREE(piNbItemRow);
-       FREE(piColPos);
-       FREE(pdblReal);
-       if(iComplex)
-       {
-               FREE(pdblImg);
-       }
+     FREE(piNbItemRow);
+     FREE(piColPos);
+     FREE(pdblReal);
+     if(iComplex)
+     {
+         FREE(pdblImg);
+     }
  
  
-       if(iRet)
-       {
-               return false;
-       }
+     if(iRet)
+     {
+         return false;
+     }
  
-       return true;
+     return true;
  }
  
 -static bool import_boolean_sparse(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 +static bool import_boolean_sparse(int* _piKey, int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
  {
 -    int iRet                                          = 0;
 -    int i                                                             = 0;
 -    int       iRows                                           = 0;
 -    int iCols                                         = 0;
 -    int iNbItem                                       = 0;
 -    int* piNbItemRow          = NULL;
 -    int* piColPos                             = NULL;
 -    SciErr sciErr;
 -
 -    iRet                                                              = getSparseDimension(_iDatasetId, &iRows, &iCols, &iNbItem);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -
 -    piNbItemRow                               = (int*)MALLOC(iRows * sizeof(int));
 -    piColPos                                  = (int*)MALLOC(iNbItem * sizeof(int));
 -    iRet                                                      = readBooleanSparseMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 -    if(iRet)
 -    {
 -        return false;
 -    }
 -
 -    if(_piAddress == NULL)
 -    {
 -        sciErr                                        = createNamedBooleanSparseMatrix(pvApiCtx, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 -    }
 -    else //if not null this variable is in a list
 -    {
 -        sciErr                                        = createBooleanSparseMatrixInNamedList(pvApiCtx, _pstVarname, _piAddress, _iItemPos, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 -    }
 -
 -    if(sciErr.iErr)
 -    {
 -        printError(&sciErr, 0);
 -        return false;
 -    }
 +      int iRet                                                = 0;
 +      int i                                                           = 0;
 +      int     iRows                                           = 0;
 +      int iCols                                               = 0;
 +      int iNbItem                                     = 0;
 +      int* piNbItemRow                = NULL;
 +      int* piColPos                           = NULL;
 +      SciErr sciErr;
 +
 +      iRet                                                            = getSparseDimension(_iDatasetId, &iRows, &iCols, &iNbItem);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +
 +      piNbItemRow                             = (int*)MALLOC(iRows * sizeof(int));
 +      piColPos                                        = (int*)MALLOC(iNbItem * sizeof(int));
 +      iRet                                                    = readBooleanSparseMatrix(_iDatasetId, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 +      if(iRet)
 +      {
 +              return false;
 +      }
 +
 +      if(_piAddress == NULL)
 +      {
 +              sciErr                                  = createNamedBooleanSparseMatrix(_piKey, _pstVarname, iRows, iCols, iNbItem, piNbItemRow, piColPos);
 +      }
 +      else //if not null this variable is in a list
 +      {
 +              sciErr                &n