* isnum has been redesigned in native code. Up to 130x performance 93/11293/4
Sylvestre Ledru [Wed, 17 Apr 2013 13:28:27 +0000 (15:28 +0200)]
  improvements. See bug #10404

spreadsheet csvIsnum() becomes string isnum()
moved stringToComplex and csv_complex (renamed to complex_array) to string
replaced spreadsheet csv_strsubst() with string strsub()

Change-Id: I6f9c4fdc22b9a3f5c44453daf9aef16b96d6c7a3

36 files changed:
scilab/CHANGES_5.5.X
scilab/modules/spreadsheet/Makefile.am
scilab/modules/spreadsheet/Makefile.in
scilab/modules/spreadsheet/TODO
scilab/modules/spreadsheet/includes/gw_spreadsheet.h
scilab/modules/spreadsheet/sci_gateway/c/gw_spreadsheet.c
scilab/modules/spreadsheet/sci_gateway/c/sci_csvRead.c
scilab/modules/spreadsheet/sci_gateway/c/sci_csvStringToDouble.c
scilab/modules/spreadsheet/sci_gateway/c/sci_csvTextScan.c
scilab/modules/spreadsheet/sci_gateway/spreadsheet_gateway.xml
scilab/modules/spreadsheet/spreadsheet.vcxproj
scilab/modules/spreadsheet/src/c/csvRead.c
scilab/modules/spreadsheet/src/c/csvWrite.c
scilab/modules/spreadsheet/src/c/csv_complex.c [deleted file]
scilab/modules/spreadsheet/src/c/csv_strsubst.c [deleted file]
scilab/modules/spreadsheet/src/c/csv_strsubst.h [deleted file]
scilab/modules/spreadsheet/src/c/getRange.c
scilab/modules/spreadsheet/src/c/getRange.h
scilab/modules/spreadsheet/src/c/splitLine.c
scilab/modules/spreadsheet/tests/unit_tests/csvIsnum.dia.ref [new file with mode: 0644]
scilab/modules/string/Makefile.am
scilab/modules/string/Makefile.in
scilab/modules/string/includes/complex_array.h [moved from scilab/modules/spreadsheet/src/c/csv_complex.h with 59% similarity]
scilab/modules/string/includes/gw_string.h
scilab/modules/string/includes/stringToComplex.h [moved from scilab/modules/spreadsheet/src/c/stringToComplex.h with 89% similarity]
scilab/modules/string/macros/isnum.sci [deleted file]
scilab/modules/string/sci_gateway/c/gw_string.c
scilab/modules/string/sci_gateway/c/sci_isnum.c [moved from scilab/modules/spreadsheet/sci_gateway/c/sci_csvIsnum.c with 79% similarity]
scilab/modules/string/sci_gateway/string_gateway.xml
scilab/modules/string/src/c/complex_array.c [new file with mode: 0644]
scilab/modules/string/src/c/isnum.c [moved from scilab/modules/spreadsheet/src/c/csvIsnum.c with 81% similarity]
scilab/modules/string/src/c/isnum.h [moved from scilab/modules/spreadsheet/src/c/csvIsnum.h with 85% similarity]
scilab/modules/string/src/c/string.vcxproj
scilab/modules/string/src/c/stringToComplex.c [moved from scilab/modules/spreadsheet/src/c/stringToComplex.c with 93% similarity]
scilab/modules/string/tests/unit_tests/isnum.dia.ref
scilab/modules/string/tests/unit_tests/isnum.tst

index eff8106..e271312 100644 (file)
@@ -24,6 +24,9 @@ BDF methods with direct and preconditioned Krylov linear solvers, from ODEPACK.
 * The Variable Browser shows also the size of integers.
   See bug #12523
 
+* isnum has been redesigned in native code. Up to 130x performance
+  improvements. See bug #10404
+
 
 Syntax changes
 ===============
@@ -49,7 +52,7 @@ Xcos
 
 * Bug #12359 fixed - Xcos files has been converted to zcos to gain some space.
 
-* Bug #12384 fixed - Using a modelica part linked with explicit link to 
+* Bug #12384 fixed - Using a modelica part linked with explicit link to
                      another modelica part lead to an algebraic loop error.
 
 
@@ -74,7 +77,7 @@ Bug fixes
 
 * Bug #7684 fixed - Introduction demo splitted in subsections.
 
-* Bug #7927 fixed - Output "flag" in qmr function was not well documented. 
+* Bug #7927 fixed - Output "flag" in qmr function was not well documented.
 
 * Bug #8667 fixed - Handling of %nan in functions min,max,median is not correctly documented.
 
index e61364f..4b3857b 100644 (file)
@@ -7,15 +7,11 @@
 SPREADSHEET_C_SOURCES = \
 src/c/xls.c \
 src/c/checkCsvWriteFormat.c \
-src/c/csv_complex.c \
 src/c/csvDefault.c \
-src/c/csvIsnum.c \
 src/c/csvRead.c \
-src/c/csv_strsubst.c \
 src/c/csvWrite.c \
 src/c/getRange.c \
 src/c/splitLine.c \
-src/c/stringToComplex.c \
 src/c/utftolatin.c
 
 RIPOLE_SOURCES = \
@@ -33,7 +29,6 @@ sci_gateway/c/sci_xls_read.c \
 sci_gateway/c/sci_xls_open.c \
 sci_gateway/c/gw_csv_helpers.c \
 sci_gateway/c/sci_csvDefault.c \
-sci_gateway/c/sci_csvIsnum.c \
 sci_gateway/c/sci_csvRead.c \
 sci_gateway/c/sci_csvStringToDouble.c \
 sci_gateway/c/sci_csvTextScan.c \
@@ -64,7 +59,7 @@ libscispreadsheet_algo_la_CPPFLAGS = $(libscispreadsheet_la_CPPFLAGS)
 CHECK_SRC= $(SPREADSHEET_C_SOURCES) $(GATEWAY_C_SOURCES) $(RIPOLE_SOURCES)
 INCLUDE_FLAGS = $(libscispreadsheet_la_CPPFLAGS)
 
-libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la 
+libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la
 
 #### Target ######
 modulename=spreadsheet
@@ -72,7 +67,7 @@ modulename=spreadsheet
 
 #### spreadsheet : Conf files ####
 libscispreadsheet_la_rootdir = $(mydatadir)
-libscispreadsheet_la_root_DATA =  license.txt 
+libscispreadsheet_la_root_DATA =  license.txt
 
 
 ####�spreadsheet : init scripts ####
index ab2879e..aebfda9 100644 (file)
@@ -136,15 +136,11 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscispreadsheet_algo_la_LIBADD =
 am__objects_1 = libscispreadsheet_algo_la-xls.lo \
        libscispreadsheet_algo_la-checkCsvWriteFormat.lo \
-       libscispreadsheet_algo_la-csv_complex.lo \
        libscispreadsheet_algo_la-csvDefault.lo \
-       libscispreadsheet_algo_la-csvIsnum.lo \
        libscispreadsheet_algo_la-csvRead.lo \
-       libscispreadsheet_algo_la-csv_strsubst.lo \
        libscispreadsheet_algo_la-csvWrite.lo \
        libscispreadsheet_algo_la-getRange.lo \
        libscispreadsheet_algo_la-splitLine.lo \
-       libscispreadsheet_algo_la-stringToComplex.lo \
        libscispreadsheet_algo_la-utftolatin.lo
 am__objects_2 = libscispreadsheet_algo_la-olestream-unwrap.lo \
        libscispreadsheet_algo_la-pldstr.lo \
@@ -163,7 +159,6 @@ am__objects_3 = libscispreadsheet_la-gw_spreadsheet.lo \
        libscispreadsheet_la-sci_xls_open.lo \
        libscispreadsheet_la-gw_csv_helpers.lo \
        libscispreadsheet_la-sci_csvDefault.lo \
-       libscispreadsheet_la-sci_csvIsnum.lo \
        libscispreadsheet_la-sci_csvRead.lo \
        libscispreadsheet_la-sci_csvStringToDouble.lo \
        libscispreadsheet_la-sci_csvTextScan.lo \
@@ -459,15 +454,11 @@ top_srcdir = @top_srcdir@
 SPREADSHEET_C_SOURCES = \
 src/c/xls.c \
 src/c/checkCsvWriteFormat.c \
-src/c/csv_complex.c \
 src/c/csvDefault.c \
-src/c/csvIsnum.c \
 src/c/csvRead.c \
-src/c/csv_strsubst.c \
 src/c/csvWrite.c \
 src/c/getRange.c \
 src/c/splitLine.c \
-src/c/stringToComplex.c \
 src/c/utftolatin.c
 
 RIPOLE_SOURCES = \
@@ -485,7 +476,6 @@ sci_gateway/c/sci_xls_read.c \
 sci_gateway/c/sci_xls_open.c \
 sci_gateway/c/gw_csv_helpers.c \
 sci_gateway/c/sci_csvDefault.c \
-sci_gateway/c/sci_csvIsnum.c \
 sci_gateway/c/sci_csvRead.c \
 sci_gateway/c/sci_csvStringToDouble.c \
 sci_gateway/c/sci_csvTextScan.c \
@@ -513,14 +503,14 @@ libscispreadsheet_algo_la_CPPFLAGS = $(libscispreadsheet_la_CPPFLAGS)
 # For the code check (splint)
 CHECK_SRC = $(SPREADSHEET_C_SOURCES) $(GATEWAY_C_SOURCES) $(RIPOLE_SOURCES)
 INCLUDE_FLAGS = $(libscispreadsheet_la_CPPFLAGS)
-libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la 
+libscispreadsheet_la_LIBADD = libscispreadsheet-algo.la
 
 #### Target ######
 modulename = spreadsheet
 
 #### spreadsheet : Conf files ####
 libscispreadsheet_la_rootdir = $(mydatadir)
-libscispreadsheet_la_root_DATA = license.txt 
+libscispreadsheet_la_root_DATA = license.txt
 
 ####�spreadsheet : init scripts ####
 libscispreadsheet_la_etcdir = $(mydatadir)/etc
@@ -693,11 +683,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-bytedecoders.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-checkCsvWriteFormat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csvDefault.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csvIsnum.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csvRead.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csvWrite.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csv_complex.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-csv_strsubst.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-getRange.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-logger.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-ole.Plo@am__quote@
@@ -705,13 +692,11 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-pldstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-ripole.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-splitLine.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-stringToComplex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-utftolatin.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_algo_la-xls.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-gw_csv_helpers.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-gw_spreadsheet.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_csvDefault.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_csvIsnum.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_csvRead.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_csvStringToDouble.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscispreadsheet_la-sci_csvTextScan.Plo@am__quote@
@@ -754,13 +739,6 @@ libscispreadsheet_algo_la-checkCsvWriteFormat.lo: src/c/checkCsvWriteFormat.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-checkCsvWriteFormat.lo `test -f 'src/c/checkCsvWriteFormat.c' || echo '$(srcdir)/'`src/c/checkCsvWriteFormat.c
 
-libscispreadsheet_algo_la-csv_complex.lo: src/c/csv_complex.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csv_complex.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csv_complex.Tpo -c -o libscispreadsheet_algo_la-csv_complex.lo `test -f 'src/c/csv_complex.c' || echo '$(srcdir)/'`src/c/csv_complex.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csv_complex.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csv_complex.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/csv_complex.c' object='libscispreadsheet_algo_la-csv_complex.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-csv_complex.lo `test -f 'src/c/csv_complex.c' || echo '$(srcdir)/'`src/c/csv_complex.c
-
 libscispreadsheet_algo_la-csvDefault.lo: src/c/csvDefault.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csvDefault.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csvDefault.Tpo -c -o libscispreadsheet_algo_la-csvDefault.lo `test -f 'src/c/csvDefault.c' || echo '$(srcdir)/'`src/c/csvDefault.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csvDefault.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csvDefault.Plo
