Added strchr strrchr strstr strtod strncpy strrev. 56/3656/6
cedric Delamarre [Mon, 28 Mar 2011 10:04:15 +0000 (12:04 +0200)]
Change-Id: I16b781d2e2b45f4b6bc558b66ffc833321d86e5f

23 files changed:
scilab/modules/string/Makefile.am
scilab/modules/string/Makefile.in
scilab/modules/string/includes/gw_string.h
scilab/modules/string/includes/string_gw.hxx
scilab/modules/string/sci_gateway/c/gw_string.c
scilab/modules/string/sci_gateway/c/sci_strchr.c [deleted file]
scilab/modules/string/sci_gateway/c/sci_strncpy.c [deleted file]
scilab/modules/string/sci_gateway/c/sci_strrev.c [deleted file]
scilab/modules/string/sci_gateway/c/sci_strstr.c [deleted file]
scilab/modules/string/sci_gateway/c/sci_strtod.c [deleted file]
scilab/modules/string/sci_gateway/cpp/sci_strchr.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/sci_strncpy.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/sci_strrchr.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/sci_strrev.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/sci_strstr.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/sci_strtod.cpp [new file with mode: 0644]
scilab/modules/string/sci_gateway/cpp/string_gw.cpp
scilab/modules/string/sci_gateway/cpp/string_gw.vcproj
scilab/modules/string/src/c/string.vcproj
scilab/modules/string/src/c/stringsstrrchr.c [deleted file]
scilab/modules/string/src/c/stringsstrrchr.h [deleted file]
scilab/modules/string/src/c/stringsstrrev.c
scilab/modules/string/src/c/stringsstrrev.h

index 5c2560c..163a70c 100644 (file)
@@ -21,7 +21,6 @@ src/c/pcre_error.c \
 src/c/isletter.c \
 src/c/isdigit.c \
 src/c/strsubst.c \
-src/c/stringsstrrchr.c \
 src/c/stringsstrrev.c \
 src/c/stringsCompare.c \
 src/c/isalphanum.c \
@@ -31,24 +30,18 @@ src/c/scistrtostr.c
 
 STRING_FORTRAN_SOURCES =
 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_string.c \
-sci_gateway/c/sci_code2str.c \
-sci_gateway/c/sci_str2code.c \
-sci_gateway/c/sci_strsplit.c \
-sci_gateway/c/sci_tokens.c \
-sci_gateway/c/sci_strcmp.c \
-sci_gateway/c/sci_isletter.c \
-sci_gateway/c/sci_isdigit.c \
-sci_gateway/c/sci_isalphanum.c \
-sci_gateway/c/sci_isascii.c \
-sci_gateway/c/sci_strchr.c \
-sci_gateway/c/sci_strcspn.c \
-sci_gateway/c/sci_strncpy.c \
-sci_gateway/c/sci_strrev.c \
-sci_gateway/c/sci_strspn.c \
-sci_gateway/c/sci_strstr.c \
-sci_gateway/c/sci_strtod.c \
-sci_gateway/c/sci_strtok.c
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/gw_string.c \
+    sci_gateway/c/sci_strsplit.c \
+    sci_gateway/c/sci_tokens.c \
+    sci_gateway/c/sci_strcmp.c \
+    sci_gateway/c/sci_isletter.c \
+    sci_gateway/c/sci_isdigit.c \
+    sci_gateway/c/sci_isalphanum.c \
+    sci_gateway/c/sci_isascii.c \
+    sci_gateway/c/sci_strcspn.c \
+    sci_gateway/c/sci_strspn.c \
+    sci_gateway/c/sci_strtok.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_stripblanks.cpp \
@@ -62,8 +55,13 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_ascii.cpp \
        sci_gateway/cpp/sci_strcat.cpp \
        sci_gateway/cpp/sci_string.cpp \
-       sci_gateway/cpp/sci_convstr.cpp
-
+       sci_gateway/cpp/sci_convstr.cpp \
+    sci_gateway/cpp/sci_strncpy.cpp \
+    sci_gateway/cpp/sci_strrchr.cpp \
+    sci_gateway/cpp/sci_strchr.cpp \
+    sci_gateway/cpp/sci_strstr.cpp \
+    sci_gateway/cpp/sci_strrev.cpp \
+    sci_gateway/cpp/sci_strtod.cpp 
 
 GATEWAY_FORTRAN_SOURCES =  sci_gateway/fortran/sci_f_string.f \
 sci_gateway/fortran/strops.f
index f5fa09a..2cfef9d 100644 (file)
@@ -125,7 +125,6 @@ am__objects_1 = libscistring_algo_la-code2str.lo \
        libscistring_algo_la-isletter.lo \
        libscistring_algo_la-isdigit.lo \
        libscistring_algo_la-strsubst.lo \
-       libscistring_algo_la-stringsstrrchr.lo \
        libscistring_algo_la-stringsstrrev.lo \
        libscistring_algo_la-stringsCompare.lo \
        libscistring_algo_la-isalphanum.lo \
@@ -143,17 +142,12 @@ libscistring_la_DEPENDENCIES = libscistring-algo.la \
        $(top_builddir)/libs/MALLOC/libscimalloc.la \
        $(top_builddir)/modules/output_stream/libscioutput_stream.la
 am__objects_4 = libscistring_la-gw_string.lo \
-       libscistring_la-sci_code2str.lo \
-       libscistring_la-sci_str2code.lo \
        libscistring_la-sci_strsplit.lo libscistring_la-sci_tokens.lo \
        libscistring_la-sci_strcmp.lo libscistring_la-sci_isletter.lo \
        libscistring_la-sci_isdigit.lo \
        libscistring_la-sci_isalphanum.lo \
-       libscistring_la-sci_isascii.lo libscistring_la-sci_strchr.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_isascii.lo libscistring_la-sci_strcspn.lo \
+       libscistring_la-sci_strspn.lo libscistring_la-sci_strtok.lo
 am__objects_5 = sci_f_string.lo strops.lo
 am__objects_6 = libscistring_la-sci_stripblanks.lo \
        libscistring_la-sci_grep.lo libscistring_la-string_gw.lo \
@@ -161,7 +155,10 @@ am__objects_6 = libscistring_la-sci_stripblanks.lo \
        libscistring_la-sci_length.lo libscistring_la-sci_strindex.lo \
        libscistring_la-sci_strsubst.lo libscistring_la-sci_ascii.lo \
        libscistring_la-sci_strcat.lo libscistring_la-sci_string.lo \
-       libscistring_la-sci_convstr.lo
+       libscistring_la-sci_convstr.lo libscistring_la-sci_strncpy.lo \
+       libscistring_la-sci_strrchr.lo libscistring_la-sci_strchr.lo \
+       libscistring_la-sci_strstr.lo libscistring_la-sci_strrev.lo \
+       libscistring_la-sci_strtod.lo
 am_libscistring_la_OBJECTS = $(am__objects_4) $(am__objects_5) \
        $(am__objects_6)
 libscistring_la_OBJECTS = $(am_libscistring_la_OBJECTS)
@@ -479,7 +476,6 @@ src/c/pcre_error.c \
 src/c/isletter.c \
 src/c/isdigit.c \
 src/c/strsubst.c \
-src/c/stringsstrrchr.c \
 src/c/stringsstrrev.c \
 src/c/stringsCompare.c \
 src/c/isalphanum.c \
@@ -488,24 +484,18 @@ src/c/os_wcsdup.c \
 src/c/scistrtostr.c
 
 STRING_FORTRAN_SOURCES = 
-GATEWAY_C_SOURCES = sci_gateway/c/gw_string.c \
-sci_gateway/c/sci_code2str.c \
-sci_gateway/c/sci_str2code.c \
-sci_gateway/c/sci_strsplit.c \
-sci_gateway/c/sci_tokens.c \
-sci_gateway/c/sci_strcmp.c \
-sci_gateway/c/sci_isletter.c \
-sci_gateway/c/sci_isdigit.c \
-sci_gateway/c/sci_isalphanum.c \
-sci_gateway/c/sci_isascii.c \
-sci_gateway/c/sci_strchr.c \
-sci_gateway/c/sci_strcspn.c \
-sci_gateway/c/sci_strncpy.c \
-sci_gateway/c/sci_strrev.c \
-sci_gateway/c/sci_strspn.c \
-sci_gateway/c/sci_strstr.c \
-sci_gateway/c/sci_strtod.c \
-sci_gateway/c/sci_strtok.c
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/gw_string.c \
+    sci_gateway/c/sci_strsplit.c \
+    sci_gateway/c/sci_tokens.c \
+    sci_gateway/c/sci_strcmp.c \
+    sci_gateway/c/sci_isletter.c \
+    sci_gateway/c/sci_isdigit.c \
+    sci_gateway/c/sci_isalphanum.c \
+    sci_gateway/c/sci_isascii.c \
+    sci_gateway/c/sci_strcspn.c \
+    sci_gateway/c/sci_strspn.c \
+    sci_gateway/c/sci_strtok.c
 
 GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_stripblanks.cpp \
