Merge commit 'origin/master' into atoms
Pierre MARECHAL [Fri, 26 Jun 2009 14:22:45 +0000 (16:22 +0200)]
72 files changed:
scilab/CHANGES_5.1.X
scilab/CHANGES_5.2.X
scilab/configure
scilab/configure.ac
scilab/contrib/toolbox_skeleton/sci_gateway/c/sci_csub.c
scilab/contrib/toolbox_skeleton/sci_gateway/c/sci_csum.c
scilab/contrib/toolbox_skeleton/sci_gateway/cpp/sci_cpp_find.cxx
scilab/contrib/toolbox_skeleton/sci_gateway/fortran/sci_fsum.c
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/includes/api_boolean.h [moved from scilab/modules/core/includes/boolean_api.h with 100% similarity]
scilab/modules/core/includes/api_boolean_sparse.h [moved from scilab/modules/core/includes/boolean_sparse_api.h with 100% similarity]
scilab/modules/core/includes/api_common.h [moved from scilab/modules/core/includes/common_api.h with 84% similarity]
scilab/modules/core/includes/api_double.h [moved from scilab/modules/core/includes/double_api.h with 100% similarity]
scilab/modules/core/includes/api_int.h [moved from scilab/modules/core/includes/int_api.h with 88% similarity]
scilab/modules/core/includes/api_list.h [moved from scilab/modules/core/includes/list_api.h with 64% similarity]
scilab/modules/core/includes/api_poly.h [moved from scilab/modules/core/includes/poly_api.h with 95% similarity]
scilab/modules/core/includes/api_sparse.h [moved from scilab/modules/core/includes/sparse_api.h with 100% similarity]
scilab/modules/core/includes/api_string.h [moved from scilab/modules/core/includes/string_api.h with 100% similarity]
scilab/modules/core/includes/api_variable.h [moved from scilab/modules/core/includes/variable_api.h with 69% similarity]
scilab/modules/core/sci_gateway/c/sci_funcprot.c
scilab/modules/core/sci_gateway/c/sci_typename.c
scilab/modules/core/sci_gateway/c/sci_what.c
scilab/modules/core/src/c/api_boolean.c [moved from scilab/modules/core/src/c/boolean_api.c with 82% similarity]
scilab/modules/core/src/c/api_boolean_sparse.c [moved from scilab/modules/core/src/c/boolean_sparse_api.c with 94% similarity]
scilab/modules/core/src/c/api_common.c [moved from scilab/modules/core/src/c/common_api.c with 78% similarity]
scilab/modules/core/src/c/api_double.c [moved from scilab/modules/core/src/c/double_api.c with 96% similarity]
scilab/modules/core/src/c/api_int.c [moved from scilab/modules/core/src/c/int_api.c with 84% similarity]
scilab/modules/core/src/c/api_internal_boolean.h [moved from scilab/modules/core/src/c/internal_boolean_api.h with 100% similarity]
scilab/modules/core/src/c/api_internal_common.h [moved from scilab/modules/core/src/c/internal_common_api.h with 89% similarity]
scilab/modules/core/src/c/api_internal_double.h [moved from scilab/modules/core/src/c/internal_double_api.h with 100% similarity]
scilab/modules/core/src/c/api_internal_poly.h [new file with mode: 0644]
scilab/modules/core/src/c/api_internal_string.h [moved from scilab/modules/core/src/c/internal_string_api.h with 100% similarity]
scilab/modules/core/src/c/api_list.c [moved from scilab/modules/core/src/c/list_api.c with 66% similarity]
scilab/modules/core/src/c/api_poly.c [moved from scilab/modules/core/src/c/poly_api.c with 68% similarity]
scilab/modules/core/src/c/api_sparse.c [moved from scilab/modules/core/src/c/sparse_api.c with 94% similarity]
scilab/modules/core/src/c/api_string.c [moved from scilab/modules/core/src/c/string_api.c with 85% similarity]
scilab/modules/core/src/c/core.vcproj
scilab/modules/core/src/c/hashtable_core.c
scilab/modules/core/src/c/hashtable_core.h
scilab/modules/core/tests/nonreg_tests/bug_4611.dia.ref [new file with mode: 0644]
scilab/modules/core/tests/nonreg_tests/bug_4611.tst [new file with mode: 0644]
scilab/modules/core/tests/unit_tests/api_double.dia.ref
scilab/modules/core/tests/unit_tests/api_double.tst
scilab/modules/core/tests/unit_tests/api_double_test_hardcoded_matrix.c [new file with mode: 0644]
scilab/modules/core/tests/unit_tests/api_double_test_matrix.c
scilab/modules/core/tests/unit_tests/api_double_test_scalar.c
scilab/modules/core/tests/unit_tests/resume.dia.ref
scilab/modules/core/tests/unit_tests/resume.tst
scilab/modules/development_tools/macros/tbx_build_loader.sci
scilab/modules/fileio/LibScilab_Import.def
scilab/modules/fileio/includes/h5_attributeConstants.h
scilab/modules/fileio/includes/h5_readDataFromFile.h
scilab/modules/fileio/includes/h5_writeDataToFile.h
scilab/modules/fileio/sci_gateway/cpp/sci_export_to_hdf5.cpp
scilab/modules/fileio/sci_gateway/cpp/sci_import_from_hdf5.cpp
scilab/modules/fileio/src/c/h5_readDataFromFile.c
scilab/modules/fileio/src/c/h5_writeDataToFile.c
scilab/modules/functions/sci_gateway/c/sci_lib.c
scilab/modules/functions/src/c/LibScilab_Import.def
scilab/modules/gui/license.txt
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/ExportOptionWindow.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/FileMask.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/SwingScilabExportFileChooser.java
scilab/modules/gui/src/java/org/scilab/modules/gui/bridge/filechooser/SwingScilabFileChooser.java
scilab/modules/io/src/c/LibScilab_Import.def
scilab/modules/scipad/changelog.txt
scilab/modules/scipad/help/en_US/scipad.xml
scilab/modules/scipad/tcl/filecommands.tcl
scilab/modules/scipad/tcl/msg_files/ca_es.msg [new file with mode: 0644]
scilab/modules/scipad/tcl/msg_files/localenames.tcl
scilab/modules/scipad/tcl/scilabexec.tcl

index af2fee1..5d59727 100644 (file)
@@ -1,6 +1,14 @@
 
                Changes between version 5.1.1 and 5.1.2 of Scilab
                =================================================
+
+
+Improvements:
+=============
+
+* Catalan localization added to Scipad (Thanks Oriol Gonzalez)
+
+
 Compilation:
 ============
 
@@ -151,6 +159,12 @@ Bug fixes:
 
  * bug 4603 fixed - Unknown function lst2tree called by function mtlb_eval (+ some other problems fixed in mtlb_eval).
 
+ * bug 4612 fixed - The graphic export used to consider .jpeg as an invalid
+                                       extension.
+
+ * bug 4614 fixed - On some (rare) archs/OS, File -> Export on a graphic could
+                                       lead to a crash 
+
 
                Changes between version 5.1.0 and 5.1.1 of Scilab
                =================================================
index daac9ca..83f0aa1 100644 (file)
@@ -270,3 +270,5 @@ Bug fixes:
 * bug 4605 fixed - basename('') returns a error.
 
 * bug 4606 fixed - example of 'link' in help does not work
+
+* bug 4611 fixed - what function doesn't returns a complete list of functions.
index 0e26892..e9814cb 100755 (executable)
@@ -1826,9 +1826,9 @@ Optional Packages:
   --with-gfortran         Use gfortran, GNU Fortran 95 compiler
   --with-intelcompilers   Use Intel C (icc) and Fortran (ifort) proprietary
                           compilers (GNU/Linux only)
-  --without-tk            Do not compile with TCL/TK
-  --without-javasci       Do not compile the Java/Scilab module
-  --without-gui           Do not compile the Graphical User Interface (GUI).
+  --without-tk            Disable the interface to Tcl/Tk
+  --without-javasci       Disable the Java/Scilab interface (javasci)
+  --without-gui           Disable the Scilab Graphical User Interface (GUI).
                           Intended for embedded/clustering/grid Scilab
   --with-jdk=DIR          use JDK from DIR
   --with-ant=DIR          Use ant from DIR
@@ -1836,12 +1836,12 @@ Optional Packages:
   --without-libiconv-prefix     don't search for libiconv in includedir and libdir
   --with-libintl-prefix[=DIR]  search for libintl in DIR/include and DIR/lib
   --without-libintl-prefix     don't search for libintl in includedir and libdir
-  --without-scicos        Compile without Scicos
-  --without-ocaml         Do not compile ocaml modules (modelica)
+  --without-scicos        Disable Scicos
+  --without-ocaml         Disable the OCaml modules (modelica)
   --without-fftw          Disable the interface to the FFTW 3 library
   --with-fftw-include=DIR Set the path to the FFTW headers
   --with-fftw-library=DIR Set the path to the FFTW libraries
-  --with-hdf5             Compile with the HDF5 library
+  --without-hdf5          Disable the interface to the HDF5 library
   --without-pvm           Disable the interface to the PVM library
   --with-pvm-include=DIR  Set the path to the PVM headers
   --with-pvm-library=DIR  Set the path to the PVM library directory
@@ -1862,7 +1862,8 @@ Optional Packages:
   --with-tk-library=DIR   Set the path to the TK library
   --with-tk-include=DIR   Set the path to the TK headers
   --with-x                use the X Window System
-  --without-matio         Compile with the MAT File I/O library
+  --without-matio         Disable the interface to Matio (MAT File I/O
+                          library)
   --with-matio-include=DIR
                           Set the path to the MATIO headers
   --with-matio-library=DIR
@@ -11494,7 +11495,7 @@ $as_echo "$ac_java_classpath" >&6; }
 $as_echo_n "checking to see if the java compiler works... " >&6; }
 
     cat << \EOF > conftest.java
-// #line 11497 "configure"
+// #line 11498 "configure"
 
 
 public class conftest {
@@ -11544,7 +11545,7 @@ $as_echo_n "checking type of jvm... " >&6; }
     if test "x$ac_java_jvm_name" = "x" ; then
 
     cat << \EOF > conftest.java
-// #line 11547 "configure"
+// #line 11548 "configure"
 import gnu.java.io.EncodingManager;
 
 public class conftest {
@@ -11592,7 +11593,7 @@ $as_echo_n "checking java API version... " >&6; }
 
 
     cat << \EOF > conftest.java