@@ -768,13 +746,6 @@ libscispreadsheet_algo_la-csvDefault.lo: src/c/csvDefault.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-csvDefault.lo `test -f 'src/c/csvDefault.c' || echo '$(srcdir)/'`src/c/csvDefault.c
 
-libscispreadsheet_algo_la-csvIsnum.lo: src/c/csvIsnum.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csvIsnum.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csvIsnum.Tpo -c -o libscispreadsheet_algo_la-csvIsnum.lo `test -f 'src/c/csvIsnum.c' || echo '$(srcdir)/'`src/c/csvIsnum.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csvIsnum.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csvIsnum.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/csvIsnum.c' object='libscispreadsheet_algo_la-csvIsnum.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-csvIsnum.lo `test -f 'src/c/csvIsnum.c' || echo '$(srcdir)/'`src/c/csvIsnum.c
-
 libscispreadsheet_algo_la-csvRead.lo: src/c/csvRead.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csvRead.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csvRead.Tpo -c -o libscispreadsheet_algo_la-csvRead.lo `test -f 'src/c/csvRead.c' || echo '$(srcdir)/'`src/c/csvRead.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csvRead.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csvRead.Plo
@@ -782,13 +753,6 @@ libscispreadsheet_algo_la-csvRead.lo: src/c/csvRead.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-csvRead.lo `test -f 'src/c/csvRead.c' || echo '$(srcdir)/'`src/c/csvRead.c
 
-libscispreadsheet_algo_la-csv_strsubst.lo: src/c/csv_strsubst.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csv_strsubst.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csv_strsubst.Tpo -c -o libscispreadsheet_algo_la-csv_strsubst.lo `test -f 'src/c/csv_strsubst.c' || echo '$(srcdir)/'`src/c/csv_strsubst.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csv_strsubst.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csv_strsubst.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/csv_strsubst.c' object='libscispreadsheet_algo_la-csv_strsubst.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-csv_strsubst.lo `test -f 'src/c/csv_strsubst.c' || echo '$(srcdir)/'`src/c/csv_strsubst.c
-
 libscispreadsheet_algo_la-csvWrite.lo: src/c/csvWrite.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-csvWrite.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-csvWrite.Tpo -c -o libscispreadsheet_algo_la-csvWrite.lo `test -f 'src/c/csvWrite.c' || echo '$(srcdir)/'`src/c/csvWrite.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-csvWrite.Tpo $(DEPDIR)/libscispreadsheet_algo_la-csvWrite.Plo
@@ -810,13 +774,6 @@ libscispreadsheet_algo_la-splitLine.lo: src/c/splitLine.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-splitLine.lo `test -f 'src/c/splitLine.c' || echo '$(srcdir)/'`src/c/splitLine.c
 
-libscispreadsheet_algo_la-stringToComplex.lo: src/c/stringToComplex.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-stringToComplex.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-stringToComplex.Tpo -c -o libscispreadsheet_algo_la-stringToComplex.lo `test -f 'src/c/stringToComplex.c' || echo '$(srcdir)/'`src/c/stringToComplex.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-stringToComplex.Tpo $(DEPDIR)/libscispreadsheet_algo_la-stringToComplex.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/stringToComplex.c' object='libscispreadsheet_algo_la-stringToComplex.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) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_algo_la-stringToComplex.lo `test -f 'src/c/stringToComplex.c' || echo '$(srcdir)/'`src/c/stringToComplex.c
-
 libscispreadsheet_algo_la-utftolatin.lo: src/c/utftolatin.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_algo_la-utftolatin.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_algo_la-utftolatin.Tpo -c -o libscispreadsheet_algo_la-utftolatin.lo `test -f 'src/c/utftolatin.c' || echo '$(srcdir)/'`src/c/utftolatin.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_algo_la-utftolatin.Tpo $(DEPDIR)/libscispreadsheet_algo_la-utftolatin.Plo
@@ -908,13 +865,6 @@ libscispreadsheet_la-sci_csvDefault.lo: sci_gateway/c/sci_csvDefault.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) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_la-sci_csvDefault.lo `test -f 'sci_gateway/c/sci_csvDefault.c' || echo '$(srcdir)/'`sci_gateway/c/sci_csvDefault.c
 
-libscispreadsheet_la-sci_csvIsnum.lo: sci_gateway/c/sci_csvIsnum.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_la-sci_csvIsnum.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_csvIsnum.Tpo -c -o libscispreadsheet_la-sci_csvIsnum.lo `test -f 'sci_gateway/c/sci_csvIsnum.c' || echo '$(srcdir)/'`sci_gateway/c/sci_csvIsnum.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_csvIsnum.Tpo $(DEPDIR)/libscispreadsheet_la-sci_csvIsnum.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_csvIsnum.c' object='libscispreadsheet_la-sci_csvIsnum.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) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscispreadsheet_la-sci_csvIsnum.lo `test -f 'sci_gateway/c/sci_csvIsnum.c' || echo '$(srcdir)/'`sci_gateway/c/sci_csvIsnum.c
-
 libscispreadsheet_la-sci_csvRead.lo: sci_gateway/c/sci_csvRead.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscispreadsheet_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscispreadsheet_la-sci_csvRead.lo -MD -MP -MF $(DEPDIR)/libscispreadsheet_la-sci_csvRead.Tpo -c -o libscispreadsheet_la-sci_csvRead.lo `test -f 'sci_gateway/c/sci_csvRead.c' || echo '$(srcdir)/'`sci_gateway/c/sci_csvRead.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscispreadsheet_la-sci_csvRead.Tpo $(DEPDIR)/libscispreadsheet_la-sci_csvRead.Plo
index 6b2586b..8f7fc63 100644 (file)
@@ -1,2 +1 @@
-* Merge csvIsnum => isnum
 * Get ride of helper functions sci_gateway/cpp/gw_csv_helpers.cpp
index ac5b93a..7c12c8c 100644 (file)
@@ -21,7 +21,6 @@ SPREADSHEET_IMPEXP int gw_spreadsheet(void);
 SPREADSHEET_IMPEXP int sci_xls_read(char *fname, unsigned long fname_len);
 SPREADSHEET_IMPEXP int sci_xls_open(char *fname, unsigned long fname_len);
 SPREADSHEET_IMPEXP int sci_csvDefault(char *fname, unsigned long fname_len);
-SPREADSHEET_IMPEXP int sci_csvIsnum(char *fname, unsigned long fname_len);
 SPREADSHEET_IMPEXP int sci_csvRead(char *fname, unsigned long fname_len);
 SPREADSHEET_IMPEXP int sci_csvStringToDouble(char *fname, unsigned long fname_len);
 SPREADSHEET_IMPEXP int sci_csvTextScan(char *fname, unsigned long fname_len);
index 6e76c13..583ce1e 100644 (file)
@@ -22,7 +22,6 @@ static gw_generic_table Tab[] =
     {sci_xls_open, "xls_open"},
     {sci_xls_read, "xls_read"},
     {sci_csvDefault, "csvDefault"},
-    {sci_csvIsnum, "csvIsnum"},
     {sci_csvRead, "csvRead"},
     {sci_csvStringToDouble, "csvStringToDouble"},
     {sci_csvTextScan, "csvTextScan"},
index 14fdb15..7b986d5 100644 (file)
@@ -27,7 +27,7 @@
 #endif
 #include "stringToComplex.h"
 #include "csvDefault.h"
-#include "csv_complex.h"
+#include "complex_array.h"
 #include "gw_csv_helpers.h"
 #include "getRange.h"
 
@@ -408,9 +408,9 @@ int sci_csvRead(char *fname, unsigned long fname_len)
                 else /* to double */
                 {
                     stringToComplexError ierr = STRINGTOCOMPLEX_ERROR;
-                    csv_complexArray *ptrCsvComplexArray = stringsToCsvComplexArray((const char**)result->pstrValues, result->m * result->n, decimal, TRUE, &ierr);
+                    complexArray *ptrComplexArray = stringsToComplexArray((const char**)result->pstrValues, result->m * result->n, decimal, TRUE, &ierr);
 
-                    if (ptrCsvComplexArray == NULL)
+                    if (ptrComplexArray == NULL)
                     {
                         releaseObjects(result, filename, conversion);
                         if (ierr == STRINGTOCOMPLEX_ERROR)
@@ -433,19 +433,19 @@ int sci_csvRead(char *fname, unsigned long fname_len)
                             {
                                 int newM = 0;
                                 int newN = 0;
-                                csv_complexArray *csvComplexRange = getRangeAsCsvComplexArray(ptrCsvComplexArray, result->m, result->n, iRange, &newM, &newN);
-                                if (csvComplexRange)
+                                complexArray *complexRange = getRangeAsComplexArray(ptrComplexArray, result->m, result->n, iRange, &newM, &newN);
+                                if (complexRange)
                                 {
-                                    if (csvComplexRange->isComplex)
+                                    if (complexRange->isComplex)
                                     {
-                                        sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, ptrCsvComplexArray->realPart, ptrCsvComplexArray->imagPart);
+                                        sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, ptrComplexArray->realPart, ptrComplexArray->imagPart);
                                     }
                                     else
                                     {
-                                        sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, csvComplexRange->realPart);
+                                        sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, complexRange->realPart);
                                     }
-                                    freeCsvComplexArray(csvComplexRange);
-                                    csvComplexRange = NULL;
+                                    freeComplexArray(complexRange);
+                                    complexRange = NULL;
                                 }
                                 else
                                 {
@@ -463,16 +463,16 @@ int sci_csvRead(char *fname, unsigned long fname_len)
                             }
                             else
                             {
-                                if (ptrCsvComplexArray->isComplex)
+                                if (ptrComplexArray->isComplex)
                                 {
-                                    sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrCsvComplexArray->realPart, ptrCsvComplexArray->imagPart);
+                                    sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrComplexArray->realPart, ptrComplexArray->imagPart);
                                 }
                                 else
                                 {
-                                    sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrCsvComplexArray->realPart);
+                                    sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrComplexArray->realPart);
                                 }
-                                freeCsvComplexArray(ptrCsvComplexArray);
-                                ptrCsvComplexArray = NULL;
+                                freeComplexArray(ptrComplexArray);
+                                ptrComplexArray = NULL;
                             }
                         }
                         break;
index 143c1fb..2900942 100644 (file)
@@ -25,7 +25,7 @@
 #include "stringToComplex.h"
 #include "csvDefault.h"
 #include "gw_csv_helpers.h"
-#include "csv_complex.h"
+#include "complex_array.h"
 
 // =============================================================================
 int sci_csvStringToDouble(char *fname, unsigned long fname_len)
@@ -37,7 +37,7 @@ int sci_csvStringToDouble(char *fname, unsigned long fname_len)
 
     BOOL bConvertToNan = TRUE;
 
-    csv_complexArray *ptrCsvComplexArray = NULL;
+    complexArray *ptrComplexArray = NULL;
     stringToComplexError ierr = STRINGTOCOMPLEX_ERROR;
 
     CheckRhs(1, 2);
@@ -62,12 +62,12 @@ int sci_csvStringToDouble(char *fname, unsigned long fname_len)
         return 0;
     }
 
-    ptrCsvComplexArray = stringsToCsvComplexArray((const char**)pStringValues, m1 * n1, getCsvDefaultDecimal(), bConvertToNan, &ierr);
+    ptrComplexArray = stringsToComplexArray((const char**)pStringValues, m1 * n1, getCsvDefaultDecimal(), bConvertToNan, &ierr);
 
     freeArrayOfString(pStringValues, m1 * n1);
     pStringValues = NULL;
 