@@ -519,7 +509,13 @@ GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_ascii.cpp \
        sci_gateway/cpp/sci_strcat.cpp \
        sci_gateway/cpp/sci_string.cpp \
-       sci_gateway/cpp/sci_convstr.cpp
+       sci_gateway/cpp/sci_convstr.cpp \
+    sci_gateway/cpp/sci_strncpy.cpp \
+    sci_gateway/cpp/sci_strrchr.cpp \
+    sci_gateway/cpp/sci_strchr.cpp \
+    sci_gateway/cpp/sci_strstr.cpp \
+    sci_gateway/cpp/sci_strrev.cpp \
+    sci_gateway/cpp/sci_strtod.cpp 
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_string.f \
 sci_gateway/fortran/strops.f
@@ -746,7 +742,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-setScilabCharactersCodes.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-strcatfunction.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@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stringsstrrev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-stripblanks.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-strsplitfunction.Plo@am__quote@
@@ -754,7 +749,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_algo_la-tokens.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-gw_string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_ascii.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_code2str.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_convstr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_grep.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_isalphanum.Plo@am__quote@
@@ -764,7 +758,6 @@ distclean-compile:
 @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@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_str2code.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strcat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strchr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strcmp.Plo@am__quote@
@@ -773,6 +766,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_string.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_stripblanks.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strncpy.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strrchr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strrev.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strsplit.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscistring_la-sci_strspn.Plo@am__quote@
@@ -916,13 +910,6 @@ libscistring_algo_la-strsubst.lo: src/c/strsubst.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) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-strsubst.lo `test -f 'src/c/strsubst.c' || echo '$(srcdir)/'`src/c/strsubst.c
 
-libscistring_algo_la-stringsstrrchr.lo: src/c/stringsstrrchr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -MT libscistring_algo_la-stringsstrrchr.lo -MD -MP -MF $(DEPDIR)/libscistring_algo_la-stringsstrrchr.Tpo -c -o libscistring_algo_la-stringsstrrchr.lo `test -f 'src/c/stringsstrrchr.c' || echo '$(srcdir)/'`src/c/stringsstrrchr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_algo_la-stringsstrrchr.Tpo $(DEPDIR)/libscistring_algo_la-stringsstrrchr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/stringsstrrchr.c' object='libscistring_algo_la-stringsstrrchr.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) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -c -o libscistring_algo_la-stringsstrrchr.lo `test -f 'src/c/stringsstrrchr.c' || echo '$(srcdir)/'`src/c/stringsstrrchr.c
-
 libscistring_algo_la-stringsstrrev.lo: src/c/stringsstrrev.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_algo_la_CFLAGS) $(CFLAGS) -MT libscistring_algo_la-stringsstrrev.lo -MD -MP -MF $(DEPDIR)/libscistring_algo_la-stringsstrrev.Tpo -c -o libscistring_algo_la-stringsstrrev.lo `test -f 'src/c/stringsstrrev.c' || echo '$(srcdir)/'`src/c/stringsstrrev.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_algo_la-stringsstrrev.Tpo $(DEPDIR)/libscistring_algo_la-stringsstrrev.Plo
@@ -972,20 +959,6 @@ libscistring_la-gw_string.lo: sci_gateway/c/gw_string.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-gw_string.lo `test -f 'sci_gateway/c/gw_string.c' || echo '$(srcdir)/'`sci_gateway/c/gw_string.c
 
-libscistring_la-sci_code2str.lo: sci_gateway/c/sci_code2str.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_code2str.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_code2str.Tpo -c -o libscistring_la-sci_code2str.lo `test -f 'sci_gateway/c/sci_code2str.c' || echo '$(srcdir)/'`sci_gateway/c/sci_code2str.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_code2str.Tpo $(DEPDIR)/libscistring_la-sci_code2str.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_code2str.c' object='libscistring_la-sci_code2str.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_code2str.lo `test -f 'sci_gateway/c/sci_code2str.c' || echo '$(srcdir)/'`sci_gateway/c/sci_code2str.c
-
-libscistring_la-sci_str2code.lo: sci_gateway/c/sci_str2code.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_str2code.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_str2code.Tpo -c -o libscistring_la-sci_str2code.lo `test -f 'sci_gateway/c/sci_str2code.c' || echo '$(srcdir)/'`sci_gateway/c/sci_str2code.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_str2code.Tpo $(DEPDIR)/libscistring_la-sci_str2code.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_str2code.c' object='libscistring_la-sci_str2code.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_str2code.lo `test -f 'sci_gateway/c/sci_str2code.c' || echo '$(srcdir)/'`sci_gateway/c/sci_str2code.c
-
 libscistring_la-sci_strsplit.lo: sci_gateway/c/sci_strsplit.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strsplit.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strsplit.Tpo -c -o libscistring_la-sci_strsplit.lo `test -f 'sci_gateway/c/sci_strsplit.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strsplit.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strsplit.Tpo $(DEPDIR)/libscistring_la-sci_strsplit.Plo
@@ -1035,13 +1008,6 @@ libscistring_la-sci_isascii.lo: sci_gateway/c/sci_isascii.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_isascii.lo `test -f 'sci_gateway/c/sci_isascii.c' || echo '$(srcdir)/'`sci_gateway/c/sci_isascii.c
 
-libscistring_la-sci_strchr.lo: sci_gateway/c/sci_strchr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strchr.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strchr.Tpo -c -o libscistring_la-sci_strchr.lo `test -f 'sci_gateway/c/sci_strchr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strchr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strchr.Tpo $(DEPDIR)/libscistring_la-sci_strchr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_strchr.c' object='libscistring_la-sci_strchr.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strchr.lo `test -f 'sci_gateway/c/sci_strchr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strchr.c
-
 libscistring_la-sci_strcspn.lo: sci_gateway/c/sci_strcspn.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strcspn.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strcspn.Tpo -c -o libscistring_la-sci_strcspn.lo `test -f 'sci_gateway/c/sci_strcspn.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strcspn.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strcspn.Tpo $(DEPDIR)/libscistring_la-sci_strcspn.Plo
@@ -1049,20 +1015,6 @@ libscistring_la-sci_strcspn.lo: sci_gateway/c/sci_strcspn.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strcspn.lo `test -f 'sci_gateway/c/sci_strcspn.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strcspn.c
 
-libscistring_la-sci_strncpy.lo: sci_gateway/c/sci_strncpy.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strncpy.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strncpy.Tpo -c -o libscistring_la-sci_strncpy.lo `test -f 'sci_gateway/c/sci_strncpy.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strncpy.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strncpy.Tpo $(DEPDIR)/libscistring_la-sci_strncpy.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_strncpy.c' object='libscistring_la-sci_strncpy.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strncpy.lo `test -f 'sci_gateway/c/sci_strncpy.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strncpy.c
-
-libscistring_la-sci_strrev.lo: sci_gateway/c/sci_strrev.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strrev.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strrev.Tpo -c -o libscistring_la-sci_strrev.lo `test -f 'sci_gateway/c/sci_strrev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strrev.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strrev.Tpo $(DEPDIR)/libscistring_la-sci_strrev.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_strrev.c' object='libscistring_la-sci_strrev.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strrev.lo `test -f 'sci_gateway/c/sci_strrev.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strrev.c
-
 libscistring_la-sci_strspn.lo: sci_gateway/c/sci_strspn.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strspn.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strspn.Tpo -c -o libscistring_la-sci_strspn.lo `test -f 'sci_gateway/c/sci_strspn.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strspn.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strspn.Tpo $(DEPDIR)/libscistring_la-sci_strspn.Plo
@@ -1070,20 +1022,6 @@ libscistring_la-sci_strspn.lo: sci_gateway/c/sci_strspn.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strspn.lo `test -f 'sci_gateway/c/sci_strspn.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strspn.c
 