-// #line 11595 "configure"
+// #line 11596 "configure"
 import java.nio.charset.Charset;
 
 public class conftest {
@@ -11619,7 +11620,7 @@ EOF
 
 
     cat << \EOF > conftest.java
-// #line 11622 "configure"
+// #line 11623 "configure"
 import java.lang.StringBuilder;
 
 public class conftest {
@@ -12935,7 +12936,7 @@ $as_echo_n "checking flexdock... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 12938 "configure"
+// #line 12939 "configure"
 import org.flexdock.docking.DockingManager;
 
 public class conftest {
@@ -13008,7 +13009,7 @@ $as_echo_n "checking looks... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13011 "configure"
+// #line 13012 "configure"
 import com.jgoodies.looks.common.RenderingUtils;
 
 public class conftest {
@@ -13081,7 +13082,7 @@ $as_echo_n "checking looks2... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13084 "configure"
+// #line 13085 "configure"
 import com.jgoodies.looks.common.RenderingUtils;
 
 public class conftest {
@@ -13157,7 +13158,7 @@ $as_echo_n "checking skinlf... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13160 "configure"
+// #line 13161 "configure"
 import com.l2fprod.util.AccessUtils;
 
 public class conftest {
@@ -13230,7 +13231,7 @@ $as_echo_n "checking jogl... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13233 "configure"
+// #line 13234 "configure"
 import javax.media.opengl.glu.GLUnurbs;
 
 public class conftest {
@@ -13303,7 +13304,7 @@ $as_echo_n "checking jhall... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13306 "configure"
+// #line 13307 "configure"
 import javax.help.JHelp;
 
 public class conftest {
@@ -13376,7 +13377,7 @@ $as_echo_n "checking javahelp2... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13379 "configure"
+// #line 13380 "configure"
 import javax.help.JHelp;
 
 public class conftest {
@@ -13450,7 +13451,7 @@ $as_echo_n "checking gluegen-rt... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13453 "configure"
+// #line 13454 "configure"
 import com.sun.gluegen.runtime.CPU;
 
 public class conftest {
@@ -13523,7 +13524,7 @@ $as_echo_n "checking jrosetta-API... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13526 "configure"
+// #line 13527 "configure"
 import com.artenum.rosetta.interfaces.core.ConsoleConfiguration;
 
 public class conftest {
@@ -13596,7 +13597,7 @@ $as_echo_n "checking jrosetta-engine... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13599 "configure"
+// #line 13600 "configure"
 import com.artenum.rosetta.core.action.AbstractConsoleAction;
 
 public class conftest {
@@ -13669,7 +13670,7 @@ $as_echo_n "checking commons-logging... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 13672 "configure"
+// #line 13673 "configure"
 import org.apache.commons.logging.LogFactory;
 
 public class conftest {
@@ -28845,7 +28846,7 @@ CPPFLAGS="$CPPFLAGS -I$CHK_TCL_INCLUDE_PATH"
 { $as_echo "$as_me:$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 28848 "configure"
+#line 28849 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@ -29404,7 +29405,7 @@ CPPFLAGS="$CPPFLAGS $TCL_INC_PATH -I$CHK_TK_INCLUDE_PATH $X_CFLAGS"
 $as_echo_n "checking if tk is version $CHK_TK_MAJOR.$CHK_TK_MINOR or later... " >&6; }
 
 cat > conftest.$ac_ext <<EOF
-#line 29407 "configure"
+#line 29408 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@ -30255,7 +30256,7 @@ $as_echo_n "checking batik-all... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30258 "configure"
+// #line 30259 "configure"
 import org.apache.batik.parser.Parser;
 
 public class conftest {
@@ -30328,7 +30329,7 @@ $as_echo_n "checking batik... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30331 "configure"
+// #line 30332 "configure"
 import org.apache.batik.parser.Parser;
 
 public class conftest {
@@ -30403,7 +30404,7 @@ $as_echo_n "checking saxon... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30406 "configure"
+// #line 30407 "configure"
 import com.icl.saxon.Loader;
 
 public class conftest {
@@ -30476,7 +30477,7 @@ $as_echo_n "checking fop... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30479 "configure"
+// #line 30480 "configure"
 import org.apache.fop.pdf.PDFInfo;
 
 public class conftest {
@@ -30549,7 +30550,7 @@ $as_echo_n "checking jeuclid-core... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30552 "configure"
+// #line 30553 "configure"
 import net.sourceforge.jeuclid.LayoutContext;
 
 public class conftest {
@@ -30622,7 +30623,7 @@ $as_echo_n "checking commons-io... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30625 "configure"
+// #line 30626 "configure"
 import org.apache.commons.io.output.CountingOutputStream;
 
 public class conftest {
@@ -30695,7 +30696,7 @@ $as_echo_n "checking xmlgraphics-commons... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30698 "configure"
+// #line 30699 "configure"
 import org.apache.xmlgraphics.util.Service;
 
 public class conftest {
@@ -30768,7 +30769,7 @@ $as_echo_n "checking xml-apis-ext... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30771 "configure"
+// #line 30772 "configure"
 import org.w3c.dom.svg.SVGDocument;
 
 public class conftest {
@@ -30842,7 +30843,7 @@ $as_echo_n "checking avalon-framework... " >&6; }
           export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 30845 "configure"
+// #line 30846 "configure"
 import org.apache.avalon.framework.configuration.ConfigurationException;
 
 public class conftest {
@@ -31543,7 +31544,7 @@ ia64-*-hpux*)
   ;;
 *-*-irix6*)
   # Find out which ABI we are using.
-  echo '#line 31546 "configure"' > conftest.$ac_ext
+  echo '#line 31547 "configure"' > conftest.$ac_ext
   if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
   (eval $ac_compile) 2>&5
   ac_status=$?
@@ -33413,11 +33414,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:33416: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:33417: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:33420: \$? = $ac_status" >&5
+   echo "$as_me:33421: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -33703,11 +33704,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:33706: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:33707: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:33710: \$? = $ac_status" >&5
+   echo "$as_me:33711: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -33807,11 +33808,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:33810: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:33811: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:33814: \$? = $ac_status" >&5
+   echo "$as_me:33815: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -36292,7 +36293,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 36295 "configure"
+#line 36296 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -36392,7 +36393,7 @@ else
   lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
   lt_status=$lt_dlunknown
   cat > conftest.$ac_ext <<EOF
-#line 36395 "configure"
+#line 36396 "configure"
 #include "confdefs.h"
 
 #if HAVE_DLFCN_H
@@ -38821,11 +38822,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:38824: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:38825: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:38828: \$? = $ac_status" >&5
+   echo "$as_me:38829: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -38925,11 +38926,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:38928: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:38929: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:38932: \$? = $ac_status" >&5
+   echo "$as_me:38933: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -40523,11 +40524,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:40526: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:40527: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:40530: \$? = $ac_status" >&5
+   echo "$as_me:40531: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -40627,11 +40628,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:40630: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:40631: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:40634: \$? = $ac_status" >&5
+   echo "$as_me:40635: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -42859,11 +42860,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:42862: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:42863: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:42866: \$? = $ac_status" >&5
+   echo "$as_me:42867: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -43149,11 +43150,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:43152: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:43153: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>conftest.err)
    ac_status=$?
    cat conftest.err >&5
-   echo "$as_me:43156: \$? = $ac_status" >&5
+   echo "$as_me:43157: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s "$ac_outfile"; then
      # The compiler can only warn and ignore the option if not recognized
      # So say no if there are warnings other than the usual output.
@@ -43253,11 +43254,11 @@ else
    -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
    -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
    -e 's:$: $lt_compiler_flag:'`
-   (eval echo "\"\$as_me:43256: $lt_compile\"" >&5)
+   (eval echo "\"\$as_me:43257: $lt_compile\"" >&5)
    (eval "$lt_compile" 2>out/conftest.err)
    ac_status=$?
    cat out/conftest.err >&5
-   echo "$as_me:43260: \$? = $ac_status" >&5
+   echo "$as_me:43261: \$? = $ac_status" >&5
    if (exit $ac_status) && test -s out/conftest2.$ac_objext
    then
      # The compiler can only warn and ignore the option if not recognized
@@ -47815,28 +47816,27 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
 
 
   case $ac_file$ac_mode in
-    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
-  # Autoconf 2.62 quotes --file arguments for eval, but not when files
-  # are listed without --file.  Let's play safe and only enable the eval
-  # if we detect the quoting.
-  case $CONFIG_FILES in
-  *\'*) eval set x "$CONFIG_FILES" ;;
-  *)   set x $CONFIG_FILES ;;
-  esac
-  shift
-  for mf
-  do
-    # Strip MF so we end up with the name of the file.
-    mf=`echo "$mf" | sed -e 's/:.*$//'`
-    # Check whether this is an Automake generated Makefile or not.
-    # We used to match only the files named `Makefile.in', but
-    # some people rename them; so instead we look at the file content.
-    # Grep'ing the first line is not enough: some people post-process
-    # each Makefile.in and add a new line on top of each file to say so.
-    # Grep'ing the whole file is not good either: AIX grep has a line
-    # limit of 2048, but all sed's we know have understand at least 4000.
-    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
-      dirpart=`$as_dirname -- "$mf" ||
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files
+# are listed without --file.  Let's play safe and only enable the eval
+# if we detect the quoting.
+case $CONFIG_FILES in
+*\'*) eval set x "$CONFIG_FILES" ;;
+*)   set x $CONFIG_FILES ;;
+esac
+shift
+for mf
+do
+  # Strip MF so we end up with the name of the file.
+  mf=`echo "$mf" | sed -e 's/:.*$//'`
+  # Check whether this is an Automake generated Makefile or not.
+  # We used to match only the files named `Makefile.in', but
+  # some people rename them; so instead we look at the file content.
+  # Grep'ing the first line is not enough: some people post-process
+  # each Makefile.in and add a new line on top of each file to say so.
+  # Grep'ing the whole file is not good either: AIX grep has a line
+  # limit of 2048, but all sed's we know have understand at least 4000.
+  if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+    dirpart=`$as_dirname -- "$mf" ||
 $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$mf" : 'X\(//\)[^/]' \| \
         X"$mf" : 'X\(//\)$' \| \
@@ -47859,28 +47859,28 @@ $as_echo X"$mf" |
            q
          }
          s/.*/./; q'`
-    else
-      continue
-    fi
-    # Extract the definition of DEPDIR, am__include, and am__quote
-    # from the Makefile without running `make'.
-    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
-    test -z "$DEPDIR" && continue
-    am__include=`sed -n 's/^am__include = //p' < "$mf"`
-    test -z "am__include" && continue
-    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
-    # When using ansi2knr, U may be empty or an underscore; expand it
-    U=`sed -n 's/^U = //p' < "$mf"`
-    # Find all dependency output files, they are included files with
-    # $(DEPDIR) in their names.  We invoke sed twice because it is the
-    # simplest approach to changing $(DEPDIR) to its actual value in the
-    # expansion.
-    for file in `sed -n "
-      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
-        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
-      # Make sure the directory exists.
-      test -f "$dirpart/$file" && continue
-      fdir=`$as_dirname -- "$file" ||
+  else
+    continue
+  fi
+  # Extract the definition of DEPDIR, am__include, and am__quote
+  # from the Makefile without running `make'.
+  DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  am__include=`sed -n 's/^am__include = //p' < "$mf"`
+  test -z "am__include" && continue
+  am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n 's/^U = //p' < "$mf"`
+  # Find all dependency output files, they are included files with
+  # $(DEPDIR) in their names.  We invoke sed twice because it is the
+  # simplest approach to changing $(DEPDIR) to its actual value in the
+  # expansion.
+  for file in `sed -n "
+    s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`$as_dirname -- "$file" ||
 $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
         X"$file" : 'X\(//\)[^/]' \| \
         X"$file" : 'X\(//\)$' \| \
@@ -47903,7 +47903,7 @@ $as_echo X"$file" |
            q
          }
          s/.*/./; q'`
-      { as_dir=$dirpart/$fdir
+    { as_dir=$dirpart/$fdir
   case $as_dir in #(
   -*) as_dir=./$as_dir;;
   esac
@@ -47944,11 +47944,10 @@ $as_echo X"$as_dir" |
   } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;}
    { (exit 1); exit 1; }; }; }
-      # echo "creating $dirpart/$file"
-      echo '# dummy' > "$dirpart/$file"
-    done
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
   done
-}
+done
  ;;
     "po-directories":C)
     for ac_file in $CONFIG_FILES; do
index b16f9cc..71236cc 100644 (file)
@@ -111,13 +111,13 @@ AC_ARG_WITH(intelcompilers,
     AC_HELP_STRING([--with-intelcompilers],[Use Intel C (icc) and Fortran (ifort) proprietary compilers (GNU/Linux only) ]))
 
 AC_ARG_WITH(tk,
-    AC_HELP_STRING([--without-tk],[Do not compile with TCL/TK ]))
+    AC_HELP_STRING([--without-tk],[Disable the interface to Tcl/Tk ]))
 
 AC_ARG_WITH(javasci,
-    AC_HELP_STRING([--without-javasci],[Do not compile the Java/Scilab module ]))
+    AC_HELP_STRING([--without-javasci],[Disable the Java/Scilab interface (javasci)]))
 
 AC_ARG_WITH(gui,
-    AC_HELP_STRING([--without-gui],[Do not compile the Graphical User Interface (GUI). Intended for embedded/clustering/grid Scilab ]))
+    AC_HELP_STRING([--without-gui],[Disable the Scilab Graphical User Interface (GUI). Intended for embedded/clustering/grid Scilab ]))
 
 AC_ARG_ENABLE(build-swig,
     AC_HELP_STRING([--enable-build-swig],[Regenerate Java => C wrappers produces by Swig (A Java Development Kit (JDK) is mandatory for this option)]))
@@ -934,10 +934,10 @@ AC_SEARCH_LIBS([pthread_join],[pthread])
 #################
 
 AC_ARG_WITH(scicos,
-    AC_HELP_STRING([--without-scicos],[Compile without Scicos]))
+    AC_HELP_STRING([--without-scicos],[Disable Scicos]))
 
 AC_ARG_WITH(ocaml,
-    AC_HELP_STRING([--without-ocaml],[Do not compile ocaml modules (modelica)]))
+    AC_HELP_STRING([--without-ocaml],[Disable the OCaml modules (modelica)]))
 
 
 SCICOS_ENABLE=no
@@ -998,7 +998,7 @@ AM_CONDITIONAL(FFTW, test "$with_fftw" != no)
 #################
 
 AC_ARG_WITH(hdf5,
-       AC_HELP_STRING([--with-hdf5],[Compile with the HDF5 library]))  
+       AC_HELP_STRING([--without-hdf5],[Disable the interface to the HDF5 library]))   
 
 HDF5_ENABLE=no
 
@@ -1183,7 +1183,7 @@ AM_CONDITIONAL(TCLTK, test "$WITH_TKSCI" = yes)
 
 
 AC_ARG_WITH(matio,
-    AC_HELP_STRING([--without-matio],[Compile with the MAT File I/O library]))
+    AC_HELP_STRING([--without-matio],[Disable the interface to Matio (MAT File I/O library)]))
 
 AC_ARG_WITH(matio_include,
                AC_HELP_STRING([--with-matio-include=DIR],[Set the path to the MATIO headers]),
index f675849..d12b3c1 100644 (file)
@@ -5,8 +5,8 @@
 /* This file is released into the public domain */
 /* ==================================================================== */
 #include "stack-c.h" 
-#include "common_api.h"
-#include "double_api.h"
+#include "api_common.h"
+#include "api_double.h"
 #include "Scierror.h"
 #include "MALLOC.h"
 /* ==================================================================== */
@@ -33,8 +33,8 @@ int sci_csub(char *fname)
   CheckLhs(1,1) ;   
   
   /* get Address of inputs */
-  getVarAddressFromNumber(1, &piAddressVarOne);
-  getVarAddressFromNumber(2, &piAddressVarTwo);
+  getVarAddressFromPosition(1, &piAddressVarOne);
+  getVarAddressFromPosition(2, &piAddressVarTwo);
   
   /* check input type */
   if ( getVarType(piAddressVarOne) != sci_matrix )
index 17cfca8..59b8645 100644 (file)
@@ -5,8 +5,8 @@
 /* This file is released into the public domain */
 /* ==================================================================== */
 #include "stack-c.h" 
-#include "common_api.h"
-#include "double_api.h"
+#include "api_common.h"
+#include "api_double.h"
 #include "Scierror.h"
 #include "MALLOC.h"
 /* ==================================================================== */
@@ -32,8 +32,8 @@ int sci_csum(char *fname)
   CheckLhs(1,1) ;   
   
   /* get Address of inputs */
-  getVarAddressFromNumber(1, &piAddressVarOne);
-  getVarAddressFromNumber(2, &piAddressVarTwo);
+  getVarAddressFromPosition(1, &piAddressVarOne);
+  getVarAddressFromPosition(2, &piAddressVarTwo);
   
   /* check input type */
   if ( getVarType(piAddressVarOne) != sci_matrix )
index 41fd4a1..21820a9 100644 (file)
@@ -10,9 +10,9 @@ extern "C"
 {
 /* ==================================================================== */     
   #include "stack-c.h"
-  #include "common_api.h"
-  #include "string_api.h"
-  #include "double_api.h"
+  #include "api_common.h"
+  #include "api_string.h"
+  #include "api_double.h"
   #include "Scierror.h"
   #include "MALLOC.h"
 /* ==================================================================== */
@@ -35,8 +35,8 @@ extern "C"
     CheckLhs(1,1);
     
     /* get Address of inputs */
-    getVarAddressFromNumber(1, &piAddressVarOne);
-    getVarAddressFromNumber(2, &piAddressVarTwo);
+    getVarAddressFromPosition(1, &piAddressVarOne);
+    getVarAddressFromPosition(2, &piAddressVarTwo);
     
     if ( getVarType(piAddressVarOne) != sci_strings )
     {
index c517b17..a7916af 100644 (file)
@@ -5,8 +5,8 @@
 /* This file is released into the public domain */
 /* ==================================================================== */
 #include "stack-c.h" 
-#include "common_api.h"
-#include "double_api.h"
+#include "api_common.h"
+#include "api_double.h"
 #include "Scierror.h"
 #include "MALLOC.h"
 /* ==================================================================== */
@@ -32,8 +32,8 @@ int sci_fsum(char *fname)
   CheckLhs(1,1) ;   
   
   /* get Address of inputs */
-  getVarAddressFromNumber(1, &piAddressVarOne);
-  getVarAddressFromNumber(2, &piAddressVarTwo);
+  getVarAddressFromPosition(1, &piAddressVarOne);
+  getVarAddressFromPosition(2, &piAddressVarTwo);
   
   /* check input type */
   if ( getVarType(piAddressVarOne) != sci_matrix )
index 08af756..5d5e3f8 100644 (file)
@@ -82,15 +82,15 @@ src/c/mode_exec.c \
 src/c/predef.c \
 src/c/transposeMatrix.c \
 src/c/recursionFunction.c \
-src/c/common_api.c \
-src/c/double_api.c \
-src/c/int_api.c \
-src/c/poly_api.c \
-src/c/sparse_api.c \
-src/c/boolean_sparse_api.c \
-src/c/boolean_api.c \
-src/c/string_api.c \
-src/c/list_api.c \
+src/c/api_common.c \
+src/c/api_double.c \
+src/c/api_int.c \
+src/c/api_poly.c \
+src/c/api_sparse.c \
+src/c/api_boolean_sparse.c \
+src/c/api_boolean.c \
+src/c/api_string.c \
+src/c/api_list.c \
 src/c/typename.c \
 src/c/inittypenames.c \
 src/c/funcprot.c
@@ -425,16 +425,16 @@ includes/LaunchScilabSignal.h \
 includes/getos.h \
 includes/mode_exec.h \
 includes/transposeMatrix.h \
-includes/boolean_api.h \
-includes/double_api.h \
-includes/sparse_api.h \
-includes/boolean_sparse_api.h \
-includes/int_api.h \
-includes/string_api.h \
-includes/common_api.h \
-includes/poly_api.h \
-includes/variable_api.h \
-includes/list_api.h \
+includes/api_boolean.h \
+includes/api_double.h \
+includes/api_sparse.h \
+includes/api_boolean_sparse.h \
+includes/api_int.h \
+includes/api_string.h \
+includes/api_common.h \
+includes/api_poly.h \
+includes/api_variable.h \
+includes/api_list.h \
 includes/recursionFunction.h
 
 include $(top_srcdir)/Makefile.incl.am
index b47ca47..dc59739 100644 (file)
@@ -131,10 +131,10 @@ am__libscicore_la_SOURCES_DIST = src/c/inffic.c src/c/cs2st.c \
        src/c/comparehandles.c src/c/setPrecisionFPU.c \
        src/c/LaunchScilabSignal.c src/c/getos.c src/c/mode_exec.c \
        src/c/predef.c src/c/transposeMatrix.c \
-       src/c/recursionFunction.c src/c/common_api.c \
-       src/c/double_api.c src/c/int_api.c src/c/poly_api.c \
-       src/c/sparse_api.c src/c/boolean_sparse_api.c \
-       src/c/boolean_api.c src/c/string_api.c src/c/list_api.c \
+       src/c/recursionFunction.c src/c/api_common.c \
+       src/c/api_double.c src/c/api_int.c src/c/api_poly.c \
+       src/c/api_sparse.c src/c/api_boolean_sparse.c \
+       src/c/api_boolean.c src/c/api_string.c src/c/api_list.c \
        src/c/typename.c src/c/inittypenames.c src/c/funcprot.c \
        src/c/scimem64.c src/fortran/clunit.f src/fortran/getlin.f \
        src/fortran/allowptr.f src/fortran/isany.f \
@@ -270,12 +270,12 @@ am__objects_2 = libscicore_la-inffic.lo libscicore_la-cs2st.lo \
        libscicore_la-LaunchScilabSignal.lo libscicore_la-getos.lo \
        libscicore_la-mode_exec.lo libscicore_la-predef.lo \
        libscicore_la-transposeMatrix.lo \
-       libscicore_la-recursionFunction.lo libscicore_la-common_api.lo \
-       libscicore_la-double_api.lo libscicore_la-int_api.lo \
-       libscicore_la-poly_api.lo libscicore_la-sparse_api.lo \
-       libscicore_la-boolean_sparse_api.lo \
-       libscicore_la-boolean_api.lo libscicore_la-string_api.lo \
-       libscicore_la-list_api.lo libscicore_la-typename.lo \
+       libscicore_la-recursionFunction.lo libscicore_la-api_common.lo \
+       libscicore_la-api_double.lo libscicore_la-api_int.lo \
+       libscicore_la-api_poly.lo libscicore_la-api_sparse.lo \
+       libscicore_la-api_boolean_sparse.lo \
+       libscicore_la-api_boolean.lo libscicore_la-api_string.lo \
+       libscicore_la-api_list.lo libscicore_la-typename.lo \
        libscicore_la-inittypenames.lo libscicore_la-funcprot.lo \
        $(am__objects_1)
 @USE_DYNAMIC_STACK_TRUE@am__objects_3 = relocstack.lo
@@ -623,10 +623,10 @@ CORE_C_SOURCES = src/c/inffic.c src/c/cs2st.c src/c/tmpdir.c \
        src/c/comparehandles.c src/c/setPrecisionFPU.c \
        src/c/LaunchScilabSignal.c src/c/getos.c src/c/mode_exec.c \
        src/c/predef.c src/c/transposeMatrix.c \
-       src/c/recursionFunction.c src/c/common_api.c \
-       src/c/double_api.c src/c/int_api.c src/c/poly_api.c \
-       src/c/sparse_api.c src/c/boolean_sparse_api.c \
-       src/c/boolean_api.c src/c/string_api.c src/c/list_api.c \
+       src/c/recursionFunction.c src/c/api_common.c \
+       src/c/api_double.c src/c/api_int.c src/c/api_poly.c \
+       src/c/api_sparse.c src/c/api_boolean_sparse.c \
+       src/c/api_boolean.c src/c/api_string.c src/c/api_list.c \
        src/c/typename.c src/c/inittypenames.c src/c/funcprot.c \
        $(am__append_1)
 CORE_FORTRAN_SOURCES = src/fortran/clunit.f src/fortran/getlin.f \
@@ -876,16 +876,16 @@ includes/LaunchScilabSignal.h \
 includes/getos.h \
 includes/mode_exec.h \
 includes/transposeMatrix.h \
-includes/boolean_api.h \
-includes/double_api.h \
-includes/sparse_api.h \
-includes/boolean_sparse_api.h \
-includes/int_api.h \
-includes/string_api.h \
-includes/common_api.h \
-includes/poly_api.h \
-includes/variable_api.h \
-includes/list_api.h \
+includes/api_boolean.h \
+includes/api_double.h \
+includes/api_sparse.h \
+includes/api_boolean_sparse.h \
+includes/api_int.h \
+includes/api_string.h \
+includes/api_common.h \
+includes/api_poly.h \
+includes/api_variable.h \
+includes/api_list.h \
 includes/recursionFunction.h
 
 
@@ -1030,19 +1030,24 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-SCIHOME.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-SetScilabEnvironment.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-TerminateCore.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_boolean.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_boolean_sparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_common.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_double.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_int.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_list.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_poly.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_sparse.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-api_string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-banier.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-boolean_api.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-boolean_sparse_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-callDynamicGateway.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-callFunctionFromGateway.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-callinterf.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-commandwords.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-common_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-comparehandles.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-coretable.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-cs2st.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-csignal.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-double_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-dynamic_gateways.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-expr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-freeArrayOfString.Plo@am__quote@
@@ -1064,18 +1069,15 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-inffic.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-inisci-c.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-inittypenames.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-int_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-intmacr2tree.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-isanan.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-islittleendian.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-librarieslist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-libraryinfo.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-list_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-loadversion.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-md5.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-mode_exec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-parse.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-poly_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-predef.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-readGateway.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-realmain.Plo@am__quote@
@@ -1148,13 +1150,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-scirun.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-setPrecisionFPU.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-setgetSCIpath.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-sparse_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-stack1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-stack2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-stack3.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-stackinfo.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-str2sci.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-string_api.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-syncexec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-terme.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_la-texmacs.Plo@am__quote@
@@ -1699,68 +1699,68 @@ libscicore_la-recursionFunction.lo: src/c/recursionFunction.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-recursionFunction.lo `test -f 'src/c/recursionFunction.c' || echo '$(srcdir)/'`src/c/recursionFunction.c
 
-libscicore_la-common_api.lo: src/c/common_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-common_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-common_api.Tpo -c -o libscicore_la-common_api.lo `test -f 'src/c/common_api.c' || echo '$(srcdir)/'`src/c/common_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-common_api.Tpo $(DEPDIR)/libscicore_la-common_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/common_api.c' object='libscicore_la-common_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_common.lo: src/c/api_common.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_common.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_common.Tpo -c -o libscicore_la-api_common.lo `test -f 'src/c/api_common.c' || echo '$(srcdir)/'`src/c/api_common.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_common.Tpo $(DEPDIR)/libscicore_la-api_common.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_common.c' object='libscicore_la-api_common.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-common_api.lo `test -f 'src/c/common_api.c' || echo '$(srcdir)/'`src/c/common_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_common.lo `test -f 'src/c/api_common.c' || echo '$(srcdir)/'`src/c/api_common.c
 
-libscicore_la-double_api.lo: src/c/double_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-double_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-double_api.Tpo -c -o libscicore_la-double_api.lo `test -f 'src/c/double_api.c' || echo '$(srcdir)/'`src/c/double_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-double_api.Tpo $(DEPDIR)/libscicore_la-double_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/double_api.c' object='libscicore_la-double_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_double.lo: src/c/api_double.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_double.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_double.Tpo -c -o libscicore_la-api_double.lo `test -f 'src/c/api_double.c' || echo '$(srcdir)/'`src/c/api_double.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_double.Tpo $(DEPDIR)/libscicore_la-api_double.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_double.c' object='libscicore_la-api_double.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-double_api.lo `test -f 'src/c/double_api.c' || echo '$(srcdir)/'`src/c/double_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_double.lo `test -f 'src/c/api_double.c' || echo '$(srcdir)/'`src/c/api_double.c
 
-libscicore_la-int_api.lo: src/c/int_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-int_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-int_api.Tpo -c -o libscicore_la-int_api.lo `test -f 'src/c/int_api.c' || echo '$(srcdir)/'`src/c/int_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-int_api.Tpo $(DEPDIR)/libscicore_la-int_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/int_api.c' object='libscicore_la-int_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_int.lo: src/c/api_int.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_int.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_int.Tpo -c -o libscicore_la-api_int.lo `test -f 'src/c/api_int.c' || echo '$(srcdir)/'`src/c/api_int.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_int.Tpo $(DEPDIR)/libscicore_la-api_int.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_int.c' object='libscicore_la-api_int.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-int_api.lo `test -f 'src/c/int_api.c' || echo '$(srcdir)/'`src/c/int_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_int.lo `test -f 'src/c/api_int.c' || echo '$(srcdir)/'`src/c/api_int.c
 
-libscicore_la-poly_api.lo: src/c/poly_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-poly_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-poly_api.Tpo -c -o libscicore_la-poly_api.lo `test -f 'src/c/poly_api.c' || echo '$(srcdir)/'`src/c/poly_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-poly_api.Tpo $(DEPDIR)/libscicore_la-poly_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/poly_api.c' object='libscicore_la-poly_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_poly.lo: src/c/api_poly.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_poly.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_poly.Tpo -c -o libscicore_la-api_poly.lo `test -f 'src/c/api_poly.c' || echo '$(srcdir)/'`src/c/api_poly.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_poly.Tpo $(DEPDIR)/libscicore_la-api_poly.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_poly.c' object='libscicore_la-api_poly.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-poly_api.lo `test -f 'src/c/poly_api.c' || echo '$(srcdir)/'`src/c/poly_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_poly.lo `test -f 'src/c/api_poly.c' || echo '$(srcdir)/'`src/c/api_poly.c
 
-libscicore_la-sparse_api.lo: src/c/sparse_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-sparse_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-sparse_api.Tpo -c -o libscicore_la-sparse_api.lo `test -f 'src/c/sparse_api.c' || echo '$(srcdir)/'`src/c/sparse_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-sparse_api.Tpo $(DEPDIR)/libscicore_la-sparse_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/sparse_api.c' object='libscicore_la-sparse_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_sparse.lo: src/c/api_sparse.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_sparse.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_sparse.Tpo -c -o libscicore_la-api_sparse.lo `test -f 'src/c/api_sparse.c' || echo '$(srcdir)/'`src/c/api_sparse.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_sparse.Tpo $(DEPDIR)/libscicore_la-api_sparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_sparse.c' object='libscicore_la-api_sparse.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-sparse_api.lo `test -f 'src/c/sparse_api.c' || echo '$(srcdir)/'`src/c/sparse_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_sparse.lo `test -f 'src/c/api_sparse.c' || echo '$(srcdir)/'`src/c/api_sparse.c
 
-libscicore_la-boolean_sparse_api.lo: src/c/boolean_sparse_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-boolean_sparse_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-boolean_sparse_api.Tpo -c -o libscicore_la-boolean_sparse_api.lo `test -f 'src/c/boolean_sparse_api.c' || echo '$(srcdir)/'`src/c/boolean_sparse_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-boolean_sparse_api.Tpo $(DEPDIR)/libscicore_la-boolean_sparse_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/boolean_sparse_api.c' object='libscicore_la-boolean_sparse_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_boolean_sparse.lo: src/c/api_boolean_sparse.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_boolean_sparse.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_boolean_sparse.Tpo -c -o libscicore_la-api_boolean_sparse.lo `test -f 'src/c/api_boolean_sparse.c' || echo '$(srcdir)/'`src/c/api_boolean_sparse.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_boolean_sparse.Tpo $(DEPDIR)/libscicore_la-api_boolean_sparse.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_boolean_sparse.c' object='libscicore_la-api_boolean_sparse.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-boolean_sparse_api.lo `test -f 'src/c/boolean_sparse_api.c' || echo '$(srcdir)/'`src/c/boolean_sparse_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_boolean_sparse.lo `test -f 'src/c/api_boolean_sparse.c' || echo '$(srcdir)/'`src/c/api_boolean_sparse.c
 
-libscicore_la-boolean_api.lo: src/c/boolean_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-boolean_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-boolean_api.Tpo -c -o libscicore_la-boolean_api.lo `test -f 'src/c/boolean_api.c' || echo '$(srcdir)/'`src/c/boolean_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-boolean_api.Tpo $(DEPDIR)/libscicore_la-boolean_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/boolean_api.c' object='libscicore_la-boolean_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_boolean.lo: src/c/api_boolean.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_boolean.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_boolean.Tpo -c -o libscicore_la-api_boolean.lo `test -f 'src/c/api_boolean.c' || echo '$(srcdir)/'`src/c/api_boolean.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_boolean.Tpo $(DEPDIR)/libscicore_la-api_boolean.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_boolean.c' object='libscicore_la-api_boolean.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-boolean_api.lo `test -f 'src/c/boolean_api.c' || echo '$(srcdir)/'`src/c/boolean_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_boolean.lo `test -f 'src/c/api_boolean.c' || echo '$(srcdir)/'`src/c/api_boolean.c
 
-libscicore_la-string_api.lo: src/c/string_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-string_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-string_api.Tpo -c -o libscicore_la-string_api.lo `test -f 'src/c/string_api.c' || echo '$(srcdir)/'`src/c/string_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-string_api.Tpo $(DEPDIR)/libscicore_la-string_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/string_api.c' object='libscicore_la-string_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_string.lo: src/c/api_string.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_string.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_string.Tpo -c -o libscicore_la-api_string.lo `test -f 'src/c/api_string.c' || echo '$(srcdir)/'`src/c/api_string.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_string.Tpo $(DEPDIR)/libscicore_la-api_string.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_string.c' object='libscicore_la-api_string.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-string_api.lo `test -f 'src/c/string_api.c' || echo '$(srcdir)/'`src/c/string_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_string.lo `test -f 'src/c/api_string.c' || echo '$(srcdir)/'`src/c/api_string.c
 
-libscicore_la-list_api.lo: src/c/list_api.c
-@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-list_api.lo -MD -MP -MF $(DEPDIR)/libscicore_la-list_api.Tpo -c -o libscicore_la-list_api.lo `test -f 'src/c/list_api.c' || echo '$(srcdir)/'`src/c/list_api.c
-@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-list_api.Tpo $(DEPDIR)/libscicore_la-list_api.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/list_api.c' object='libscicore_la-list_api.lo' libtool=yes @AMDEPBACKSLASH@
+libscicore_la-api_list.lo: src/c/api_list.c
+@am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-api_list.lo -MD -MP -MF $(DEPDIR)/libscicore_la-api_list.Tpo -c -o libscicore_la-api_list.lo `test -f 'src/c/api_list.c' || echo '$(srcdir)/'`src/c/api_list.c
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/libscicore_la-api_list.Tpo $(DEPDIR)/libscicore_la-api_list.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/api_list.c' object='libscicore_la-api_list.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-list_api.lo `test -f 'src/c/list_api.c' || echo '$(srcdir)/'`src/c/list_api.c
+@am__fastdepCC_FALSE@  $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -c -o libscicore_la-api_list.lo `test -f 'src/c/api_list.c' || echo '$(srcdir)/'`src/c/api_list.c
 
 libscicore_la-typename.lo: src/c/typename.c
 @am__fastdepCC_TRUE@   $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libscicore_la_CFLAGS) $(CFLAGS) -MT libscicore_la-typename.lo -MD -MP -MF $(DEPDIR)/libscicore_la-typename.Tpo -c -o libscicore_la-typename.lo `test -f 'src/c/typename.c' || echo '$(srcdir)/'`src/c/typename.c
similarity index 84%
rename from scilab/modules/core/includes/common_api.h
rename to scilab/modules/core/includes/api_common.h
index cc379f2..4f96df1 100644 (file)
 /* generics functions */
 
 /**
- * Get memory address of a variable from the variable number
+ * Get memory address of a variable from the variable position
  * @param[in] _iVar variable number
  * @param[out] _piAddress return variable address
  * @return if the operation successed (0) or not ( !0 )
  */
-int getVarAddressFromNumber(int _iVar, int** _piAddress);
+int getVarAddressFromPosition(int _iVar, int** _piAddress);
 
 /**
+ * Get memory address of a variable from the variable position
+ * @param[in] _iVar variable number
+ * @param[out] _pstName variable name
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int getVarNameFromPosition(int _iVar, char* _pstName);
+/**
  * Get memory address of a variable from the variable name
  * @param[in] _pstName variable name
  * @param[out] _iNameLen variable name length
similarity index 88%
rename from scilab/modules/core/includes/int_api.h
rename to scilab/modules/core/includes/api_int.h
index c123bf7..6e520d8 100644 (file)
@@ -36,7 +36,7 @@ int getMatrixOfIntegerPrecision(int* _piAddress, int* _piPrecision);
  * @param[out] _piData8 return pointer on 8 bits integer
  * @return if the operation successed (0) or not ( !0 )
  */
-int getMatrixOfInteger8(int* _piAddress, int* _piRows, int* _piCols, char** _piData8);
+int getMatrixOfInteger8(int* _piAddress, int* _piRows, int* _piCols, char** _pcData8);
 
 /**
  * Get integer 16 bit variable data
@@ -46,7 +46,7 @@ int getMatrixOfInteger8(int* _piAddress, int* _piRows, int* _piCols, char** _piD
  * @param[out] _piData16 return pointer on 16 bits integer
  * @return if the operation successed (0) or not ( !0 )
  */
-int getMatrixOfInteger16(int* _piAddress, int* _piRows, int* _piCols, short** _piData16);
+int getMatrixOfInteger16(int* _piAddress, int* _piRows, int* _piCols, short** _psData16);
 
 /**
  * Get integer 32 bit variable data
@@ -67,7 +67,7 @@ int getMatrixOfInteger32(int* _piAddress, int* _piRows, int* _piCols, int** _piD
  * @return if the operation successed (0) or not ( !0 )
  */
 #ifdef __SCILAB_INT64__
-int getMatrixOfInteger64(int* _piAddress, int* _piRows, int* _piCols, long long** _piData64);
+int getMatrixOfInteger64(int* _piAddress, int* _piRows, int* _piCols, long long** _pllData64);
 #endif
 
 /**
@@ -76,10 +76,9 @@ int getMatrixOfInteger64(int* _piAddress, int* _piRows, int* _piCols, long long*
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[in] _piData8 array of integer 8 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _piData8, int** _piAddress);
+int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _pcData8);
 
 /**
  * Get integer variable data
@@ -87,10 +86,9 @@ int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _piData8, in
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[in] _piData16 array of integer 16 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _piData16, int** _piAddress);
+int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _psData16);
 
 /**
  * Get integer variable data
@@ -98,10 +96,9 @@ int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _piData16,
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[in] _piData32 array of integer 32 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32, int** _piAddress);
+int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32);
 
 /**
  * Get integer variable data
@@ -109,22 +106,22 @@ int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32, i
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[in] _piData64 array of integer 64 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
+
 #ifdef __SCILAB_INT64__
-int createMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long* _piData64, int** _piAddress);
+int createMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long* _pllData64);
 #endif
+
 /**
  * Get integer variable data
  * @param[in] _iVar variable number
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[out] _piData8 return array of integer 8 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _piData8, int **_piAddress);
+int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _pcData8);
 
 /**
  * Get integer variable data
@@ -132,10 +129,9 @@ int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _piData8, in
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[out] _piData16 return array of integer 16 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _piData16, int **_piAddress);
+int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _psData16);
 
 /**
  * Get integer variable data
@@ -143,10 +139,9 @@ int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _piData16,
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[out] _piData32 return array of integer 32 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32, int **_piAddress);
+int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32);
 
 /**
  * Get integer variable data
@@ -154,12 +149,12 @@ int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32, i
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
  * @param[out] _piData64 return array of integer 64 bits
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
 #ifdef __SCILAB_INT64__
-int allocMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long** _piData64, int **_piAddress);
+int allocMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long** _pllData64);
 #endif
+
 /**
  * Get integer variable data
  * @param[in] _pstName variable name
@@ -170,7 +165,7 @@ int allocMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long** _piDat
  * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int _iRows, int _iCols, char* _piData8);
+int createNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int _iRows, int _iCols, char* _pcData8);
 
 /**
  * Get integer variable data
@@ -182,7 +177,7 @@ int createNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int _iRows, int _
  * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createNamedMatrixOfInteger16(char* _pstName, int _iNameLen, int _iRows, int _iCols, short* _piData16);
+int createNamedMatrixOfInteger16(char* _pstName, int _iNameLen, int _iRows, int _iCols, short* _psData16);
 
 /**
  * Get integer variable data
@@ -207,8 +202,9 @@ int createNamedMatrixOfInteger32(char* _pstName, int _iNameLen, int _iRows, int
  * @return if the operation successed (0) or not ( !0 )
  */
 #ifdef __SCILAB_INT64__
-int createNamedMatrixOfInteger64(char* _pstName, int _iNameLen, int _iRows, int _iCols, long long* _piData64);
+int createNamedMatrixOfInteger64(char* _pstName, int _iNameLen, int _iRows, int _iCols, long long* _pllData64);
 #endif
+
 /**
  * Get integer precision ( 8, 16, 32, 64 )
  * @param[in] _pstName variable name
@@ -226,7 +222,7 @@ int getNamedMatrixOfIntegerPrecision(char* _pstName, int _iNameLen, int* _piPrec
  * @param[out] _piData8 return array of integer 8 bits
  * @return if the operation successed (0) or not ( !0 )
  */
-int readNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, char* _piData8);
+int readNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, char* _pcData8);
 /**
  * Get integer named variable data
  * @param[in] _pstName variable name
@@ -236,7 +232,7 @@ int readNamedMatrixOfInteger8(char* _pstName, int _iNameLen, int* _piRows, int*
  * @param[out] _piData16 return array of integer 16 bits
  * @return if the operation successed (0) or not ( !0 )
  */
-int readNamedMatrixOfInteger16(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, short* _piData16);
+int readNamedMatrixOfInteger16(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, short* _psData16);
 /**
  * Get integer named variable data
  * @param[in] _pstName variable name
@@ -257,6 +253,6 @@ int readNamedMatrixOfInteger32(char* _pstName, int _iNameLen, int* _piRows, int*
  * @return if the operation successed (0) or not ( !0 )
  */
 #ifdef __SCILAB_INT64__
-int readNamedMatrixOfInteger64(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, long long* _piData64);
+int readNamedMatrixOfInteger64(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, long long* _pllData64);
 #endif
 #endif /* __INT_API__ */
similarity index 64%
rename from scilab/modules/core/includes/list_api.h
rename to scilab/modules/core/includes/api_list.h
index a7e9665..72096c2 100644 (file)
@@ -252,6 +252,10 @@ int createTListInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _i
  */
 int createMListInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iNbItem, int** _piAddress);
 
+/*********************
+ * Double functions *
+ *********************/
+
 /**
  * Get double variable data
  * @param[in] _iVar variable number
@@ -301,7 +305,6 @@ int allocMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemPos, int _iRo
  */
 int allocComplexMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, double** _pdblReal, double** _pdblImg);
 
-
 /**
  * create double variable in a list
  * @param[in] _iVar variable number
@@ -473,10 +476,242 @@ int allocMatrixOfBooleanInList(int _iVar, int* _piParent, int _iItemPos, int _iR
  * @param[in] _iItemPos item postion in the list
  * @param[in] _iRows Number of row
  * @param[in] _iCols Number of column
- * @param[in] _piBool return pointer on data
+ * @param[in] _piBool  pointer on data
  * @return if the operation successed (0) or not ( !0 )
  */
 int createMatrixOfBooleanInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piBool);
 
+/**
+ * create boolean variable in a named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piBool pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfBooleanInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piBool);
+
+/*************************
+ * polynomials functions *
+ *************************/
+
+/**
+ * Get polynomial variable in list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[out] _piRows return number of row 
+ * @param[out] _piCols return number of column
+ * @param[out] _piNbCoef return an array of polynomials coefficients
+ * @param[out] _pdblReal return polynomials coefficients
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int getMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal);
+
+/**
+ * Get complex polynomial variable in list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[out] _piRows return number of row 
+ * @param[out] _piCols return number of column
+ * @param[out] _piNbCoef return an array of polynomials coefficients
+ * @param[out] _pdblReal return polynomials coefficients
+ * @param[out] _pdblImg return polynomials coefficients
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int getComplexMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+/**
+ * Create polynomial variable in list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piNbCoef array of polynomials coefficients
+ * @param[in] _pdblReal pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal);
+
+/**
+ * Create complex polynomial variable in list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piNbCoef array of polynomials coefficients
+ * @param[in] _pdblReal pointer on real data
+ * @param[in] _pdblImg pointer on img data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createComplexMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+/**
+ * Get polynomial variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length 
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[out] _piRows return number of row
+ * @param[out] _piCols return number of column
+ * @param[out] _piNbCoef return polynomials coefficients
+ * @param[out] _pdblReal return data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int readMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal);
+
+/**
+ * Get polynomial variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length 
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[out] _piRows return number of row
+ * @param[out] _piCols return number of column
+ * @param[out] _piNbCoef return polynomials coefficients
+ * @param[out] _pdblReal return real data
+ * @param[out] _pdblImg return img data
+* @return if the operation successed (0) or not ( !0 )
+ */
+int readComplexMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+/**
+ * Create polynomial variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piNbCoef array of polynomials coefficients
+ * @param[in] _pdblReal pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal);
+
+/**
+ * Create complex polynomial variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piNbCoef array of polynomials coefficients
+ * @param[in] _pdblReal pointer on real data
+ * @param[in] _pdblImg pointer on img data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createComplexMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+/**
+ * create integer 8 variable in a list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _pcData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger8InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char* _pcData);
+
+/**
+ * create integer 16 variable in a list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _psData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger16InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, short* _psData);
+
+/**
+ * create integer 32 variable in a list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData);
+
+/**
+ * create integer 64 variable in a list
+ * @param[in] _iVar variable number
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _pllData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+#ifdef __SCILAB_INT64__
+int createMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData);
+#endif
+/**
+ * Create integer 8 bis variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _pcData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger8InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, char* _pcData);
+
+/**
+ * Create integer 16 bis variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _psData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger16InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, short* _psData);
+
+/**
+ * Create integer 32 bis variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _piData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+int createMatrixOfInteger32InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData);
+
+/**
+ * Create integer 64 bis variable in named list
+ * @param[in] _pstName variable name
+ * @param[in] _iNameLen variable name length
+ * @param[in] _piParent address of parent node
+ * @param[in] _iItemPos item postion in the list
+ * @param[in] _iRows Number of row
+ * @param[in] _iCols Number of column
+ * @param[in] _pllData pointer on data
+ * @return if the operation successed (0) or not ( !0 )
+ */
+#ifdef __SCILAB_INT64__
+int createMatrixOfInteger64InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, long long* _pllData);
+#endif
+
 #endif /* __LIST_API__ */
 
similarity index 95%
rename from scilab/modules/core/includes/poly_api.h
rename to scilab/modules/core/includes/api_poly.h
index a2b322d..60be4ea 100644 (file)
@@ -57,10 +57,9 @@ int getComplexMatrixOfPoly(int* _piAddress, int* _piRows, int* _piCols, int* _pi
  * @param[in] _iCols Number of column
  * @param[in] _piNbCoef array of polynomials coefficients
  * @param[in] _pdblReal pointer on data
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, int** _piAddress);
+int createMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal);
 
 /**
  * Get complex polynomial named variable data
@@ -71,10 +70,9 @@ int createMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int
  * @param[in] _piNbCoef array of polynomials coefficients
  * @param[in] _pdblReal pointer on real data
  * @param[in] _pdblImg pointer on imaginary data
- * @param[out] _piAddress return pointer on new variable
  * @return if the operation successed (0) or not ( !0 )
  */
-int createComplexMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int** _piAddress);
+int createComplexMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
 
 /**
  * Create polynomial named variable
similarity index 69%
rename from scilab/modules/core/includes/variable_api.h
rename to scilab/modules/core/includes/api_variable.h
index 521cdef..1918281 100644 (file)
 #ifndef __VARIABLE_API__
 #define __VARIABLE_API__
 
-#include "common_api.h"
-#include "double_api.h"
-#include "string_api.h"
-#include "int_api.h"
-#include "poly_api.h"
-#include "sparse_api.h"
-#include "boolean_api.h"
-#include "boolean_sparse_api.h"
-#include "list_api.h"
+#include "api_common.h"
+#include "api_double.h"
+#include "api_string.h"
+#include "api_int.h"
+#include "api_poly.h"
+#include "api_sparse.h"
+#include "api_boolean.h"
+#include "api_boolean_sparse.h"
+#include "api_list.h"
 
 #endif /* __VARIABLE_API__ */
index 72db5fc..03c3c7a 100644 (file)
@@ -14,9 +14,9 @@
 #include "gw_core.h"
 #include "stack-c.h"
 #include "funcprot.h"
-#include "common_api.h"
-#include "int_api.h"
-#include "double_api.h"
+#include "api_common.h"
+#include "api_int.h"
+#include "api_double.h"
 #include "Scierror.h"
 #include "localization.h"
 #include "MALLOC.h"
@@ -46,7 +46,7 @@ int C2F(sci_funcprot)(char *fname,unsigned long fname_len)
                double *pdVarOne = NULL;
 
                /* get Address of inputs */
-               getVarAddressFromNumber(1, &piAddressVarOne);
+               getVarAddressFromPosition(1, &piAddressVarOne);
 
                /* check input type */
                if ( getVarType(piAddressVarOne) != sci_matrix )
index 35fe8ac..0b16441 100644 (file)
 #include "localization.h"
 #include "typename.h"
 #include "MALLOC.h"
-#include "common_api.h"
-#include "string_api.h"
-#include "double_api.h"
-#include "int_api.h"
+#include "api_common.h"
+#include "api_string.h"
+#include "api_double.h"
+#include "api_int.h"
 #include "freeArrayOfString.h"
 /*--------------------------------------------------------------------------*/
 static int sci_typename_two_rhs(char *fname,unsigned long fname_len);
@@ -55,8 +55,8 @@ int sci_typename_two_rhs(char *fname,unsigned long fname_len)
        int *piAddressVarTwo = NULL;
        double *pdVarTwo = NULL;
 
-       getVarAddressFromNumber(1, &piAddressVarOne);
-       getVarAddressFromNumber(2, &piAddressVarTwo);
+       getVarAddressFromPosition(1, &piAddressVarOne);
+       getVarAddressFromPosition(2, &piAddressVarTwo);
 
        if ( getVarType(piAddressVarOne) != sci_strings )
        {
@@ -139,7 +139,7 @@ int sci_typename_no_rhs(char *fname,unsigned long fname_len)
        m_out1 = numberOfTypes;
        n_out1 = 1;
 
-       createMatrixOfInteger32(Rhs + 1,m_out1,n_out1,TypesNumbers,&piAddressOut1);
+       createMatrixOfInteger32(Rhs + 1,m_out1,n_out1,TypesNumbers);
        if (TypesNumbers) { FREE(TypesNumbers);TypesNumbers = NULL;     }
        LhsVar(1) = Rhs + 1; 
 
index 64d154a..b141bd5 100644 (file)
@@ -1,16 +1,17 @@
 /*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - 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
- *
- */
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2006 - INRIA - 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 <string.h>
 #include <stdio.h>
+#include <stdio.h> /* sprintf */
 #include "gw_core.h"
 #include "stack-c.h"
 #include "MALLOC.h"
@@ -30,7 +31,7 @@ static int CreateLocalFunctionsTab(void);
 static int IsACommand(char *primitive);
 static void DispInternalFunctions(void);
 static void DispCommands(void);
-static void SortStrings(char **Strs,int SizeOfStrs);
+static int cmpfunctionnames( const void *a ,const void *b);
 /*--------------------------------------------------------------------------*/
 extern char **GetFunctionsList(int *sizeList);
 /*--------------------------------------------------------------------------*/
@@ -44,7 +45,7 @@ int C2F(sci_what)(char *fname,unsigned long fname_len)
        CheckLhs(1,2);
 
        CreateLocalFunctionsTab();
-       SortStrings(LocalFunctionsTab,SizeLocalFunctionsTab);
+       qsort( LocalFunctionsTab , SizeLocalFunctionsTab ,  sizeof (char *)  , cmpfunctionnames);
 
        if (Lhs == 1)
        {
@@ -82,10 +83,10 @@ static void DispInternalFunctions(void)
        sciprint("\n");
        sciprint(_("Internal Functions:\n"));
        sciprint("\n");
-       for (i=1;i<SizeLocalFunctionsTab-1;i++)
+       for (i=0;i<SizeLocalFunctionsTab;i++)
        {
-               sciprint("%+24s ",LocalFunctionsTab[i-1]);
-               if (i%4==0) sciprint("\n");
+               sciprint("%+24s ",LocalFunctionsTab[i]);
+               if ((i+1)%4==0) sciprint("\n");
        }
        sciprint("\n");
 }
@@ -99,10 +100,10 @@ static void DispCommands(void)
        sciprint("\n");
        sciprint(_("Commands:\n"));
        sciprint("\n");
-       for (i=1;i <sizecommandwords+1;i++)
+       for (i=0;i <sizecommandwords;i++)
        {
-               sciprint("%+24s ",commandwords[i-1]);
-               if (i%4==0) sciprint("\n");
+               sciprint("%+24s ",commandwords[i]);
+               if ((i+1)%4==0) sciprint("\n");
        }
        sciprint("\n");
 
@@ -178,24 +179,8 @@ static int CreateLocalFunctionsTab(void)
        return TRUE;
 }
 /*--------------------------------------------------------------------------*/
-static void SortStrings(char **Strs,int SizeOfStrs)
+static int cmpfunctionnames( const void *a ,const void *b)
 {
-       int fin,i;
-       for(fin=SizeOfStrs-1;fin>0;fin--)
-       {
-               int Sorted=FALSE;
-               for(i=0;i<fin;i++)
-               {
-                       if(strcmp(Strs[i],Strs[i+1])>0)
-                       {
-                               char *tmp;
-                               memcpy(&tmp,Strs+i,sizeof(char *));
-                               memcpy(Strs+i,Strs+(i+1),sizeof(char *));
-                               memcpy(Strs+(i+1),&tmp,sizeof(char *));
-                               Sorted=TRUE;
-                       }
-               }
-               if(!Sorted)break;
-       }
+       return strcmp(*(const char **)a, *(const char **)b );
 }
 /*--------------------------------------------------------------------------*/
similarity index 82%
rename from scilab/modules/core/src/c/boolean_api.c
rename to scilab/modules/core/src/c/api_boolean.c
index a1e8276..e8e52ce 100644 (file)
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "double_api.h"
-#include "internal_common_api.h"
-#include "internal_boolean_api.h"
+#include "api_common.h"
+#include "api_double.h"
+#include "api_boolean.h"
+#include "api_internal_common.h"
+#include "api_internal_boolean.h"
 
 #include "CallScilab.h"
 #include "stack-c.h"
@@ -48,7 +49,7 @@ int allocMatrixOfBoolean(int _iVar, int _iRows, int _iCols, int** _piBool)
        int iNewPos                     = Top - Rhs + _iVar;
        int iAddr                               = *Lstk(iNewPos);
 
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -97,7 +98,7 @@ int createNamedMatrixOfBoolean(char* _pstName, int _iNameLen, int _iRows, int _i
        C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        //write matrix information
        fillMatrixOfBoolean(piAddr, _iRows, _iCols, &piBool);
@@ -119,35 +120,23 @@ int createNamedMatrixOfBoolean(char* _pstName, int _iNameLen, int _iRows, int _i
 
 int readNamedMatrixOfBoolean(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, int* _piBool)
 {
-       int iVarID[nsiz];
        int* piAddr     = NULL;
        int* piBool     = NULL;
        int iRet                = 0;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable 
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
 
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
-
        iRet = getMatrixOfBoolean(piAddr, _piRows, _piCols, &piBool);
+       if(iRet)
+       {
+               return 1;
+       }
        
-       if(iRet == 0 && _piBool)
+       if(_piBool)
        {
                memcpy(_piBool, piBool, sizeof(int) * *_piRows * *_piCols);
        }
@@ -13,9 +13,9 @@
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "boolean_sparse_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_boolean_sparse.h"
 
 //#include <string.h>
 #include "CallScilab.h"
@@ -54,10 +54,9 @@ int allocBooleanSparseMatrix(int _iVar, int _iRows, int _iCols, int _iNbItem, in
 {
        int iNewPos                     = Top - Rhs + _iVar;
        int iAddr                               = *Lstk(iNewPos);
-       int *piAddr                     = NULL;
        int iPos                                = 0;
 
-       getNewVarAddressFromNumber(iNewPos, _piAddress);
+       getNewVarAddressFromPosition(iNewPos, _piAddress);
        fillBooleanSparseMatrix(*_piAddress, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos);
 
        iPos    = iAddr + 5;//4 for header + 1 for NbItem
@@ -119,7 +118,7 @@ int createNamedBooleanSparseMatrix(char* _pstName, int _iNameLen, int _iRows, in
   C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        fillBooleanSparseMatrix(piAddr, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos);
 
@@ -145,7 +144,6 @@ int createNamedBooleanSparseMatrix(char* _pstName, int _iNameLen, int _iRows, in
 int readNamedBooleanSparseMatrix(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, int* _piNbItem, int* _piNbItemRow, int* _piColPos)
 {
        int* piAddr                             = NULL;
-       int iNbItem                             = 0;
        int* piNbItemRow        = 0;
        int* piColPos                   = 0;
 
similarity index 78%
rename from scilab/modules/core/src/c/common_api.c
rename to scilab/modules/core/src/c/api_common.c
index e25331b..83e2009 100644 (file)
 #include <string.h>
 
 #include "CallScilab.h"
-#include "common_api.h"
-#include "internal_common_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
 #include "stack-c.h"
+#include "stackinfo.h"
+
+/* Defined in SCI/modules/core/src/fortran/cvname.f */
+extern int C2F(cvnamel)(int *id,char *str,int *jobptr,int *str_len); 
+/* *jobptr==0: Get Scilab codes from C-string */
+/* *jobptr==1: Get C-string from Scilab codes */
+
+#define idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz)
+#define CvNameL(id,str,jobptr,str_len) C2F(cvnamel)(id,str,jobptr,str_len);
 
 int getVarDimension(int* _piAddress, int* _piRows, int* _piCols)
 {
@@ -36,7 +45,7 @@ int getVarDimension(int* _piAddress, int* _piRows, int* _piCols)
        }
 }
 
-int getVarAddressFromNumber(int _iVar, int** _piAddress)
+int getVarAddressFromPosition(int _iVar, int** _piAddress)
 {
        int iAddr                       = iadr(*Lstk(Top - Rhs + _iVar));
        int iValType    = *istk(iAddr);
@@ -50,10 +59,23 @@ int getVarAddressFromNumber(int _iVar, int** _piAddress)
        return 0;
 }
 
-int getNewVarAddressFromNumber(int _iVar, int** _piAddress)
+int getVarNameFromPosition(int _iVar, char* _pstName)
+{
+       int iNameLen                            = 0;
+       int iJob1                                               = 1;
+       CvNameL(&vstk_.idstk[(_iVar - 1) * 6], _pstName, &iJob1, &iNameLen);
+       if(iNameLen == 0)
+       {
+               return 1;
+       }
+
+       _pstName[iNameLen]      = '\0';
+       return 0;
+}
+
+int getNewVarAddressFromPosition(int _iVar, int** _piAddress)
 {
        int iAddr                       = iadr(*Lstk(_iVar));
-       int iValType    = *istk(iAddr);
        *_piAddress             = istk(iAddr);
        //intersci_.ntypes[_iVar - 1] = '$' ;
 
@@ -83,7 +105,7 @@ int getVarAddressFromName(char* _pstName, int _iNameLen, int** _piAddress)
 
        //get variable address
        //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
+       getNewVarAddressFromPosition(Fin, &piAddr);
 
        *_piAddress = piAddr;
        return 0;
@@ -124,11 +146,11 @@ int isVarComplex(int* _piAddress)
 
 void createNamedVariable(int *_piVarID)
 {
-       int iZero                               = 0;
+       int iOne                                = 1;
        //it seems this part setting up the output format but "stackp" print anything
 //     int iSaveLct            = C2F(iop).lct[3];
 //  C2F(iop).lct[3] = -1;
-  C2F(stackp)(_piVarID, &iZero);
+  C2F(stackp)(_piVarID, &iOne);
 //  C2F(iop).lct[3] = iSaveLct;
 }
 
similarity index 96%
rename from scilab/modules/core/src/c/double_api.c
rename to scilab/modules/core/src/c/api_double.c
index f3ea8c0..8a501cb 100644 (file)
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "double_api.h"
-#include "internal_double_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_double.h"
+#include "api_internal_double.h"
 
 //#include <string.h>
 #include "CallScilab.h"
@@ -105,7 +105,7 @@ int allocCommonMatrixOfDouble(int _iVar, int _iComplex, int _iRows, int _iCols,
        int iAddr                               = *Lstk(iNewPos);
        int* piAddr                     = NULL;
 
-       getNewVarAddressFromNumber(iNewPos, &piAddr);
+       getNewVarAddressFromPosition(iNewPos, &piAddr);
        fillCommonMatrixOfDouble(piAddr, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg);
        updateInterSCI(_iVar, '$', iAddr, sadr(iadr(iAddr) + 4));
        updateLstk(iNewPos, sadr(iadr(iAddr) + 4), _iRows * _iCols * (_iComplex + 1));
@@ -184,7 +184,6 @@ int createCommunNamedMatrixOfDouble(char* _pstName, int _iNameLen, int _iComplex
        int iVarID[nsiz];
   int iSaveRhs                 = Rhs;
        int iSaveTop                    = Top;
-       int iOne                                        = 1;
        int iSize                                       = _iRows * _iCols;
        int iRet                                        = 0;
        int *piAddr                             = NULL;
@@ -194,7 +193,7 @@ int createCommunNamedMatrixOfDouble(char* _pstName, int _iNameLen, int _iComplex
   C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        //write matrix information
        fillCommonMatrixOfDouble(piAddr, _iComplex, _iRows, _iCols, &pdblReal, &pdblImg);
similarity index 84%
rename from scilab/modules/core/src/c/int_api.c
rename to scilab/modules/core/src/c/api_int.c
index 3fedbee..6ab08ed 100644 (file)
@@ -13,9 +13,9 @@
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "int_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_int.h"
 
 #include "CallScilab.h"
 #include "stack-c.h"
@@ -81,13 +81,12 @@ static int getCommonMatrixOfInteger(int* _piAddress, int _iPrecision, int* _piRo
        return 0;
 }
 
-int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _piData8, int** _piAddress)
+int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _piData8)
 {
        char *piData8   = NULL;
-       int * piAddr    = NULL;
        int iSize                       = _iRows * _iCols;
 
-       int iRet = allocMatrixOfInteger8(_iVar, _iRows, _iCols, &piData8, &piAddr);
+       int iRet = allocMatrixOfInteger8(_iVar, _iRows, _iCols, &piData8);
        if(iRet)
        {
                return 1;
@@ -97,13 +96,12 @@ int createMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char* _piData8, in
        return 0;
 }
 
-int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _piData16, int** _piAddress)
+int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _piData16)
 {
        short *piData16 = NULL;
-       int * piAddr    = NULL;
        int iSize                       = _iRows * _iCols;
 
-       int iRet = allocMatrixOfInteger16(_iVar, _iRows, _iCols, &piData16, &piAddr);
+       int iRet = allocMatrixOfInteger16(_iVar, _iRows, _iCols, &piData16);
        if(iRet)
        {
                return 1;
@@ -113,13 +111,12 @@ int createMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short* _piData16,
        return 0;
 }
 
-int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32, int** _piAddress)
+int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32)
 {
        int *piData32   = NULL;
-       int * piAddr    = NULL;
        int iSize                       = _iRows * _iCols;
 
-       int iRet = allocMatrixOfInteger32(_iVar, _iRows, _iCols, &piData32, &piAddr);
+       int iRet = allocMatrixOfInteger32(_iVar, _iRows, _iCols, &piData32);
        if(iRet)
        {
                return 1;
@@ -130,13 +127,12 @@ int createMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int* _piData32, i
 }
 
 #ifdef __SCILAB_INT64__
-int createMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long* _piData64, int** _piAddress)
+int createMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long* _piData64)
 {
        long long  *piData64    = NULL;
-       int * piAddr                                    = NULL;
        int iSize                                                       = _iRows * _iCols;
 
-       int iRet = allocMatrixOfInteger64(_iVar, _iRows, _iCols, &piData64, &piAddr);
+       int iRet = allocMatrixOfInteger64(_iVar, _iRows, _iCols, &piData64);
        if(iRet)
        {
                return 1;
@@ -147,13 +143,13 @@ int createMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long* _piDat
 }
 #endif
 
-int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _piData8, int **_piAddress)
+int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _piData8)
 {
        int *piAddr             = NULL;
        char *piData8   = NULL;
 
        int iNewPos = Top - Rhs + _iVar;
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -165,19 +161,17 @@ int allocMatrixOfInteger8(int _iVar, int _iRows, int _iCols, char** _piData8, in
                return 1;
        }
 
-       *_piAddress = piAddr;
        *_piData8               = piData8;
-
        return 0;
 }
 
-int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _piData16, int **_piAddress)
+int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _piData16)
 {
        int *piAddr                     = NULL;
        short *piData16 = NULL;
 
        int iNewPos = Top - Rhs + _iVar;
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -189,19 +183,17 @@ int allocMatrixOfInteger16(int _iVar, int _iRows, int _iCols, short** _piData16,
                return 1;
        }
 
-       *_piAddress = piAddr;
        *_piData16      = piData16;
-
        return 0;
 }
 
-int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32, int **_piAddress)
+int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32)
 {
        int *piAddr             = NULL;
        int *piData32   = NULL;
 
        int iNewPos = Top - Rhs + _iVar;
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -213,14 +205,12 @@ int allocMatrixOfInteger32(int _iVar, int _iRows, int _iCols, int** _piData32, i
                return 1;
        }
 
-       *_piAddress = piAddr;
        *_piData32      = piData32;
-
        return 0;
 }
 
 #ifdef __SCILAB_INT64__
-int allocMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long** _piData64, int **_piAddress)
+int allocMatrixOfInteger64(int _iVar, int _iRows, int _iCols, long long** _piData64)
 {
        return 1;
 }
@@ -297,7 +287,7 @@ static int createCommonNamedMatrixOfInteger(char* _pstName, int _iNameLen, int _
        C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        //write matrix information
        fillCommonMatrixOfInteger(piAddr, _iPrecision, _iRows, _iCols, &piData);
@@ -319,30 +309,15 @@ static int createCommonNamedMatrixOfInteger(char* _pstName, int _iNameLen, int _
 
 int getNamedMatrixOfIntegerPrecision(char* _pstName, int _iNameLen, int* _piPrecision)
 {
-       int iVarID[nsiz];
+       int iRet                                        = 0;
        int* piAddr                             = NULL;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable 
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
 
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
-
        //check variable type
        if(piAddr[0] != sci_ints)
        {
@@ -377,32 +352,17 @@ int readNamedMatrixOfInteger64(char* _pstName, int _iNameLen, int* _piRows, int*
 
 static int readCommonNamedMatrixOfInteger(char* _pstName, int _iNameLen, int _iPrecision, int* _piRows, int* _piCols, void* _piData)
 {
-       int iVarID[nsiz];
+       int iRet                                        = 0;
        int* piAddr                             = NULL;
        int iSize                                       = 0;
        void* piData                    = NULL;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable 
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
 
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
-       
        getCommonMatrixOfInteger(piAddr, _iPrecision, _piRows, _piCols, &piData);
 
        iSize = *_piRows * *_piCols;
@@ -12,7 +12,7 @@
 #ifndef __INTERNAL_COMMON_API__
 #define __INTERNAL_COMMON_API__
 
-int getNewVarAddressFromNumber(int _iVar, int** _piAddress);
+int getNewVarAddressFromPosition(int _iVar, int** _piAddress);
 
 #endif /* __INTERNAL_COMMON_API__ */
 
diff --git a/scilab/modules/core/src/c/api_internal_poly.h b/scilab/modules/core/src/c/api_internal_poly.h
new file mode 100644 (file)
index 0000000..0b95a97
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009 - DIGITEO - Antoine ELIAS
+ *
+ * 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
+ */
+
+#ifndef __INTERNAL_POLY_API__
+#define __INTERNAL_POLY_API__
+
+//internal poly functions
+int getCommonMatrixOfPoly(int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+int fillCommonMatrixOfPoly(int* _piAddress, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen);
+int createCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+int readCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+int createCommonMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+int readCommonMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+
+#endif /* __INTERNAL_POLY_API__ */
+
similarity index 66%
rename from scilab/modules/core/src/c/list_api.c
rename to scilab/modules/core/src/c/api_list.c
index 72fc7e5..152ddc4 100644 (file)
 #include "stack-c.h"
 #include "CallScilab.h"
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "internal_double_api.h"
-#include "internal_string_api.h"
-#include "internal_boolean_api.h"
-#include "list_api.h"
-#include "string_api.h"
-#include "boolean_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_internal_double.h"
+#include "api_internal_string.h"
+#include "api_internal_boolean.h"
+#include "api_internal_poly.h"
+#include "api_list.h"
+#include "api_string.h"
+#include "api_boolean.h"
 
 
 //internal functions
 static int createCommonList(int _iVar, int _iListType, int _iNbItem, int** _piAddress);
-static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress);
+static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress, int iNamed);
 static int createCommonNamedList(char* _pstName, int _iNameLen, int _iListType, int _iNbItem, int** _piAddress);
 static int createCommonListInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress);
 static int getCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int** _piAddress);
@@ -39,7 +40,9 @@ static int fillCommonList(int* _piAddress, int _iListType, int _iNbItem);
 static int isKindOfList(int* _piNode);
 static int getParentList(int* _piStart, int* _piToFind, int* _piDepth, int** _piParent);
 static void closeList(int _iVar, int *_piEnd);
-static void updateOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd);
+static void updateListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd);
+static void updateNamedListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd);
+static void updateCommunListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd);
 
 static int allocCommonMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, double **_pdblReal, double **_pdblImg);
 static int getCommonMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, double** _pdblReal, double** _pdblImg);