-    if (ptrCsvComplexArray == NULL)
+    if (ptrComplexArray == NULL)
     {
         switch (ierr)
         {
@@ -87,16 +87,16 @@ int sci_csvStringToDouble(char *fname, unsigned long fname_len)
         case STRINGTOCOMPLEX_NOT_A_NUMBER:
         case STRINGTOCOMPLEX_NO_ERROR:
         {
-            if (ptrCsvComplexArray->isComplex)
+            if (ptrComplexArray->isComplex)
             {
-                sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, m1, n1, ptrCsvComplexArray->realPart, ptrCsvComplexArray->imagPart);
+                sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, m1, n1, ptrComplexArray->realPart, ptrComplexArray->imagPart);
             }
             else
             {
-                sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m1, n1, ptrCsvComplexArray->realPart);
+                sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m1, n1, ptrComplexArray->realPart);
             }
-            freeCsvComplexArray(ptrCsvComplexArray);
-            ptrCsvComplexArray = NULL;
+            freeComplexArray(ptrComplexArray);
+            ptrComplexArray = NULL;
         }
         break;
 
index 67563a2..62eda08 100644 (file)
@@ -325,8 +325,8 @@ int sci_csvTextScan(char *fname, unsigned long fname_len)
                 else /* to double */
                 {
                     stringToComplexError ierr = STRINGTOCOMPLEX_ERROR;
-                    csv_complexArray *ptrCsvComplexArray = stringsToCsvComplexArray((const char**)result->pstrValues, result->m * result->n, decimal, TRUE, &ierr);
-                    if (ptrCsvComplexArray == NULL)
+                    complexArray *ptrComplexArray = stringsToComplexArray((const char**)result->pstrValues, result->m * result->n, decimal, TRUE, &ierr);
+                    if (ptrComplexArray == NULL)
                     {
                         freeCsvResult(result);
                         if (decimal)
@@ -364,18 +364,18 @@ int sci_csvTextScan(char *fname, unsigned long fname_len)
                             {
                                 int newM = 0;
                                 int newN = 0;
-                                csv_complexArray *csvComplexRange = getRangeAsCsvComplexArray(ptrCsvComplexArray, result->m, result->n, iRange, &newM, &newN);
+                                complexArray *csvComplexRange = getRangeAsComplexArray(ptrComplexArray, result->m, result->n, iRange, &newM, &newN);
                                 if (csvComplexRange)
                                 {
                                     if (csvComplexRange->isComplex)
                                     {
-                                        sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, ptrCsvComplexArray->realPart, ptrCsvComplexArray->imagPart);
+                                        sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, ptrComplexArray->realPart, ptrComplexArray->imagPart);
                                     }
                                     else
                                     {
                                         sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, newM, newN, csvComplexRange->realPart);
                                     }
-                                    freeCsvComplexArray(csvComplexRange);
+                                    freeComplexArray(csvComplexRange);
                                     csvComplexRange = NULL;
                                 }
                                 else
@@ -385,17 +385,17 @@ int sci_csvTextScan(char *fname, unsigned long fname_len)
                             }
                             else
                             {
-                                if (ptrCsvComplexArray->isComplex)
+                                if (ptrComplexArray->isComplex)
                                 {
-                                    sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrCsvComplexArray->realPart, ptrCsvComplexArray->imagPart);
+                                    sciErr = createComplexMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrComplexArray->realPart, ptrComplexArray->imagPart);
                                 }
                                 else
                                 {
-                                    sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrCsvComplexArray->realPart);
+                                    sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, result->m, result->n, ptrComplexArray->realPart);
                                 }
                             }
-                            freeCsvComplexArray(ptrCsvComplexArray);
-                            ptrCsvComplexArray = NULL;
+                            freeComplexArray(ptrComplexArray);
+                            ptrComplexArray = NULL;
                         }
                         break;
 
index e3582b0..2fdcf28 100644 (file)
     <PRIMITIVE gatewayId="56" primitiveId="1" primitiveName="xls_open" />
     <PRIMITIVE gatewayId="56" primitiveId="2" primitiveName="xls_read" />
     <PRIMITIVE gatewayId="56" primitiveId="3" primitiveName="csvDefault" />
-    <PRIMITIVE gatewayId="56" primitiveId="4" primitiveName="csvIsnum" />
-    <PRIMITIVE gatewayId="56" primitiveId="5" primitiveName="csvRead" />
-    <PRIMITIVE gatewayId="56" primitiveId="6" primitiveName="csvStringToDouble" />
-    <PRIMITIVE gatewayId="56" primitiveId="7" primitiveName="csvTextScan" />
-    <PRIMITIVE gatewayId="56" primitiveId="8" primitiveName="csvWrite" />
-    <PRIMITIVE gatewayId="56" primitiveId="9" primitiveName="write_csv" />
-    <PRIMITIVE gatewayId="56" primitiveId="10" primitiveName="read_csv" />
+    <PRIMITIVE gatewayId="56" primitiveId="4" primitiveName="csvRead" />
+    <PRIMITIVE gatewayId="56" primitiveId="5" primitiveName="csvStringToDouble" />
+    <PRIMITIVE gatewayId="56" primitiveId="6" primitiveName="csvTextScan" />
+    <PRIMITIVE gatewayId="56" primitiveId="7" primitiveName="csvWrite" />
+    <PRIMITIVE gatewayId="56" primitiveId="8" primitiveName="write_csv" />
+    <PRIMITIVE gatewayId="56" primitiveId="9" primitiveName="read_csv" />
 </GATEWAY>
index e72d345..bac78d9 100644 (file)
     <ClInclude Include="sci_gateway\c\gw_csv_helpers.h" />
     <ClInclude Include="src\c\checkCsvWriteFormat.h" />
     <ClInclude Include="src\c\csvDefault.h" />
-    <ClInclude Include="src\c\csvIsnum.h" />
     <ClInclude Include="src\c\csvRead.h" />
     <ClInclude Include="src\c\csvWrite.h" />
-    <ClInclude Include="src\c\csv_complex.h" />
-    <ClInclude Include="src\c\csv_strsubst.h" />
     <ClInclude Include="src\c\getRange.h" />
     <ClInclude Include="src\c\ripole\bt-int.h" />
     <ClInclude Include="src\c\ripole\bytedecoders.h" />
     <ClInclude Include="src\c\ripole\pldstr.h" />
     <ClInclude Include="src\c\ripole\ripole.h" />
     <ClInclude Include="src\c\splitLine.h" />
-    <ClInclude Include="src\c\stringToComplex.h" />
     <ClInclude Include="src\c\utftolatin.h" />
     <ClInclude Include="src\c\xls.h" />
   </ItemGroup>
     <ClCompile Include="sci_gateway\c\gw_csv_helpers.c" />
     <ClCompile Include="sci_gateway\c\gw_spreadsheet.c" />
     <ClCompile Include="sci_gateway\c\sci_csvDefault.c" />
-    <ClCompile Include="sci_gateway\c\sci_csvIsnum.c" />
     <ClCompile Include="sci_gateway\c\sci_csvRead.c" />
     <ClCompile Include="sci_gateway\c\sci_csvStringToDouble.c" />
     <ClCompile Include="sci_gateway\c\sci_csvTextScan.c" />
     <ClCompile Include="sci_gateway\c\sci_xls_read.c" />
     <ClCompile Include="src\c\checkCsvWriteFormat.c" />
     <ClCompile Include="src\c\csvDefault.c" />
-    <ClCompile Include="src\c\csvIsnum.c" />
     <ClCompile Include="src\c\csvRead.c" />
     <ClCompile Include="src\c\csvWrite.c" />
-    <ClCompile Include="src\c\csv_complex.c" />
-    <ClCompile Include="src\c\csv_strsubst.c" />
     <ClCompile Include="src\c\DllmainSpreadsheet.c" />
     <ClCompile Include="src\c\getRange.c" />
     <ClCompile Include="src\c\ripole\bt-int.c" />
     <ClCompile Include="src\c\ripole\pldstr.c" />
     <ClCompile Include="src\c\ripole\ripole.c" />
     <ClCompile Include="src\c\splitLine.c" />
-    <ClCompile Include="src\c\stringToComplex.c" />
     <ClCompile Include="src\c\utftolatin.c" />
     <ClCompile Include="src\c\xls.c" />
   </ItemGroup>
index 94de7ec..f3528a4 100644 (file)
@@ -24,7 +24,7 @@
 #include "pcre_private.h"
 #include "sciprint.h"
 #include "splitLine.h"
-#include "csv_strsubst.h"
+#include "strsubst.h"
 #if _MSC_VER
 #include "strdup_windows.h"
 #endif