-libscistring_la-sci_strstr.lo: sci_gateway/c/sci_strstr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strstr.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strstr.Tpo -c -o libscistring_la-sci_strstr.lo `test -f 'sci_gateway/c/sci_strstr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strstr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strstr.Tpo $(DEPDIR)/libscistring_la-sci_strstr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_strstr.c' object='libscistring_la-sci_strstr.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strstr.lo `test -f 'sci_gateway/c/sci_strstr.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strstr.c
-
-libscistring_la-sci_strtod.lo: sci_gateway/c/sci_strtod.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strtod.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strtod.Tpo -c -o libscistring_la-sci_strtod.lo `test -f 'sci_gateway/c/sci_strtod.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strtod.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strtod.Tpo $(DEPDIR)/libscistring_la-sci_strtod.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_strtod.c' object='libscistring_la-sci_strtod.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) $(libscistring_la_CFLAGS) $(CFLAGS) -c -o libscistring_la-sci_strtod.lo `test -f 'sci_gateway/c/sci_strtod.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strtod.c
-
 libscistring_la-sci_strtok.lo: sci_gateway/c/sci_strtok.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(libscistring_la_CFLAGS) $(CFLAGS) -MT libscistring_la-sci_strtok.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strtok.Tpo -c -o libscistring_la-sci_strtok.lo `test -f 'sci_gateway/c/sci_strtok.c' || echo '$(srcdir)/'`sci_gateway/c/sci_strtok.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscistring_la-sci_strtok.Tpo $(DEPDIR)/libscistring_la-sci_strtok.Plo
@@ -1203,6 +1141,48 @@ libscistring_la-sci_convstr.lo: sci_gateway/cpp/sci_convstr.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_convstr.lo `test -f 'sci_gateway/cpp/sci_convstr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_convstr.cpp
 
+libscistring_la-sci_strncpy.lo: sci_gateway/cpp/sci_strncpy.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strncpy.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strncpy.Tpo -c -o libscistring_la-sci_strncpy.lo `test -f 'sci_gateway/cpp/sci_strncpy.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strncpy.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strncpy.Tpo $(DEPDIR)/libscistring_la-sci_strncpy.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strncpy.cpp' object='libscistring_la-sci_strncpy.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strncpy.lo `test -f 'sci_gateway/cpp/sci_strncpy.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strncpy.cpp
+
+libscistring_la-sci_strrchr.lo: sci_gateway/cpp/sci_strrchr.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strrchr.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strrchr.Tpo -c -o libscistring_la-sci_strrchr.lo `test -f 'sci_gateway/cpp/sci_strrchr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strrchr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strrchr.Tpo $(DEPDIR)/libscistring_la-sci_strrchr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strrchr.cpp' object='libscistring_la-sci_strrchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strrchr.lo `test -f 'sci_gateway/cpp/sci_strrchr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strrchr.cpp
+
+libscistring_la-sci_strchr.lo: sci_gateway/cpp/sci_strchr.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strchr.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strchr.Tpo -c -o libscistring_la-sci_strchr.lo `test -f 'sci_gateway/cpp/sci_strchr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strchr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strchr.Tpo $(DEPDIR)/libscistring_la-sci_strchr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strchr.cpp' object='libscistring_la-sci_strchr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strchr.lo `test -f 'sci_gateway/cpp/sci_strchr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strchr.cpp
+
+libscistring_la-sci_strstr.lo: sci_gateway/cpp/sci_strstr.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strstr.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strstr.Tpo -c -o libscistring_la-sci_strstr.lo `test -f 'sci_gateway/cpp/sci_strstr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strstr.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strstr.Tpo $(DEPDIR)/libscistring_la-sci_strstr.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strstr.cpp' object='libscistring_la-sci_strstr.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strstr.lo `test -f 'sci_gateway/cpp/sci_strstr.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strstr.cpp
+
+libscistring_la-sci_strrev.lo: sci_gateway/cpp/sci_strrev.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strrev.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strrev.Tpo -c -o libscistring_la-sci_strrev.lo `test -f 'sci_gateway/cpp/sci_strrev.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strrev.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strrev.Tpo $(DEPDIR)/libscistring_la-sci_strrev.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strrev.cpp' object='libscistring_la-sci_strrev.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strrev.lo `test -f 'sci_gateway/cpp/sci_strrev.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strrev.cpp
+
+libscistring_la-sci_strtod.lo: sci_gateway/cpp/sci_strtod.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscistring_la-sci_strtod.lo -MD -MP -MF $(DEPDIR)/libscistring_la-sci_strtod.Tpo -c -o libscistring_la-sci_strtod.lo `test -f 'sci_gateway/cpp/sci_strtod.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strtod.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscistring_la-sci_strtod.Tpo $(DEPDIR)/libscistring_la-sci_strtod.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_strtod.cpp' object='libscistring_la-sci_strtod.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscistring_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscistring_la-sci_strtod.lo `test -f 'sci_gateway/cpp/sci_strtod.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_strtod.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
index 8b5e4ac..ffcd49d 100644 (file)
@@ -23,18 +23,17 @@ STRING_IMPEXP int gw_string(void);
 //STRING_IMPEXP int sci_length(char *fname,unsigned long fname_len); -> C++
 //STRING_IMPEXP int sci_string(char *fname,unsigned long fname_len); -> C++
 //STRING_IMPEXP int sci_convstr(char *fname,unsigned long fname_len); -> C++