@@ -49,9 +52,10 @@ static int createCommomMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen,
 static int readCommonMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, double* _pdblReal, double* _pdblImg);
 static int allocCommonItemInList(int* _piParent, int _iItemPos, int** _piChildAddr);
 static int fillMatrixOfBoolInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int** _piBool);
-
-
-int fillCommonMatrixOfStringInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pstStrings, int* _piTotalLen);
+static int getCommonxMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+static int createCommonMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+static int fillCommonMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen);
+static int fillCommonMatrixOfStringInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pstStrings, int* _piTotalLen);
 
 int getListItemNumber(int* _piAddress, int* _piNbItem)
 {
@@ -71,9 +75,7 @@ int getListItemNumber(int* _piAddress, int* _piNbItem)
 
 int getListItemAddress(int* _piAddress, int _iItemNum, int** _piItemAddress)
 {
-       int i                                                           = 0;
        int iRet                                                = 0;
-       int iType                                               = 0;
        int iItem                                               = 0;
        int* piOffset                           = NULL;
        int* piItemAddress      = NULL;
@@ -127,22 +129,29 @@ static int createCommonNamedList(char* _pstName, int _iNameLen, int _iListType,
        int iVarID[nsiz];
   int iSaveRhs                 = Rhs;
        int iSaveTop                    = Top;
-       int iOne                                        = 1;
        int iRet                                        = 0;
        int *piAddr                             = NULL;
+       int* piEnd                              = NULL;
 
   C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
        fillCommonList(piAddr, _iListType, _iNbItem);
 
+       piEnd = piAddr + 3 + _iNbItem + !(_iNbItem % 2);
+       closeList(Top, piEnd);
+
+
        Rhs = 0;
-       //Add name in stack reference list
-       createNamedVariable(iVarID);
+       
+       if(_iNbItem == 0)
+       {//Add name in stack reference list
+               createNamedVariable(iVarID);
+       }
 
-       Top = iSaveTop;
-  Rhs = iSaveRhs;
+       Top                                             = iSaveTop;
+  Rhs                                          = iSaveRhs;
 
        *_piAddress = piAddr;
        return 0;
@@ -150,14 +159,11 @@ static int createCommonNamedList(char* _pstName, int _iNameLen, int _iListType,
 
 static int createCommonList(int _iVar, int _iListType, int _iNbItem, int** _piAddress)
 {
-       int i                                           = 0;
        int *piAddr                     = NULL;
-       int* piBool                     = NULL;
        int iNewPos                     = Top - Rhs + _iVar;
        int iAddr                               = *Lstk(iNewPos);
-       int* piOffset           = NULL;
 
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet)
        {
                return 1;
@@ -256,7 +262,6 @@ int getMListInList(int _iVar, int* _piParent, int _iItemPos, int** _piAddress)
 int getCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int** _piAddress)
 {
        int iRet                        = 0;
-       int* piAddr             = NULL;
 
        iRet = getListItemAddress(_piParent, _iItemPos, _piAddress);
        if(iRet)
@@ -353,17 +358,19 @@ static int allocCommonMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItem
 
        piEnd = (int*) (*_pdblReal + _iRows * _iCols * (_iComplex + 1));
        closeList(iNewPos, piEnd);
+
+       if(_iItemPos == _piParent[1])
+       {
+               updateListOffset(_iVar, _piParent, _iItemPos, piEnd);
+       }
+
        return 0;
 }
 
 static int fillCommonMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, double** _pdblReal, double** _pdblImg)
 {
-       int i                                                   = 0;
        int iRet                                        = 0;
        int iNbItem                             = 0;
-       int iNewPos                             = Top - Rhs + _iVar;
-       int iAddr                                       = *Lstk(iNewPos);
-       int* piEnd                              = NULL;
        int* piOffset                   = NULL;
        int* piChildAddr        = NULL;
 
@@ -390,11 +397,6 @@ static int fillCommonMatrixOfDoubleInList(int _iVar, int* _piParent, int _iItemP
        piOffset                                                = _piParent + 2;
        piOffset[_iItemPos] = piOffset[_iItemPos - 1] + _iRows * _iCols * (_iComplex + 1) + 2;
 
-       piEnd   =       piChildAddr + 4 + (_iRows * _iCols * (_iComplex + 1) * (sizeof(double) / sizeof(int)));
-       if(_iItemPos == iNbItem)
-       {
-               updateOffset(_iVar, _piParent, _iItemPos, piEnd);
-       }
        return 0;
 }
 
@@ -465,18 +467,20 @@ int createComplexMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen, int* _
 
 int createCommomMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, double* _pdblReal, double* _pdblImg)
 {
+       int iVarID[nsiz];
   int iSaveRhs                 = Rhs;
        int iSaveTop                    = Top;
        int iRet                                        = 0;
-       int iNewPos                             = 0;
        int *piAddr                             = NULL;
        double *pdblReal        = NULL;
        double *pdblImg         = NULL;
        int* piEnd                              = NULL;
+       int* piChildAddr        = NULL;
 
+  C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
        if(iRet)
        {
                return 1;
@@ -494,9 +498,21 @@ int createCommomMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen, int* _p
                memcpy(pdblImg, _pdblImg, sizeof(double) * _iRows * _iCols);
        }
 
-       piEnd = (int*) (pdblReal + _iRows * _iCols * (_iComplex + 1));
+       iRet = allocCommonItemInList(_piParent, _iItemPos, &piChildAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       piEnd = piChildAddr + 4 + (_iRows * _iCols * 2);
        closeList(Top, piEnd);
 
+       if(_iItemPos == _piParent[1])
+       {
+               updateNamedListOffset(Top, _piParent, _iItemPos, piEnd);
+               createNamedVariable(iVarID);
+       }
+
        Top = iSaveTop;
   Rhs = iSaveRhs;
 
@@ -505,28 +521,24 @@ int createCommomMatrixOfDoubleInNamedList(char* _pstName, int _iNameLen, int* _p
 
 int createListInList(int _iVar, int* _piParent, int _iItemPos, int _iNbItem, int** _piAddress)
 {
-       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_list, _iNbItem, _piAddress);
+       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_list, _iNbItem, _piAddress, 0);
 }
 
 int createTListInList(int _iVar, int* _piParent, int _iItemPos, int _iNbItem, int** _piAddress)
 {
-       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_tlist, _iNbItem, _piAddress);
+       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_tlist, _iNbItem, _piAddress, 0);
 }
 
 int createMListInList(int _iVar, int* _piParent, int _iItemPos, int _iNbItem, int** _piAddress)
 {
-       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_mlist, _iNbItem, _piAddress);
+       return createCommonListInList(_iVar, _piParent, _iItemPos, sci_mlist, _iNbItem, _piAddress, 0);
 }
 
-static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress)
+static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress, int iNamed)
 {
-       int i                                                   = 0;
        int iRet                                        = 0;
        int iNewPos                             = Top - Rhs + _iVar;
-       int iAddr                                       = *Lstk(iNewPos);
        int iNbItem                             = 0;
-       int* piOffset                   = NULL;
-       //int* piAddr                           = NULL;
        int* piChildAddr        = NULL;
 
        //Does item can be added in the list
@@ -549,7 +561,14 @@ static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int
        }
 
        *_piAddress = piChildAddr;