@@ -447,7 +447,7 @@ static char **getStringsFromLines(const char **lines, int sizelines,
                 {
                     /* Proceed to the remplacement of the provided decimal to the default on
                      * usually, it converts "," => "." */
-                    results[i + n * j] = csv_strsubst(lineStrings[j], decimal, getCsvDefaultDecimal());
+                    results[i + n * j] = strsub(lineStrings[j], decimal, getCsvDefaultDecimal());
                 }
 
                 if (lineStrings[j])
@@ -561,16 +561,16 @@ static char *stripCharacters(const char *line)
     char *returnedLine = NULL;
     if (line)
     {
-        char *tmpLineWithoutTab = csv_strsubst((char*)line, "\t", "");
+        char *tmpLineWithoutTab = strsub((char*)line, "\t", "");
         if (tmpLineWithoutTab)
         {
-            char *tmpLineWithoutLF = csv_strsubst(tmpLineWithoutTab, "\r", "");
+            char *tmpLineWithoutLF = strsub(tmpLineWithoutTab, "\r", "");
             if (tmpLineWithoutLF)
             {
-                char *tmpLineWithoutCR = csv_strsubst(tmpLineWithoutTab, "\n", "");
+                char *tmpLineWithoutCR = strsub(tmpLineWithoutTab, "\n", "");
                 if (tmpLineWithoutCR)
                 {
-                    returnedLine = csv_strsubst(tmpLineWithoutCR, " ", "");
+                    returnedLine = strsub(tmpLineWithoutCR, " ", "");
                     FREE(tmpLineWithoutCR);
                 }
                 else
@@ -621,7 +621,7 @@ static char **replaceStrings(const char **lines, int nbLines, const char **torep
             {
                 for (j = 0; j < nbLines; j++)
                 {
-                    replacedStrings[j] = csv_strsubst(replacedStrings[j], toreplace[i], toreplace[nr + i]);
+                    replacedStrings[j] = strsub(replacedStrings[j], toreplace[i], toreplace[nr + i]);
                 }
             }
         }
index 809a4d6..9821cd4 100644 (file)
@@ -27,7 +27,7 @@
 #ifdef _MSC_VER
 #include "strdup_windows.h"
 #endif
-#include "csv_strsubst.h"
+#include "strsubst.h"
 #include "csvDefault.h"
 #include "utftolatin.h"
 // =============================================================================
@@ -170,7 +170,7 @@ csvWriteError csvWrite_double(const char *filename,
                 char buffer[65535];
                 char *result = NULL;
                 sprintf(buffer, precisionFormat, pdValues[i + m * j]);
-                result = csv_strsubst(buffer, getCsvDefaultDecimal(), decimal);
+                result = strsub(buffer, getCsvDefaultDecimal(), decimal);
                 if (result)
                 {
                     fprintf(fd, DEFAULT_CSV_WRITE_STRING_FORMAT, result);
@@ -317,7 +317,7 @@ csvWriteError csvWrite_complex(const char *filename,
                     char *result = NULL;
 
                     sprintf(buffer, precisionFormat, pdValuesReal[i + m * j]);
-                    result = csv_strsubst(buffer, getCsvDefaultDecimal(), decimal);
+                    result = strsub(buffer, getCsvDefaultDecimal(), decimal);
                     if (result)
                     {
                         strcpy(StringValue, result);
@@ -380,7 +380,7 @@ csvWriteError csvWrite_complex(const char *filename,
                     }
 
                     sprintf(buffer, precisionFormat, fabs(imagValue));
-                    result = csv_strsubst(buffer, getCsvDefaultDecimal(), decimal);
+                    result = strsub(buffer, getCsvDefaultDecimal(), decimal);
                     if (result)
                     {
                         if ((hasReal) || (imagValue < 0))
@@ -535,7 +535,7 @@ csvWriteError csvWrite_string(const char *filename,
             else
             {
                 char *result = NULL;
-                result = csv_strsubst((char*)(pStrValues[i + m * j]), getCsvDefaultDecimal(), decimal);
+                result = strsub((char*)(pStrValues[i + m * j]), getCsvDefaultDecimal(), decimal);
                 if (result)
                 {
                     if (isIsoLatin)
diff --git a/scilab/modules/spreadsheet/src/c/csv_complex.c b/scilab/modules/spreadsheet/src/c/csv_complex.c
deleted file mode 100644 (file)
index e14c9d2..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010-2011 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#include <string.h>
-#include "csv_complex.h"
-#include "MALLOC.h"
-// =============================================================================
-csv_complexArray *createCsvComplexArrayEmpty(int nbSize)
-{
-    csv_complexArray *pCsvComplexArray = NULL;
-    pCsvComplexArray = (csv_complexArray *) MALLOC(sizeof(csv_complexArray));
-    if (pCsvComplexArray)
-    {
-        pCsvComplexArray->realPart = (double *)MALLOC(sizeof(double) * nbSize);
-        if (pCsvComplexArray->realPart == NULL)
-        {
-            FREE(pCsvComplexArray);
-            return NULL;
-        }
-
-        pCsvComplexArray->imagPart = (double *)MALLOC(sizeof(double) * nbSize);
-        if (pCsvComplexArray->imagPart == NULL)
-        {
-            FREE(pCsvComplexArray->realPart);
-            pCsvComplexArray->realPart = NULL;
-            FREE(pCsvComplexArray);
-            return NULL;
-        }
-
-        memset(pCsvComplexArray->realPart, 0, sizeof(double) * nbSize);
-        memset(pCsvComplexArray->imagPart, 0, sizeof(double) * nbSize);
-        pCsvComplexArray->isComplex = 1;
-        pCsvComplexArray->nbElements = nbSize;
-    }
-    return pCsvComplexArray;
-}
-// =============================================================================
-csv_complexArray *createCsvComplexArray(const double *realpart, const double *imagpart, int nbSize)
-{
-    csv_complexArray *pCsvComplexArray = NULL;
-
-    if (realpart == NULL)
-    {
-        return pCsvComplexArray;
-    }
-
-    if (nbSize <= 0)
-    {
-        return pCsvComplexArray;
-    }
-
-    pCsvComplexArray = (csv_complexArray *) MALLOC(sizeof(csv_complexArray));
-    if (pCsvComplexArray)
-    {
-        if (imagpart == NULL)
-        {
-            pCsvComplexArray->isComplex = 0;
-        }
-        else
-        {
-            int i = 0;
-            pCsvComplexArray->isComplex = 0;
-            for (i = 0; i < nbSize; i++)
-            {
-                if (imagpart[i] != 0)
-                {
-                    pCsvComplexArray->isComplex = 1;
-                    break;
-                }
-            }
-        }
-
-        pCsvComplexArray->realPart = (double *)MALLOC(sizeof(double) * nbSize);
-        if (pCsvComplexArray->realPart)
-        {
-            memcpy(pCsvComplexArray->realPart, realpart, nbSize);
-            pCsvComplexArray->nbElements = nbSize;
-        }
-        if (pCsvComplexArray->isComplex)
-        {
-            pCsvComplexArray->imagPart = (double *)MALLOC(sizeof(double) * nbSize);
-            if (pCsvComplexArray->imagPart)
-            {
-                memcpy(pCsvComplexArray->imagPart, imagpart, nbSize);
-            }
-        }
-        else
-        {
-            pCsvComplexArray->imagPart = NULL;
-        }
-    }
-    return pCsvComplexArray;
-}
-// =============================================================================
-void freeCsvComplexArray(csv_complexArray *pCsvComplexArray)
-{
-    if (pCsvComplexArray)
-    {
-        if (pCsvComplexArray->realPart)
-        {
-            FREE(pCsvComplexArray->realPart);
-            pCsvComplexArray->realPart = NULL;
-        }
-
-        if (pCsvComplexArray->imagPart)
-        {
-            FREE(pCsvComplexArray->imagPart);
-            pCsvComplexArray->imagPart = NULL;
-        }
-        pCsvComplexArray->isComplex = 0;
-        pCsvComplexArray->nbElements = 0;
-
-        FREE(pCsvComplexArray);
-        pCsvComplexArray = NULL;
-    }
-}
-// =============================================================================
-int cleanImagPartCsvComplexArray(csv_complexArray *pCsvComplexArray)
-{
-    if (pCsvComplexArray)
-    {
-        if (pCsvComplexArray->imagPart)
-        {
-            int i = 0;
-            int isComplex = 0;
-            for (i = 0; i < pCsvComplexArray->nbElements; i++)
-            {
-                if (pCsvComplexArray->imagPart[i] != 0)
-                {
-                    isComplex = 1;
-                    break;
-                }
-            }
-
-            if (isComplex)
-            {
-                pCsvComplexArray->isComplex = 1;
-            }
-            else
-            {
-                pCsvComplexArray->isComplex = 0;
-            }
-        }
-        else
-        {
-            return 1;
-        }
-    }
-    return 0;
-}
-// =============================================================================
diff --git a/scilab/modules/spreadsheet/src/c/csv_strsubst.c b/scilab/modules/spreadsheet/src/c/csv_strsubst.c
deleted file mode 100644 (file)
index 81a16db..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010-2011 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#include <string.h>
-#ifndef _MSC_VER
-#include <stddef.h>
-#endif
-#include "csv_strsubst.h"
-#include "MALLOC.h"
-#ifdef _MSC_VER
-#include "strdup_windows.h"
-#endif
-// =============================================================================
-char *csv_strsubst(const char *input_string, const char *string_to_search, const char *replacement_string)
-{
-    char *result = NULL, *r = NULL;
-    const char *p = NULL, *q = NULL;
-
-    size_t string_to_searchlen = 0;
-    size_t count = 0, resultlen = 0, replacement_stringlen = 0;
-
-    if (input_string == NULL)
-    {
-        return NULL;
-    }
-    if (string_to_search == NULL)
-    {
-        return strdup(input_string);
-    }
-    if (replacement_string == NULL)
-    {
-        return strdup(input_string);
-    }
-
-    string_to_searchlen = strlen(string_to_search);
-    replacement_stringlen = strlen(replacement_string);
-
-    if (string_to_searchlen != replacement_stringlen)
-    {
-        for (count = 0, p = input_string; (q = strstr(p, string_to_search)) != NULL; p = q + string_to_searchlen)
-        {
-            count++;
-        }
-        resultlen = p - input_string + strlen(p) + count * (replacement_stringlen - string_to_searchlen);
-    }
-    else
-    {
-        resultlen = strlen(input_string);
-    }
-
-    if (resultlen + 1 > 0)
-    {
-        result = (char*)CALLOC(resultlen + 1, sizeof(char));
-    }
-    if (result)
-    {
-        for (r = result, p = input_string; (q = strstr(p, string_to_search)) != NULL; p = q + string_to_searchlen)
-        {
-
-            ptrdiff_t l = q - p;
-            memcpy(r, p, l);
-            r += l;
-            memcpy(r, replacement_string, replacement_stringlen);
-            r += replacement_stringlen;
-        }
-        strcpy(r, p);
-    }
-
-    return result;
-}
-// =============================================================================
diff --git a/scilab/modules/spreadsheet/src/c/csv_strsubst.h b/scilab/modules/spreadsheet/src/c/csv_strsubst.h
deleted file mode 100644 (file)
index 7395c1a..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010-2011 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#ifndef __CSV_STRSUBST_H__
-#define __CSV_STRSUBST_H__
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-    char * csv_strsubst(const char* input_string,
-                        const char* string_to_search,
-                        const char* replacement_string);
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif /* __CSV_STRSUBST_H__ */
-// =============================================================================
index c7c8639..55760bf 100644 (file)
@@ -116,7 +116,7 @@ char **getRangeAsString(const char **pStrsValues,
     return NULL;
 }
 // =============================================================================
-csv_complexArray *getRangeAsCsvComplexArray(const csv_complexArray *pComplex,
+complexArray *getRangeAsComplexArray(const complexArray *pComplex,
         int nbRows, int nbCols,
         const int *iRange,
         int *returnedNbRows, int *returnedNbCols)
@@ -134,8 +134,8 @@ csv_complexArray *getRangeAsCsvComplexArray(const csv_complexArray *pComplex,
         rangeSize = (*returnedNbRows) * (*returnedNbCols);
         if (rangeSize > 0)
         {
-            csv_complexArray *newComplexArray =
-                createCsvComplexArrayEmpty(rangeSize);
+            complexArray *newComplexArray =
+                createComplexArrayEmpty(rangeSize);
             if (newComplexArray != NULL)
             {
                 int i = 0;
index f8744b8..3378395 100644 (file)
@@ -13,7 +13,7 @@
 #define __GETRANGE_H__
 
 #include "doublecomplex.h"
-#include "csv_complex.h"
+#include "complex_array.h"
 
 #define SIZE_RANGE_SUPPORTED 4
 
@@ -29,7 +29,7 @@ extern "C" {
 
 
     // Extract the double complexes in pComplex which are in the range.
-    csv_complexArray *getRangeAsCsvComplexArray(const csv_complexArray *pComplex,
+    complexArray *getRangeAsComplexArray(const complexArray *pComplex,
             int nbRows, int nbCols,
             const int *iRange,
             int *returnedNbRows, int *returnedNbCols);
index e80060d..d8f4a0b 100644 (file)
@@ -12,7 +12,7 @@
 #include <string.h>
 #include <stdio.h>
 #include "splitLine.h"
-#include "csv_strsubst.h"
+#include "strsubst.h"
 #include "MALLOC.h"
 #include "freeArrayOfString.h"
 
@@ -96,11 +96,11 @@ char **splitLineCSV(const char *str, const char *sep, int *toks)
 
     sprintf(tokenstring_to_search, "%s%s", sep, sep);
     sprintf(tokenreplacement_string, "%s%s%s", sep, EMPTYFIELD, sep);
-    substitutedstring = csv_strsubst(str, tokenstring_to_search, tokenreplacement_string);
+    substitutedstring = strsub(str, tokenstring_to_search, tokenreplacement_string);
     /* in a string like foo;bar;;;, replace all the ;;, not only the first and last one */
     while (strstr(substitutedstring, tokenstring_to_search) != NULL)
     {
-        substitutedstring = csv_strsubst(substitutedstring, tokenstring_to_search, tokenreplacement_string);
+        substitutedstring = strsub(substitutedstring, tokenstring_to_search, tokenreplacement_string);
     }
 
     if (strncmp(substitutedstring, sep, strlen(sep)) == 0)
diff --git a/scilab/modules/spreadsheet/tests/unit_tests/csvIsnum.dia.ref b/scilab/modules/spreadsheet/tests/unit_tests/csvIsnum.dia.ref
new file mode 100644 (file)
index 0000000..24dd452
--- /dev/null
@@ -0,0 +1,35 @@
+// =============================================================================
+// Copyright (C) 2010 - 2012 - INRIA - Allan CORNET
+// =============================================================================
+// <-- JVM NOT MANDATORY -->
+// <-- NO CHECK REF -->
+// =============================================================================
+assert_checkequal (csvIsnum('%pi'), %t);
+assert_checkequal (csvIsnum('1'), %t);
+assert_checkequal (csvIsnum('1.2'), %t);
+assert_checkequal (csvIsnum('+1.2'), %t);
+assert_checkequal (csvIsnum('-1.2'), %t);
+assert_checkequal (csvIsnum('1e2'), %t);
+if getos() == "Windows" then
+   assert_checkequal (csvIsnum('1d2'), %t);
+end
+assert_checkequal (csvIsnum('1E2'), %t);
+if getos() == "Windows" then
+   assert_checkequal (csvIsnum('1D2'), %t);
+end
+assert_checkequal (csvIsnum('1e+2'), %t);
+assert_checkequal (csvIsnum('1e-2'), %t);
+assert_checkequal (csvIsnum('+1e+2'), %t);
+assert_checkequal (csvIsnum('-1e+2'), %t);
+assert_checkequal (csvIsnum('-12e+3'), %t);
+assert_checkequal (csvIsnum('-1.2e+3'), %t);
+assert_checkequal (csvIsnum('-1.2e+345'), %t);
+assert_checkequal (csvIsnum('a'), %f);
+assert_checkequal (csvIsnum('e'), %f);
+assert_checkequal (csvIsnum('d'), %f);
+assert_checkequal (csvIsnum('E'), %f);
+assert_checkequal (csvIsnum('e'), %f);
+assert_checkequal (csvIsnum('-1.2a+345'), %f);
+assert_checkequal (csvIsnum('-1.2e+3+45'), %f);
+assert_checkequal (csvIsnum('-1.2e+3-45'), %f);
+// =============================================================================
index bc9cddf..bf4d4c2 100644 (file)
@@ -26,7 +26,10 @@ src/c/stringsCompare.c \
 src/c/isalphanum.c \
 src/c/StringConvert.c \
 src/c/scistrtostr.c \
-src/c/stringToDouble.c
+src/c/stringToDouble.c \
+src/c/isnum.c \
+src/c/stringToComplex.c \
+src/c/complex_array.c
 
 STRING_FORTRAN_SOURCES =
 
@@ -59,7 +62,8 @@ sci_gateway/c/sci_strspn.c \
 sci_gateway/c/sci_strstr.c \
 sci_gateway/c/sci_strtod.c \
 sci_gateway/c/sci_strtok.c \
-sci_gateway/c/sci_regexp.c
+sci_gateway/c/sci_regexp.c \
+sci_gateway/c/sci_isnum.c
 
 
 
@@ -71,6 +75,7 @@ libscistring_la_CPPFLAGS = -I$(srcdir)/src/c \
        -I$(top_srcdir)/modules/functions/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
+        -I$(top_srcdir)/modules/spreadsheet/src/c/ \
        -I$(top_srcdir)/modules/output_stream/includes/ \
        $(PCRE_CFLAGS) \
        $(AM_CPPFLAGS)
@@ -94,7 +99,7 @@ CHECK_SRC= $(STRING_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscistring_la_CPPFLAGS)
 
 # commented since it is the first module to be processed
-libscistring_la_LIBADD = libscistring-algo.la 
+libscistring_la_LIBADD = libscistring-algo.la
 
 #### Target ######
 modulename=string
@@ -102,7 +107,7 @@ modulename=string
 
 #### string : Conf files ####
 libscistring_la_rootdir = $(mydatadir)
-libscistring_la_root_DATA =  license.txt 
+libscistring_la_root_DATA =  license.txt
 
 #### string : init scripts ####
 libscistring_la_etcdir = $(mydatadir)/etc
index 3338377..8f87678 100644 (file)
@@ -157,7 +157,10 @@ am__objects_1 = libscistring_algo_la-code2str.lo \
        libscistring_algo_la-isalphanum.lo \
        libscistring_algo_la-StringConvert.lo \
        libscistring_algo_la-scistrtostr.lo \
-       libscistring_algo_la-stringToDouble.lo
+       libscistring_algo_la-stringToDouble.lo \
+       libscistring_algo_la-isnum.lo \
+       libscistring_algo_la-stringToComplex.lo \
+       libscistring_algo_la-complex_array.lo
 am__objects_2 =
 am_libscistring_algo_la_OBJECTS = $(am__objects_1) $(am__objects_2)
 libscistring_algo_la_OBJECTS = $(am_libscistring_algo_la_OBJECTS)
@@ -181,7 +184,8 @@ am__objects_3 = libscistring_la-gw_string.lo \
        libscistring_la-sci_strcspn.lo libscistring_la-sci_strncpy.lo \
        libscistring_la-sci_strrev.lo libscistring_la-sci_strspn.lo \
        libscistring_la-sci_strstr.lo libscistring_la-sci_strtod.lo \
-       libscistring_la-sci_strtok.lo libscistring_la-sci_regexp.lo
+       libscistring_la-sci_strtok.lo libscistring_la-sci_regexp.lo \
+       libscistring_la-sci_isnum.lo
 am__objects_4 = sci_f_string.lo strops.lo
 am_libscistring_la_OBJECTS = $(am__objects_3) $(am__objects_4)
 libscistring_la_OBJECTS = $(am_libscistring_la_OBJECTS)
@@ -504,7 +508,10 @@ src/c/stringsCompare.c \
 src/c/isalphanum.c \
 src/c/StringConvert.c \
 src/c/scistrtostr.c \
-src/c/stringToDouble.c
+src/c/stringToDouble.c \
+src/c/isnum.c \
+src/c/stringToComplex.c \
+src/c/complex_array.c
 
 STRING_FORTRAN_SOURCES = 
 GATEWAY_C_SOURCES = sci_gateway/c/gw_string.c \
@@ -536,7 +543,8 @@ sci_gateway/c/sci_strspn.c \
 sci_gateway/c/sci_strstr.c \
 sci_gateway/c/sci_strtod.c \
 sci_gateway/c/sci_strtok.c \
-sci_gateway/c/sci_regexp.c
+sci_gateway/c/sci_regexp.c \
+sci_gateway/c/sci_isnum.c
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_string.f \
 sci_gateway/fortran/strops.f
@@ -546,6 +554,7 @@ libscistring_la_CPPFLAGS = -I$(srcdir)/src/c \
        -I$(top_srcdir)/modules/functions/includes/ \
        -I$(top_srcdir)/modules/api_scilab/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
+        -I$(top_srcdir)/modules/spreadsheet/src/c/ \
        -I$(top_srcdir)/modules/output_stream/includes/ \
        $(PCRE_CFLAGS) \
        $(AM_CPPFLAGS)
@@ -563,14 +572,14 @@ CHECK_SRC = $(STRING_C_SOURCES) $(GATEWAY_C_SOURCES)
 INCLUDE_FLAGS = $(libscistring_la_CPPFLAGS)
 
 # commented since it is the first module to be processed
-libscistring_la_LIBADD = libscistring-algo.la 
+libscistring_la_LIBADD = libscistring-algo.la
 
 #### Target ######
 modulename = string
 
 #### string : Conf files ####
 libscistring_la_rootdir = $(mydatadir)
-libscistring_la_root_DATA = license.txt 
+libscistring_la_root_DATA = license.txt
 
 #### string : init scripts ####
 libscistring_la_etcdir = $(mydatadir)/etc
@@ -742,18 +751,21 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-InitializeString.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-StringConvert.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-code2str.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-complex_array.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-convstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-cvstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-getfastcode.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-isalphanum.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-isdigit.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-isletter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-isnum.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-men_Sutils.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-partfunction.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-pcre_error.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-pcre_private.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-scistrtostr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-setScilabCharactersCodes.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stringToComplex.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stringToDouble.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stringsCompare.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stringsstrrchr.Plo@am__quote@
@@ -773,6 +785,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_isascii.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_isdigit.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_isletter.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_isnum.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_length.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_part.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_regexp.Plo@am__quote@
@@ -983,6 +996,27 @@ libscistring_algo_la-stringToDouble.lo: src/c/stringToDouble.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) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-stringToDouble.lo `test -f 'src/c/stringToDouble.c' || echo '$(srcdir)/'`src/c/stringToDouble.c
 
+libscistring_algo_la-isnum.lo: src/c/isnum.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscistring_algo_la-isnum.lo -MD -MP -MF $(DEPDIR)/libscistring_algo_la-isnum.Tpo -c -o libscistring_algo_la-isnum.lo `test -f 'src/c/isnum.c' || echo '$(srcdir)/'`src/c/isnum.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_algo_la-isnum.Tpo $(DEPDIR)/libscistring_algo_la-isnum.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/isnum.c' object='libscistring_algo_la-isnum.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) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-isnum.lo `test -f 'src/c/isnum.c' || echo '$(srcdir)/'`src/c/isnum.c
+
+libscistring_algo_la-stringToComplex.lo: src/c/stringToComplex.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscistring_algo_la-stringToComplex.lo -MD -MP -MF $(DEPDIR)/libscistring_algo_la-stringToComplex.Tpo -c -o libscistring_algo_la-stringToComplex.lo `test -f 'src/c/stringToComplex.c' || echo '$(srcdir)/'`src/c/stringToComplex.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_algo_la-stringToComplex.Tpo $(DEPDIR)/libscistring_algo_la-stringToComplex.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/stringToComplex.c' object='libscistring_algo_la-stringToComplex.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) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-stringToComplex.lo `test -f 'src/c/stringToComplex.c' || echo '$(srcdir)/'`src/c/stringToComplex.c
+
+libscistring_algo_la-complex_array.lo: src/c/complex_array.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscistring_algo_la-complex_array.lo -MD -MP -MF $(DEPDIR)/libscistring_algo_la-complex_array.Tpo -c -o libscistring_algo_la-complex_array.lo `test -f 'src/c/complex_array.c' || echo '$(srcdir)/'`src/c/complex_array.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_algo_la-complex_array.Tpo $(DEPDIR)/libscistring_algo_la-complex_array.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/complex_array.c' object='libscistring_algo_la-complex_array.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) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-complex_array.lo `test -f 'src/c/complex_array.c' || echo '$(srcdir)/'`src/c/complex_array.c
+
 libscistring_la-gw_string.lo: sci_gateway/c/gw_string.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscistring_la-gw_string.lo -MD -MP -MF $(DEPDIR)/libscistring_la-gw_string.Tpo -c -o libscistring_la-gw_string.lo `test -f 'sci_gateway/c/gw_string.c' || echo '$(srcdir)/'`sci_gateway/c/gw_string.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-gw_string.Tpo $(DEPDIR)/libscistring_la-gw_string.Plo
@@ -1193,6 +1227,13 @@ libscistring_la-sci_regexp.lo: sci_gateway/c/sci_regexp.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) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_regexp.lo `test -f 'sci_gateway/c/sci_regexp.c' || echo '$(srcdir)/'`sci_gateway/c/sci_regexp.c
 
+libscistring_la-sci_isnum.lo: sci_gateway/c/sci_isnum.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_isnum.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_isnum.Tpo -c -o libscistring_la-sci_isnum.lo `test -f 'sci_gateway/c/sci_isnum.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isnum.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_isnum.Tpo $(DEPDIR)/libscistring_la-sci_isnum.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_isnum.c' object='libscistring_la-sci_isnum.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) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_isnum.lo `test -f 'sci_gateway/c/sci_isnum.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isnum.c
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
@@ -9,8 +9,10 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-#ifndef __CSV_COMPLEX_H__
-#define __CSV_COMPLEX_H__
+#ifndef __COMPLEX_ARRAY_H__
+#define __COMPLEX_ARRAY_H__
+
+#include "dynlib_string.h"
 
 typedef struct
 {
@@ -18,16 +20,16 @@ typedef struct
     double *imagPart;
     int nbElements;
     int isComplex;
-} csv_complexArray;
+} complexArray;
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-    csv_complexArray *createCsvComplexArray(const double *realpart, const double *imagpart, int nbSize);
-    csv_complexArray *createCsvComplexArrayEmpty(int nbSize);
-    int cleanImagPartCsvComplexArray(csv_complexArray *pCsvComplexArray);
-    void freeCsvComplexArray(csv_complexArray *pCsvComplexArray);
+    STRING_IMPEXP complexArray *createComplexArray(const double *realpart, const double *imagpart, int nbSize);
+    STRING_IMPEXP complexArray *createComplexArrayEmpty(int nbSize);
+    STRING_IMPEXP int cleanImagPartComplexArray(complexArray *pComplexArray);
+    STRING_IMPEXP void freeComplexArray(complexArray *pComplexArray);
 
 #ifdef __cplusplus
 }
index 9d085f3..c503ac7 100644 (file)
@@ -2,50 +2,51 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
- * 
+ *
  * 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    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 #ifndef __GW_STRING__
 #define __GW_STRING__
 #include "dynlib_string.h"
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
 STRING_IMPEXP int gw_string(void);
-/*--------------------------------------------------------------------------*/ 
-STRING_IMPEXP int sci_length(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_part(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_string(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_convstr(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_emptystr(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_str2code(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_code2str(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strcat(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strindex(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strsubst(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_ascii(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_grep(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_tokens(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strsplit(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_stripblanks(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strcmp(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_isletter(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_isdigit(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_isalphanum(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_isascii(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strcspn(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strncpy(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strchr(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strstr(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strrev(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strtok(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strspn(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strtod(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_regexp(char *fname,unsigned long fname_len);
-/*--------------------------------------------------------------------------*/ 
+/*--------------------------------------------------------------------------*/
+STRING_IMPEXP int sci_length(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_part(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_string(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_convstr(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_emptystr(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_str2code(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_code2str(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strcat(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strindex(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strsubst(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_ascii(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_grep(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_tokens(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strsplit(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_stripblanks(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strcmp(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_isletter(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_isdigit(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_isalphanum(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_isascii(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strcspn(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strncpy(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strchr(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strstr(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strrev(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strtok(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strspn(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_strtod(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_regexp(char *fname, unsigned long fname_len);
+STRING_IMPEXP int sci_isnum(char *fname, unsigned long fname_len);
+/*--------------------------------------------------------------------------*/
 #endif /*  __GW_STRING__ */
 /*--------------------------------------------------------------------------*/
 #define __STRINGTOCOMPLEX_H__
 
 #include "doublecomplex.h"
-#include "csv_complex.h"
+#include "complex_array.h"
 #include "BOOL.h"
 
+#include "dynlib_string.h"
+
 typedef enum
 {
     STRINGTOCOMPLEX_NO_ERROR = 0,
@@ -36,7 +38,7 @@ extern "C" {
                                   BOOL bConvertByNAN,
                                   stringToComplexError *ierr);
 
-    csv_complexArray *stringsToCsvComplexArray(const char **pSTRs, int nbElements,
+    STRING_IMPEXP  complexArray *stringsToComplexArray(const char **pSTRs, int nbElements,
             const char *decimal,
             BOOL bConvertByNAN,
             stringToComplexError *ierr);
diff --git a/scilab/modules/string/macros/isnum.sci b/scilab/modules/string/macros/isnum.sci
deleted file mode 100644 (file)
index e899d63..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2007 - INRIA - Pierre MARECHAL
-// Copyright (C) 2010 - DIGITEO - Pierre MARECHAL
-// Copyright (C) 2010 - DIGITEO - Allan CORNET
-//
-// This file must be used under the terms of the CeCILL.
-// This source file is licensed as described in the file COPYING, which
-// you should have received as part of this distribution. The terms
-// are also available at
-// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-
-//
-// isnum(str) return %T if str represent a number
-//
-
-function res = isnum(str)
-
-  // Check input argument
-
-  if argn(2) <> 1 then
-    error(msprintf(gettext("%s: Wrong number of input argument: %d expected.\n"), "isnum", 1));
-  end
-
-  if type(str) <> 10 then
-    error(msprintf(gettext("%s: Wrong type for input argument #%d: A string array expected.\n"), "isnum", 1));
-  end
-
-  // bug 8206 isnum did not manage blanks
-  str = stripblanks(str);
-  
-  // Loop on input argument entries
-  for i=1:size(str, "*") do
-    res(i) = %F;
-    if execstr("v = evstr(str(i))" , "errcatch") == 0 then
-      if type(v) == 1 & v <> [] then
-        res(i) = %T;
-      end
-    end
-  end
-
-  // Reshape the resulting matrix
-  res = matrix(res, size(str));
-
-endfunction
index 0eb0e0d..9e7ca2e 100644 (file)
@@ -1,11 +1,11 @@
 /*
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 * Copyright (C) INRIA - Allan CORNET , Cong WU
-* 
+*
 * 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    
+* are also available at
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 *
 */
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
-       {sci_length,"length"},
-       {sci_part,"part"},
-       {sci_string,"string"},
-       {sci_convstr,"convstr"},
-       {sci_emptystr,"emptystr"},
-       {sci_str2code,"str2code"},
-       {sci_code2str,"code2str"},
-       {sci_strcat,"strcat"},
-       {sci_strindex,"strindex"},
-       {sci_strsubst,"strsubst"},
-       {sci_ascii,"ascii"},
-       {sci_grep,"grep"},
-       {sci_tokens,"tokens"},
-       {sci_strsplit,"strsplit"},
-       {sci_stripblanks,"stripblank"},
-       {sci_strcmp,"strcmp"},
-       {sci_isletter,"isletter"},
-       {sci_isdigit,"isdigit"},
-       {sci_isalphanum,"isalphanum"},
-       {sci_isascii,"isascii"},
-       {sci_strcspn,"strcspn"},
-       {sci_strncpy,"strncpy"},
-       {sci_strchr,"strrchr"},
-       {sci_strchr,"strchr"},
-       {sci_strstr,"strstr"},
-       {sci_strrev,"strrev"},
-       {sci_strtok,"strtok"},
-       {sci_strspn,"strspn"},
-       {sci_strtod,"strtod"},
-       {sci_regexp,"regexp"},
-    {sci_str2code,"_str2code"},
-    {sci_code2str,"_code2str"}
+    {sci_length, "length"},
+    {sci_part, "part"},
+    {sci_string, "string"},
+    {sci_convstr, "convstr"},
+    {sci_emptystr, "emptystr"},
+    {sci_str2code, "str2code"},
+    {sci_code2str, "code2str"},
+    {sci_strcat, "strcat"},
+    {sci_strindex, "strindex"},
+    {sci_strsubst, "strsubst"},
+    {sci_ascii, "ascii"},
+    {sci_grep, "grep"},
+    {sci_tokens, "tokens"},
+    {sci_strsplit, "strsplit"},
+    {sci_stripblanks, "stripblank"},
+    {sci_strcmp, "strcmp"},
+    {sci_isletter, "isletter"},
+    {sci_isdigit, "isdigit"},
+    {sci_isalphanum, "isalphanum"},
+    {sci_isascii, "isascii"},
+    {sci_strcspn, "strcspn"},
+    {sci_strncpy, "strncpy"},
+    {sci_strchr, "strrchr"},
+    {sci_strchr, "strchr"},
+    {sci_strstr, "strstr"},
+    {sci_strrev, "strrev"},
+    {sci_strtok, "strtok"},
+    {sci_strspn, "strspn"},
+    {sci_strtod, "strtod"},
+    {sci_regexp, "regexp"},
+    {sci_str2code, "_str2code"},
+    {sci_code2str, "_code2str"},
+    {sci_isnum, "isnum"},
+    {sci_isnum, "csvIsnum"}
 };
 /*--------------------------------------------------------------------------*/
 int gw_string(void)
-{  
-       if(pvApiCtx == NULL)
-       {
-               pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
-       }
+{
+    if (pvApiCtx == NULL)
+    {
+        pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
+    }
 
-       pvApiCtx->pstName = (char*)Tab[Fin-1].name;
-       callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
-       return 0;
+    pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
+    callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
 
  *
  */
 
-#include "gw_spreadsheet.h"
 #include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
-#include "csvIsnum.h"
+#include "isnum.h"
 #include "MALLOC.h"
 
 // =============================================================================
-int sci_csvIsnum(char *fname, unsigned long fname_len)
+int sci_isnum(char *fname, unsigned long fname_len)
 {
     SciErr sciErr;
     int *piAddressVarOne = NULL;
@@ -32,6 +31,16 @@ int sci_csvIsnum(char *fname, unsigned long fname_len)
     CheckRhs(1, 1);
     CheckLhs(0, 1);
 
+    if (strcmp(fname, "csvIsnum") == 0)
+    {
+        if (getWarningMode())
+        {
+            sciprint(_("%s: Feature %s is obsolete.\n"), _("Warning"), fname);
+            sciprint(_("%s: Please use %s instead.\n"), _("Warning"), "isnum");
+            sciprint(_("%s: This feature will be permanently removed in Scilab %s\n\n"), _("Warning"), "6.0.0");
+        }
+    }
+
     sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
     if (sciErr.iErr)
     {
@@ -51,7 +60,7 @@ int sci_csvIsnum(char *fname, unsigned long fname_len)
         return 0;
     }
 
-    bRESULT = csv_isNumMatrix((const char**)pStrs, mOne, nOne);
+    bRESULT = isNumMatrix((const char**)pStrs, mOne, nOne);
 
     freeAllocatedMatrixOfString(mOne, nOne, pStrs);
     pStrs = NULL;
index 3bf9046..ca049ca 100644 (file)
@@ -2,8 +2,8 @@
 
 <!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
 <GATEWAY name="string">
-<!-- =================== -->
-<!--
+    <!-- =================== -->
+    <!--
  Scilab
  Interface description. In this file, we define the list of the function which
  will be available into Scilab and the link to the "native" function.
  ===================
  Don't touch if you do not know what you are doing
 -->
-<!-- =================== -->
+    <!-- =================== -->
 
 
-<!--
+    <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA - Allan CORNET , 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    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  -->
 
 
-<PRIMITIVE gatewayId="21" primitiveId="1" primitiveName="length" />
-<PRIMITIVE gatewayId="21" primitiveId="2" primitiveName="part" />
-<PRIMITIVE gatewayId="21" primitiveId="3" primitiveName="string" />
-<PRIMITIVE gatewayId="21" primitiveId="4" primitiveName="convstr" />
-<PRIMITIVE gatewayId="21" primitiveId="5" primitiveName="emptystr" />
-<PRIMITIVE gatewayId="21" primitiveId="6" primitiveName="str2code" />
-<PRIMITIVE gatewayId="21" primitiveId="7" primitiveName="code2str" />
-<PRIMITIVE gatewayId="21" primitiveId="8" primitiveName="strcat" />
-<PRIMITIVE gatewayId="21" primitiveId="9" primitiveName="strindex" />
-<PRIMITIVE gatewayId="21" primitiveId="10" primitiveName="strsubst" />
-<PRIMITIVE gatewayId="21" primitiveId="11" primitiveName="ascii" />
-<PRIMITIVE gatewayId="21" primitiveId="12" primitiveName="grep" />
-<PRIMITIVE gatewayId="21" primitiveId="13" primitiveName="tokens" />
-<PRIMITIVE gatewayId="21" primitiveId="14" primitiveName="strsplit" />
-<PRIMITIVE gatewayId="21" primitiveId="15" primitiveName="stripblanks" />
-<PRIMITIVE gatewayId="21" primitiveId="16" primitiveName="strcmp" />
-<PRIMITIVE gatewayId="21" primitiveId="17" primitiveName="isletter" />
-<PRIMITIVE gatewayId="21" primitiveId="18" primitiveName="isdigit" />
-<PRIMITIVE gatewayId="21" primitiveId="19" primitiveName="isalphanum" />
-<PRIMITIVE gatewayId="21" primitiveId="20" primitiveName="isascii" />
-<PRIMITIVE gatewayId="21" primitiveId="21" primitiveName="strcspn" />
-<PRIMITIVE gatewayId="21" primitiveId="22" primitiveName="strncpy" />
-<PRIMITIVE gatewayId="21" primitiveId="23" primitiveName="strrchr" />
-<PRIMITIVE gatewayId="21" primitiveId="24" primitiveName="strchr" />
-<PRIMITIVE gatewayId="21" primitiveId="25" primitiveName="strstr" />
-<PRIMITIVE gatewayId="21" primitiveId="26" primitiveName="strrev" />
-<PRIMITIVE gatewayId="21" primitiveId="27" primitiveName="strtok" />
-<PRIMITIVE gatewayId="21" primitiveId="28" primitiveName="strspn" />
-<PRIMITIVE gatewayId="21" primitiveId="29" primitiveName="strtod" />
-<PRIMITIVE gatewayId="21" primitiveId="30" primitiveName="regexp" />
-<PRIMITIVE gatewayId="21" primitiveId="31" primitiveName="_str2code" />
-<PRIMITIVE gatewayId="21" primitiveId="32" primitiveName="_code2str" />
+    <PRIMITIVE gatewayId="21" primitiveId="1" primitiveName="length" />
+    <PRIMITIVE gatewayId="21" primitiveId="2" primitiveName="part" />
+    <PRIMITIVE gatewayId="21" primitiveId="3" primitiveName="string" />
+    <PRIMITIVE gatewayId="21" primitiveId="4" primitiveName="convstr" />
+    <PRIMITIVE gatewayId="21" primitiveId="5" primitiveName="emptystr" />
+    <PRIMITIVE gatewayId="21" primitiveId="6" primitiveName="str2code" />
+    <PRIMITIVE gatewayId="21" primitiveId="7" primitiveName="code2str" />
+    <PRIMITIVE gatewayId="21" primitiveId="8" primitiveName="strcat" />
+    <PRIMITIVE gatewayId="21" primitiveId="9" primitiveName="strindex" />
+    <PRIMITIVE gatewayId="21" primitiveId="10" primitiveName="strsubst" />
+    <PRIMITIVE gatewayId="21" primitiveId="11" primitiveName="ascii" />
+    <PRIMITIVE gatewayId="21" primitiveId="12" primitiveName="grep" />
+    <PRIMITIVE gatewayId="21" primitiveId="13" primitiveName="tokens" />
+    <PRIMITIVE gatewayId="21" primitiveId="14" primitiveName="strsplit" />
+    <PRIMITIVE gatewayId="21" primitiveId="15" primitiveName="stripblanks" />
+    <PRIMITIVE gatewayId="21" primitiveId="16" primitiveName="strcmp" />
+    <PRIMITIVE gatewayId="21" primitiveId="17" primitiveName="isletter" />
+    <PRIMITIVE gatewayId="21" primitiveId="18" primitiveName="isdigit" />
+    <PRIMITIVE gatewayId="21" primitiveId="19" primitiveName="isalphanum" />
+    <PRIMITIVE gatewayId="21" primitiveId="20" primitiveName="isascii" />
+    <PRIMITIVE gatewayId="21" primitiveId="21" primitiveName="strcspn" />
+    <PRIMITIVE gatewayId="21" primitiveId="22" primitiveName="strncpy" />
+    <PRIMITIVE gatewayId="21" primitiveId="23" primitiveName="strrchr" />
+    <PRIMITIVE gatewayId="21" primitiveId="24" primitiveName="strchr" />
+    <PRIMITIVE gatewayId="21" primitiveId="25" primitiveName="strstr" />
+    <PRIMITIVE gatewayId="21" primitiveId="26" primitiveName="strrev" />
+    <PRIMITIVE gatewayId="21" primitiveId="27" primitiveName="strtok" />
+    <PRIMITIVE gatewayId="21" primitiveId="28" primitiveName="strspn" />
+    <PRIMITIVE gatewayId="21" primitiveId="29" primitiveName="strtod" />
+    <PRIMITIVE gatewayId="21" primitiveId="30" primitiveName="regexp" />
+    <PRIMITIVE gatewayId="21" primitiveId="31" primitiveName="_str2code" />
+    <PRIMITIVE gatewayId="21" primitiveId="32" primitiveName="_code2str" />
+    <PRIMITIVE gatewayId="21" primitiveId="33" primitiveName="isnum" />
+    <PRIMITIVE gatewayId="21" primitiveId="34" primitiveName="csvIsnum" />
 
-</GATEWAY>
\ No newline at end of file
+</GATEWAY>
diff --git a/scilab/modules/string/src/c/complex_array.c b/scilab/modules/string/src/c/complex_array.c
new file mode 100644 (file)
index 0000000..29d1d4b
--- /dev/null
@@ -0,0 +1,159 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010-2011 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+#include <string.h>
+#include "complex_array.h"
+#include "MALLOC.h"
+// =============================================================================
+complexArray *createComplexArrayEmpty(int nbSize)
+{
+    complexArray *pComplexArray = NULL;
+    pComplexArray = (complexArray *) MALLOC(sizeof(complexArray));
+    if (pComplexArray)
+    {
+        pComplexArray->realPart = (double *)MALLOC(sizeof(double) * nbSize);
+        if (pComplexArray->realPart == NULL)
+        {
+            FREE(pComplexArray);
+            return NULL;
+        }
+
+        pComplexArray->imagPart = (double *)MALLOC(sizeof(double) * nbSize);
+        if (pComplexArray->imagPart == NULL)
+        {
+            FREE(pComplexArray->realPart);
+            pComplexArray->realPart = NULL;
+            FREE(pComplexArray);
+            return NULL;
+        }
+
+        memset(pComplexArray->realPart, 0, sizeof(double) * nbSize);
+        memset(pComplexArray->imagPart, 0, sizeof(double) * nbSize);
+        pComplexArray->isComplex = 1;
+        pComplexArray->nbElements = nbSize;
+    }
+    return pComplexArray;
+}
+// =============================================================================
+complexArray *createComplexArray(const double *realpart, const double *imagpart, int nbSize)
+{
+    complexArray *pComplexArray = NULL;
+
+    if (realpart == NULL)
+    {
+        return pComplexArray;
+    }
+
+    if (nbSize <= 0)
+    {
+        return pComplexArray;
+    }
+
+    pComplexArray = (complexArray *) MALLOC(sizeof(complexArray));
+    if (pComplexArray)
+    {
+        if (imagpart == NULL)
+        {
+            pComplexArray->isComplex = 0;
+        }
+        else
+        {
+            int i = 0;
+            pComplexArray->isComplex = 0;
+            for (i = 0; i < nbSize; i++)
+            {
+                if (imagpart[i] != 0)
+                {
+                    pComplexArray->isComplex = 1;
+                    break;
+                }
+            }
+        }
+
+        pComplexArray->realPart = (double *)MALLOC(sizeof(double) * nbSize);
+        if (pComplexArray->realPart)
+        {
+            memcpy(pComplexArray->realPart, realpart, nbSize);
+            pComplexArray->nbElements = nbSize;
+        }
+        if (pComplexArray->isComplex)
+        {
+            pComplexArray->imagPart = (double *)MALLOC(sizeof(double) * nbSize);
+            if (pComplexArray->imagPart)
+            {
+                memcpy(pComplexArray->imagPart, imagpart, nbSize);
+            }
+        }
+        else
+        {
+            pComplexArray->imagPart = NULL;
+        }
+    }
+    return pComplexArray;
+}
+// =============================================================================
+void freeComplexArray(complexArray *pComplexArray)
+{
+    if (pComplexArray)
+    {
+        if (pComplexArray->realPart)
+        {
+            FREE(pComplexArray->realPart);
+            pComplexArray->realPart = NULL;
+        }
+
+        if (pComplexArray->imagPart)
+        {
+            FREE(pComplexArray->imagPart);
+            pComplexArray->imagPart = NULL;
+        }
+        pComplexArray->isComplex = 0;
+        pComplexArray->nbElements = 0;
+
+        FREE(pComplexArray);
+        pComplexArray = NULL;
+    }
+}
+// =============================================================================
+int cleanImagPartComplexArray(complexArray *pComplexArray)
+{
+    if (pComplexArray)
+    {
+        if (pComplexArray->imagPart)
+        {
+            int i = 0;
+            int isComplex = 0;
+            for (i = 0; i < pComplexArray->nbElements; i++)
+            {
+                if (pComplexArray->imagPart[i] != 0)
+                {
+                    isComplex = 1;
+                    break;
+                }
+            }
+
+            if (isComplex)
+            {
+                pComplexArray->isComplex = 1;
+            }
+            else
+            {
+                pComplexArray->isComplex = 0;
+            }
+        }
+        else
+        {
+            return 1;
+        }
+    }
+    return 0;
+}
+// =============================================================================
similarity index 81%
rename from scilab/modules/spreadsheet/src/c/csvIsnum.c
rename to scilab/modules/string/src/c/isnum.c
index 8203cd4..ab68b57 100644 (file)
@@ -9,23 +9,22 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-#include "csvIsnum.h"
-#include "csvDefault.h"
+#include "isnum.h"
 #include "stringToComplex.h"
 #include "MALLOC.h"
 // =============================================================================
-BOOL csv_isNum(const char *pStr)
+BOOL isNum(const char *pStr)
 {
     if (pStr)
     {
         stringToComplexError ierr = STRINGTOCOMPLEX_NO_ERROR;
-        stringToComplex(pStr, getCsvDefaultDecimal(), FALSE, &ierr);
+        stringToComplex(pStr, ".", FALSE, &ierr);
         return (BOOL)(ierr == STRINGTOCOMPLEX_NO_ERROR);
     }
     return FALSE;
 }
 // =============================================================================
-BOOL *csv_isNumMatrix(const char **pStrs, int nbRows, int nbCols)
+BOOL *isNumMatrix(const char **pStrs, int nbRows, int nbCols)
 {
     BOOL *pResults = NULL;
     if (pStrs)
@@ -36,7 +35,7 @@ BOOL *csv_isNumMatrix(const char **pStrs, int nbRows, int nbCols)
             int i = 0;
             for (i = 0; i < nbRows * nbCols; i++)
             {
-                pResults[i] = csv_isNum(pStrs[i]);
+                pResults[i] = isNum(pStrs[i]);
             }
         }
     }
similarity index 85%
rename from scilab/modules/spreadsheet/src/c/csvIsnum.h
rename to scilab/modules/string/src/c/isnum.h
index f0cfce8..958974f 100644 (file)
@@ -18,9 +18,9 @@
 extern "C" {
 #endif
 
-    BOOL csv_isNum(const char *pStr);
+    BOOL isNum(const char *pStr);
 
-    BOOL *csv_isNumMatrix(const char **pStrs, int nbRows, int nbCols);
+    BOOL *isNumMatrix(const char **pStrs, int nbRows, int nbCols);
 
 #ifdef __cplusplus
 }
index 85f3066..4e111d4 100644 (file)
@@ -254,6 +254,7 @@ lib /DEF:"$(ProjectDir)functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClCompile Include="..\..\sci_gateway\c\sci_strtod.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_strtok.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_tokens.c" />
+    <ClCompile Include="..\..\sci_gateway\c\sci_isnum.c" />
     <ClCompile Include="scistrtostr.c" />
     <ClCompile Include="setScilabCharactersCodes.c" />
     <ClCompile Include="StringConvert.c" />
@@ -266,6 +267,9 @@ lib /DEF:"$(ProjectDir)functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClCompile Include="strsplit.c" />
     <ClCompile Include="strsubst.c" />
     <ClCompile Include="tokens.c" />
+    <ClCompile Include="isnum.c" />
+    <ClCompile Include="stringToComplex.c" />
+    <ClCompile Include="complex_array.c" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\locales\string.pot" />
@@ -316,6 +320,8 @@ lib /DEF:"$(ProjectDir)functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClInclude Include="..\..\includes\stripblanks.h" />
     <ClInclude Include="..\..\includes\stristr.h" />
     <ClInclude Include="..\..\includes\strsubst.h" />
+    <ClInclude Include="..\..\includes\stringToComplex.h" />
+    <ClInclude Include="..\..\includes\complex_array.h" />
     <ClInclude Include="config.h" />
     <ClInclude Include="convstr.h" />
     <ClInclude Include="CreateEmptystr.h" />
@@ -332,6 +338,7 @@ lib /DEF:"$(ProjectDir)functions_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClInclude Include="strsplit.h" />
     <ClInclude Include="tokens.h" />
     <ClInclude Include="ucp.h" />
+    <ClInclude Include="isnum.h" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
@@ -21,7 +21,7 @@
 #include "strdup_windows.h"
 #endif
 #include "BOOL.h"
-#include "csv_strsubst.h"
+#include "strsubst.h"
 /* ========================================================================== */
 #define PlusChar '+'
 #define LessChar '-'
@@ -49,12 +49,12 @@ static char *leftstring(const char *tx, size_t pos);
 static BOOL is_unit_imaginary (const char *src, double *im);
 static double returnNAN(void);
 /* ========================================================================== */
-csv_complexArray *stringsToCsvComplexArray(const char **pSTRs, int nbElements,
+complexArray *stringsToComplexArray(const char **pSTRs, int nbElements,
         const char *decimal,
         BOOL bConvertByNAN,
         stringToComplexError *ierr)
 {
-    csv_complexArray *pCsvComplexArray = NULL;
+    complexArray *pComplexArray = NULL;
 
     *ierr = STRINGTOCOMPLEX_ERROR;
     if (nbElements <= 0)
@@ -68,8 +68,8 @@ csv_complexArray *stringsToCsvComplexArray(const char **pSTRs, int nbElements,
     }
     else
     {
-        pCsvComplexArray = createCsvComplexArrayEmpty(nbElements);
-        if (pCsvComplexArray)
+        pComplexArray = createComplexArrayEmpty(nbElements);
+        if (pComplexArray)
         {
             int i = 0;
             for (i = 0; i < nbElements; i++)
@@ -77,23 +77,23 @@ csv_complexArray *stringsToCsvComplexArray(const char **pSTRs, int nbElements,
                 doublecomplex dComplexValue = stringToComplex(pSTRs[i], decimal, bConvertByNAN, ierr);
                 if (*ierr != STRINGTOCOMPLEX_NO_ERROR)
                 {
-                    freeCsvComplexArray(pCsvComplexArray);
+                    freeComplexArray(pComplexArray);
                     return NULL;
                 }
                 else
                 {
-                    pCsvComplexArray->realPart[i] = dComplexValue.r;
-                    pCsvComplexArray->imagPart[i] = dComplexValue.i;
+                    pComplexArray->realPart[i] = dComplexValue.r;
+                    pComplexArray->imagPart[i] = dComplexValue.i;
                 }
             }
-            cleanImagPartCsvComplexArray(pCsvComplexArray);
+            cleanImagPartComplexArray(pComplexArray);
         }
         else
         {
             *ierr = STRINGTOCOMPLEX_MEMORY_ALLOCATION;
         }
     }
-    return pCsvComplexArray;
+    return pComplexArray;
 }
 /* ========================================================================== */
 doublecomplex stringToComplex(const char *pSTR, const char *decimal, BOOL bConvertByNAN, stringToComplexError *ierr)
@@ -108,11 +108,11 @@ doublecomplex stringToComplex(const char *pSTR, const char *decimal, BOOL bConve
     {
         double real = 0.;
         double imag = 0.;
-        char *pStrTemp = csv_strsubst(pSTR, " ", "");
+        char *pStrTemp = strsub(pSTR, " ", "");
 
         if (pStrTemp)
         {
-            char *pStrFormatted = csv_strsubst(pStrTemp, decimal, ".");
+            char *pStrFormatted = strsub(pStrTemp, decimal, ".");
             FREE(pStrTemp);
 
             if (pStrFormatted)
@@ -136,11 +136,11 @@ doublecomplex stringToComplex(const char *pSTR, const char *decimal, BOOL bConve
                             (pStrFormatted[1] == '.'))
                     {
                         /* case +.4 replaced by +0.4 */
-                        char *pstStrTemp = csv_strsubst(pStrFormatted, "+.", "+0.");
+                        char *pstStrTemp = strsub(pStrFormatted, "+.", "+0.");
                         FREE(pStrFormatted);
 
                         /* case -.4 replaced by -0.4 */
-                        pStrFormatted = csv_strsubst(pstStrTemp, "-.", "-0.");
+                        pStrFormatted = strsub(pstStrTemp, "-.", "-0.");
                         FREE(pstStrTemp);
                     }
                 }
@@ -260,7 +260,7 @@ static stringToComplexError ParseComplexValue(const char *tx, BOOL bConvertByNAN
     }
     else if (ierrDouble != STRINGTODOUBLE_NO_ERROR)
     {
-        modifiedTxt = csv_strsubst(tx, ComplexScilab, ComplexI);
+        modifiedTxt = strsub(tx, ComplexScilab, ComplexI);
         lnum = ParseNumber(modifiedTxt);
         if (lnum <= 1)
         {
@@ -441,7 +441,7 @@ static char *leftstring(const char *tx, size_t pos)
 /* ========================================================================== */
 static BOOL is_unit_imaginary (const char *src, double *im)
 {
-    char *modifiedSrc = csv_strsubst(src, ComplexScilab, ComplexI);
+    char *modifiedSrc = strsub(src, ComplexScilab, ComplexI);
     char *nextChar = NULL;
     BOOL isUnitImag = FALSE;
 
index 55b79c2..1bc8f8d 100644 (file)
@@ -5,28 +5,28 @@
 //  This file is distributed under the same license as the Scilab package.
 // =============================================================================
 // <-- CLI SHELL MODE -->
-if ~isnum('%pi')       then bugmes();quit;end
-if ~isnum('1')         then bugmes();quit;end
-if ~isnum('1.2')       then bugmes();quit;end
-if ~isnum('+1.2')      then bugmes();quit;end
-if ~isnum('-1.2')      then bugmes();quit;end
-if ~isnum('1e2')       then bugmes();quit;end
-if ~isnum('1d2')       then bugmes();quit;end
-if ~isnum('1E2')       then bugmes();quit;end
-if ~isnum('1D2')       then bugmes();quit;end
-if ~isnum('1e+2')      then bugmes();quit;end
-if ~isnum('1e-2')      then bugmes();quit;end
-if ~isnum('+1e+2')     then bugmes();quit;end
-if ~isnum('-1e+2')     then bugmes();quit;end
-if ~isnum('-12e+3')    then bugmes();quit;end
-if ~isnum('-1.2e+3')   then bugmes();quit;end
-if ~isnum('-1.2e+345') then bugmes();quit;end
-if isnum('a')          then bugmes();quit;end
-if isnum('e')          then bugmes();quit;end
-if isnum('d')          then bugmes();quit;end
-if isnum('E')          then bugmes();quit;end
-if isnum('e')          then bugmes();quit;end
-if isnum('-1.2a+345')  then bugmes();quit;end
-if ~isnum('-1.2e+3+45') then bugmes();quit;end
-if ~isnum('-1.2e+3-45') then bugmes();quit;end
-if execstr("isnum(1)","errcatch") == 0 then bugmes();quit;end
+assert_checktrue(isnum('%pi'));
+assert_checktrue(isnum('1'));
+assert_checktrue(isnum('1.2'));
+assert_checktrue(isnum('+1.2'));
+assert_checktrue(isnum('-1.2'));
+assert_checktrue(isnum('1e2'));
+assert_checktrue(isnum('1d2'));
+assert_checktrue(isnum('1E2'));
+assert_checktrue(isnum('1D2'));
+assert_checktrue(isnum('1e+2'));
+assert_checktrue(isnum('1e-2'));
+assert_checktrue(isnum('+1e+2'));
+assert_checktrue(isnum('-1e+2'));
+assert_checktrue(isnum('-12e+3'));
+assert_checktrue(isnum('-1.2e+3'));
+assert_checktrue(isnum('-1.2e+345'));
+assert_checkfalse(isnum('a'));
+assert_checkfalse(isnum('e'));
+assert_checkfalse(isnum('d'));
+assert_checkfalse(isnum('E'));
+assert_checkfalse(isnum('e'));
+assert_checkfalse(isnum('-1.2a+345'));
+assert_checkfalse(isnum('-1.2e+3+45'));
+assert_checkfalse(isnum('-1.2e+3-45'));
+assert_checkerror("isnum(1)",[],999);
index 277142e..6b6b1e0 100644 (file)
@@ -7,36 +7,36 @@
 
 // <-- CLI SHELL MODE -->
 
-if ~isnum('%pi')       then pause, end
+assert_checktrue(isnum('%pi'));
 
-if ~isnum('1')         then pause, end
-if ~isnum('1.2')       then pause, end
-if ~isnum('+1.2')      then pause, end
-if ~isnum('-1.2')      then pause, end
+assert_checktrue(isnum('1'));
+assert_checktrue(isnum('1.2'));
+assert_checktrue(isnum('+1.2'));
+assert_checktrue(isnum('-1.2'));
 
-if ~isnum('1e2')       then pause, end
-if ~isnum('1d2')       then pause, end
-if ~isnum('1E2')       then pause, end
-if ~isnum('1D2')       then pause, end
+assert_checktrue(isnum('1e2'));
+assert_checktrue(isnum('1d2'));
+assert_checktrue(isnum('1E2'));
+assert_checktrue(isnum('1D2'));
 
-if ~isnum('1e+2')      then pause, end
-if ~isnum('1e-2')      then pause, end
-if ~isnum('+1e+2')     then pause, end
-if ~isnum('-1e+2')     then pause, end
+assert_checktrue(isnum('1e+2'));
+assert_checktrue(isnum('1e-2'));
+assert_checktrue(isnum('+1e+2'));
+assert_checktrue(isnum('-1e+2'));
 
-if ~isnum('-12e+3')    then pause, end
+assert_checktrue(isnum('-12e+3'));
 
-if ~isnum('-1.2e+3')   then pause, end
-if ~isnum('-1.2e+345') then pause, end
+assert_checktrue(isnum('-1.2e+3'));
+assert_checktrue(isnum('-1.2e+345'));
 
-if isnum('a')          then pause, end
-if isnum('e')          then pause, end
-if isnum('d')          then pause, end
-if isnum('E')          then pause, end
-if isnum('e')          then pause, end
+assert_checkfalse(isnum('a'));
+assert_checkfalse(isnum('e'));
+assert_checkfalse(isnum('d'));
+assert_checkfalse(isnum('E'));
+assert_checkfalse(isnum('e'));
 
-if isnum('-1.2a+345')  then pause, end
-if ~isnum('-1.2e+3+45') then pause, end
-if ~isnum('-1.2e+3-45') then pause, end
+assert_checkfalse(isnum('-1.2a+345'));
+assert_checkfalse(isnum('-1.2e+3+45'));
+assert_checkfalse(isnum('-1.2e+3-45'));
 
-if execstr("isnum(1)","errcatch") == 0 then pause, end
+assert_checkerror("isnum(1)",[],999);