-STRING_IMPEXP int sci_str2code(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_tokens(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_strcspn(char *fname,unsigned long fname_len);
-STRING_IMPEXP int sci_strncpy(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_strstr(char *fname,unsigned long fname_len); 
+//STRING_IMPEXP int sci_strrev(char *fname,unsigned long fname_len); -> C++
 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_strtod(char *fname,unsigned long fname_len); 
 //STRING_IMPEXP int sci_NumTokens(char *fname,unsigned long fname_len);
 
 //YaSp
@@ -42,7 +41,7 @@ STRING_IMPEXP int sci_strsplit(char *fname, int* _piKey);
 STRING_IMPEXP int sci_isdigit(char *fname, int* _piKey);
 STRING_IMPEXP int sci_isalphanum(char *fname, int* _piKey);
 STRING_IMPEXP int sci_isascii(char *fname, int* _piKey);
-STRING_IMPEXP int sci_strchr(char *fname, int* _piKey);
+//STRING_IMPEXP int sci_strchr(char *fname, int* _piKey); 
 /*--------------------------------------------------------------------------*/
 #endif /*  __GW_STRING__ */
 /*--------------------------------------------------------------------------*/
index 8f62d49..a6bf426 100644 (file)
@@ -39,6 +39,11 @@ CPP_GATEWAY_PROTOTYPE(sci_ascii);
 CPP_GATEWAY_PROTOTYPE(sci_strcat);
 CPP_GATEWAY_PROTOTYPE(sci_string);
 CPP_GATEWAY_PROTOTYPE(sci_convstr);
-
-
+CPP_GATEWAY_PROTOTYPE(sci_strncpy);
+CPP_GATEWAY_PROTOTYPE(sci_str2code);
+CPP_GATEWAY_PROTOTYPE(sci_strchr);
+CPP_GATEWAY_PROTOTYPE(sci_strrchr);
+CPP_GATEWAY_PROTOTYPE(sci_strstr);
+CPP_GATEWAY_PROTOTYPE(sci_strrev);
+CPP_GATEWAY_PROTOTYPE(sci_strtod);
 #endif /* !__STRING_GW_HXX__ */
index e970d96..6ae2783 100644 (file)
@@ -24,30 +24,30 @@ static gw_generic_table Tab[] =
        {NULL,""}, //string
        {NULL,""}, //convstr
        {NULL, ""}, //emptystr
-       {sci_str2code,"str2code"},
-       {sci_code2str,"code2str"},
+       {NULL,""}, //str2code
+       {sci_code2str,"code2str"}, //5
        {NULL ,""}, //strcat
        {NULL, ""}, //strindex
        {NULL, ""}, //strsubst
        {NULL, ""}, //ascii
        {NULL, ""}, //grep
-       {sci_tokens,"tokens"},
+       {sci_tokens,"tokens"}, //2
        {NULL, ""}, //strsplit
        {NULL, ""}, //stripblank
-       {sci_strcmp,"strcmp"},
-       {sci_isletter,"isletter"},
+       {sci_strcmp,"strcmp"}, //3
+       {sci_isletter,"isletter"}, //4
        {NULL, ""}, //isdigit
        {NULL ,""}, //isalphanum
        {NULL, ""}, //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_strcspn,"strcspn"}, //4
+       {NULL, ""}, //strncpy
+       {NULL,""}, //1 strrchr
+       {NULL,""}, //1 strchr
+       {NULL,""}, //1 strstr
+       {NULL,""}, //1 strrev
+       {sci_strtok,"strtok"}, //2
+       {sci_strspn,"strspn"}, //4
+       {NULL,""}, //1 strtod
        {NULL, ""} //regexp
 };
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/sci_gateway/c/sci_strchr.c b/scilab/modules/string/sci_gateway/c/sci_strchr.c
deleted file mode 100644 (file)
index 6b0aa39..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "gw_string.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "freeArrayOfString.h"
-#include "stringsstrrchr.h"
-/*----------------------------------------------------------------------------*/
-static wchar_t **getInputArgumentAsMatrixOfWideString( int *_piKey, int _iVar,
-                                       const char *fname,
-                                       int *m, int *n, int *iErr);
-/*----------------------------------------------------------------------------*/
-int sci_strchr(char *fname, int *_piKey)
-{
-    SciErr sciErr;
-    int iErr = 0;
-
-    wchar_t **pStrVarOne = NULL;
-    int m1 = 0; int n1 = 0;
-
-    wchar_t **pStrVarTwo = NULL;
-    int m2 = 0; int n2 = 0;
-
-    int i = 0;
-    BOOL do_strchr = (strcmp(fname, "strchr") == 0);
-
-    wchar_t **wcOutput_Strings = NULL;
-
-    pStrVarOne = getInputArgumentAsMatrixOfWideString(_piKey, 1, fname, &m1, &n1, &iErr);
-    if (iErr) return 0;
-
-    pStrVarTwo = getInputArgumentAsMatrixOfWideString(_piKey, 2, fname, &m2, &n2, &iErr);
-    if (iErr)
-    {
-        if (pStrVarOne) {freeAllocatedMatrixOfWideString(m1, n1, pStrVarOne); pStrVarOne = NULL;}
-        return 0;
-    }
-
-    for (i = 0; i < m2 * n2; i++)
-    {
-               if (wcslen(pStrVarTwo[i]) != 1)
-        {
-            if (pStrVarOne) {freeAllocatedMatrixOfWideString(m1, n1, pStrVarOne); pStrVarOne = NULL;}
-            if (pStrVarTwo) {freeAllocatedMatrixOfWideString(m2, n2, pStrVarTwo); pStrVarTwo = NULL;}
-            Scierror(999, _("%s: Wrong size for input argument #%d: A character expected.\n"), fname, 2);
-            return 0;
-        }
-    }
-
-    wcOutput_Strings = strings_wcsrchr(pStrVarOne, m1 * n1, pStrVarTwo, m2 * n2, do_strchr);
-    if (pStrVarOne) {freeAllocatedMatrixOfWideString(m1, n1, pStrVarOne); pStrVarOne = NULL;}
-    if (pStrVarTwo) {freeAllocatedMatrixOfWideString(m2, n2, pStrVarTwo); pStrVarTwo = NULL;}
-
-    if (wcOutput_Strings)
-    {
-        sciErr = createMatrixOfWideString(_piKey, Rhs + 1 , m1, n1, wcOutput_Strings);
-
-        if (wcOutput_Strings) {freeAllocatedMatrixOfWideString(m1, n1, wcOutput_Strings); wcOutput_Strings = NULL;}
-
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return 0;
-        }
-
-        LhsVar(1) = Rhs+1 ;
-        PutLhsVar();
-    }
-    else
-    {
-        Scierror(999,_("%s: No more memory.\n"), fname);
-    }
-    return 0;
-}
-/*----------------------------------------------------------------------------*/
-static wchar_t **getInputArgumentAsMatrixOfWideString( int *_piKey, int _iVar,
-                                       const char *fname,
-                                       int *m, int *n, int *iErr)
-{
-    SciErr sciErr;
-    wchar_t **pStringValues = NULL;
-    int *piAddressVar = NULL;
-    int m_ = 0, n_ = 0;
-    int iType = 0;
-
-    sciErr = getVarAddressFromPosition(_piKey, _iVar, &piAddressVar);
-    if(sciErr.iErr)
-    {
-        *iErr = sciErr.iErr;
-        printError(&sciErr, 0);
-        return NULL;
-    }
-
-    sciErr = getVarType(_piKey, piAddressVar, &iType);
-    if(sciErr.iErr)
-    {
-        *iErr = sciErr.iErr;
-        printError(&sciErr, 0);
-        return NULL;
-    }
-
-    if (iType != sci_strings)
-    {
-        *iErr =  API_ERROR_INVALID_TYPE;
-        Scierror(999,_("%s: Wrong type for input argument #%d: A string expected.\n"), fname, _iVar);
-        return NULL;
-    }
-
-    *iErr = getAllocatedMatrixOfWideString(_piKey, piAddressVar, &m_, &n_, &pStringValues);
-    if (*iErr)
-    {
-        if (pStringValues) {freeAllocatedMatrixOfWideString(m_, n_, pStringValues); pStringValues = NULL;}
-        *m = 0;
-        *n = 0;
-    }
-    else
-    {
-        *m = m_;
-        *n = n_;
-    }
-
-    return pStringValues;
-}
-/*----------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/sci_gateway/c/sci_strncpy.c b/scilab/modules/string/sci_gateway/c/sci_strncpy.c
deleted file mode 100644 (file)
index 1477a33..0000000
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - 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    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*----------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "gw_string.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "freeArrayOfString.h"
-#include "charEncoding.h"
-/*----------------------------------------------------------------------------*/
-int sci_strncpy(char *fname,unsigned long fname_len)
-{
-       CheckRhs(2,2);
-       CheckLhs(0,1);
-       
-       if ( (GetType(1) == sci_strings) && (GetType(2) == sci_matrix) )
-       {
-               int m1 = 0; int n1 = 0;
-               char **InputString_Parameter1 = NULL;
-               int m1n1 = 0; /* m1 * n1 */
-               
-               int m2 = 0; int n2 = 0 ; int l2 = 0;
-               double *InputLength_Parameter2 = NULL;
-               int *InputLength_Parameter2_checked = NULL;
-               int m2n2 = 0; /* m2 * n2 */
-               
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&InputString_Parameter1);
-               m1n1 = m1 * n1;
-               
-               GetRhsVar(2,MATRIX_OF_DOUBLE_DATATYPE,&m2,&n2,&l2);
-               InputLength_Parameter2 = stk(l2);
-               m2n2 = m2 * n2;
-               
-               if (m2n2 == 0)
-               {
-                       freeArrayOfString(InputString_Parameter1,m1n1);
-                       Scierror(999,_("%s: Wrong size for input argument #%d: Non-empty matrix expected.\n"),fname,2);
-                       return 0;
-               }
-               else
-               {
-                       int j = 0;
-                       InputLength_Parameter2_checked = (int*)MALLOC(sizeof(int)*m2n2);
-                       if (InputLength_Parameter2_checked == NULL)
-                       {
-                               freeArrayOfString(InputString_Parameter1,m1n1);
-                               Scierror(999,_("%s: No more memory.\n"),fname);
-                               return 0;
-                       }
-                       
-                       if ( ((m1 == m2) && (n1 == n2)) || (m2n2 == 1) )
-                       {
-                               for(j = 0; j < m2n2;j++)
-                               {
-                                       int len = 0;
-                                       wchar_t *wcstring = to_wide_string(InputString_Parameter1[j]);
-                                       if (wcstring)
-                                       {
-                                               len = (int)wcslen(wcstring);
-                                               FREE(wcstring);
-                                               wcstring = NULL;
-                                       }
-                                       if ( len < InputLength_Parameter2[j] ) InputLength_Parameter2_checked[j] = len;
-                                       else
-                                       {
-                                               if ( InputLength_Parameter2[j] < 0 ) InputLength_Parameter2_checked[j] = 0;
-                                               else InputLength_Parameter2_checked[j] = (int)InputLength_Parameter2[j];
-                                       }
-                               }
-                       }
-               }
-               
-               if ( ((m1 == m2) && (n1 == n2)) || (m2n2 == 1) )
-               {
-                       char **OutputStrings = NULL;
-                       int i = 0;
-                       
-                       OutputStrings = (char**)MALLOC(sizeof(char*)*m1n1);
-                       if (OutputStrings == NULL)
-                       {
-                               if (InputLength_Parameter2_checked) 
-                               {
-                                       FREE(InputLength_Parameter2_checked);
-                                       InputLength_Parameter2_checked = NULL;
-                               }
-                               freeArrayOfString(InputString_Parameter1,m1n1);
-                               Scierror(999,_("%s: No more memory.\n"),fname);
-                               return 0;
-                       }
-                       
-                       for (i=0; i < m1n1 ; i++)
-                       {
-                               wchar_t *wcInput = NULL;
-                               wchar_t *wcOutput = NULL;
-
-                               int j = 0;
-                               
-                               if (m2n2 == 1) 
-                               {
-                                       j = 0; /* Input parameter two is dimension one */
-                               }
-                               else 
-                               {
-                                       j = i; /* Input parameter One & two have same dimension */
-                               }
-
-                               wcInput = to_wide_string(InputString_Parameter1[i]);
-                               wcOutput = (wchar_t*)MALLOC(sizeof(wchar_t)*(InputLength_Parameter2_checked[j]+1));
-                               if (wcInput && wcOutput)
-                               {
-                                       wcsncpy(wcOutput,wcInput,InputLength_Parameter2_checked[j]);
-                                       wcOutput[InputLength_Parameter2_checked[j]] = L'\0';
-
-                                       OutputStrings[i] = wide_string_to_UTF8(wcOutput);
-                                       FREE(wcOutput); wcOutput = NULL;
-                                       FREE(wcInput); wcInput = NULL;
-                               }
-                               else
-                               {
-                                       if (InputLength_Parameter2_checked) 
-                                       {
-                                               FREE(InputLength_Parameter2_checked);
-                                               InputLength_Parameter2_checked = NULL;
-                                       }
-                                       freeArrayOfString(InputString_Parameter1,m1n1);
-                                       freeArrayOfString(OutputStrings,i);
-                                       Scierror(999,_("%s: No more memory.\n"),fname);
-                                       return 0;
-                               }
-                       }
-                       
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,OutputStrings);
-                       freeArrayOfString(OutputStrings,m1n1);
-                       if (InputLength_Parameter2_checked) 
-                       {
-                               FREE(InputLength_Parameter2_checked);
-                               InputLength_Parameter2_checked = NULL;
-                       }
-                       
-                       LhsVar(1) = Rhs+1 ;
-                       C2F(putlhsvar)();
-               }
-               else
-               {
-                       freeArrayOfString(InputString_Parameter1,m1n1);
-                       Scierror(999,_("%s: Wrong size for input argument #%d.\n"),fname,2);
-                       return 0;
-               }
-               
-               freeArrayOfString(InputString_Parameter1,m1n1);
-       }
-       else
-       {
-               if(GetType(1) != sci_strings)
-               {
-                       Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of strings expected.\n"),fname,1);
-               }
-               else
-               {
-                       Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of integers expected.\n"),fname,2);
-               }
-       }
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/sci_gateway/c/sci_strrev.c b/scilab/modules/string/sci_gateway/c/sci_strrev.c
deleted file mode 100644 (file)
index 0c3aed3..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - 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
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*----------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "gw_string.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "freeArrayOfString.h"
-#include "stringsstrrev.h"
-/*----------------------------------------------------------------------------*/
-int sci_strrev(char *fname,unsigned long fname_len)
-{
-       CheckRhs(1,1);
-       CheckLhs(0,1);
-
-       if (GetType(1) == sci_strings)
-       {
-               int m1 = 0; int n1 = 0;
-               char **InputStrings = NULL;
-               int m1n1 = 0; /* m1 * n1 */
-
-               char **OutputStrings = NULL;
-
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&InputStrings);
-               m1n1 = m1 * n1;
-
-               OutputStrings = strings_strrev(InputStrings,m1n1);
-
-               if (OutputStrings)
-               {
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,OutputStrings);
-                       LhsVar(1) = Rhs+1 ;
-                       C2F(putlhsvar)();
-                       freeArrayOfString(InputStrings,m1n1);
-                       freeArrayOfString(OutputStrings,m1n1);
-               }
-               else
-               {
-                       freeArrayOfString(InputStrings,m1n1);
-                       Scierror(999,_("%s: No more memory.\n"),fname);
-                       return 0;
-               }
-       }
-       else
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of strings expected.\n"),fname,1);
-       }
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/sci_gateway/c/sci_strstr.c b/scilab/modules/string/sci_gateway/c/sci_strstr.c
deleted file mode 100644 (file)
index 7f28825..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * Copyright (C) DIGITEO - 2010 - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*----------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "gw_string.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "freeArrayOfString.h"
-#include "os_strdup.h"
-/*----------------------------------------------------------------------------*/
-int sci_strstr(char *fname,unsigned long fname_len)
-{
-    CheckRhs(2,2);
-    CheckLhs(0,1);
-
-    if ( (GetType(1) == sci_strings) && (GetType(2) == sci_strings) )
-    {
-        int m1 = 0; int n1 = 0;
-        char **InputString_Parameter1 = NULL;
-        int m1n1 = 0; /* m1 * n1 */
-
-        int m2 = 0; int n2 = 0 ;
-        char **InputString_Parameter2 = NULL;
-        int m2n2 = 0; /* m2 * n2 */
-
-        GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&InputString_Parameter1);
-        m1n1 = m1 * n1;
-
-        GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&m2,&n2,&InputString_Parameter2);
-        m2n2 = m2 * n2;
-
-        if (m2n2 == 0)
-        {
-            freeArrayOfString(InputString_Parameter1,m1n1);
-            freeArrayOfString(InputString_Parameter2,m2n2);
-            Scierror(999,_("%s: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),fname,2);
-            return 0;
-        }
-        else
-        {
-            int j = 0;
-            if ( ((m1 == m2) && (n1 == n2)) || (m2n2 == 1) )
-            {
-                char **OutputStrings = NULL;
-
-                OutputStrings = (char**)CALLOC(m1n1, sizeof(char*));
-                if (OutputStrings == NULL)
-                {
-                    freeArrayOfString(InputString_Parameter1,m1n1);
-                    freeArrayOfString(InputString_Parameter2,m2n2);
-                    Scierror(999,_("%s: No more memory.\n"),fname);
-                    return 0;
-                }
-
-                for (j = 0;j < m1n1; j++)
-                {
-                    int i = 0;
-
-                    if (m2n2 == 1)
-                    {
-                        i = 0; /* Second input argument is one dimensional */
-                    }
-                    else
-                    {
-                        i = j; /* First and second input arguments have same size */
-                    }
-
-                    if (strlen(InputString_Parameter1[j])< strlen(InputString_Parameter2[i]))
-                    {
-                        OutputStrings[j] = os_strdup("");
-                        if (OutputStrings[j] == NULL)
-                        {
-                            freeArrayOfString(OutputStrings,m1n1);
-                            freeArrayOfString(InputString_Parameter1,m1n1);
-                            freeArrayOfString(InputString_Parameter2,m2n2);
-                            Scierror(999,_("%s: No more memory.\n"),fname);
-                            return 0;
-                        }
-                    }
-                    else
-                    {
-                        char *ptrstrstr = strstr(InputString_Parameter1[j],InputString_Parameter2[i]);
-                        if (ptrstrstr)
-                        {
-                            OutputStrings[j] = os_strdup(ptrstrstr);
-                            if (OutputStrings[j] == NULL)
-                            {
-                                freeArrayOfString(OutputStrings,m1n1);
-                                freeArrayOfString(InputString_Parameter1,m1n1);
-                                freeArrayOfString(InputString_Parameter2,m2n2);
-                                Scierror(999,_("%s: No more memory.\n"),fname);
-                                return 0;
-                            }
-                        }
-                        else
-                        {
-                            OutputStrings[j] = os_strdup("");
-                            if (OutputStrings[j] == NULL)
-                            {
-                                freeArrayOfString(OutputStrings,m1n1);
-                                freeArrayOfString(InputString_Parameter1,m1n1);
-                                freeArrayOfString(InputString_Parameter2,m2n2);
-                                Scierror(999,_("%s: No more memory.\n"),fname);
-                                return 0;
-                            }
-                        }
-                    }
-                }
-
-                CreateVarFromPtr(Rhs+1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,OutputStrings);
-                LhsVar(1) = Rhs+1 ;
-                C2F(putlhsvar)();
-
-                freeArrayOfString(OutputStrings,m1n1);
-                freeArrayOfString(InputString_Parameter1,m1n1);
-                freeArrayOfString(InputString_Parameter2,m2n2);
-            }
-            else
-            {
-                freeArrayOfString(InputString_Parameter1,m1n1);
-                freeArrayOfString(InputString_Parameter2,m2n2);
-                Scierror(999,_("%s: Wrong size for input argument #%d.\n"),fname,2);
-                return 0;
-            }
-        }
-    }
-    else
-    {
-        if(GetType(1) != sci_strings)
-        {
-            Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of strings expected.\n"),fname,1);
-        }
-        else
-        {
-            Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of strings expected.\n"),fname,2);
-        }
-    }
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-
diff --git a/scilab/modules/string/sci_gateway/c/sci_strtod.c b/scilab/modules/string/sci_gateway/c/sci_strtod.c
deleted file mode 100644 (file)
index c1b0e45..0000000
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*----------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "gw_string.h"
-#include "stack-c.h"
-#include "MALLOC.h"
-#include "Scierror.h"
-#include "localization.h"
-#include "freeArrayOfString.h"
-#include "stringsstrrchr.h"
-/*----------------------------------------------------------------------------*/
-int sci_strtod(char *fname,unsigned long fname_len)
-{
-       CheckRhs(1,1);
-       CheckLhs(1,2);
-
-       if (GetType(1) == sci_strings)
-       {
-               int m1 = 0, n1 = 0;
-               char **Input_StringMatrix_1 = NULL;
-               int m1n1 = 0;
-
-               int x = 0;
-
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&Input_StringMatrix_1);
-               m1n1 = m1 * n1 ;
-
-               if (Lhs == 2)
-               {
-                       double *OutputDoubles = NULL;
-                       char **OutputStrings = NULL;
-
-                       OutputStrings = (char **)MALLOC(sizeof(char*)*m1n1);
-                       if (OutputStrings == NULL)
-                       {
-                               freeArrayOfString(Input_StringMatrix_1,m1n1);
-                               Scierror(999,_("%s: No more memory.\n"),fname);
-                               return 0;
-                       }
-
-                       OutputDoubles = (double*)MALLOC(sizeof(double)*m1n1);
-                       if (OutputDoubles == NULL)
-                       {
-                               FREE(OutputStrings); OutputStrings = NULL;
-                               freeArrayOfString(Input_StringMatrix_1,m1n1);
-                               Scierror(999,_("%s: No more memory.\n"),fname);
-                               return 0;
-                       }
-
-                       for ( x = 0 ; x < m1n1 ; x++ )
-                       {
-                               char *stopstring = NULL;
-                               OutputDoubles[x] = (double)strtod( Input_StringMatrix_1[x], &stopstring);
-
-                               if (stopstring) OutputStrings[x] = (char*)MALLOC(sizeof(char)*(strlen(stopstring)+1));
-                               else OutputStrings[x] = (char*)MALLOC(sizeof(char)*(strlen("")+1));
-
-                               if (OutputStrings[x] == NULL)
-                               {
-                                       freeArrayOfString(Input_StringMatrix_1,m1n1);
-                                       freeArrayOfString(OutputStrings,m1n1);
-                                       if (OutputDoubles) {FREE(OutputDoubles); OutputDoubles = NULL;}
-                                       Scierror(999,_("%s: No more memory.\n"),fname);
-                                       return 0;
-                               }
-
-                               if (stopstring) strcpy(OutputStrings[x],stopstring);
-                               else strcpy(OutputStrings[x],"");
-                       }
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&OutputDoubles);
-                       CreateVarFromPtr(Rhs+2,MATRIX_OF_STRING_DATATYPE,&m1,&n1,OutputStrings);
-
-                       LhsVar(1) = Rhs+1 ;
-                       LhsVar(2) = Rhs+2 ;
-
-                       freeArrayOfString(OutputStrings,m1n1);
-                       if (OutputDoubles) {FREE(OutputDoubles); OutputDoubles = NULL;}
-               }
-               else /* Lhs == 1 */
-               {
-                       int outIndex = 0;
-                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&outIndex);
-                       for ( x = 0 ; x < m1n1 ; x++ )
-                       {
-                               char  *stopstring = NULL;
-                               stk(outIndex)[x] = (double)strtod( Input_StringMatrix_1[x], &stopstring);
-                       
-                       }
-                       LhsVar(1) = Rhs+1 ;
-               }
-
-               freeArrayOfString(Input_StringMatrix_1,m1n1);
-               C2F(putlhsvar)();
-       }
-       else
-       {
-               Scierror(999,_("%s: Wrong type for input argument #%d: Matrix of strings or empty matrix expected.\n"),fname,1);
-       }
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strchr.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strchr.cpp
new file mode 100644 (file)
index 0000000..82a20cf
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "os_wcsdup.h"
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+
+types::Function::ReturnValue sci_strchr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pOutString   = NULL;
+    types::String* pString      = NULL;
+    types::String* pCharSample  = NULL;
+       
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strchr", 2);
+        return types::Function::Error;
+    }    
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"strchr", 1);
+        return types::Function::Error;
+    }
+       if(in[0]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strchr", 1);
+               return types::Function::Error;
+       }
+       if(in[1]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strchr", 2);
+               return types::Function::Error;
+       }
+
+    pString      = in[0]->getAs<types::String>();
+    pCharSample  = in[1]->getAs<types::String>();
+
+    if(pString->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strchr",1);
+        return types::Function::Error;
+    }
+
+    if(pCharSample->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strchr",2);
+        return types::Function::Error;
+    }
+    
+    if(pString->getSize() != pCharSample->getSize() && pCharSample->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d.\n"),L"strchr", 2);
+        return types::Function::Error;
+    }
+    
+    pOutString  = new types::String(pString->getDims(), pString->getDimsArray());
+
+    int j = 0; /* Input parameter two is dimension one */
+    for(int i=0 ; i < pString->getSize() ; i++)
+    {
+        if(pCharSample->isScalar() == false) 
+        {
+            j = i; /* Input parameter One & two have same dimension */
+        }
+        int iLen = wcslen(pCharSample->get(j));
+        if(iLen != 1)
+        {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: Char(s) expected.\n"),L"strchr", 2);
+               delete pOutString;
+            return types::Function::Error;
+        }
+        
+        if(wcslen(pString->get(i)) < wcslen(pCharSample->get(j)))
+        {
+            pOutString->set(i,os_wcsdup(L""));
+        }
+        else
+        {
+               wchar_t* ptrwstrstr = wcschr(pString->get(i),pCharSample->get(j)[0]);
+
+            if (ptrwstrstr)
+            {
+                pOutString->set(i,os_wcsdup(ptrwstrstr));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strchr");
+                    return types::Function::Error;
+                }
+            }
+            else
+            {
+                pOutString->set(i,os_wcsdup(L""));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strchr");
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+    
+    out.push_back(pOutString);
+    return types::Function::OK;
+}
+
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strncpy.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strncpy.cpp
new file mode 100644 (file)
index 0000000..5aa690d
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+
+types::Function::ReturnValue sci_strncpy(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pString      = NULL;
+    types::Double* pDouble      = NULL;
+    types::String* pOutString   = NULL;
+    
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strncpy", 2);
+        return types::Function::Error;
+    }    
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"strncpy", 1);
+        return types::Function::Error;
+    }    
+       if(in[0]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: Matrix of strings expected.\n"),L"strncpy", 1);
+               return types::Function::Error;
+       }
+
+       if(in[1]->isDouble() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: Matrix of integers expected.\n"),L"strncpy", 2);
+        return types::Function::Error;
+       }
+
+    pString = in[0]->getAs<types::String>();
+    pDouble = in[1]->getAs<types::Double>();
+    
+    if(pDouble->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix expected.\n"), L"strncpy",2);
+        return types::Function::Error;
+    }
+    
+    //same dimension or 2nd arg scalar
+    if(pString->getSize() != pDouble->getSize() && pDouble->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d.\n"),L"strncpy", 2);
+        return types::Function::Error;
+    }
+    
+    pOutString  = new types::String(pString->getDims(), pString->getDimsArray());
+    
+    int j = 0; /* Input parameter two is dimension one */
+    for(int i=0 ; i < pString->getSize() ; i++)
+    {
+        wchar_t *wcOutput   = NULL;
+               int sizeOfCopy      = 0;
+        
+        if(pDouble->isScalar() == false) 
+        {
+            j = i; /* Input parameter One & two have same dimension */
+        }
+
+        if(pDouble->get(j) < wcslen(pString->get(i)))
+        {
+            int iLen = pDouble->get(j);
+            if(iLen < 0)
+            {
+                iLen = 0;
+            }
+            
+            wcOutput = (wchar_t*)MALLOC(sizeof(wchar_t) * (iLen + 1));
+            sizeOfCopy = iLen;
+        }
+        else
+        {
+            int iLen = wcslen(pString->get(i));
+            wcOutput = (wchar_t*)MALLOC(sizeof(wchar_t) * (iLen + 1));
+            sizeOfCopy = iLen;
+        }
+               
+               if(wcOutput)
+               {
+                       wcsncpy(wcOutput, pString->get(i), sizeOfCopy);
+                       wcOutput[sizeOfCopy] = L'\0';
+
+                       pOutString->set(i, wcOutput);
+                       FREE(wcOutput);
+                       wcOutput = NULL;
+               }
+               else
+               {
+            delete pOutString;
+                       ScierrorW(999, _W("%ls: No more memory.\n"),L"strncpy");
+                       return types::Function::Error;
+               }
+    }
+    
+    out.push_back(pOutString);
+    return types::Function::OK;
+}
+
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strrchr.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strrchr.cpp
new file mode 100644 (file)
index 0000000..bf93e86
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "os_wcsdup.h"
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+
+types::Function::ReturnValue sci_strrchr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pOutString   = NULL;
+    types::String* pString      = NULL;
+    types::String* pCharSample  = NULL;
+       
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strrchr", 2);
+        return types::Function::Error;
+    }    
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"strrchr", 1);
+        return types::Function::Error;
+    }
+       if(in[0]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strrchr", 1);
+               return types::Function::Error;
+       }
+       if(in[1]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strrchr", 2);
+               return types::Function::Error;
+       }
+
+    pString      = in[0]->getAs<types::String>();
+    pCharSample  = in[1]->getAs<types::String>();
+
+    if(pString->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strrchr",1);
+        return types::Function::Error;
+    }
+
+    if(pCharSample->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strrchr",2);
+        return types::Function::Error;
+    }
+    
+    if(pString->getSize() != pCharSample->getSize() && pCharSample->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d.\n"),L"strrchr", 2);
+        return types::Function::Error;
+    }
+    
+    pOutString  = new types::String(pString->getDims(), pString->getDimsArray());
+
+    int j = 0; /* Input parameter two is dimension one */
+    for(int i=0 ; i < pString->getSize() ; i++)
+    {
+        if(pCharSample->isScalar() == false) 
+        {
+            j = i; /* Input parameter One & two have same dimension */
+        }
+        int iLen = wcslen(pCharSample->get(j));
+        if(iLen != 1)
+        {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: Char(s) expected.\n"),L"strrchr", 2);
+               delete pOutString;
+            return types::Function::Error;
+        }
+        
+        if(wcslen(pString->get(i)) < wcslen(pCharSample->get(j)))
+        {
+            pOutString->set(i,os_wcsdup(L""));
+        }
+        else
+        {
+               wchar_t* ptrwstrstr = wcsrchr(pString->get(i),pCharSample->get(j)[0]);
+
+            if (ptrwstrstr)
+            {
+                pOutString->set(i,os_wcsdup(ptrwstrstr));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strrchr");
+                    return types::Function::Error;
+                }
+            }
+            else
+            {
+                pOutString->set(i,os_wcsdup(L""));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strrchr");
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+    
+    out.push_back(pOutString);
+    return types::Function::OK;
+}
+
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strrev.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strrev.cpp
new file mode 100644 (file)
index 0000000..1a71631
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+#include "stringsstrrev.h"
+}
+
+types::Function::ReturnValue sci_strrev(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pString      = NULL; 
+    types::String* pOutString   = NULL; 
+    wchar_t **OutputStrings     = NULL;
+    
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strrev", 1);
+        return types::Function::Error;
+    }    
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"strrev", 1);
+        return types::Function::Error;
+    }
+       if(in[0]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: Matrix of Strings expected.\n"),L"strrev", 1);
+               return types::Function::Error;
+       }
+
+    pString = in[0]->getAs<types::String>();
+   // wchar_t* pwstStr = in[0]->getAs<types::String>()->get(0);
+   
+    OutputStrings = strings_strrev(pString->get(),pString->getSize());
+    
+    pOutString = new types::String(pString->getDims(),pString->getDimsArray());
+    pOutString->set(OutputStrings);
+    
+    out.push_back(pOutString);
+    return types::Function::OK;
+}
+
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strstr.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strstr.cpp
new file mode 100644 (file)
index 0000000..3dfcc90
--- /dev/null
@@ -0,0 +1,123 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "os_wcsdup.h"
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+
+types::Function::ReturnValue sci_strstr(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pOutString   = NULL;
+    types::String* pString      = NULL;
+    types::String* pStrSample   = NULL;
+       
+    if(in.size() != 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strstr", 2);
+        return types::Function::Error;
+    }    
+    if(_iRetCount != 1)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d expected.\n"), L"strstr", 1);
+        return types::Function::Error;
+    }
+       if(in[0]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strstr", 1);
+               return types::Function::Error;
+       }
+       if(in[1]->isString() == false)
+       {
+               ScierrorW(999,_W("%ls: Wrong type for input argument #%d: String expected.\n"),L"strstr", 2);
+               return types::Function::Error;
+       }
+
+    pString     = in[0]->getAs<types::String>();
+    pStrSample  = in[1]->getAs<types::String>();
+
+    if(pString->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strstr",1);
+        return types::Function::Error;
+    }
+
+    if(pStrSample->getSize() == 0)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d: Non-empty matrix of strings expected.\n"),L"strstr",2);
+        return types::Function::Error;
+    }
+    
+    if(pString->getSize() != pStrSample->getSize() && pStrSample->isScalar() == false)
+    {
+        ScierrorW(999,_W("%ls: Wrong size for input argument #%d.\n"),L"strstr", 2);
+        return types::Function::Error;
+    }
+    
+    pOutString  = new types::String(pString->getDims(), pString->getDimsArray());
+
+    int j = 0; /* Input parameter two is dimension one */
+    for(int i=0 ; i < pString->getSize() ; i++)
+    {
+        if(pStrSample->isScalar() == false) 
+        {
+            j = i; /* Input parameter One & two have same dimension */
+        }
+
+        if(wcslen(pString->get(i)) < wcslen(pStrSample->get(j)))
+        {
+            pOutString->set(i,os_wcsdup(L""));
+        }
+        else
+        {
+               wchar_t* ptrwstrstr = wcsstr(pString->get(i),pStrSample->get(j));
+
+            if (ptrwstrstr)
+            {
+                pOutString->set(i,os_wcsdup(ptrwstrstr));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strstr");
+                    return types::Function::Error;
+                }
+            }
+            else
+            {
+                pOutString->set(i,os_wcsdup(L""));
+                if (pOutString->get(i) == NULL)
+                {
+                    delete pOutString;
+                    FREE(ptrwstrstr);
+                    ScierrorW(999,_W("%ls: No more memory.\n"),L"strstr");
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+    
+    out.push_back(pOutString);
+    return types::Function::OK;
+}
+
diff --git a/scilab/modules/string/sci_gateway/cpp/sci_strtod.cpp b/scilab/modules/string/sci_gateway/cpp/sci_strtod.cpp
new file mode 100644 (file)
index 0000000..997bb7b
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) Digiteo 2011 - Cedric DELAMARRE
+ *
+ * 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 "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "funcmanager.hxx"
+#include "string_gw.hxx"
+
+extern "C"
+{
+#include "core_math.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+
+types::Function::ReturnValue sci_strtod(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::Double* pOutDouble = NULL;
+    types::String* pOutString = NULL;
+    types::String* pString = NULL;       
+     
+    if(in.size() != 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"strtod", 1);
+        return types::Function::Error;
+    }    
+    if(_iRetCount > 2)
+    {
+        ScierrorW(78, _W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"strtod", 1, 2);
+        return types::Function::Error;
+    }
+    
+    pString = in[0]->getAs<types::String>();
+    
+    if(_iRetCount == 2)
+    {
+        pOutDouble = new types::Double(pString->getDims(),pString->getDimsArray());
+        pOutString = new types::String(pString->getDims(),pString->getDimsArray());
+        
+        for (int i = 0 ; i < pString->getSize() ; i++)
+        {
+            wchar_t *stopstring = NULL;
+            pOutDouble->set(i,wcstod(pString->get(i),&stopstring));
+            if(stopstring)
+            {
+                pOutString->set(i,stopstring);
+            }
+            else
+            {
+                pOutString->set(i,L"");
+            }
+        }
+        
+        out.push_back(pOutDouble);
+        out.push_back(pOutString);
+    }
+    else // _iRetCount == 1
+    {
+        pOutDouble = new types::Double(pString->getDims(),pString->getDimsArray());
+
+        for (int i = 0 ; i < pString->getSize() ; i++)
+        {
+            wchar_t *stopstring = NULL;
+            pOutDouble->set(i,wcstod(pString->get(i),&stopstring));
+        }
+                
+        out.push_back(pOutDouble);
+    }
+    
+    return types::Function::OK;
+}
+
index c1f7327..54b3b4a 100644 (file)
@@ -32,5 +32,11 @@ bool StringModule::Load()
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strcat", &sci_strcat, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"string", &sci_string, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"convstr", &sci_convstr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strncpy", &sci_strncpy, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strrchr", &sci_strrchr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strchr", &sci_strchr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strstr", &sci_strstr, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strrev", &sci_strrev, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strtod", &sci_strtod, MODULE_NAME));
     return true;
 }