-       closeList(iNewPos, piChildAddr + 2 + _iNbItem + 1 + !(_iNbItem % 2));
+               if(iNamed)
+               {
+                       closeList(_iVar, piChildAddr + 2 + _iNbItem + 1 + !(_iNbItem % 2));
+               }
+               else
+               {
+                       closeList(iNewPos, piChildAddr + 2 + _iNbItem + 1 + !(_iNbItem % 2));
+               }
 
        if(_iNbItem == 0)
        {//for empty list
@@ -557,7 +576,14 @@ static int createCommonListInList(int _iVar, int* _piParent, int _iItemPos, int
                int* piEnd                                      = piChildAddr + 4;
 
                piOffset[_iItemPos] = piOffset[_iItemPos - 1] + 2;
-               updateOffset(_iVar, _piParent, _iItemPos, piEnd);
+               if(iNamed)
+               {
+                       updateNamedListOffset(_iVar, _piParent, _iItemPos, piEnd);
+               }
+               else
+               {
+                       updateListOffset(_iVar, _piParent, _iItemPos, piEnd);
+               }
        }
 
        return 0;
@@ -580,15 +606,24 @@ int createMListInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _i
 
 int createCommonListInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iListType, int _iNbItem, int** _piAddress)
 {
-       int iRet                                        = 0;
-       int iTotalLen                   = 0;
+       int iVarID[nsiz];
+       int iRet = 0;
+       int iSaveTop = Top;
 
-       iRet = createCommonListInList(Top, _piParent, _iItemPos, _iListType, _iNbItem, _piAddress);
-       if(iRet)
+  C2F(str2name)(_pstName, iVarID, _iNameLen);
+       Top = Top + Nbvars + 1;
+
+       iRet = createCommonListInList(Top, _piParent, _iItemPos, _iListType, _iNbItem, _piAddress, 1);
+
+       if(_iNbItem == 0 && _iItemPos == _piParent[1])
        {
-               return 1;
+               int* piEnd = *_piAddress + 4;
+               updateNamedListOffset(Top, _piParent, _iItemPos, piEnd);
+               createNamedVariable(iVarID);
        }
-       return 0;
+
+       Top = iSaveTop;
+       return iRet;
 }
 
 
@@ -683,6 +718,12 @@ int createMatrixOfStringInList(int _iVar, int* _piParent, int _iItemPos, int _iR
 
        piEnd = piItemAddr + iTotalLen + 5 + _iRows * _iCols + !((iTotalLen + _iRows * _iCols) % 2);
        closeList(iNewPos, piEnd);
+
+       if(_iItemPos == iNbItem)
+       {
+               updateListOffset(_iVar, _piParent, _iItemPos, piEnd);
+       }
+
        return 0;
 }
 
@@ -693,7 +734,6 @@ int fillCommonMatrixOfStringInList(int _iVar, int* _piParent, int _iItemPos, int
 
        int* piAddr                     = NULL;
        int* piOffset           = NULL;
-       int* piEnd                      = NULL;
 
        //Does item can be added in the list
        getListItemNumber(_piParent, &iNbItem);
@@ -717,16 +757,12 @@ int fillCommonMatrixOfStringInList(int _iVar, int* _piParent, int _iItemPos, int
        piOffset                                                = _piParent + 2;
        piOffset[_iItemPos] = piOffset[_iItemPos - 1] + (*_piTotalLen + 5 + _iRows * _iCols + !((*_piTotalLen + _iRows * _iCols) %2)) / 2;
 
-       piEnd = piAddr + (*_piTotalLen + 5 + _iRows * _iCols + !((_iRows * _iCols) %2));
-       if(_iItemPos == iNbItem)
-       {
-               updateOffset(_iVar, _piParent, _iItemPos, piEnd);
-       }
-               return 0;
+       return 0;
 }
 
 int createMatrixOfStringInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pstStrings)
 {
+       int iVarID[nsiz];
        int iRet                                        = 0;
        int iTotalLen                   = 0;
        int iSaveRhs                    = Rhs;
@@ -735,6 +771,7 @@ int createMatrixOfStringInNamedList(char* _pstName, int _iNameLen, int* _piParen
        int* piItemAddr         = NULL;
        int* piEnd                              = NULL;
 
+  C2F(str2name)(_pstName, iVarID, _iNameLen);
        Top = Top + Nbvars + 1;
 
        iRet = getListItemAddress(_piParent, _iItemPos, &piItemAddr);
@@ -749,9 +786,15 @@ int createMatrixOfStringInNamedList(char* _pstName, int _iNameLen, int* _piParen
                return 1;
        }
 
-       piEnd = piItemAddr + iTotalLen + 5 + _iRows * _iCols;
+       piEnd = piItemAddr + (iTotalLen + 5 + _iRows * _iCols + !((_iRows * _iCols) %2));
        closeList(Top, piEnd);
 
+       if(_iItemPos == _piParent[1])
+       {
+               updateNamedListOffset(Top, _piParent, _iItemPos, piEnd);
+               createNamedVariable(iVarID);
+       }
+
        Top = iSaveTop;
   Rhs = iSaveRhs;
 
@@ -764,6 +807,10 @@ int readMatrixOfStringInNamedList(char* _pstName, int _iNameLen, int* _piParent,
        return 0;
 }
 
+/*********************
+ * boolean functions *
+ *********************/
+
 int getMatrixOfBooleanInList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int** _piBool)
 {
        int iRet                        = 0;
@@ -808,19 +855,20 @@ int allocMatrixOfBooleanInList(int _iVar, int* _piParent, int _iItemPos, int _iR
 
        fillMatrixOfBoolInList(_iVar, _piParent, _iItemPos, _iRows, _iCols, _piBool);
 
-       piEnd = *_piBool + _iRows * _iCols;
+       piEnd = *_piBool + _iRows * _iCols + !((_iRows * _iCols) % 2);
        closeList(iNewPos, piEnd);
+
+       if(_iItemPos == _piParent[1])
+       {
+               updateListOffset(_iVar, _piParent, _iItemPos, piEnd);
+       }
        return 0;
 }
 
 static int fillMatrixOfBoolInList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int** _piBool)
 {
-       int i                                                   = 0;
        int iRet                                        = 0;
        int iNbItem                             = 0;
-       int iNewPos                             = Top - Rhs + _iVar;
-       int iAddr                                       = *Lstk(iNewPos);
-       int* piEnd                              = NULL;
        int* piOffset                   = NULL;
        int* piChildAddr        = NULL;
 
@@ -847,27 +895,307 @@ static int fillMatrixOfBoolInList(int _iVar, int* _piParent, int _iItemPos, int
        piOffset                                                = _piParent + 2;
        piOffset[_iItemPos] = piOffset[_iItemPos - 1] + ((3 + _iRows * _iCols + !((_iRows * _iCols) % 2)) / 2);
 
-       piEnd   =       piChildAddr + 3 + _iRows * _iCols + !((_iRows * _iCols) % 2);
-       if(_iItemPos == iNbItem)
+       return 0;
+}
+
+int createMatrixOfBooleanInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piBool)
+{
+       int iVarID[nsiz];
+  int iSaveRhs                 = Rhs;
+       int iSaveTop                    = Top;
+       int iRet                                        = 0;
+       int *piAddr                             = NULL;
+       int* piBool                             = NULL;
+       int* piEnd                              = NULL;
+       int* piChildAddr        = NULL;
+
+  C2F(str2name)(_pstName, iVarID, _iNameLen);
+  Top = Top + Nbvars + 1;
+
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iRet = fillMatrixOfBoolInList(Top, _piParent, _iItemPos, _iRows, _iCols, &piBool);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       memcpy(piBool, _piBool, sizeof(int) * _iRows * _iCols);
+
+       iRet = allocCommonItemInList(_piParent, _iItemPos, &piChildAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       piEnd = piChildAddr + 4 + (_iRows * _iCols) + ((_iRows * _iCols) % 2);
+       closeList(Top, piEnd);
+
+       if(_iItemPos == _piParent[1])
+       {
+               updateNamedListOffset(Top, _piParent, _iItemPos, piEnd);
+               createNamedVariable(iVarID);
+       }
+
+       Top = iSaveTop;
+  Rhs = iSaveRhs;
+
+       return 0;
+}
+
+/*************************
+ * polynomials functions *
+ *************************/
+
+int getMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal)
+{
+       return getCommonxMatrixOfPolyInList(_iVar, _piParent, _iItemPos, 0, _piRows, _piCols, _piNbCoef, _pdblReal, NULL);
+}
+
+int getComplexMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       return getCommonxMatrixOfPolyInList(_iVar, _piParent, _iItemPos, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
+}
+
+int getCommonxMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       int iRet                        = 0;
+       int* piAddr             = NULL;
+
+       iRet = getListItemAddress(_piParent, _iItemPos, &piAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iRet = getCommonMatrixOfPoly(piAddr, _iComplex, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
+       if(iRet)
+       {
+               return 1;
+       }
+       return 0;
+}
+
+int createMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal)
+{
+       return createCommonMatrixOfPolyInList(_iVar, _piParent, _iItemPos, _pstVarName, 0, _iRows, _iCols, _piNbCoef, _pdblReal, NULL);
+}
+
+int createComplexMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       return createCommonMatrixOfPolyInList(_iVar, _piParent, _iItemPos, _pstVarName, 1, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
+}
+
+int createCommonMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       int iRet                                                = 0;
+       int* piItemAddr                 = NULL;
+       int *piEnd                                      = NULL;
+       int iItemLen                            = 0;
+       int iTotalLen                           = 0;
+
+       iRet = getListItemAddress(_piParent, _iItemPos, &piItemAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iRet = fillCommonMatrixOfPolyInList(_iVar, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iItemLen                                                = 9 + _iRows * _iCols + (9 + _iRows * _iCols)%2;
+       iItemLen                                                += iTotalLen;
+       piEnd                                                           =       piItemAddr + iItemLen;
+       if(_iItemPos == _piParent[1])
+       {
+               updateListOffset(_iVar, _piParent, _iItemPos, piEnd);
+       }
+
+       closeList(_iVar, piEnd);
+
+       return 0;
+}
+
+static int fillCommonMatrixOfPolyInList(int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen)
+{
+       int iRet                                        = 0;
+       int iNbItem                             = 0;
+       int iTotalLen                   = 0;
+       int* piOffset                   = NULL;
+       int* piChildAddr        = NULL;
+
+       int iItemLen                    = 0;
+
+       //Does item can be added in the list
+       getListItemNumber(_piParent, &iNbItem);
+       if(iNbItem < _iItemPos)
+       {
+               return 1;
+       }
+
+       iRet = allocCommonItemInList(_piParent, _iItemPos, &piChildAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iRet = fillCommonMatrixOfPoly(piChildAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       piOffset                                                = _piParent + 2;
+
+       iItemLen                                                = 9 + _iRows * _iCols + (9 + _iRows * _iCols)%2;
+       iItemLen                                                += iTotalLen;
+       piOffset[_iItemPos] = piOffset[_iItemPos - 1] + ((iItemLen + 1) / 2);
+
+       *_piTotalLen = iTotalLen;
+       return 0;
+}
+
+
+int createMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal)
+{
+       return createCommonMatrixOfPolyInNamedList(_pstName, _iNameLen, _piParent, _iItemPos, _pstVarName, 0, _iRows, _iCols, _piNbCoef, _pdblReal, NULL);
+}
+
+int createComplexMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       return createCommonMatrixOfPolyInNamedList(_pstName, _iNameLen, _piParent, _iItemPos, _pstVarName, 1, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
+}
+
+int createCommonMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       int iVarID[nsiz];
+  int iSaveRhs                 = Rhs;
+       int iSaveTop                    = Top;
+       int iRet                                        = 0;
+       int *piAddr                             = NULL;
+       int* piEnd                              = NULL;
+       int* piChildAddr        = NULL;
+       int iTotalLen                   = 0;
+       int iItemLen                    = 0;
+
+  C2F(str2name)(_pstName, iVarID, _iNameLen);
+  Top = Top + Nbvars + 1;
+
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iRet = fillCommonMatrixOfPolyInList(Top, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
+       if(iRet)
+       {
+               return 1;
+       }
+
+       iItemLen                                                = 9 + _iRows * _iCols + (9 + _iRows * _iCols)%2;
+       iItemLen                                                += iTotalLen;
+
+       getListItemAddress(_piParent, _iItemPos, &piChildAddr);
+       piEnd                                                           =       piChildAddr + iItemLen;
+       closeList(Top, piEnd);
+
+       if(_iItemPos == _piParent[1])
        {
-               updateOffset(_iVar, _piParent, _iItemPos, piEnd);
+               updateNamedListOffset(Top, _piParent, _iItemPos, piEnd);
+               createNamedVariable(iVarID);
        }
+
+
+       Top = iSaveTop;
+  Rhs = iSaveRhs;
+
        return 0;
 }
 
+int readMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal)
+{
+       return readCommonMatrixOfPolyInNamedList(_pstName, _iNameLen, _piParent, _iItemPos, 0, _piRows, _piCols, _piNbCoef, _pdblReal, NULL);
+}
+
+int readComplexMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       return readCommonMatrixOfPolyInNamedList(_pstName, _iNameLen, _piParent, _iItemPos, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
+}
+
+int readCommonMatrixOfPolyInNamedList(char* _pstName, int _iNameLen, int _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+//TODO !!!!!
+}
+
+int allocMatrixOfInteger8InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char* _pcData)
+{
+}
+
+int allocMatrixOfInteger16InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, short* _psData)
+{
+}
+
+int allocMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData)
+{
+}
+
+int createMatrixOfInteger8InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char* _pcData)
+{
+}
+
+int createMatrixOfInteger16InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, short* _psData)
+{
+}
+
+int createMatrixOfInteger32InList(int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData)
+{
+}
+
+
+int createMatrixOfInteger8InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, char* _pcData)
+{
+
+}
+
+int createMatrixOfInteger16InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, short* _psData)
+{
+
+}
+
+int createMatrixOfInteger32InNamedList(char* _pstName, int _iNameLen, int* _piParent, int _iItemPos, int _iRows, int _iCols, int* _piData)
+{
+}
+
+
+
+static void updateNamedListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd)
+{
+       updateCommunListOffset(_iVar, _piCurrentNode, _iItemPos, _piEnd);
+}
+
+static void updateListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd)
+{
+       int iNewPos                             = Top - Rhs + _iVar;
+       updateCommunListOffset(iNewPos, _piCurrentNode, _iItemPos, _piEnd);
+}
 
 //internal tool functions
-static void updateOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd)
+static void updateCommunListOffset(int _iVar, int *_piCurrentNode, int _iItemPos, int *_piEnd)
 {
        //find list depth and update list offset for last item
        int i                                                   = 0;
-       int iNewPos                             = Top - Rhs + _iVar;
-       int *piRoot                             = istk(iadr(*Lstk(iNewPos)));
+       int *piRoot                             = istk(iadr(*Lstk(_iVar)));
        int iDepth                              = 1; //we are already in a list
        int iMaxDepth                   = 0; //we are already in a list
-       int iLastChild          = 0;
        int **piParent                  = NULL;
-       int iItemPos                    = 0;
 
        getParentList(piRoot, _piCurrentNode, &iDepth, NULL);
        piParent = (int**)MALLOC(sizeof(int*) * iDepth);
@@ -910,7 +1238,6 @@ static void closeList(int _iVar, int *_piEnd)
        //Get Root address;
        int *piRoot                             = istk(iadr(*Lstk(_iVar)));
        int iAddr                                       = *Lstk(_iVar);
-       int iAddr2                              = iadr(*Lstk(_iVar));
 
        int iOffsetData         =       2 + piRoot[1] + 1 + !(piRoot[1] % 2);
        int iScale                              = (int)(_piEnd - (piRoot + iOffsetData));
@@ -921,7 +1248,6 @@ static void closeList(int _iVar, int *_piEnd)
 
 static int getParentList(int* _piStart, int* _piToFind, int* _piDepth, int** _piParent)
 {
-       int iRet = 0;
        if(isKindOfList(_piStart))
        {
                int iItem       = _piStart[1];
similarity index 68%
rename from scilab/modules/core/src/c/poly_api.c
rename to scilab/modules/core/src/c/api_poly.c
index 6d07138..40259cc 100644 (file)
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "poly_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_internal_poly.h"
+#include "api_poly.h"
 
 #include "MALLOC.h"
 #include "CallScilab.h"
 #include "stack-c.h"
 #include "code2str.h"
 
-//internal poly functions
-static int getCommonMatrixOfPoly(int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
-static int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int** _piAddress);
-static int fillCommonMatrixOfPoly(int* _piAddress, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen);
-static int createCommonNamedComplexMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
-static int readCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
 
 int getPolyVariableName(int* _piAddress, char* _pstVarName, int* _piVarNameLen)
 {
@@ -73,7 +68,7 @@ int getComplexMatrixOfPoly(int* _piAddress, int* _piRows, int* _piCols, int* _pi
        return getCommonMatrixOfPoly(_piAddress, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
 }
 
-static int getCommonMatrixOfPoly(int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+int getCommonMatrixOfPoly(int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
        int i                                                   = 0;
        int iSize                                       = 0;
@@ -124,17 +119,17 @@ static int getCommonMatrixOfPoly(int* _piAddress, int _iComplex, int* _piRows, i
        return 0;
 }
 
-int createMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, int** _piAddress)
+int createMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal)
 {
-       return createCommonMatrixOfPoly(_iVar, 0, _pstVarName, _iRows, _iCols, _piNbCoef, _pdblReal, NULL, _piAddress);
+       return createCommonMatrixOfPoly(_iVar, 0, _pstVarName, _iRows, _iCols, _piNbCoef, _pdblReal, NULL);
 }
 
-int createComplexMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int** _piAddress)
+int createComplexMatrixOfPoly(int _iVar, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
-       return createCommonMatrixOfPoly(_iVar, 1, _pstVarName, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, _piAddress);
+       return createCommonMatrixOfPoly(_iVar, 1, _pstVarName, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
 }
 
-static int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int** _piAddress)
+int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
        int *piAddr                             = NULL;
        int iSize                                       = _iRows * _iCols;
@@ -142,7 +137,7 @@ static int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName,
        int iAddr                                       = *Lstk(iNewPos);
        int iTotalLen                   = 0;
 
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -150,15 +145,13 @@ static int createCommonMatrixOfPoly(int _iVar, int _iComplex, char* _pstVarName,
 
        fillCommonMatrixOfPoly(piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
 
-       *_piAddress = piAddr;
-
        updateInterSCI(_iVar, '$', iAddr, iAddr + 4 + 4 + iSize + 1);
        updateLstk(iNewPos, iAddr + 4 + 4 + iSize + 1, iTotalLen);
 
        return 0;
 }
 
-static int fillCommonMatrixOfPoly(int* _piAddress, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen)
+int fillCommonMatrixOfPoly(int* _piAddress, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen)
 {
        int i                                                   = 0;
        int* piOffset                   = NULL;
@@ -217,20 +210,19 @@ static int fillCommonMatrixOfPoly(int* _piAddress, char* _pstVarName, int _iComp
 
 int createNamedMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal)
 {
-       return createCommonNamedComplexMatrixOfPoly(_pstName, _iNameLen, _pstVarName, 0, _iRows, _iCols, _piNbCoef, _pdblReal, NULL);
+       return createCommonNamedMatrixOfPoly(_pstName, _iNameLen, _pstVarName, 0, _iRows, _iCols, _piNbCoef, _pdblReal, NULL);
 }
 
 int createNamedComplexMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
-       return createCommonNamedComplexMatrixOfPoly(_pstName, _iNameLen, _pstVarName, 1, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
+       return createCommonNamedMatrixOfPoly(_pstName, _iNameLen, _pstVarName, 1, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
 }
 
-static int createCommonNamedComplexMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+int createCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
        int iVarID[nsiz];
   int iSaveRhs                 = Rhs;
        int iSaveTop                    = Top;
-       int iSize                                       = _iRows * _iCols;
        int iRet                                        = 0;
        int *piAddr                             = NULL;
        int iTotalLen                   = 0;
@@ -238,7 +230,7 @@ static int createCommonNamedComplexMatrixOfPoly(char* _pstName, int _iNameLen, c
        C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        //write matrix information
        fillCommonMatrixOfPoly(piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
@@ -266,35 +258,16 @@ int readNamedComplexMatrixOfPoly(char* _pstName, int _iNameLen, int* _piRows, in
        return readCommonNamedMatrixOfPoly(_pstName, _iNameLen, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
 }
 
-static int readCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+int readCommonNamedMatrixOfPoly(char* _pstName, int _iNameLen, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
 {
-       int iVarID[nsiz];
+       int iRet                                        = 0;
        int* piAddr                             = NULL;
-       double* pdblReal        = NULL;
-       double* pdblImg         = NULL;
-       int iSize                                       = 0;
-       int iOne                                        = 1;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable 
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
-
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
        
        if(_iComplex == 1)
        {
similarity index 94%
rename from scilab/modules/core/src/c/sparse_api.c
rename to scilab/modules/core/src/c/api_sparse.c
index 94be5e9..62741c0 100644 (file)
@@ -13,9 +13,9 @@
  * still available and supported in Scilab 6.
  */
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "sparse_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_sparse.h"
 
 #include "MALLOC.h"
 #include "CallScilab.h"
@@ -41,7 +41,6 @@ int getComplexSparseMatrix(int* _piAddress, int* _piRows, int* _piCols, int* _pi
 
 static int getCommonSparseMatrix(int* _piAddress, int _iComplex, int* _piRows, int* _piCols, int* _piNbItem, int** _piNbItemRow, int** _piColPos, double** _pdblReal, double** _pdblImg)
 {
-       int i                                                   = 0;
        int iPos                                        = 0;
 
        if(     _piAddress == NULL || 
@@ -95,11 +94,10 @@ static int allocCommonSparseMatrix(int _iVar, int _iComplex, int _iRows, int _iC
 {
        int iNewPos                     = Top - Rhs + _iVar;
        int iAddr                               = *Lstk(iNewPos);
-       int *piAddr                     = NULL;
        int     iTotalSize      = 0;
        int iOffset                     = 0;
 
-       getNewVarAddressFromNumber(iNewPos, _piAddress);
+       getNewVarAddressFromPosition(iNewPos, _piAddress);
        fillCommonSparseMatrix(*_piAddress, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg, &iTotalSize);
 
        iOffset = 5;//4 for header + 1 for NbItem
@@ -200,7 +198,7 @@ static int createCommonNamedSparseMatrix(char* _pstName, int _iNameLen, int _iCo
   C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
        fillCommonSparseMatrix(piAddr, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg, &iTotalSize);
 
@@ -241,7 +239,7 @@ int readNamedComplexSparseMatrix(char* _pstName, int _iNameLen, int* _piRows, in
 
 static int readCommonNamedSparseMatrix(char* _pstName, int _iNameLen, int _iComplex, int* _piRows, int* _piCols, int* _piNbItem, int* _piNbItemRow, int* _piColPos, double* _pdblReal, double* _pdblImg)
 {
-       int iVarID[nsiz];
+       int iRet                                        = 0;
        int* piAddr                             = NULL;
        int* piNbItemRow        = 0;
        int* piColPos                   = 0;
@@ -249,26 +247,11 @@ static int readCommonNamedSparseMatrix(char* _pstName, int _iNameLen, int _iComp
        double* pdblReal        = NULL;
        double* pdblImg         = NULL;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable 
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
-
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
        
        if(_iComplex == 1)
        {
similarity index 85%
rename from scilab/modules/core/src/c/string_api.c
rename to scilab/modules/core/src/c/api_string.c
index e613a25..734aada 100644 (file)
 
 #include <string.h>
 
-#include "common_api.h"
-#include "internal_common_api.h"
-#include "string_api.h"
+#include "api_common.h"
+#include "api_internal_common.h"
+#include "api_string.h"
 
 #include "CallScilab.h"
 #include "stack-c.h"
 #include "code2str.h"
-#include "internal_string_api.h"
+#include "api_internal_string.h"
 
 
 /*******************************/
@@ -81,7 +81,7 @@ int createMatrixOfString(int _iVar, int _iRows, int _iCols, char** _pstStrings)
        int iTotalLen           = 0;
        int *piAddr                     = NULL;
 
-       int iRet = getNewVarAddressFromNumber(iNewPos, &piAddr);
+       int iRet = getNewVarAddressFromPosition(iNewPos, &piAddr);
        if(iRet != 0)
        {
                return 1;
@@ -96,7 +96,6 @@ int createMatrixOfString(int _iVar, int _iRows, int _iCols, char** _pstStrings)
 int fillMatrixOfString(int* _piAddress, int _iRows, int _iCols, char** _pstStrings, int* _piTotalLen)
 {
        int* piOffset = NULL;
-       int* piAddr             = NULL;
        int* piData             = NULL;
        int i                                   = 0;
        int iOffset             = 0;
@@ -136,7 +135,7 @@ int createNamedMatrixOfString(char* _pstName, int _iNameLen, int _iRows, int _iC
   C2F(str2name)(_pstName, iVarID, _iNameLen);
   Top = Top + Nbvars + 1;
 
-       iRet = getNewVarAddressFromNumber(Top, &piAddr);
+       iRet = getNewVarAddressFromPosition(Top, &piAddr);
 
 
        //write matrix information
@@ -157,30 +156,14 @@ int createNamedMatrixOfString(char* _pstName, int _iNameLen, int _iRows, int _iC
 
 int readNamedMatrixOfString(char* _pstName, int _iNameLen, int* _piRows, int* _piCols, int* _piLength, char** _pstStrings)
 {
-       int iVarID[nsiz];
+       int iRet                                        = 0;
        int* piAddr                             = NULL;
 
-       //get variable id from name
-       C2F(str2name)(_pstName, iVarID, _iNameLen);
-
-       //define scope of search
-  Fin = -1;
-       //search variable
-  C2F(stackg)(iVarID);
-
-       if (Err > 0 || Fin == 0)
+       iRet = getVarAddressFromName(_pstName, _iNameLen, &piAddr);
+       if(iRet)
        {
                return 1;
        }
-
-       //No idea :(
-  if ( *Infstk(Fin) == 2)
-               Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
-
-       //get variable address
-       //WARNING check in VarType can be negative
-       getNewVarAddressFromNumber(Fin, &piAddr);
-
        return getMatrixOfString(piAddr, _piRows, _piCols, _piLength, _pstStrings);
 }
 /*--------------------------------------------------------------------------*/
index 278017c..10b1d66 100644 (file)
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
                        >
                        <File
-                               RelativePath=".\banier.c"
+                               RelativePath=".\api_boolean.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_boolean_sparse.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_common.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_double.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_int.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_list.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_poly.c"
                                >
                        </File>
                        <File
-                               RelativePath=".\boolean_api.c"
+                               RelativePath=".\api_sparse.c"
                                >
                        </File>
                        <File
-                               RelativePath=".\boolean_sparse_api.c"
+                               RelativePath=".\api_string.c"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\banier.c"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath=".\common_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\comparehandles.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\double_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\dynamic_gateways.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\int_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\intmacr2tree.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\list_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\LoadFunctionsTab.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\poly_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\predef.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\sparse_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\stack1.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath=".\string_api.c"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\syncexec.c"
                                >
                        </File>
                        Filter="h;hpp;hxx;hm;inl"
                        >
                        <File
-                               RelativePath=".\banier.h"
+                               RelativePath="..\..\includes\api_boolean.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\BOOL.h"
+                               RelativePath="..\..\includes\api_boolean_sparse.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_common.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_double.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_int.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_internal_boolean.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_internal_common.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_internal_double.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_internal_poly.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\api_internal_string.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_list.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_poly.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\api_sparse.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\boolean_api.h"
+                               RelativePath="..\..\includes\api_string.h"
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\boolean_sparse_api.h"
+                               RelativePath="..\..\includes\api_variable.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\banier.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\..\includes\BOOL.h"
                                >
                        </File>
                        <File
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\common_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\core_math.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\double_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\doublecomplex.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\int_api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\internal_boolean_api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\internal_common_api.h"
-                               >
-                       </File>
-                       <File
-                               RelativePath=".\internal_double_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\intmacr2tree.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\list_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\LoadFunctionsTab.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\poly_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath=".\predef.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\sparse_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\stack-c.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\string_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\syncexec.h"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\includes\variable_api.h"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\includes\version.h"
                                >
                        </File>
index f1b334d..fd56c5f 100644 (file)
@@ -33,6 +33,7 @@ static int isprime(unsigned int number);
 /*--------------------------------------------------------------------------*/
 int create_hashtable_scilab_functions(unsigned int nel)
 {
+    unsigned int i;
        if (htable == NULL)
        {
                nel |= 1;      /* make odd */
@@ -47,7 +48,14 @@ int create_hashtable_scilab_functions(unsigned int nel)
                }
                else
                {
-                       return 1;
+                 for(i=0;i<hashtableSize;i++)
+                   {
+                     htable[i].used = 0;
+                     strcpy(htable[i].entry.namefunction,"");
+                     htable[i].entry.key[0] = 0;
+                     htable[i].entry.data = 0;
+                   }
+                 return 1;
                }
        }
        return 0;
@@ -110,7 +118,9 @@ int action_hashtable_scilab_functions(int *key,char *name, int *data, SCI_HFUNCT
                                        {
                                        case SCI_HFUNCTIONS_ENTER :
                                                htable[idx].entry.data = *data;
+                                               htable[idx].used = 1;
                                                if (name) strcpy(htable[idx].entry.namefunction,name);
+                                               else strcpy(htable[idx].entry.namefunction,"");
                                                return OK;
                                                break;
                                        case SCI_HFUNCTIONS_DELETE :
@@ -146,7 +156,9 @@ int action_hashtable_scilab_functions(int *key,char *name, int *data, SCI_HFUNCT
                                                {
                                                case SCI_HFUNCTIONS_ENTER :
                                                        htable[idx].entry.data = *data; 
+                                                       htable[idx].used = 1;
                                                        if (name) strcpy(htable[idx].entry.namefunction,name);
+                                                       else strcpy(htable[idx].entry.namefunction,"");
                                                        return OK;
                                                case SCI_HFUNCTIONS_DELETE :
                                                        htable[idx].used = 0;
@@ -207,7 +219,10 @@ char **GetFunctionsList(int *sizeList)
 
        for ( i = 0 ; i < hashtableSize ; i++ ) if ( htable[i].used) 
        {
-               if (htable[i].entry.namefunction) j++;
+               if (htable[i].entry.namefunction) 
+               {
+                       if (strlen(htable[i].entry.namefunction) > 0) j++;
+               }
        }
        *sizeList=j;
 
@@ -219,8 +234,11 @@ char **GetFunctionsList(int *sizeList)
        {
                if (htable[i].entry.namefunction)
                {
-                       ListFunctions[j] = strdup(htable[i].entry.namefunction);
-                       j++;
+                       if (strlen(htable[i].entry.namefunction) > 0)
+                       {
+                               ListFunctions[j] = strdup(htable[i].entry.namefunction);
+                               j++;
+                       }
                }
        }
        return ListFunctions;
index b7b59b2..e9ea33b 100644 (file)
@@ -40,10 +40,12 @@ typedef enum
        SCI_HFUNCTIONS_FIND = 1,SCI_HFUNCTIONS_BACKSEARCH = 2, SCI_HFUNCTIONS_ENTER = 3,SCI_HFUNCTIONS_DELETE = 4
 } SCI_HFUNCTIONS_ACTION;
 /*--------------------------------------------------------------------------*/
-/* maximum number of entries in the htable */
-/* in fact create_hashtable_scilab_functions used a prime > MAXTAB */
-/* WARNING : MAXTAB must be chosen > 2* the number of scilab functions */
-/* for good efficiency of the hash code */
+/* maximum number of entries in the htable 
+ * in fact create_hashtable_scilab_functions used a 
+ * prime > MAXELEMENTFUNCTIONLIST 
+ * WARNING : MAXELEMENTFUNCTIONLIST must be chosen > 2* the number of scilab
+ * functions 
+ * for good efficiency of the hash code */
 #define MAXELEMENTFUNCTIONLIST 1536
 /*--------------------------------------------------------------------------*/
 /** 
diff --git a/scilab/modules/core/tests/nonreg_tests/bug_4611.dia.ref b/scilab/modules/core/tests/nonreg_tests/bug_4611.dia.ref
new file mode 100644 (file)
index 0000000..f5fdbd3
--- /dev/null
@@ -0,0 +1,21 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+// <-- Non-regression test for bug 4611 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4611
+//
+// <-- Short Description -->
+// what function doesn't returns a complete list of functions.
+[a,b]=what();
+if with_module('arnoldi') then
+  if grep(a,'zneupd') == [] then bugmes();quit;end
+end
+if with_module('graphics') then
+  if grep(a,'zoom_rect') == [] then bugmes();quit;end
+end
+if part(a(1),1) <> '%' then bugmes();quit;end
diff --git a/scilab/modules/core/tests/nonreg_tests/bug_4611.tst b/scilab/modules/core/tests/nonreg_tests/bug_4611.tst
new file mode 100644 (file)
index 0000000..293cfd4
--- /dev/null
@@ -0,0 +1,26 @@
+// =============================================================================
+// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+// Copyright (C) 2009 - DIGITEO - Allan CORNET
+//
+//  This file is distributed under the same license as the Scilab package.
+// =============================================================================
+
+// <-- Non-regression test for bug 4611 -->
+//
+// <-- Bugzilla URL -->
+// http://bugzilla.scilab.org/show_bug.cgi?id=4611
+//
+// <-- Short Description -->
+// what function doesn't returns a complete list of functions.
+
+[a,b]=what();
+
+if with_module('arnoldi') then
+  if grep(a,'zneupd') == [] then pause,end
+end
+
+if with_module('graphics') then
+  if grep(a,'zoom_rect') == [] then pause,end
+end
+
+if part(a(1),1) <> '%' then pause,end
index 5b31c26..f6cddb4 100644 (file)
@@ -5,6 +5,7 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 ilib_verbose(0);
+// Scalar value
 pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_scalar.c";
 cflags="-I"+SCI+"/modules/localization/includes";
 ilib_build('foo',['foo_set_scalar','sci_foo_set_scalar';'foo_get_scalar','sci_foo_get_scalar'],pathTest,[],[],"",cflags);
@@ -20,11 +21,18 @@ if foo_get_scalar()<>b then bugmes();quit;end
 b=-42;
 foo_set_scalar(b)
 if foo_get_scalar()<>b then bugmes();quit;end
+// Matrix
 pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_matrix.c";
-cflags="-I"+SCI+"/modules/localization/includes";
 ilib_build('foo2',['foo_set_matrix','sci_foo_set_matrix';'foo_get_matrix','sci_foo_get_matrix'],pathTest,[],[],"",cflags);
 exec loader.sce;
 // Generates a big matrix and to the same test
 a=rand(1000,1000);
 foo_set_matrix(a)
 if foo_get_matrix()<>a then bugmes();quit;end
+// Hardcoded value from C
+pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_hardcoded_matrix.c";
+ilib_build('foo3',['foo_get_hardcoded_matrix','sci_foo_get_hardcoded_matrix'],pathTest,[],[],"",cflags);
+exec loader.sce;
+Foo=[1 4 2 3; ..
+    3 9 8 2 ];
+if foo_get_hardcoded_matrix()<> Foo then bugmes();quit;end
index 5437540..0318023 100644 (file)
@@ -6,6 +6,7 @@
 // =============================================================================
 ilib_verbose(0);
 
+// Scalar value
 pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_scalar.c";
 cflags="-I"+SCI+"/modules/localization/includes";
 ilib_build('foo',['foo_set_scalar','sci_foo_set_scalar';'foo_get_scalar','sci_foo_get_scalar'],pathTest,[],[],"",cflags);
@@ -26,8 +27,9 @@ b=-42;
 foo_set_scalar(b)
 if foo_get_scalar()<>b then pause, end
 
+
+// Matrix
 pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_matrix.c";
-cflags="-I"+SCI+"/modules/localization/includes";
 ilib_build('foo2',['foo_set_matrix','sci_foo_set_matrix';'foo_get_matrix','sci_foo_get_matrix'],pathTest,[],[],"",cflags);
 exec loader.sce;
 
@@ -35,3 +37,12 @@ exec loader.sce;
 a=rand(1000,1000);
 foo_set_matrix(a)
 if foo_get_matrix()<>a then pause, end
+
+// Hardcoded value from C
+pathTest=SCI+"/modules/core/tests/unit_tests/api_double_test_hardcoded_matrix.c";
+ilib_build('foo3',['foo_get_hardcoded_matrix','sci_foo_get_hardcoded_matrix'],pathTest,[],[],"",cflags);
+exec loader.sce;
+
+Foo=[1 4 2 3; ..
+    3 9 8 2 ];
+if foo_get_hardcoded_matrix()<> Foo then pause, end
diff --git a/scilab/modules/core/tests/unit_tests/api_double_test_hardcoded_matrix.c b/scilab/modules/core/tests/unit_tests/api_double_test_hardcoded_matrix.c
new file mode 100644 (file)
index 0000000..0ff9040
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2009 - DIGITEO - Antoine ELIAS
+* Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+*
+* 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 "stack-c.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "sciprint.h"
+#include "api_variable.h"
+
+int sci_foo_get_hardcoded_matrix(char *fname,unsigned long fname_len)
+{
+       /*                  
+        * Foo=[1 4 2 3; 
+        *      3 9 8 2 ]
+        */
+       int iVarOut                     = Rhs + 1;
+       double Foo[] = {1,3,4,9,2,8,3,2};   /* Declare the matrix */
+       int iRows = 2, iCols = 4; /* Size of the matrix */
+
+       //check number of output arguments
+       CheckLhs(1,1);
+
+       createMatrixOfDouble(iVarOut, iRows, iCols, Foo);
+       LhsVar(1)                               = iVarOut;
+
+  return 0;
+}
index a87b372..0a7985c 100644 (file)
@@ -15,7 +15,7 @@
 #include "Scierror.h"
 #include "localization.h"
 #include "sciprint.h"
-#include "variable_api.h"
+#include "api_variable.h"
 
 double *Foo;
 int iRows                                      = 0;
@@ -28,14 +28,14 @@ int sci_foo_set_matrix(char *fname,unsigned long fname_len)
        double *pdblReal                = NULL;
 
        /************************
-        * Get input parameters *
+        * Get input arguments *
         ************************/
 
-       //check number of input parameters
+       //check number of input arguments
        CheckRhs(1,1);
 
        //get variable 1 address
-       getVarAddressFromNumber(1, &piAddrVar1);
+       getVarAddressFromPosition(1, &piAddrVar1);
 
        //get variable 1 dimensions
        getVarDimension(piAddrVar1, &iRows, &iCols);
@@ -62,14 +62,12 @@ int sci_foo_set_matrix(char *fname,unsigned long fname_len)
 
 int sci_foo_get_matrix(char *fname,unsigned long fname_len)
 {
-       //for ouput variable 1
-       int* piAddrOut  = NULL;
        int iVarOut                     = Rhs + 1;
 
-       //check number of output parameters
+       //check number of output arguments
        CheckLhs(1,1);
 
-       createMatrixOfDouble(iVarOut, iRows, iCols, Foo, &piAddrOut);
+       createMatrixOfDouble(iVarOut, iRows, iCols, Foo);
        LhsVar(1)                               = iVarOut;
 
   return 0;
index 65170ad..7dcddd7 100644 (file)
@@ -15,7 +15,7 @@
 #include "Scierror.h"
 #include "localization.h"
 #include "sciprint.h"
-#include "variable_api.h"
+#include "api_variable.h"
 
 double Foo;
 
@@ -27,11 +27,11 @@ int sci_foo_set_scalar(char *fname,unsigned long fname_len)
        int iCols1                                      = 0;
        double *pdblReal1               = NULL;
 
-       //check number of input parameters
+       //check number of input arguments
        CheckRhs(1,1);
 
        //get variable 1 address
-       getVarAddressFromNumber(1, &piAddrVar1);
+       getVarAddressFromPosition(1, &piAddrVar1);
        //get variable 1 dimensions
        getVarDimension(piAddrVar1, &iRows1, &iCols1);
        //check type, dimension and if it is a real number
@@ -52,16 +52,14 @@ int sci_foo_set_scalar(char *fname,unsigned long fname_len)
 
 int sci_foo_get_scalar(char *fname,unsigned long fname_len)
 {
-       //for ouput variable 1
-       int* piAddrOut  = NULL;
        int iRowsOut            = 1;
        int iColsOut            = 1;
        int iVarOut                     = Rhs + 1;
 
-       //check number of output parameters
+       //check number of output arguments
        CheckLhs(1,1);
 
-       createMatrixOfDouble(iVarOut, iRowsOut, iColsOut, &Foo, &piAddrOut);
+       createMatrixOfDouble(iVarOut, iRowsOut, iColsOut, &Foo);
        LhsVar(1)                               = iVarOut;
 
        return 0;
index 53b145a..9a8b6a9 100644 (file)
 //
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
-deff('foo()','a=1,b=2,c=3;[x,y]=resume(a,b)')
+// <-- JVM NOT MANDATORY -->
+deff("foo()","a=1,b=2,c=3;[x,y]=resume(a,b)")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y,z]=resume(a,b,c)')
+deff("foo()","a=1,b=2,c=3;[x,y,z]=resume(a,b,c)")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end')
+deff("foo()","if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end')
+deff("foo()","if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y]=resume(a,b)','n')
+deff("foo()","a=1,b=2,c=3;[x,y]=resume(a,b)","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y,z]=resume(a,b,c)','n')
+deff("foo()","a=1,b=2,c=3;[x,y,z]=resume(a,b,c)","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end','n')
+deff("foo()","if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end','n')
+deff("foo()","if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end','n')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end','n')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
-//======================================================================
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'')')
-Warning : redefining function: foo                     . Use funcprot(0) to avoid this message
-
+clear foo x y z
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"")")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'')')
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"")")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end')
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end')
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end;end')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end;end")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end;end')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end;end")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'')','n')
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"")","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'')','n')
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"")","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end','n')
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end','n')
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end;end','n')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end;end","n")
 foo(); if x<>1|y<>2 then bugmes();quit;end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end;end','n')
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end;end","n")
 foo(); if x<>1|y<>2|z<>3 then bugmes();quit;end
+clear foo x y z
+// Nested functions
+// =============================================================================
+function foo1()
+       clear var_a var_b var_c var_d;
+       foo2()
+       [va,vb,vc,vd] = resume(var_a,var_b,var_c,var_d);
+endfunction
+function foo2()
+       clear variable_a variable_b variable_c variable_d;
+       foo3()
+       [var_a,var_b,var_c,var_d] = resume(variable_a,variable_b,variable_c,variable_d);
+endfunction
+function foo3()
+       a = [ 1 2 ; 3 4 ];
+       b = [ "un" "deux" ; "trois" "quatre" ];
+       c = [ %T %F ; %T %T ];
+       d = struct();
+       d("field1") = a;
+       d("field2") = b;
+       d("field3") = c;
+       [variable_a,variable_b,variable_c,variable_d] = resume(a,b,c,d);
+endfunction
+clear ref_a ref_b ref_c
+ref_a = [ 1 2 ; 3 4 ];
+ref_b = [ "un" "deux" ; "trois" "quatre" ];
+ref_c = [ %T %F ; %T %T ];
+ref_d = struct();
+ref_d("field1") = ref_a;
+ref_d("field2") = ref_b;
+ref_d("field3") = ref_c;
+clear va vb vc vd;
+foo1()
+if or( va <> ref_a ) then bugmes();quit;end
+if or( vb <> ref_b ) then bugmes();quit;end
+if or( vc <> ref_c ) then bugmes();quit;end
+if or( vd <> ref_d ) then bugmes();quit;end
+clear va vb vc vd;
+err = execstr("foo1()","errcatch");
+if err<>0 then bugmes();quit;end
+if or( va <> ref_a ) then bugmes();quit;end
+if or( vb <> ref_b ) then bugmes();quit;end
+if or( vc <> ref_c ) then bugmes();quit;end
+if or( vd <> ref_d ) then bugmes();quit;end
+clear va vb vc vd;
+clear foo1() foo2() foo3() ref_a ref_b ref_c ref_d;
index 5760820..8c811eb 100644 (file)
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 
-deff('foo()','a=1,b=2,c=3;[x,y]=resume(a,b)')
+// <-- JVM NOT MANDATORY -->
+
+deff("foo()","a=1,b=2,c=3;[x,y]=resume(a,b)")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y,z]=resume(a,b,c)')
+
+deff("foo()","a=1,b=2,c=3;[x,y,z]=resume(a,b,c)")
 foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end')
+
+deff("foo()","if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y]=resume(a,b)','n')
+
+deff("foo()","a=1,b=2,c=3;[x,y]=resume(a,b)","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;[x,y,z]=resume(a,b,c)','n')
+
+deff("foo()","a=1,b=2,c=3;[x,y,z]=resume(a,b,c)","n")
 foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end','n')
+
+deff("foo()","if %t then a=1,b=2,c=3;[x,y]=resume(a,b);end","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end','n')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","if %t then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end","n")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end','n')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y]=resume(a,b);end;end","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end','n')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;[x,y,z]=resume(a,b,c);end;end","n")
 foo(); if x<>1|y<>2|z<>3 then pause,end
+clear foo x y z
 
-//======================================================================
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'')')
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"")")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'')')
+
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"")")
 foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end')
+
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end;end')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end;end")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end;end')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end;end")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'')','n')
+
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"")","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'')','n')
+
+deff("foo()","a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"")","n")
 foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end','n')
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','if %t then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end','n')
-foo(); if x<>1|y<>2|z<>3 then pause,end
 
+deff("foo()","if %t then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end","n")
+foo(); if x<>1|y<>2|z<>3 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y]=resume(a,b)'');end;end','n')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y]=resume(a,b)"");end;end","n")
 foo(); if x<>1|y<>2 then pause,end
 clear foo x y z
-deff('foo()','for k=1:3,if k==3 then a=1,b=2,c=3;execstr(''[x,y,z]=resume(a,b,c)'');end;end','n')
+
+deff("foo()","for k=1:3,if k==3 then a=1,b=2,c=3;execstr(""[x,y,z]=resume(a,b,c)"");end;end","n")
 foo(); if x<>1|y<>2|z<>3 then pause,end
+clear foo x y z
+
+// Nested functions
+// =============================================================================
+
+function foo1()
+       clear var_a var_b var_c var_d;
+       foo2()
+       [va,vb,vc,vd] = resume(var_a,var_b,var_c,var_d);
+endfunction
+
+function foo2()
+       clear variable_a variable_b variable_c variable_d;
+       foo3()
+       [var_a,var_b,var_c,var_d] = resume(variable_a,variable_b,variable_c,variable_d);
+endfunction
+
+function foo3()
+       a = [ 1 2 ; 3 4 ];
+       b = [ "un" "deux" ; "trois" "quatre" ];
+       c = [ %T %F ; %T %T ];
+       d = struct();
+       d("field1") = a;
+       d("field2") = b;
+       d("field3") = c;
+       [variable_a,variable_b,variable_c,variable_d] = resume(a,b,c,d);
+endfunction
+
+clear ref_a ref_b ref_c
+
+ref_a = [ 1 2 ; 3 4 ];
+ref_b = [ "un" "deux" ; "trois" "quatre" ];
+ref_c = [ %T %F ; %T %T ];
+ref_d = struct();
+ref_d("field1") = ref_a;
+ref_d("field2") = ref_b;
+ref_d("field3") = ref_c;
+clear va vb vc vd;
+
+foo1()
+if or( va <> ref_a ) then pause, end
+if or( vb <> ref_b ) then pause, end
+if or( vc <> ref_c ) then pause, end
+if or( vd <> ref_d ) then pause, end
+clear va vb vc vd;
+
+err = execstr("foo1()","errcatch");
+if err<>0 then pause, end
+if or( va <> ref_a ) then pause, end
+if or( vb <> ref_b ) then pause, end
+if or( vc <> ref_c ) then pause, end
+if or( vd <> ref_d ) then pause, end
+clear va vb vc vd;
 
+clear foo1() foo2() foo3() ref_a ref_b ref_c ref_d;
index fafb486..87bc9b9 100644 (file)
@@ -22,11 +22,15 @@ function tbx_build_loader(toolbox_name, toolbox_path)
          "// Copyright INRIA 2008",
          "// ====================================================================",
          "try",
-         " getversion(''scilab'');",
+         " v = getversion(''scilab'');",
          "catch",
          " warning(''Scilab 5.0 or more is required.'');",
          " return;",
          "end;",
+         "if v(2) < 2 then",
+         "  // new API in scilab 5.2",
+         "  error(gettext(''Scilab 5.2 or more is required.''));",
+         "end",
          "// ====================================================================",
          "root_tlbx = get_absolute_file_path(''loader.sce'');",
          "exec(root_tlbx+''etc\''+''"+toolbox_name+".start'');",
index 49cbeb7..85d92b3 100644 (file)
@@ -30,7 +30,6 @@ xscion_
 returnanan_
 transposeMatrixDouble
 iAllocMatrixOfBoolean
-getVarAddressFromNumber
 iArraySum
 GetRhsStringVar
 iGetAddressFromItemPos
@@ -62,4 +61,40 @@ createTList
 createMatrixOfInteger32
 createMatrixOfBoolean
 getMatrixOfBoolean
-createMatrixOfBooleanInList
\ No newline at end of file
+createMatrixOfBooleanInList
+getMatrixOfPoly
+getPolyVariableName
+createMatrixOfPoly
+createMatrixOfPolyInList
+createNamedList
+createMatrixOfDoubleInNamedList
+createNamedMatrixOfDouble
+getVarNameFromPostion
+getVarAddressFromName
+createMListInNamedList
+createTListInNamedList
+createListInNamedList
+createNamedMList
+createNamedTList
+createNamedMatrixOfString
+createMatrixOfStringInNamedList
+createMatrixOfBooleanInNamedList
+createNamedMatrixOfBoolean
+getVarAddressFromPosition
+createNamedMatrixOfPoly
+createMatrixOfPolyInNamedList
+createComplexMatrixOfDoubleInNamedList
+createNamedComplexMatrixOfDouble
+getComplexMatrixOfPoly
+createComplexMatrixOfPolyInNamedList
+createNamedComplexMatrixOfPoly
+getMatrixOfIntegerPrecision
+getMatrixOfInteger8
+getMatrixOfInteger16
+getMatrixOfInteger32
+createNamedMatrixOfInteger8
+createNamedMatrixOfInteger16
+createNamedMatrixOfInteger32
+createMatrixOfInteger8InNamedList
+createMatrixOfInteger16InNamedList
+createMatrixOfInteger32InNamedList
\ No newline at end of file
index c964540..64fe91d 100644 (file)
 
 static const char g_SCILAB_CLASS[]                                     =       "SCILAB_Class";
 static const char g_SCILAB_CLASS_EMPTY[]               =       "SCILAB_empty";
+static const char g_SCILAB_CLASS_VARNAME[]     =       "SCILAB_varname";
+static const char g_SCILAB_CLASS_COMPLEX[]     =       "SCILAB_complex";
+static const char g_SCILAB_CLASS_PREC[]                        =       "SCILAB_precision";
 
 
 static const char g_SCILAB_CLASS_DOUBLE[]              =       "double";
 static const char g_SCILAB_CLASS_STRING[]              =       "string";
 static const char g_SCILAB_CLASS_BOOLEAN[]     =       "boolean";
-static const char g_SCILAB_CLASS_INT8[]                        =       "int8";
-static const char g_SCILAB_CLASS_INT16[]               =       "int16";
-static const char g_SCILAB_CLASS_INT32[]               =       "int32";
-static const char g_SCILAB_CLASS_INT64[]               =       "int64";
-static const char g_SCILAB_CLASS_POLY[]                        =       "poly";
+static const char g_SCILAB_CLASS_INT[]                 =       "integer";
+static const char g_SCILAB_CLASS_POLY[]                        =       "polynomial";
 static const char g_SCILAB_CLASS_LIST[]                        =       "list";
 static const char g_SCILAB_CLASS_TLIST[]               =       "tlist";
 static const char g_SCILAB_CLASS_MLIST[]               =       "mlist";
 
+//interger precision
+#define SCI_INT8               1
+#define SCI_INT16              2
+#define SCI_INT32              4
+#define SCI_INT64              8
 
 #endif /* !__H5_ATTRIBUTECONSTATS_H__ */
index 8112fda..74a7b61 100644 (file)
 
 #include <hdf5.h>
 
+int isComplexData(int _iDatasetId);
+
+int getVariableNames(int _iFile, char **pstNameList);
+
 int getDataSetId(int  _iFile);
 
+int getDataSetIdFromName(int _iFile, char *_pstName);
+
 int getDataSetDims(int _iDatasetId, int *_piRows, int *_piCols);
 
 int getScilabTypeFromDataSet(int _iDatasetId);
 
-int readDoubleMatrix(int _iDatasetId, double *_pdblData, int _iRows, int _iCols);
+int getDatasetPrecision(int _iDatasetId, int* _piPrec);
+
+int readDoubleMatrix(int _iDatasetId, int _iRows, int _iCols, double *_pdblData);
+int readDoubleComplexMatrix(int _iDatasetId, int _iRows, int _iCols, double *_pdblReal, double *_pdblImg);
+
+int readStringMatrix(int _iDatasetId, int _iRows, int _iCols, char **_pstData);
+
+int readBooleanMatrix(int _iDatasetId, int _iRows, int _iCols, int* _piData);
 
-int readStringMatrix(int _iDatasetId, char **_pstData, int _iRows, int _iCols);
+int readPolyMatrix(int _iDatasetId, char* _pstVarname, int _iRows, int _iCols, int* _piNbCoef, double **_pdblData);
+int readPolyComplexMatrix(int _iDatasetId, char* _pstVarname, int _iRows, int _iCols, int* _piNbCoef, double **_pdblReal, double **_pdblImg);
 
-int readBooleanMatrix(int _iDatasetId, int* _piData, int _iRows, int _iCols);
+int readInterger8Matrix(int _iDatasetId, int _iRows, int _iCols, char* _pcData);
+int readInterger16Matrix(int _iDatasetId, int _iRows, int _iCols, short* _psData);
+int readInterger32Matrix(int _iDatasetId, int _iRows, int _iCols, int* _piData);
+int readInterger64Matrix(int _iDatasetId, int _iRows, int _iCols, long long* _pllData);
 
 int getListItemReferences(int _iDatasetId, hobj_ref_t** _piItemRef);
 
index 1033e28..60f4b4d 100644 (file)
 #ifndef __H5_WRITEDATATOFILE_H__
 #define __H5_WRITEDATATOFILE_H__
 
-int writeDoubleMatrix(int file, char* dataSetName, double *data, int rows, int cols);
+char* createGroupName(char* _pstGroupName);
+char* createPathName(char* _pstGroupName, int _iIndex);
 
-int writeStringMatrix(int file, char* dataSetName, char **data, int rows, int cols);
 
-int writeBooleanMatrix(int _iFile, char* _pstDatasetName, int *_piData, int _iRows, int _iCols);
+int writeDoubleMatrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, double *_pdblData);
+int writeDoubleComplexMatrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, double *_pdblReal, double *_pdblImg);
+
+int writeStringMatrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, char **_pstData);
+
+int writeBooleanMatrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, int *_piData);
+
+int writePolyMatrix(int _iFile, char* _pstDatasetName, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblData);
+int writePolyComplexMatrix(int _iFile, char* _pstDatasetName, char* _pstVarName, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
+
+int writeInterger8Matrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, char* _piData8);
+int writeInterger16Matrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, short* _piData16);
+int writeInterger32Matrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, int* _piData32);
+int writeInterger64Matrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, long long* _piData64);
+
 
 void* openList(int _iFile, char* pstDatasetName, int _iNbItem);
 int addItemInList(int _iFile, void* _pvList, int _iPos, char* _pstItemName);
index 3c0e9ed..3b851f6 100644 (file)
@@ -20,7 +20,7 @@ extern "C"
 #include "Scierror.h"
 #include "localization.h"
 #include "sciprint.h"
-#include "variable_api.h"
+#include "api_variable.h"
 #include "h5_fileManagement.h"
 #include "h5_writeDataToFile.h"
 #include "freeArrayOfString.h"
@@ -32,12 +32,12 @@ int iLevel = 0;
 bool export_data(int _iH5File, int *_piVar, char* _pstName);
 bool export_list(int _iH5File, int *_piVar, char* _pstName, int _iVarType);
 bool export_double(int _iH5File, int *_piVar, char* _pstName);
-bool export_poly(int *_piVar, char* _pstName);
+bool export_poly(int _iH5File, int *_piVar, char* _pstName);
 bool export_boolean(int _iH5File, int *_piVar, char* _pstName);
 bool export_sparse(int *_piVar, char* _pstName);
 bool export_boolean_sparse(int *_piVar, char* _pstName);
 bool export_matlab_sparse(int *_piVar, char* _pstName);
-bool export_ints(int *_piVar, char* _pstName);
+bool export_ints(int _iH5File, int *_piVar, char* _pstName);
 bool export_handles(int *_piVar, char* _pstName);
 bool export_strings(int _iH5File, int *_piVar, char* _pstName);
 bool export_u_function(int *_piVar, char* _pstName);
@@ -46,6 +46,7 @@ bool export_lib(int *_piVar, char* _pstName);
 bool export_lufact_pointer(int *_piVar, char* _pstName);
 
 void print_type(char* _pstType);
+int extractVarNameList(int _iStart, int _iEnd, char** _pstNameList);
 
 #ifdef _MSC_VER
 #define strdup _strdup
@@ -54,71 +55,51 @@ void print_type(char* _pstType);
 /*--------------------------------------------------------------------------*/
 int sci_export_to_hdf5(char *fname,unsigned long fname_len)
 {
-       //Real code
-       CheckRhs(3,3);//two input parameters
-       CheckLhs(1,1);//one output parameter
+       CheckRhs(2,1000000);//input parameters
+       CheckLhs(1,1);//output parameter
 
+       int iRet                                                = 0;
+       int iNbVar                                      = 0;
        int iLen                                                = 0;
-       int iRows                                               = 0;
-       int iCols                                               = 0;
-
-       int* piAddr2                            = NULL;
-       int* piAddr3                            = NULL;
-       int* piAddrReturn               = NULL;
-       char *pstVarName                = NULL;
-       char *pstFilename               = NULL;
 
-       int *piVar                                      = NULL;
+       int** piAddrList                = NULL;
+       char* pstFilename               = NULL;
+       char** pstNameList      = NULL;
 
        /*get input data*/
-       getVarAddressFromNumber(1, &piVar);
-       getVarAddressFromNumber(2, &piAddr2);
-       getVarAddressFromNumber(3, &piAddr3);
-
-       if(getVarType(piAddr2) != sci_strings)
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: A string.\n"),fname, 2);
-               return 0;
-       }
-
-       if(getVarType(piAddr3) != sci_strings)
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: A string.\n"),fname, 2);
-               return 0;
-       }
-
-       //get variable name
-       getVarDimension(piAddr2, &iRows, &iCols);
-       if(iRows != 1 || iCols != 1)
-       {
-               Scierror(999,_("%s: Wrong size for input argument #%d: A string expected.\n"),fname,2);
-       }
-
-       getMatrixOfString(piAddr2, &iRows, &iCols, &iLen, NULL);
-       pstVarName = (char*)MALLOC((iRows * iCols + 1) * sizeof(char));
-       getMatrixOfString(piAddr2, &iRows, &iCols, &iLen, &pstVarName);
+       pstNameList = (char**)MALLOC(sizeof(char*) * Rhs);
+       iNbVar = extractVarNameList(1, Rhs, pstNameList);
 
-       //get filename
-       getVarDimension(piAddr3, &iRows, &iCols);
-       if(iRows != 1 || iCols != 1)
+       piAddrList = (int**)MALLOC(sizeof(int*) * (iNbVar - 1));
+       for(int i = 0 ; i < Rhs - 1 ; i++)
        {
-               Scierror(999,_("%s: Wrong size for input argument #%d: A string expected.\n"),fname,2);
+               iRet = getVarAddressFromName(pstNameList[i + 1], (int)strlen(pstNameList[i + 1]), &piAddrList[i]);
+               if(iRet)
+               {
+                       Scierror(999,_("%s: Wrong value for input argument #%d: Defined variable expected.\n"), fname, i + 1);
+                       return 0;
+               }
        }
 
-       getMatrixOfString(piAddr3, &iRows, &iCols, &iLen, NULL);
-       pstFilename = (char*)MALLOC((iRows * iCols + 1) * sizeof(char));//1 for null termination
-       getMatrixOfString(piAddr3, &iRows, &iCols, &iLen, &pstFilename);
-
        iLevel = 0;
        //open hdf5 file
-       int iH5File = createHDF5File(pstFilename); 
+       int iH5File = createHDF5File(pstNameList[0]); 
 
        // export data
-       bool bExport = export_data(iH5File, piVar, pstVarName);
+       bool bExport = false;
+       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;
        allocMatrixOfBoolean(Rhs + 1, 1, 1, &piReturn);
        if(bExport == true)
@@ -148,7 +129,7 @@ bool export_data(int _iH5File, int* _piVar, char* _pstName)
                }
        case sci_poly :
                {
-                       bReturn = export_poly(_piVar, _pstName);
+                       bReturn = export_poly(_iH5File, _piVar, _pstName);
                        break;
                }
        case sci_boolean :
@@ -173,7 +154,7 @@ bool export_data(int _iH5File, int* _piVar, char* _pstName)
                }
        case sci_ints :
                {
-                       bReturn = export_ints(_piVar, _pstName);
+                       bReturn = export_ints(_iH5File, _piVar, _pstName);
                        break;
                }
        case sci_handles :
@@ -219,17 +200,13 @@ bool export_data(int _iH5File, int* _piVar, char* _pstName)
 
 bool export_list(int _iH5File, int *_piVar, char* _pstName, int _iVarType)
 {
+       int iRet = 0;
        bool bReturn = false;
        int iItemNumber = 0;
        getListItemNumber(_piVar, &iItemNumber);
 
        //create groupe name
-       char* pstGroupName      = strdup(_pstName);
-       char* pstSlash                  = strstr(pstGroupName, "/");
-       if(pstSlash != NULL)
-       {
-               pstSlash[0]                                     = '_';
-       }
+       char* pstGroupName      = createGroupName(_pstName);
 
        char pstMsg[256];
        sprintf(pstMsg, "list (%d)", iItemNumber);
@@ -248,20 +225,12 @@ bool export_list(int _iH5File, int *_piVar, char* _pstName, int _iVarType)
                        return 0;
                }
 
-               char* pstName   = NULL;
-               pstName                         = (char*)MALLOC(((int)log10((double)(i+1)) + 4) * sizeof(char)); //1 for null termination, 1 for round value, 2 for '#' characters
-               sprintf(pstName, "#%d#", i);
-
-               char *pstPathName       = NULL;
-               pstPathName                             = (char*)MALLOC((strlen(pstGroupName) + strlen(pstName) + 4) * sizeof(char)); //1 for null termination, 1 for separator, 2 for '#' characters
+               char* pstPathName               = createPathName(pstGroupName, i);
+               bReturn                                                 = export_data(_iH5File, piNewVar, pstPathName);
+               iRet = addItemInList(_iH5File, pvList, i, pstPathName);
 
-               sprintf(pstPathName, "#%s#/%s", pstGroupName, pstName);
-               bReturn                         = export_data(_iH5File, piNewVar, pstPathName);
-               addItemInList(_iH5File, pvList, i, pstPathName);
-
-               FREE(pstName);
-               FREE(pstPathName);
-               if(bReturn == false)
+               free(pstPathName);
+               if(bReturn == false || iRet)
                        return false;
        }
        iLevel--;
@@ -288,11 +257,12 @@ bool export_double(int _iH5File, int *_piVar, char* _pstName)
        if(iComplex)
        {
                getComplexMatrixOfDouble(_piVar, &iRows, &iCols, &pdblReal, &pdblImg);
+               writeDoubleComplexMatrix(_iH5File, _pstName, iRows, iCols, pdblReal, pdblImg);
        }
        else
        {
                getMatrixOfDouble(_piVar, &iRows, &iCols, &pdblReal);
-               writeDoubleMatrix(_iH5File, _pstName, pdblReal, iRows, iCols);
+               writeDoubleMatrix(_iH5File, _pstName, iRows, iCols, pdblReal);
        }
 
        char pstMsg[512];
@@ -301,9 +271,72 @@ bool export_double(int _iH5File, int *_piVar, char* _pstName)
        return true;
 }
 
-bool export_poly(int *_piVar, char* _pstName)
+bool export_poly(int _iH5File, int *_piVar, char* _pstName)
 {
-       print_type(_pstName);
+       int iRows                                               = 0;
+       int iCols                                               = 0;
+       int* piNbCoef                           = NULL;
+       double** pdblReal               = NULL;
+       double** pdblImg                = NULL;
+       char pstVarName[64]     = {0};
+       int iVarNameLen                 = 0;
+
+       getPolyVariableName(_piVar, pstVarName, &iVarNameLen);
+
+       if(isVarComplex(_piVar))
+       {
+               getComplexMatrixOfPoly(_piVar, &iRows, &iCols, NULL, NULL, NULL);
+               piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
+               getComplexMatrixOfPoly(_piVar, &iRows, &iCols, piNbCoef, NULL, NULL);
+               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
+               }
+               getComplexMatrixOfPoly(_piVar, &iRows, &iCols, piNbCoef, pdblReal, pdblImg);
+
+               
+               writePolyComplexMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
+       }
+       else
+       {
+               getMatrixOfPoly(_piVar, &iRows, &iCols, NULL, NULL);
+               piNbCoef = (int*)MALLOC(iRows * iCols * sizeof(int));
+               getMatrixOfPoly(_piVar, &iRows, &iCols, piNbCoef, NULL);
+               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
+               }
+               getMatrixOfPoly(_piVar, &iRows, &iCols, piNbCoef, pdblReal);
+
+               writePolyMatrix(_iH5File, _pstName, pstVarName, iRows, iCols, piNbCoef, pdblReal);
+       }
+       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;
 }
 
@@ -314,10 +347,10 @@ bool export_boolean(int _iH5File, int *_piVar, char* _pstName)
        int *piData                             = NULL;
 
        getMatrixOfBoolean(_piVar, &iRows, &iCols, &piData);
-       writeBooleanMatrix(_iH5File, _pstName, piData, iRows, iCols);
+       writeBooleanMatrix(_iH5File, _pstName, iRows, iCols, piData);
 
        char pstMsg[512];
-       sprintf(pstMsg, "double (%d x %d)", iRows, iCols);
+       sprintf(pstMsg, "bool (%d x %d)", iRows, iCols);
        print_type(pstMsg);
        return true;
 }
@@ -340,9 +373,42 @@ bool export_matlab_sparse(int *_piVar, char* _pstName)
        return true;
 }
 
-bool export_ints(int *_piVar, char* _pstName)
+bool export_ints(int _iH5File, int *_piVar, char* _pstName)
 {
-       print_type(_pstName);
+       int iRows                                       = 0;
+       int iCols                                       = 0;
+       void *piData                            = NULL;
+       int iPrec                                       = 0;
+
+       getMatrixOfIntegerPrecision(_piVar, &iPrec);
+
+       switch(iPrec)
+       {
+       case SCI_INT8 :
+               getMatrixOfInteger8(_piVar, &iRows, &iCols, (char**)&piData);
+               writeInterger8Matrix(_iH5File, _pstName, iRows, iCols, (char*)piData);
+               break;
+       case SCI_INT16 : 
+               getMatrixOfInteger16(_piVar, &iRows, &iCols, (short**)&piData);
+               writeInterger16Matrix(_iH5File, _pstName, iRows, iCols, (short*)piData);
+               break;
+       case SCI_INT32 : 
+               getMatrixOfInteger32(_piVar, &iRows, &iCols, (int**)&piData);
+               writeInterger32Matrix(_iH5File, _pstName, iRows, iCols, (int*)piData);
+               break;
+       case SCI_INT64 : 
+               //getMatrixOfInteger64(_piVar, &iRows, &iCols, (long long**)&piData);
+               //writeInterger64Matrix(_iH5File, _pstName, iRows, iCols, (long long*)piData);
+               return 1;
+               break;
+       default : 
+               return 1;
+               break;
+       }
+
+       char pstMsg[512];
+       sprintf(pstMsg, "int%d (%d x %d)", 8*iPrec, iRows, iCols);
+       print_type(pstMsg);
        return true;
 }
 
@@ -370,7 +436,7 @@ bool export_strings(int _iH5File, int *_piVar, char* _pstName)
        }
        getMatrixOfString(_piVar, &iRows, &iCols, piLen, pstData);
 
-       writeStringMatrix(_iH5File, _pstName, pstData, iRows, iCols);
+       writeStringMatrix(_iH5File, _pstName, iRows, iCols, pstData);
 
        char pstMsg[512];
        sprintf(pstMsg, "string (%d x %d)", iRows, iCols);
@@ -415,4 +481,38 @@ void print_type(char* _pstType)
 #endif
 }
 
+int extractVarNameList(int _iStart, int _iEnd, char** _pstNameList)
+{
+       int iCount = 0;
+
+       for(int i = _iStart ; i <= _iEnd ; i++)
+       {
+               int iRows                                       = 0;
+               int iCols                                       = 0;
+               int iLen                                        = 0;
+               int* piAddr                             = NULL;
+
+               getVarAddressFromPosition(i, &piAddr);
+               //get filename
+               if(getVarType(piAddr) != sci_strings)
+               {
+                       Scierror(999,_("%s: Wrong type for input argument #%d: A string.\n"), "export_to_hdf5", i);
+                       return 0;
+               }
+
+               getVarDimension(piAddr, &iRows, &iCols);
+               if(iRows != 1 || iCols != 1)
+               {
+                       Scierror(999,_("%s: Wrong size for input argument #%d: A string expected.\n"), "export_to_hdf5", i);
+                       return 0;
+               }
+               
+               getMatrixOfString(piAddr, &iRows, &iCols, &iLen, NULL);
+               _pstNameList[iCount] = (char*)MALLOC((iRows * iCols + 1) * sizeof(char));//1 for null termination
+               getMatrixOfString(piAddr, &iRows, &iCols, &iLen, &_pstNameList[iCount]);
+               iCount++;
+       }
+       return iCount;
+}
+
 /*--------------------------------------------------------------------------*/
index 1acd813..5beade0 100644 (file)
@@ -20,31 +20,32 @@ extern "C"
 #include "Scierror.h"
 #include "localization.h"
 #include "sciprint.h"
-#include "variable_api.h"
+#include "api_variable.h"
 #include "../../call_scilab/includes/CallScilab.h"
 #include "h5_fileManagement.h"
 #include "h5_readDataFromFile.h"
 #include "intmacr2tree.h"
+#include "stack-def.h"
 }
 
 
-
 //#define PRINT_DEBUG
 int iTab = 0;
 
 
 void print_tree(char* _pstMsg);
 
-int    import_data(int _iDatasetId, int _iItemPos, int* _piAddress);
-int import_double(int _iDatasetId, int _iItemPos, int* _piAddress);
-int import_string(int _iDatasetId, int _iItemPos, int* _piAddress);
-int import_boolean(int _iDatasetId, int _iVarType, int* _piAddress);
-int import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress);
+bool   import_data(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_double(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_string(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_integer(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_poly(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname);
+bool import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress, char* _pstVarname);
 
 int sci_import_from_hdf5(char *fname,unsigned long fname_len)
 {
-
-       //CheckRhs(1,1);
+       CheckRhs(1,2);
        CheckLhs(1,1);
        int iRows                                               = 0;
        int iCols                                               = 0;
@@ -56,12 +57,13 @@ int sci_import_from_hdf5(char *fname,unsigned long fname_len)
        int* piAddr2                            = NULL;
        if(Rhs > 1)
        {
-               getVarAddressFromNumber(2, &piAddr2);
+               getVarAddressFromPosition(2, &piAddr2);
        }
        int* piAddrOut                          = NULL;
-       getVarAddressFromNumber(Rhs + 1, &piAddrOut);
+       getVarAddressFromPosition(Rhs + 1, &piAddrOut);
 
-       getVarAddressFromNumber(1, &piAddr);
+       /* debug end */
+       getVarAddressFromPosition(1, &piAddr);
 
        if(getVarType(piAddr) != sci_strings)
        {
@@ -81,47 +83,88 @@ int sci_import_from_hdf5(char *fname,unsigned long fname_len)
 
        //open hdf5 file
        int iFile = openHDF5File(pstVarName);
-       int iDataSetId = getDataSetId(iFile);
 
+       int iNbItem = 0;
+       iNbItem = getVariableNames(iFile, NULL);
+       char** pstVarNameList = (char**)malloc(sizeof(char*) * iNbItem);
+       iNbItem = getVariableNames(iFile, pstVarNameList);
+
+       bool bImport = false;
+       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;
+               }
+       }
        //import all data
-       import_data(iDataSetId, 0, NULL);
 
        //close the file
        closeHDF5File(iFile);
 
        FREE(pstVarName);
+
+       int *piReturn = NULL;
+       allocMatrixOfBoolean(Rhs + 1, 1, 1, &piReturn);
+       if(bImport == true)
+       {
+               piReturn[0] = 1;
+       }
+       else
+       {
+               piReturn[0] = 0;
+       }
+
        LhsVar(1) = Rhs + 1;
        PutLhsVar();
 
        return 0;
 }
 
-int    import_data(int _iDatasetId, int _iItemPos, int* _piAddress)
+bool import_data(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 {
+       bool bRet = false;
        //get var type
        int iVarType = getScilabTypeFromDataSet(_iDatasetId);
        switch(iVarType)
        {
        case sci_matrix :
                {
-                       import_double(_iDatasetId, _iItemPos, _piAddress);
+                       bRet = import_double(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
                        break;
                }
        case sci_strings :
                {
-                       import_string(_iDatasetId, _iItemPos, _piAddress);
+                       bRet = import_string(_iDatasetId, _iItemPos, _piAddress, _pstVarname);
                        break;
                }
        case sci_list :
        case sci_tlist :
        case sci_mlist :
                {
-                       import_list(_iDatasetId, iVarType, _iItemPos, _piAddress);
+                       bRet = import_list(_iDatasetId, iVarType, _iItemPos, _piAddress, _pstVarname);
                        break;
                }
        case sci_boolean :
                {
-                       import_boolean(_iDatasetId, _iItemPos, _piAddress);
+                       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;
                }
        default : 
@@ -131,63 +174,117 @@ int      import_data(int _iDatasetId, int _iItemPos, int* _piAddress)
                        print_tree(pstMsg);
                }
        }
-       return 0;
+       return bRet;
 }
 
-int import_double(int _iDatasetId, int _iItemPos, int* _piAddress)
+bool import_double(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 {
-       double *pdblData = NULL;
-       int     iRows = 0;
-       int iCols = 0;
-       getDataSetDims(_iDatasetId, &iRows, &iCols);
+       int iRet                                                = 0;
+       double *pdblReal                = NULL;
+       double *pdblImg                 = NULL;
+       int     iRows                                           = 0;
+       int iCols                                               = 0;
+       int iComplex                            = 0;
 
+       iRet                            = getDataSetDims(_iDatasetId, &iRows, &iCols);
+       iComplex                = isComplexData(_iDatasetId);
+       if(iRet)
+       {
+               return false;
+       }
 
        if(iRows * iCols != 0)
        {
-               pdblData = (double *) malloc(iRows * iCols * sizeof(double));
-               readDoubleMatrix(_iDatasetId, pdblData, iRows, iCols);
+               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)
        {
-               createMatrixOfDouble(Rhs + 1, iRows, iCols, pdblData);
+               if(iComplex)
+               {
+                       iRet                    = createNamedComplexMatrixOfDouble(_pstVarname, (int)strlen(_pstVarname), iRows, iCols, pdblReal, pdblImg);
+               }
+               else
+               {
+                       iRet                    = createNamedMatrixOfDouble(_pstVarname, (int)strlen(_pstVarname), iRows, iCols, pdblReal);
+               }
        }
        else //if not null this variable is in a list
        {
-               createMatrixOfDoubleInList(Rhs + 1, _piAddress, _iItemPos, iRows, iCols, pdblData);
+               if(iComplex)
+               {
+                       iRet                    = createComplexMatrixOfDoubleInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, pdblReal, pdblImg);
+               }
+               else
+               {
+                       iRet                    = createMatrixOfDoubleInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, pdblReal);
+               }
        }
 
        char pstMsg[512];
        sprintf(pstMsg, "double (%d x %d)", iRows, iCols);
        print_tree(pstMsg);
 
-       if(pdblData)
+       if(pdblReal)
        {
-               free(pdblData);
+               free(pdblReal);
        }
 
-       return 0;
+       if(pdblImg)
+       {
+               free(pdblImg);
+       }
+
+       if(iRet)
+       {
+               return false;
+       }
+
+       return true;
 }
 
-int import_string(int _iDatasetId, int _iItemPos, int* _piAddress)
+bool import_string(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 {
-       int i = 0;
-       int     iRows, iCols;
-       getDataSetDims(_iDatasetId, &iRows, &iCols);
+       int iRet                                                = 0;
+       int i                                                           = 0;
+       int     iRows                                           = 0;
+       int iCols                                               = 0;
+       char **pstData                  = NULL;
 
-       char **pstData = (char **) malloc(iRows * iCols * sizeof(char*));
+       iRet = getDataSetDims(_iDatasetId, &iRows, &iCols);
+       if(iRet)
+       {
+               return false;
+       }
 
-       readStringMatrix(_iDatasetId, pstData, iRows, iCols);
+       pstData = (char **) malloc(iRows * iCols * sizeof(char*));
+       iRet = readStringMatrix(_iDatasetId, iRows, iCols, pstData);
+       if(iRet)
+       {
+               return false;
+       }
 
        if(_piAddress == NULL)
        {
-               createMatrixOfString(Rhs + 1, iRows, iCols, pstData);
+               iRet = createNamedMatrixOfString(_pstVarname, (int)strlen(_pstVarname), iRows, iCols, pstData);
        }
        else //if not null this variable is in a list
        {
-               createMatrixOfStringInList(Rhs + 1, _piAddress, _iItemPos, iRows, iCols, pstData);
+               iRet = createMatrixOfStringInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, pstData);
        }
 
        char pstMsg[512];
@@ -199,32 +296,152 @@ int import_string(int _iDatasetId, int _iItemPos, int* _piAddress)
                free(pstData[i]);
        }
        free(pstData);
-       return 0;
+
+       if(iRet)
+       {
+               return false;
+       }
+
+       return true;
 }
 
-int import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress)
+bool import_integer(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 {
-       int* piData = NULL;
-       int     iRows = 0;
-       int iCols = 0;
-       getDataSetDims(_iDatasetId, &iRows, &iCols);
+       int iRet                                                = 0;
+       int     iRows                                           = 0;
+       int iCols                                               = 0;
+       int iPrec                                               = 0;
 
+       iRet                                                            = getDataSetDims(_iDatasetId, &iRows, &iCols);
+       if(iRet)
+       {
+               return false;
+       }
 
-       if(iRows * iCols != 0)
+       iRet                                                            = getDatasetPrecision(_iDatasetId, &iPrec);
+       switch(iPrec)
        {
-               piData = (int *) malloc(iRows * iCols * sizeof(int));
-               readBooleanMatrix(_iDatasetId, piData, iRows, iCols);
+       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)
+                       {
+                               iRet = createNamedMatrixOfInteger8( _pstVarname, (int)strlen(_pstVarname), iRows, iCols, pcData);
+                       }
+                       else
+                       {
+                               iRet = createMatrixOfInteger8InNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, pcData);
+                       }
+               }
+               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)
+                       {
+                               iRet = createNamedMatrixOfInteger16( _pstVarname, (int)strlen(_pstVarname), iRows, iCols, psData);
+                       }
+                       else
+                       {
+                               iRet = createMatrixOfInteger16InNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, psData);
+                       }
+               }
+               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)
+                       {
+                               iRet = createNamedMatrixOfInteger32( _pstVarname, (int)strlen(_pstVarname), iRows, iCols, piData);
+                       }
+                       else
+                       {
+                               iRet = createMatrixOfInteger32InNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, piData);
+                       }
+               }
+               break;
+       case SCI_INT64 : 
+               {
+#ifdef __SCILAB_INT64__
+                       char* pcData    = NULL;
+                       pcData = (char*)malloc(sizeof(char) * iRows * iCols);
+                       iRet = readInterger64Matrix(_iDatasetId, iRows, iCols, pcData);
+                       if(iRet)
+                       {
+                               return false;
+                       }
+
+                       iRet = createNamedMatrixOfInteger8( _pstVarname, (int)strlen(_pstVarname), iRows, iCols, pcData);
+                       if(_piAddress == NULL)
+                       {
+                               iRet = createNamedMatrixOfInteger8( _pstVarname, (int)strlen(_pstVarname), iRows, iCols, pcData);
+                       }
+                       else
+                       {
+                               iRet = createMatrixOfInteger64InNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, pllData);
+                       }
+#else
+                       return false;
+#endif
+               }
+               break;
+       default :
+               return false;
        }