index a5d8c8c..d786fe2 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_strchr.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_strindex.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_strncpy.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sci_strrchr.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sci_strrev.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath=".\sci_strstr.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\sci_strsubst.cpp"
                                >
                        </File>
                        <File
+                               RelativePath=".\sci_strtod.cpp"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\string_gw.cpp"
                                >
                        </File>
index 1775f57..0b34535 100644 (file)
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_strchr.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\c\sci_strcmp.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_strncpy.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\sci_gateway\c\sci_strrev.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\c\sci_strsplit.c"
                                >
                        </File>
                                >
                        </File>
                        <File
-                               RelativePath="..\..\sci_gateway\c\sci_strstr.c"
-                               >
-                       </File>
-                       <File
-                               RelativePath="..\..\sci_gateway\c\sci_strtod.c"
-                               >
-                       </File>
-                       <File
                                RelativePath="..\..\sci_gateway\c\sci_strtok.c"
                                >
                        </File>
diff --git a/scilab/modules/string/src/c/stringsstrrchr.c b/scilab/modules/string/src/c/stringsstrrchr.c
deleted file mode 100644 (file)
index 442ad82..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * Copyright (C) DIGITEO - 2011 - 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 <stdlib.h>
-#include <stdio.h>
-#include <ctype.h>
-#include "stringsstrrchr.h"
-#include "MALLOC.h"
-#include "os_strdup.h"
-/*----------------------------------------------------------------------------*/
-wchar_t ** strings_wcsrchr(const wchar_t **InputStrings, int Dim_InputStrings,
-                           const wchar_t** InputChar, int Dim_InputChar, BOOL do_strchr)
-{
-    wchar_t **wcOutput_Strings = NULL;
-
-    if ( (InputStrings) && (InputChar) )
-    {
-        wcOutput_Strings = (wchar_t**)MALLOC(sizeof(wchar_t*)*Dim_InputStrings);
-        if (wcOutput_Strings)
-        {
-            int i = 0;
-            for(i = 0;i < Dim_InputStrings; i++)
-            {
-                int c = 0;
-                wchar_t *ptrStr = NULL;
-
-                if (Dim_InputChar == 1) c = InputChar[0][0];
-                else  c = InputChar[i][0];
-
-                if (do_strchr) ptrStr = wcschr(InputStrings[i], c);
-                else ptrStr = wcsrchr(InputStrings[i], c);
-
-                               if (ptrStr)
-                               {
-                                       wcOutput_Strings[i] = os_strdup(ptrStr);
-                               }
-                               else
-                               {
-                                       wcOutput_Strings[i] = os_strdup("");
-                               }
-                       }
-               }
-       }
-       return wcOutput_Strings;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/string/src/c/stringsstrrchr.h b/scilab/modules/string/src/c/stringsstrrchr.h
deleted file mode 100644 (file)
index 06c560f..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * Copyright (C) DIGITEO - 2011 - 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 __STRINGSTRRCHAR_H__
-#define __STRINGSTRRCHAR_H__
-
-#include "BOOL.h"
-#include "charEncoding.h"
-
-/*
-* Locate last occurrence of character in string or
-* Locate first occurrence of character in string
-* @param[in] String matrix One
-* @param[in] Dimension m*n of String matrix one
-* @param[in] String matrix Two
-* @param[in] Dimension m*n of String matrix two
-* @param[in] BOOL to do strchr (first occurrence)
-* @return a string matrix (result of strchr or strrchr)
-*/
-wchar_t ** strings_wcsrchr(const wchar_t **InputStrings, int Dim_InputStrings,
-                           const wchar_t** InputChar, int Dim_InputChar, BOOL do_strchr);
-
-#endif /* __STRINGSTRRCHAR_H__ */
-/*----------------------------------------------------------------------------*/
-
-
index 5dd0e1b..bafaddd 100644 (file)
 #include "stringsstrrev.h"
 #include "freeArrayOfString.h"
 #include "MALLOC.h"
-#include "charEncoding.h"
-#include "os_strdup.h"
+#include "os_wcsdup.h"
 /*----------------------------------------------------------------------------*/
-char **strings_strrev(char **Input_strings,int Dim_Input_strings)
+wchar_t **strings_strrev(wchar_t **Input_strings,int Dim_Input_strings)
 {
-       char **Output_strings = NULL;
+       wchar_t **Output_strings = NULL;
        if (Input_strings)
        {
-               Output_strings = (char **)MALLOC(sizeof(char*)*Dim_Input_strings);
+               Output_strings = (wchar_t **)MALLOC(sizeof(wchar_t*)*Dim_Input_strings);
                if (Output_strings)
                {
                        int i = 0;      
@@ -35,7 +34,7 @@ char **strings_strrev(char **Input_strings,int Dim_Input_strings)
                                Output_strings[i] = scistrrev(Input_strings[i]);
                                if (!Output_strings[i])
                                {
-                                       freeArrayOfString(Output_strings,i);
+                                       freeArrayOfWideString(Output_strings,i);
                                        return Output_strings;
                                }
                        }
@@ -44,36 +43,26 @@ char **strings_strrev(char **Input_strings,int Dim_Input_strings)
        return Output_strings;
 }
 /*----------------------------------------------------------------------------*/
-char* scistrrev(char* str)
+wchar_t* scistrrev(wchar_t* str)
 {
-       char *revstr = NULL;
+       wchar_t *revstr = NULL;
        if (str)
        {
-               wchar_t *wcstr = to_wide_string(str);
 #ifdef _MSC_VER
-               wchar_t *wcrevstr = _wcsrev(wcstr);
-               revstr = wide_string_to_UTF8(wcrevstr);
+               revstr = _wcsrev(os_wcsdup(str));
 #else
-               int i = 0;
-               int t = 0;
-               int j = 0, k = 0;
+               int iLen = 0;
+               int j = 0;
 
-               if (wcstr) i = (int)wcslen(wcstr);
-               t = !(i%2)? 1 : 0;      // check the length of the string .
-               
+               iLen = (int)wcslen(str);
+               revstr = (wchar_t*)MALLOC((iLen+1)*sizeof(wchar_t));
                /* copy character by character to reverse string */
-               k = 0;
-               for(j = i-1; j > (i/2 -t) ; j-- )
+               for(j=0 ; j<iLen ; j++)
                {
-                       /* j starts from end of string */
-                       /* k starts from beginning of string */
-                       wchar_t ch  = wcstr[j]; /* ch temp. character */
-                       wcstr[j]   = wcstr[k]; /* end and beginning characters are exchanged */
-                       wcstr[k++] = ch;
+            revstr[iLen-j-1] = str[j];
                }
-               revstr = wide_string_to_UTF8(wcstr);
+               revstr[iLen]='\0';
 #endif
-               if (wcstr) {FREE(wcstr); wcstr = NULL;}
        }
        return revstr;
 }
index dce7035..92e7990 100644 (file)
 #ifndef __STRINGSSTRREV_H__
 #define __STRINGSSTRREV_H__
 
-char **strings_strrev(char **Input_strings,int Dim_Input_strings);
-char* scistrrev(char* str);
+#include <wchar.h>
+#include "dynlib_string.h"
+
+STRING_IMPEXP wchar_t **strings_strrev(wchar_t **Input_strings,int Dim_Input_strings);
+wchar_t* scistrrev(wchar_t* str);
 
 #endif /* __STRINGSSTRREV_H__ */
 /*----------------------------------------------------------------------------*/