+       return true;
+}
 
+bool import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
+{
+       int iRet                                                = 0;
+       int* piData                                     = NULL;
+       int     iRows                                           = 0;
+       int iCols                                               = 0;
 
+       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)
        {
-               createMatrixOfBoolean(Rhs + 1, iRows, iCols, piData);
+               iRet                    = createNamedMatrixOfBoolean(_pstVarname, (int)strlen(_pstVarname), iRows, iCols, piData);
        }
        else //if not null this variable is in a list
        {
-               createMatrixOfBooleanInList(Rhs + 1, _piAddress, _iItemPos, iRows, iCols, piData);
+               iRet                    = createMatrixOfBooleanInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows, iCols, piData);
        }
 
        char pstMsg[512];
@@ -236,23 +453,110 @@ int import_boolean(int _iDatasetId, int _iItemPos, int* _piAddress)
                free(piData);
        }
 
-       return 0;
+       if(iRet)
+       {
+               return false;
+       }
+
+       return true;
 }
 
-int import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress)
+bool import_poly(int _iDatasetId, int _iItemPos, int* _piAddress, char* _pstVarname)
 {
-       int i                                                   = 0;
-       int     iRows                                   = 0;
-       int iCols                                       = 0;
-       int status                              = 0;
-       int* piListAddr         = NULL;
+       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;
 
+
+       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)
+               {
+                       iRet                    =       createNamedComplexMatrixOfPoly(_pstVarname, strlen(_pstVarname), pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
+               }
+               else
+               {
+                       iRet                    =       createNamedMatrixOfPoly(_pstVarname, strlen(_pstVarname), pstVarName, iRows, iCols, piNbCoef, pdblReal);
+               }
+       }
+       else //if not null this variable is in a list
+       {
+               if(iComplex)
+               {
+                       iRet                    = createComplexMatrixOfPolyInNamedList(_pstVarname, strlen(_pstVarname), _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal, pdblImg);
+               }
+               else
+               {
+                       iRet                    = createMatrixOfPolyInNamedList(_pstVarname, strlen(_pstVarname), _piAddress, _iItemPos, pstVarName, iRows, iCols, piNbCoef, pdblReal);
+               }
+       }
+
+       char pstMsg[512];
+       sprintf(pstMsg, "string (%d x %d)", iRows, iCols);
+       print_tree(pstMsg);
+
+       for(i = 0 ; i < iRows * iCols ; i++)
+       {
+               free(pdblReal[i]);
+       }
+       free(pdblReal);
+       free(piNbCoef);
+
+       if(iRet)
+       {
+               return false;
+       }
+
+       return true;
+}
+
+bool import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress, char* _pstVarname)
+{
+       int iRet                                                                = 0;
+       int i                                                                           = 0;
+       int     iRows                                                           = 0;
+       int iCols                                                               = 0;
+       int* piListAddr                                 = NULL;
        hobj_ref_t* piItemRef           = NULL;
 
-       status = getDataSetDims(_iDatasetId, &iRows, &iCols);
-       if(status)
+       iRet                            = getDataSetDims(_iDatasetId, &iRows, &iCols);
+       if(iRet)
        {
-               return 1;
+               return false;
        }
 
 
@@ -263,10 +567,10 @@ int import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress)
        }
        else
        {
-               status = getListItemReferences(_iDatasetId, &piItemRef);
-               if(status)
+               iRet                    = getListItemReferences(_iDatasetId, &piItemRef);
+               if(iRet)
                {
-                       return 1;
+                       return false;
                }
        }
 
@@ -279,16 +583,16 @@ int import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress)
                switch(_iVarType)
                {
                case sci_list :
-                       createList(Rhs + 1, iRows * iCols, &piListAddr);
+                       iRet            = createNamedList(_pstVarname, (int)strlen(_pstVarname), iRows * iCols, &piListAddr);
                        break;
                case sci_tlist :
-                       createTList(Rhs + 1, iRows * iCols, &piListAddr);
+                       iRet            = createNamedTList(_pstVarname, (int)strlen(_pstVarname), iRows * iCols, &piListAddr);
                        break;
                case sci_mlist :
-                       createMList(Rhs + 1, iRows * iCols, &piListAddr);
+                       iRet            = createNamedMList(_pstVarname, (int)strlen(_pstVarname), iRows * iCols, &piListAddr);
                        break;
                default :
-                       return 1;
+                       return false;
                }
        }
        else //if not null this variable is in a list
@@ -296,35 +600,49 @@ int import_list(int _iDatasetId, int _iVarType, int _iItemPos, int* _piAddress)
                switch(_iVarType)
                {
                case sci_list :
-                       createListInList(Rhs + 1, _piAddress, _iItemPos, iRows * iCols, &piListAddr);
+                       iRet            = createListInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows * iCols, &piListAddr);
                        break;
                case sci_tlist :
-                       createTListInList(Rhs + 1, _piAddress, _iItemPos, iRows * iCols, &piListAddr);
+                       iRet            = createTListInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows * iCols, &piListAddr);
                        break;
                case sci_mlist :
-                       createMListInList(Rhs + 1, _piAddress, _iItemPos, iRows * iCols, &piListAddr);
+                       iRet            = createMListInNamedList(_pstVarname, (int)strlen(_pstVarname), _piAddress, _iItemPos, iRows * iCols, &piListAddr);
                        break;
                default :
-                       return 1;
+                       return false;
                }
        }
 
+       if(iRet)
+       {
+               return false;
+       }
+
        iTab++;
        for(i = 0 ; i < iRows * iCols ; i++)
        {
                int iItemDataset = 0;
-               getListItemDataset(_iDatasetId, piItemRef, i, &iItemDataset);
-               if(iItemDataset == 0)
+               iRet                    = getListItemDataset(_iDatasetId, piItemRef, i, &iItemDataset);
+               if(iRet || iItemDataset == 0)
+               {
+                       return false;
+               }
+
+               bool bRet = import_data(iItemDataset, i + 1, piListAddr, _pstVarname);
+               if(bRet == false)
                {
-                       return 1;
+                       return false;
                }
-               import_data(iItemDataset, i + 1, piListAddr);
        }
        iTab--;
 
-       deleteListItemReferences(_iDatasetId, piItemRef);
+       iRet                            = deleteListItemReferences(_iDatasetId, piItemRef);
+       if(iRet)
+       {
+               return false;
+       }
 
-       return 0;
+       return true;
 }
 
 void print_tree(char* _pstMsg)
index fca4a70..c7f535e 100644 (file)
 #include <stdlib.h>
 #include "stack-c.h"
 #include "h5_attributeConstants.h"
+#include "h5_readDataFromFile.h"
+
+
+static herr_t find_attr_by_name( hid_t loc_id, const char* name, void* data )
+{ 
+       return !strcmp(name, (const char*)data);
+}
 
 /************************************************************
 
@@ -23,15 +30,15 @@ being examined.
 ************************************************************/
 static herr_t op_func (hid_t loc_id, const char *name, void *operator_data)
 {
-       herr_t          status;
-       H5G_stat_t      statbuf;
-       int                 *pDataSetId = operator_data;
+       herr_t status = 0;
+       H5G_stat_t statbuf;
+       int     *pDataSetId = operator_data;
 
        /*
        * Get type of the object and return only datasetId
        * through operator_data.
        */
-       status = H5Gget_objinfo (loc_id, name, 0, &statbuf);
+       status = H5Gget_objinfo(loc_id, name, 0, &statbuf);
        switch (statbuf.type)
        {
        case H5G_GROUP :
@@ -64,77 +71,155 @@ static char *readAttribute(int _iDatasetId, const char *_pstName)
        hsize_t dims[1];
        size_t  iDim;
 
-       char            *pstValue;
-
-
-       iAttributeId = H5Aopen_name(_iDatasetId, _pstName);
-       /*
-       * Get the datatype and its size.
-       */
-       iFileType = H5Aget_type (iAttributeId);
-       iDim = H5Tget_size (iFileType);
-       iDim++;                         /* Make room for null terminator */
+       char            *pstValue                       = NULL;
 
-       /*
-       * Get dataspace and allocate memory for read buffer.  This is a
-       * two dimensional attribute so the dynamic allocation must be done
-       * in steps.
-       */
-       iSpace = H5Aget_space (iAttributeId);
-       H5Sget_simple_extent_dims (iSpace, dims, NULL);
+       if(H5Aiterate(_iDatasetId, NULL, find_attr_by_name, (void*)_pstName))
+       {
+               iAttributeId = H5Aopen_name(_iDatasetId, _pstName);
+               /*
+               * Get the datatype and its size.
+               */
+               iFileType = H5Aget_type (iAttributeId);
+               iDim = H5Tget_size (iFileType);
+               iDim++;                         /* Make room for null terminator */
+
+               /*
+               * Get dataspace and allocate memory for read buffer.  This is a
+               * two dimensional attribute so the dynamic allocation must be done
+               * in steps.
+               */
+               iSpace = H5Aget_space (iAttributeId);
+               H5Sget_simple_extent_dims (iSpace, dims, NULL);
+
+               /*
+               * Allocate space for string data.
+               */
+               pstValue = (char *) malloc ( (size_t)((dims[0] * iDim + 1 ) * sizeof (char)));
+
+               /*
+               * Create the memory datatype.
+               */
+               memtype = H5Tcopy (H5T_C_S1);
+               status = H5Tset_size (memtype, iDim);
+
+               /*
+               * Read the data.
+               */
+               status = H5Aread (iAttributeId, memtype, pstValue);
+
+               H5Aclose(iAttributeId);
+       }
+       return pstValue;
 
-       /*
-       * Allocate space for string data.
-       */
-       pstValue = (char *) malloc ( (size_t)((dims[0] * iDim + 1 ) * sizeof (char)));
+}
 
-       /*
-       * Create the memory datatype.
-       */
-       memtype = H5Tcopy (H5T_C_S1);
-       status = H5Tset_size (memtype, iDim);
+static int checkAttribute(int _iDatasetId, char* _pstAttribute, char* _pstValue)
+{
+       int iRet                                                        = 0;
+       char *pstScilabClass    = NULL;
 
-       /*
-       * Read the data.
-       */
-       status = H5Aread (iAttributeId, memtype, pstValue);
+       //status = H5Giterate (_iFile, "/", NULL, op_func, &iDatasetId);
+       pstScilabClass = readAttribute(_iDatasetId, _pstAttribute);
+       if(pstScilabClass != NULL && strcmp(pstScilabClass, _pstValue) == 0)
+       {
+               iRet = 1;
+       }
+       if(pstScilabClass)
+       {
+               free(pstScilabClass);
+       }
+       return iRet;
+}
 
-       H5Aclose(iAttributeId);
-       return pstValue;
+static int isEmptyDataset(int _iDatasetId)
+{
+       return checkAttribute(_iDatasetId, (char*)g_SCILAB_CLASS_EMPTY, "true");
+}
 
+int isComplexData(int _iDatasetId)
+{
+       return checkAttribute(_iDatasetId, (char*)g_SCILAB_CLASS_COMPLEX, "true");
 }
 
-static int isEmptyDataset(int _iDatasetId)
+int getDatasetPrecision(int _iDatasetId, int* _piPrec)
 {
        int iRet                                                        = 0;
-       char *pstScilabClass    = NULL;
+       char* pstScilabClass    = readAttribute(_iDatasetId, g_SCILAB_CLASS_PREC);
+       if(pstScilabClass == NULL)
+       {
+               return 0;
+       }
+       else if(strcmp(pstScilabClass, "8") == 0)
+       {
+               iRet    = SCI_INT8;
+       }
+       else if(strcmp(pstScilabClass, "16") == 0)
+       {
+               iRet = SCI_INT16;
+       }
+       else if(strcmp(pstScilabClass, "32") == 0)
+       {
+               iRet = SCI_INT32;
+       }
+       else if(strcmp(pstScilabClass, "64") == 0)
+       {
+               iRet = SCI_INT64;
+       }
+       else
+       {
+               iRet = 0;
+       }
+       
+       free(pstScilabClass);
+       return iRet;
+}
 
-       if(H5Aget_num_attrs(_iDatasetId) > 1)
+int getVariableNames(int _iFile, char **pstNameList)
+{
+       hsize_t i                                               = 0;
+       hsize_t iCount                  = 0;
+       herr_t status                           = 0;
+       int iNbItem                                     = 0;
+
+       status = H5Gget_num_objs(_iFile, &iCount);
+       if(status != 0)
        {
-               pstScilabClass = readAttribute(_iDatasetId, g_SCILAB_CLASS_EMPTY);
-               if(pstScilabClass != NULL &&strcmp(pstScilabClass, "true") == 0)
-               {
-                       iRet = 1;
-               }
-               if(pstScilabClass)
+               return 0;
+       }
+       
+       for(i = 0 ; i < iCount ; i++)
+       {
+               if(H5Gget_objtype_by_idx(_iFile, i) == H5G_DATASET)
                {
-                       free(pstScilabClass);
+                       if(pstNameList != NULL)
+                       {
+                               int iLen = 0;
+                               iLen = H5Gget_objname_by_idx(_iFile, i, NULL, iLen);
+                               pstNameList[iNbItem] = (char*)malloc(sizeof(char) * iLen - 1); //null terminated
+                               H5Gget_objname_by_idx(_iFile, i, pstNameList[iNbItem], iLen + 1);
+                       }
+                       iNbItem++;
                }
        }
-       return iRet;
+       return iNbItem;
+}
+
+int getDataSetIdFromName(int _iFile, char *_pstName)
+{
+       return H5Dopen(_iFile, _pstName);
 }
 
 int getDataSetId(int  _iFile)
 {
-       herr_t          status;
-       int               dataSetId;
+       herr_t status                           = 0;
+       int iDatasetId                  = 0;
+
        /*
        * Begin iteration.
        */
        //  printf ("Objects in root group:\n");
-       status = H5Giterate (_iFile, "/", NULL, op_func, &dataSetId);
-
-       return dataSetId;
+       status = H5Giterate (_iFile, "/", NULL, op_func, &iDatasetId);
+       return iDatasetId;
 }
 
 
@@ -159,7 +244,23 @@ int getDataSetDims(int _iDatasetId, int *_piRows, int *_piCols)
                *_piRows = (int)lDims[0];
                if (ndims == 1)
                {
-                       *_piCols = 1;
+                       //check if double in this case read chid size
+                       if(getScilabTypeFromDataSet(_iDatasetId) == sci_matrix)
+                       {
+                               int iItemDataset                                = 0;
+                               hobj_ref_t* piItemRef           = NULL;
+
+                               piItemRef = (hobj_ref_t *) malloc (*_piRows * sizeof (hobj_ref_t));
+                               H5Dread (_iDatasetId, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, piItemRef);
+
+                               getListItemDataset(_iDatasetId, piItemRef, 0, &iItemDataset);
+                               getDataSetDims(iItemDataset, _piRows, _piCols);
+                               free(piItemRef);
+                       }
+                       else
+                       {
+                               *_piCols = 1;
+                       }
                }
                else
                {
@@ -171,11 +272,13 @@ int getDataSetDims(int _iDatasetId, int *_piRows, int *_piCols)
        return 0;
 }
 
-int readDoubleMatrix(int _iDatasetId, double *_pdblData, int _iRows, int _iCols)
+int readDouble(int _iDatasetId, int _iRows, int _iCols, double *_pdblData)
 {
        herr_t      status;
        double      *pdblLocalData;
        int          i = 0, j = 0;
+       char* pstMajor          = NULL;
+       char* pstMinor          = NULL;
 
        pdblLocalData = (double*)malloc(sizeof(double) * _iRows * _iCols);
        /*
@@ -198,7 +301,43 @@ int readDoubleMatrix(int _iDatasetId, double *_pdblData, int _iRows, int _iCols)
        return status;
 }
 
-int readBooleanMatrix(int _iDatasetId, int* _piData, int _iRows, int _iCols)
+int readDoubleMatrix(int _iDatasetId, int _iRows, int _iCols, double *_pdblData)
+{
+       hid_t           obj;
+       hobj_ref_t      *pRef = (hobj_ref_t *) malloc (1 * sizeof (hobj_ref_t));
+       herr_t  status;
+
+       //Read the data.
+       status = H5Dread (_iDatasetId, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, pRef);
+
+       //Open the referenced object, get its name and type.
+       obj = H5Rdereference (_iDatasetId, H5R_OBJECT, &pRef[0]);
+       readDouble(obj,_iRows, _iCols, _pdblData);
+
+       H5Dclose(_iDatasetId);
+       return 0;
+}
+
+int readDoubleComplexMatrix(int _iDatasetId, int _iRows, int _iCols, double *_pdblReal, double *_pdblImg)
+{
+       hid_t           obj;
+       hobj_ref_t      *pRef = (hobj_ref_t *) malloc (2 * sizeof (hobj_ref_t));
+       herr_t  status;
+
+       //Read the data.
+       status = H5Dread (_iDatasetId, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, pRef);
+
+       //Open the referenced object, get its name and type.
+       obj = H5Rdereference (_iDatasetId, H5R_OBJECT, &pRef[0]);
+       readDouble(obj,_iRows, _iCols, _pdblReal);
+       obj = H5Rdereference (_iDatasetId, H5R_OBJECT, &pRef[1]);
+       readDouble(obj,_iRows, _iCols, _pdblImg);
+
+       H5Dclose(_iDatasetId);
+       return 0;
+}
+
+int readBooleanMatrix(int _iDatasetId, int _iRows, int _iCols, int* _piData)
 {
        herr_t status = 0;
        int* piData             = NULL;
@@ -268,7 +407,7 @@ static int readString(int _iDatasetId, char **_pstData)
        return 0;
 }
 
-int readStringMatrix(int _iDatasetId, char **_pstData, int _iRows, int _iCols)
+int readStringMatrix(int _iDatasetId, int _iRows, int _iCols, char **_pstData)
 {
        hid_t           obj;
        hobj_ref_t      *rdata = (hobj_ref_t *) malloc (_iRows * _iCols * sizeof (hobj_ref_t));
@@ -298,39 +437,177 @@ int readStringMatrix(int _iDatasetId, char **_pstData, int _iRows, int _iCols)
        return 0;
 }
 
+static int readComplexPoly(int _iDatasetId, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
+{
+       int iRows                               = 0;
+       int iCols                               = 0;
+
+       //Get the datatype and its size.
+       getDataSetDims(_iDatasetId, &iRows, &iCols);
+
+       //Allocate space for string data.
+       *_piNbCoef                      = iRows * iCols;
+       *_pdblReal                      = (double*)malloc(*_piNbCoef * sizeof(double));
+       *_pdblImg                               = (double*)malloc(*_piNbCoef * sizeof(double));
+
+       //Read the data and return result.
+       return readDoubleComplexMatrix(_iDatasetId, 1, *_piNbCoef, *_pdblReal, *_pdblImg);
+}
+
+static int readPoly(int _iDatasetId, int* _piNbCoef, double** _pdblData)
+{
+       //hid_t iFileType                       = 0;
+       //hid_t iSpace                          = 0;
+       //herr_t status                         = 0;
+       //size_t iDim                                   = 0;
+       //hsize_t dims[1];
+       int iRows                                                       = 0;
+       int iCols                                                       = 0;
+
+       //Get the datatype and its size.
+       getDataSetDims(_iDatasetId, &iRows, &iCols);
+
+       //iFileType = H5Dget_type (_iDatasetId);
+       //iDim = H5Tget_size (iFileType);
+       //iDim++;                         // Make room for null terminator
+
+       ////Get dataspace and allocate memory for read buffer.  This is a
+       ////two dimensional attribute so the dynamic allocation must be done
+       ////in steps.
+
+       //iSpace = H5Dget_space (_iDatasetId);
+       //H5Sget_simple_extent_dims (iSpace, dims, NULL);
+
+       //Allocate space for string data.
+       //*_piNbCoef = (int)dims[0];
+       //*_pdblData = (double*)malloc((int)dims[0] * sizeof(double));
+       *_piNbCoef = iRows * iCols;
+       *_pdblData = (double*)malloc(*_piNbCoef * sizeof(double));
+
+       //Read the data and return result.
+       return readDoubleMatrix(_iDatasetId, 1, *_piNbCoef, *_pdblData);
+}
+
+int readCommonPolyMatrix(int _iDatasetId, char* _pstVarname, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double **_pdblReal, double **_pdblImg)
+{
+       int     i                                                               = 0;
+       int j                                                           = 0;
+       hid_t obj                                               = 0;
+       char* pstVarName                = 0;
+       hobj_ref_t *pData               = (hobj_ref_t *)malloc(_iRows * _iCols * sizeof (hobj_ref_t));
+       herr_t status;
+
+       /*
+       * Read the data.
+       */
+       status = H5Dread (_iDatasetId, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT, pData);
+       if(status)
+       {
+               return 1;
+       }
+
+       for (i = 0 ; i < _iRows ; i++)
+       {
+               for (j = 0 ; j < _iCols ; ++j)
+               {
+                       /*
+                       * Open the referenced object, get its name and type.
+                       */
+                       obj = H5Rdereference (_iDatasetId, H5R_OBJECT, &pData[i * _iCols + j]);
+                       if(_iComplex)
+                       {
+                               status = readComplexPoly(obj, &_piNbCoef[i + j * _iRows], &_pdblReal[i + j * _iRows], &_pdblImg[i + j * _iRows]);
+                       }
+                       else
+                       {
+                               status = readPoly(obj, &_piNbCoef[i + j * _iRows], &_pdblReal[i + j * _iRows]);
+                       }
+               }
+       }
+
+       if(status)
+       {
+               return 1;
+       }
+
+       pstVarName = readAttribute(_iDatasetId, g_SCILAB_CLASS_VARNAME);
+       strcpy(_pstVarname, pstVarName);
+       status = H5Dclose(_iDatasetId);
+       free(pData);
+       free(pstVarName);
+
+       return status;
+}
+
+int readPolyMatrix(int _iDatasetId, char* _pstVarname, int _iRows, int _iCols, int* _piNbCoef, double **_pdblData)
+{
+       return readCommonPolyMatrix(_iDatasetId, _pstVarname, 0, _iRows, _iCols, _piNbCoef, _pdblData, NULL);
+}
+
+int readPolyComplexMatrix(int _iDatasetId, char* _pstVarname, int _iRows, int _iCols, int* _piNbCoef, double **_pdblReal, double **_pdblImg)
+{
+       return readCommonPolyMatrix(_iDatasetId, _pstVarname, 1, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg);
+}
+
+int readInterger8Matrix(int _iDatasetId, int _iRows, int _iCols, char* _pcData)
+{
+       return 0;
+}
+
+int readInterger16Matrix(int _iDatasetId, int _iRows, int _iCols, short* _psData)
+{
+       return 0;
+}
+
+int readInterger32Matrix(int _iDatasetId, int _iRows, int _iCols, int* _piData)
+{
+       return 0;
+}
+
+int readInterger64Matrix(int _iDatasetId, int _iRows, int _iCols, long long* _pllData)
+{
+       return 0;
+}
+
 int getScilabTypeFromDataSet(int _iDatasetId)
 {
        int iVarType                                    = 0;
        char *pstScilabClass    = readAttribute(_iDatasetId, g_SCILAB_CLASS);
 
        /* HDF5 Float type + SCILAB_Class = double <=> double */
-       if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_FLOAT
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_DOUBLE) == 0)
+       if(strcmp(pstScilabClass, g_SCILAB_CLASS_DOUBLE) == 0)
        {
                iVarType = sci_matrix;
        }
-       else if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_REFERENCE                /* HDF5 Reference type + SCILAB_Class = string <=> strings */
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_STRING) == 0)
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_STRING) == 0)
        {
                iVarType = sci_strings;
        }
-       else if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_INTEGER
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_BOOLEAN) == 0)
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_BOOLEAN) == 0)
+       {
+               iVarType = sci_boolean;
+       }
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_BOOLEAN) == 0)
        {
                iVarType = sci_boolean;
        }
-       else if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_REFERENCE                /* HDF5 Reference type + SCILAB_Class = list <=> list */
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_LIST) == 0)
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_POLY) == 0)
+       {
+               iVarType = sci_poly;
+       }
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_INT) == 0)
+       {
+               iVarType = sci_ints;
+       }
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_LIST) == 0)
        {
                iVarType = sci_list;
        }
-       else if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_REFERENCE                /* HDF5 Reference type + SCILAB_Class = tlist <=> tlist */
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_TLIST) == 0)
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_TLIST) == 0)
        {
                iVarType = sci_tlist;
        }
-       else if (H5Tget_class(H5Dget_type(_iDatasetId)) == H5T_REFERENCE                /* HDF5 Reference type + SCILAB_Class = string <=> MLIST */
-               && strcmp(pstScilabClass, g_SCILAB_CLASS_MLIST) == 0)
+       else if(strcmp(pstScilabClass, g_SCILAB_CLASS_MLIST) == 0)
        {
                iVarType = sci_mlist;
        }
index f52e57a..feef003 100644 (file)
@@ -1,14 +1,14 @@
 /*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET
- *
- *  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
- *
- */
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET
+*
+*  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 <hdf5.h>
 #include "stack-c.h"
 #include "h5_attributeConstants.h"
 
 
-static void addAttribute(int dataSetId, const char *name, const char *value)
+static hid_t enableCompression(int _iLevel, int _iRank, const hsize_t* _piDims)
 {
-  hsize_t     attributeDims[1] = {1};
-  hid_t       attributeTypeId, attributeSpace, attr;
-  herr_t      status;
-
-    /*
-   * Create attribute dataspace.  Setting maximum size to NULL sets the maximum
-   * size to be the current size.
-   */
-  attributeSpace = H5Screate_simple (1, attributeDims, NULL);
-
-  /*
-   * Create special attribute type
-   */
-  attributeTypeId = H5Tcopy(H5T_C_S1);
-  H5Tset_size(attributeTypeId, strlen(value));
-  /*
-   * Create the attribute and write it.
-   */
-  attr = H5Acreate (dataSetId, name, attributeTypeId, attributeSpace, H5P_DEFAULT);
-  status = H5Awrite (attr, attributeTypeId, value);
-
-  /*
-   * Close and release resources.
-   */
-  status = H5Aclose (attr);
+       hid_t iRet                      = 0;
+       int iLevel                      = _iLevel;
+
+  if(iLevel < 0)
+       {
+               iLevel                          = 0;
+       }
+
+  if(iLevel > 9)
+       {
+               iLevel                          = 9;
+       }
+
+       if(iLevel) 
+       {
+               iRet = H5Pcreate(H5P_DATASET_CREATE);
+               if(iRet<0) 
+               {
+                       iRet = 0;
+               } 
+               else 
+               {
+                       if(H5Pset_layout(iRet,H5D_COMPACT)<0) 
+                       {
+                               H5Pclose(iRet);
+                               iRet = 0;
+                       } 
+                       else 
+                       {
+                               if(H5Pset_chunk(iRet,_iRank, _piDims)<0) 
+                               {
+                                       H5Pclose(iRet);
+                                       iRet = 0;
+                               }
+                               else
+                               {
+                                       if(H5Pset_deflate(iRet,iLevel)<0) 
+                                       {
+                                               H5Pclose(iRet);
+                                               iRet = 0;
+                                       }
+                               }
+                       }
+               }
+       } 
+       else 
+       {
+               iRet = H5Pcopy(H5P_DEFAULT);
+       }
+       return iRet;
 }
 
-static int writeString(int file, char* dataSetName, char *data)
+static void addAttribute(int _iDatasetId, const char *_pstName, const char *_pstValue)
 {
-  hsize_t     dims[1] = {1};
-  hid_t       typeId, space, dset;
-  herr_t      status;
-
-  /*
-   * Create string dataspace.  Setting maximum size to NULL sets the maximum
-   * size to be the current size.
-   */
-  space = H5Screate_simple (1, dims, NULL);
-
-  /*
-   * Create special string type
-   */
-  typeId = H5Tcopy(H5T_C_S1);
-  H5Tset_size(typeId, strlen(data));
-
-  /*
-   * Create the data set and write it.
-   */
-  dset = H5Dcreate (file, dataSetName, typeId, space, H5P_DEFAULT);
-  status = H5Dwrite (dset, typeId, H5S_ALL, H5S_ALL, H5P_DEFAULT, data);
-
- /*
-   * Add attribute SCILAB_Class = string to dataset
-   */
-  addAttribute(dset, g_SCILAB_CLASS, g_SCILAB_CLASS_STRING);
-
-  /*
-   * Close and release resources.
-   */
-  status = H5Dclose (dset);
-  status = H5Sclose (space);
-  return status;
+       hsize_t     attributeDims[1] = {1};
+       hid_t       attributeTypeId, attributeSpace, attr;
+       herr_t      status;
+
+       //Create attribute dataspace.  Setting maximum size to NULL sets the maximum size to be the current size.
+       attributeSpace = H5Screate_simple (1, attributeDims, NULL);
+
+       //Create special attribute type
+       attributeTypeId = H5Tcopy(H5T_C_S1);
+       H5Tset_size(attributeTypeId, strlen(_pstValue));
+
+       //Create the attribute and write it.
+       attr = H5Acreate (_iDatasetId, _pstName, attributeTypeId, attributeSpace, H5P_DEFAULT);
+       status = H5Awrite (attr, attributeTypeId, _pstValue);
+
+       //Close and release resources.
+       status = H5Aclose (attr);
+}
+
+static int writeString(int _iFile, char* _pstDatasetName, char *_pstData)
+{
+       hsize_t     dims[1] = {1};
+       hid_t       typeId, space, dset;
+       herr_t      status;
+       hid_t iCompress;
+
+       //Create string dataspace.  Setting maximum size to NULL sets the maximum size to be the current size.
+       space = H5Screate_simple (1, dims, NULL);
+
+       //Create special string type
+       typeId = H5Tcopy(H5T_C_S1);
+       H5Tset_size(typeId, strlen(_pstData));
+
+       //Create the data set and write it.
+       iCompress       = enableCompression(9, 1, dims);
+       dset = H5Dcreate (_iFile, _pstDatasetName, typeId, space, iCompress);
+       status = H5Dwrite (dset, typeId, H5S_ALL, H5S_ALL, H5P_DEFAULT, _pstData);
+
+       //Add attribute SCILAB_Class = string to dataset
+       addAttribute(dset, g_SCILAB_CLASS, g_SCILAB_CLASS_STRING);
+
+       //Close and release resources.
+       status = H5Dclose (dset);
+       status = H5Sclose (space);
+       return status;
 }
 
-int writeStringMatrix(int file, char* dataSetName, char **data, int rows, int cols)
+int writeStringMatrix(int _iFile, char* _pstDatasetName, int _iRows, int _iCols, char **data)
 {
-  hsize_t     dims[2] = {rows, cols};
-  herr_t      status;
-  hid_t       space, dset, group;
-  hobj_ref_t  *wdata; 
-
-  char       *groupName = (char *) malloc((strlen(dataSetName) + 3) * sizeof(char));
-  char        *pstName = NULL;
-  char        *pstPathName = NULL;
+       hsize_t     dims[2] = {_iRows, _iCols};
+       herr_t      status;
+       hid_t       space, dset, group, iCompress;
+       hobj_ref_t  *wdata; 
+
+       char          *groupName = (char *) malloc((strlen(_pstDatasetName) + 3) * sizeof(char));
+       char        *pstName = NULL;
+       char        *pstPathName = NULL;
        char                            *pstSlash                       = NULL;
-  
-  int        i, j = 0;
 
-  /* Create ref matrix */
-  wdata = (hobj_ref_t *) malloc(rows * cols * sizeof(hobj_ref_t));
+       int           i, j = 0;
 
-  /* Generate groupname #<dataSetName># */
-  sprintf(groupName, "#%s#", dataSetName);
+       //Create ref matrix
+       wdata = (hobj_ref_t *) malloc(_iRows * _iCols * sizeof(hobj_ref_t));
+
+       // Generate groupname #<dataSetName>#
+       sprintf(groupName, "#%s#", _pstDatasetName);
        pstSlash                        = strstr(groupName, "/");
        if(pstSlash != NULL)
        {
                pstSlash[0]                                     = '_';
        }
 
-  /*
-   * First create a group to store all referenced objects.
-   */
-  group = H5Gcreate (file, groupName, H5P_DEFAULT);
-  status = H5Gclose (group);
+       //First create a group to store all referenced objects.
+       group = H5Gcreate (_iFile, groupName, H5P_DEFAULT);
+       status = H5Gclose (group);
 
-  /*
-   * Now create each String as a dedicated DataSet.
-   */
-  for (i = 0 ; i < rows ; ++i)
+       //Now create each String as a dedicated DataSet.
+       for (i = 0 ; i < _iRows ; ++i)
        {
-               for ( j = 0 ; j < cols ; ++j)
+               for ( j = 0 ; j < _iCols ; ++j)
                { 
-                       pstName = (char*)malloc(((int)log10((double)(i + rows * j + 1)) + 4) * sizeof(char)); 
+                       pstName = (char*)malloc(((int)log10((double)(i + _iRows * j + 1)) + 4) * sizeof(char)); 
                        //1 for null termination, 1 for round value, 2 for '#' characters
-                       sprintf(pstName, "#%d#", i + rows * j);
+                       sprintf(pstName, "#%d#", i + _iRows * j);
 
                        pstPathName = (char*)malloc((strlen(groupName) + strlen(pstName) + 2) * sizeof(char)); 
                        //1 for null termination, 1 for separator, 2 for '#' characters
                        sprintf(pstPathName, "%s/%s", groupName, pstName);
 
                        // Write the string to ref
-                       writeString(file, pstPathName, data[i + rows * j]);
+                       writeString(_iFile, pstPathName, data[i + _iRows * j]);
 
                        // create the ref
-                       status = H5Rcreate (&wdata[i * cols + j], file, pstPathName, H5R_OBJECT, -1);
+                       status = H5Rcreate (&wdata[i * _iCols + j], _iFile, pstPathName, H5R_OBJECT, -1);
 
                        free(pstName);
                        free(pstPathName);
@@ -142,124 +175,272 @@ int writeStringMatrix(int file, char* dataSetName, char **data, int rows, int co
        }
 
 
-  /*
-   * Create dataspace.  Setting maximum size to NULL sets the maximum
-   * size to be the current size.
-   */
-  space = H5Screate_simple (2, dims, NULL);
-  
-  /*
-   * Create the dataset and write the array data to it.
-   */
-  dset = H5Dcreate (file, dataSetName, H5T_STD_REF_OBJ, space, H5P_DEFAULT);
-  status = H5Dwrite (dset, H5T_STD_REF_OBJ, H5S_ALL, H5S_ALL, H5P_DEFAULT,
-                    wdata);
+       //Create dataspace.  Setting maximum size to NULL sets the maximum size to be the current size.
+       space = H5Screate_simple (2, dims, NULL);
+
+       //Create the dataset and write the array data to it.
+       iCompress       = enableCompression(9, 2, dims);
+       dset = H5Dcreate (_iFile, _pstDatasetName, H5T_STD_REF_OBJ, space, iCompress);
+    &n