Now items in list are cloned, add setfield and getfield functions, fix qmr function 34/11434/2
Antoine ELIAS [Thu, 2 May 2013 09:43:46 +0000 (11:43 +0200)]
Change-Id: Iee7b789b78a64c9a4358b6fa5b7a9f835c78c980

25 files changed:
scilab/modules/data_structures/Makefile.am
scilab/modules/data_structures/Makefile.in
scilab/modules/data_structures/includes/data_structures_gw.hxx [new file with mode: 0644]
scilab/modules/data_structures/includes/gw_data_structures2.h
scilab/modules/data_structures/sci_gateway/c/gw_data_structures2.c
scilab/modules/data_structures/sci_gateway/c/sci_getfield.c [deleted file]
scilab/modules/data_structures/sci_gateway/cpp/data_structures_gw.cpp [new file with mode: 0644]
scilab/modules/data_structures/sci_gateway/cpp/sci_getfield.cpp [new file with mode: 0644]
scilab/modules/data_structures/sci_gateway/cpp/sci_setfield.cpp [new file with mode: 0644]
scilab/modules/data_structures/src/c/data_structures.vcxproj
scilab/modules/data_structures/src/c/data_structures.vcxproj.filters
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/sparse/tests/unit_tests/qmr.dia.ref
scilab/modules/sparse/tests/unit_tests/qmr.tst
scilab/modules/types/Makefile.am
scilab/modules/types/Makefile.in
scilab/modules/types/includes/types_gw.hxx
scilab/modules/types/sci_gateway/cpp/sci_getfield.cpp [deleted file]
scilab/modules/types/sci_gateway/cpp/types_gw.cpp
scilab/modules/types/sci_gateway/cpp/types_gw.vcxproj
scilab/modules/types/sci_gateway/cpp/types_gw.vcxproj.filters
scilab/modules/types/src/cpp/list.cpp
scilab/modules/types/src/cpp/tlist.cpp

index b9f56a1..e9e986e 100644 (file)
@@ -4,11 +4,13 @@
 # This file is distributed under the same license as the Scilab package.
 
 
-DATA_STRUCTURES_C_SOURCES = src/c/stcreate.c \
+DATA_STRUCTURES_C_SOURCES = \
+src/c/stcreate.c \
 src/c/hmops.c \
 src/c/strpos.c
 
-DATA_STRUCTURES_FORTRAN_SOURCES = src/fortran/extractfields.f \
+DATA_STRUCTURES_FORTRAN_SOURCES = \
+src/fortran/extractfields.f \
 src/fortran/forcerhs.f \
 src/fortran/lsstyp.f \
 src/fortran/udptr.f \
@@ -17,29 +19,38 @@ src/fortran/gratyp.f \
 src/fortran/mlist.f \
 src/fortran/insertfield.f
 
-GATEWAY_C_SOURCES = sci_gateway/c/sci_lsslist.c \
+GATEWAY_C_SOURCES = \
+sci_gateway/c/sci_lsslist.c \
 sci_gateway/c/sci_glist.c \
 sci_gateway/c/sci_definedfields.c \
-sci_gateway/c/sci_getfield.c \
-sci_gateway/c/sci_setfield.c \
 sci_gateway/c/sci_lstcat.c \
 sci_gateway/c/gw_data_structures1.c \
 sci_gateway/c/gw_data_structures2.c \
 sci_gateway/c/sci_lstsize.c \
 sci_gateway/c/sci_rlist.c
 
-GATEWAY_FORTRAN_SOURCES =  sci_gateway/fortran/sci_f_definedfields.f \
+GATEWAY_CPP_SOURCES = \
+sci_gateway/cpp/data_structures_gw.cpp \
+sci_gateway/cpp/sci_getfield.cpp \
+sci_gateway/cpp/sci_setfield.cpp
+
+GATEWAY_FORTRAN_SOURCES = \
+sci_gateway/fortran/sci_f_definedfields.f \
 sci_gateway/fortran/sci_f_lstsize.f \
 sci_gateway/fortran/sci_f_lstcat.f \
 sci_gateway/fortran/sci_f_list.f
 
-libscidata_structures_la_CPPFLAGS = -I$(srcdir)/includes/ \
--I$(top_srcdir)/modules/localization/includes/ \
--I$(top_srcdir)/modules/output_stream/includes/ \
+libscidata_structures_la_CPPFLAGS = \
+-I$(srcdir)/includes/ \
+-I$(top_srcdir)/modules/types/includes/ \
+-I$(top_srcdir)/modules/ast/includes/ \
+-I$(top_srcdir)/modules/symbol/includes/ \
+-I$(top_srcdir)/modules/dynamic_link/includes/ \
 -I$(top_srcdir)/modules/string/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes/ \
+-I$(top_srcdir)/modules/localization/includes/ \
 -I$(top_srcdir)/modules/api_scilab/includes/ \
 -I$(top_srcdir)/modules/operations/includes/ \
--I$(top_srcdir)/modules/string/includes/ \
 $(AM_CPPFLAGS)
 
 if MAINTAINER_MODE
@@ -51,11 +62,11 @@ endif
 
 
 libscidata_structures_algo_la_SOURCES = $(DATA_STRUCTURES_C_SOURCES) $(DATA_STRUCTURES_FORTRAN_SOURCES)
-libscidata_structures_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscidata_structures_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libscidata_structures_algo_la_CPPFLAGS = $(libscidata_structures_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC= $(DATA_STRUCTURES_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC= $(DATA_STRUCTURES_C_SOURCES) $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscidata_structures_la_CFLAGS)
 
 libscidata_structures_la_LIBADD = libscidata_structures-algo.la
index ce10795..498c337 100644 (file)
@@ -149,17 +149,18 @@ libscidata_structures_la_DEPENDENCIES = libscidata_structures-algo.la
 am__objects_3 = libscidata_structures_la-sci_lsslist.lo \
        libscidata_structures_la-sci_glist.lo \
        libscidata_structures_la-sci_definedfields.lo \
-       libscidata_structures_la-sci_getfield.lo \
-       libscidata_structures_la-sci_setfield.lo \
        libscidata_structures_la-sci_lstcat.lo \
        libscidata_structures_la-gw_data_structures1.lo \
        libscidata_structures_la-gw_data_structures2.lo \
        libscidata_structures_la-sci_lstsize.lo \
        libscidata_structures_la-sci_rlist.lo
-am__objects_4 = sci_f_definedfields.lo sci_f_lstsize.lo \
+am__objects_4 = libscidata_structures_la-data_structures_gw.lo \
+       libscidata_structures_la-sci_getfield.lo \
+       libscidata_structures_la-sci_setfield.lo
+am__objects_5 = sci_f_definedfields.lo sci_f_lstsize.lo \
        sci_f_lstcat.lo sci_f_list.lo
 am_libscidata_structures_la_OBJECTS = $(am__objects_3) \
-       $(am__objects_4)
+       $(am__objects_4) $(am__objects_5)
 libscidata_structures_la_OBJECTS =  \
        $(am_libscidata_structures_la_OBJECTS)
 @MAINTAINER_MODE_FALSE@am_libscidata_structures_la_rpath =
@@ -178,6 +179,15 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
 LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
@@ -465,11 +475,13 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-DATA_STRUCTURES_C_SOURCES = src/c/stcreate.c \
+DATA_STRUCTURES_C_SOURCES = \
+src/c/stcreate.c \
 src/c/hmops.c \
 src/c/strpos.c
 
-DATA_STRUCTURES_FORTRAN_SOURCES = src/fortran/extractfields.f \
+DATA_STRUCTURES_FORTRAN_SOURCES = \
+src/fortran/extractfields.f \
 src/fortran/forcerhs.f \
 src/fortran/lsstyp.f \
 src/fortran/udptr.f \
@@ -478,40 +490,49 @@ src/fortran/gratyp.f \
 src/fortran/mlist.f \
 src/fortran/insertfield.f
 
-GATEWAY_C_SOURCES = sci_gateway/c/sci_lsslist.c \
+GATEWAY_C_SOURCES = \
+sci_gateway/c/sci_lsslist.c \
 sci_gateway/c/sci_glist.c \
 sci_gateway/c/sci_definedfields.c \
-sci_gateway/c/sci_getfield.c \
-sci_gateway/c/sci_setfield.c \
 sci_gateway/c/sci_lstcat.c \
 sci_gateway/c/gw_data_structures1.c \
 sci_gateway/c/gw_data_structures2.c \
 sci_gateway/c/sci_lstsize.c \
 sci_gateway/c/sci_rlist.c
 
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_definedfields.f \
+GATEWAY_CPP_SOURCES = \
+sci_gateway/cpp/data_structures_gw.cpp \
+sci_gateway/cpp/sci_getfield.cpp \
+sci_gateway/cpp/sci_setfield.cpp
+
+GATEWAY_FORTRAN_SOURCES = \
+sci_gateway/fortran/sci_f_definedfields.f \
 sci_gateway/fortran/sci_f_lstsize.f \
 sci_gateway/fortran/sci_f_lstcat.f \
 sci_gateway/fortran/sci_f_list.f
 
-libscidata_structures_la_CPPFLAGS = -I$(srcdir)/includes/ \
--I$(top_srcdir)/modules/localization/includes/ \
--I$(top_srcdir)/modules/output_stream/includes/ \
+libscidata_structures_la_CPPFLAGS = \
+-I$(srcdir)/includes/ \
+-I$(top_srcdir)/modules/types/includes/ \
+-I$(top_srcdir)/modules/ast/includes/ \
+-I$(top_srcdir)/modules/symbol/includes/ \
+-I$(top_srcdir)/modules/dynamic_link/includes/ \
 -I$(top_srcdir)/modules/string/includes/ \
+-I$(top_srcdir)/modules/output_stream/includes/ \
+-I$(top_srcdir)/modules/localization/includes/ \
 -I$(top_srcdir)/modules/api_scilab/includes/ \
 -I$(top_srcdir)/modules/operations/includes/ \
--I$(top_srcdir)/modules/string/includes/ \
 $(AM_CPPFLAGS)
 
 @MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libscidata_structures.la
 @MAINTAINER_MODE_FALSE@noinst_LTLIBRARIES = libscidata_structures-algo.la libscidata_structures.la
 @MAINTAINER_MODE_TRUE@noinst_LTLIBRARIES = libscidata_structures-algo.la
 libscidata_structures_algo_la_SOURCES = $(DATA_STRUCTURES_C_SOURCES) $(DATA_STRUCTURES_FORTRAN_SOURCES)
-libscidata_structures_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
+libscidata_structures_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES) $(GATEWAY_FORTRAN_SOURCES)
 libscidata_structures_algo_la_CPPFLAGS = $(libscidata_structures_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC = $(DATA_STRUCTURES_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC = $(DATA_STRUCTURES_C_SOURCES) $(GATEWAY_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscidata_structures_la_CFLAGS)
 libscidata_structures_la_LIBADD = libscidata_structures-algo.la
 
@@ -605,7 +626,7 @@ HELP_CHAPTERLANG = en_US fr_FR pt_BR
 all: all-am
 
 .SUFFIXES:
-.SUFFIXES: .sci .bin .c .f .lo .o .obj
+.SUFFIXES: .sci .bin .c .cpp .f .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -681,7 +702,7 @@ clean-pkglibLTLIBRARIES:
 libscidata_structures-algo.la: $(libscidata_structures_algo_la_OBJECTS) $(libscidata_structures_algo_la_DEPENDENCIES) $(EXTRA_libscidata_structures_algo_la_DEPENDENCIES) 
        $(F77LINK) $(am_libscidata_structures_algo_la_rpath) $(libscidata_structures_algo_la_OBJECTS) $(libscidata_structures_algo_la_LIBADD) $(LIBS)
 libscidata_structures.la: $(libscidata_structures_la_OBJECTS) $(libscidata_structures_la_DEPENDENCIES) $(EXTRA_libscidata_structures_la_DEPENDENCIES) 
-       $(F77LINK) $(am_libscidata_structures_la_rpath) $(libscidata_structures_la_OBJECTS) $(libscidata_structures_la_LIBADD) $(LIBS)
+       $(CXXLINK) $(am_libscidata_structures_la_rpath) $(libscidata_structures_la_OBJECTS) $(libscidata_structures_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -692,6 +713,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_algo_la-hmops.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_algo_la-stcreate.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_algo_la-strpos.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_la-data_structures_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_la-gw_data_structures1.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_la-gw_data_structures2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscidata_structures_la-sci_definedfields.Plo@am__quote@
@@ -766,20 +788,6 @@ libscidata_structures_la-sci_definedfields.lo: sci_gateway/c/sci_definedfields.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscidata_structures_la-sci_definedfields.lo `test -f 'sci_gateway/c/sci_definedfields.c' || echo '$(srcdir)/'`sci_gateway/c/sci_definedfields.c
 
-libscidata_structures_la-sci_getfield.lo: sci_gateway/c/sci_getfield.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscidata_structures_la-sci_getfield.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-sci_getfield.Tpo -c -o libscidata_structures_la-sci_getfield.lo `test -f 'sci_gateway/c/sci_getfield.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getfield.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidata_structures_la-sci_getfield.Tpo $(DEPDIR)/libscidata_structures_la-sci_getfield.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_getfield.c' object='libscidata_structures_la-sci_getfield.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscidata_structures_la-sci_getfield.lo `test -f 'sci_gateway/c/sci_getfield.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getfield.c
-
-libscidata_structures_la-sci_setfield.lo: sci_gateway/c/sci_setfield.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscidata_structures_la-sci_setfield.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-sci_setfield.Tpo -c -o libscidata_structures_la-sci_setfield.lo `test -f 'sci_gateway/c/sci_setfield.c' || echo '$(srcdir)/'`sci_gateway/c/sci_setfield.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidata_structures_la-sci_setfield.Tpo $(DEPDIR)/libscidata_structures_la-sci_setfield.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_setfield.c' object='libscidata_structures_la-sci_setfield.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscidata_structures_la-sci_setfield.lo `test -f 'sci_gateway/c/sci_setfield.c' || echo '$(srcdir)/'`sci_gateway/c/sci_setfield.c
-
 libscidata_structures_la-sci_lstcat.lo: sci_gateway/c/sci_lstcat.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscidata_structures_la-sci_lstcat.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-sci_lstcat.Tpo -c -o libscidata_structures_la-sci_lstcat.lo `test -f 'sci_gateway/c/sci_lstcat.c' || echo '$(srcdir)/'`sci_gateway/c/sci_lstcat.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidata_structures_la-sci_lstcat.Tpo $(DEPDIR)/libscidata_structures_la-sci_lstcat.Plo
@@ -815,6 +823,48 @@ libscidata_structures_la-sci_rlist.lo: sci_gateway/c/sci_rlist.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscidata_structures_la-sci_rlist.lo `test -f 'sci_gateway/c/sci_rlist.c' || echo '$(srcdir)/'`sci_gateway/c/sci_rlist.c
 
+.cpp.o:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
+
+libscidata_structures_la-data_structures_gw.lo: sci_gateway/cpp/data_structures_gw.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidata_structures_la-data_structures_gw.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-data_structures_gw.Tpo -c -o libscidata_structures_la-data_structures_gw.lo `test -f 'sci_gateway/cpp/data_structures_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/data_structures_gw.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidata_structures_la-data_structures_gw.Tpo $(DEPDIR)/libscidata_structures_la-data_structures_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/data_structures_gw.cpp' object='libscidata_structures_la-data_structures_gw.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidata_structures_la-data_structures_gw.lo `test -f 'sci_gateway/cpp/data_structures_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/data_structures_gw.cpp
+
+libscidata_structures_la-sci_getfield.lo: sci_gateway/cpp/sci_getfield.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidata_structures_la-sci_getfield.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-sci_getfield.Tpo -c -o libscidata_structures_la-sci_getfield.lo `test -f 'sci_gateway/cpp/sci_getfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getfield.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidata_structures_la-sci_getfield.Tpo $(DEPDIR)/libscidata_structures_la-sci_getfield.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_getfield.cpp' object='libscidata_structures_la-sci_getfield.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidata_structures_la-sci_getfield.lo `test -f 'sci_gateway/cpp/sci_getfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getfield.cpp
+
+libscidata_structures_la-sci_setfield.lo: sci_gateway/cpp/sci_setfield.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidata_structures_la-sci_setfield.lo -MD -MP -MF $(DEPDIR)/libscidata_structures_la-sci_setfield.Tpo -c -o libscidata_structures_la-sci_setfield.lo `test -f 'sci_gateway/cpp/sci_setfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_setfield.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidata_structures_la-sci_setfield.Tpo $(DEPDIR)/libscidata_structures_la-sci_setfield.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_setfield.cpp' object='libscidata_structures_la-sci_setfield.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) $(libscidata_structures_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidata_structures_la-sci_setfield.lo `test -f 'sci_gateway/cpp/sci_setfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_setfield.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
diff --git a/scilab/modules/data_structures/includes/data_structures_gw.hxx b/scilab/modules/data_structures/includes/data_structures_gw.hxx
new file mode 100644 (file)
index 0000000..26cb71d
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __DATA_STRUCTURES_GW_HXX__
+#define __DATA_STRUCTURES_GW_HXX__
+
+#include "dynlib_data_structures.h"
+
+#include "cpp_gateway_prototype.hxx"
+
+class DataStructuresModule
+{
+private:
+    DataStructuresModule() {};
+    ~DataStructuresModule() {};
+
+public:
+    DATA_STRUCTURES_IMPEXP static int Load();
+};
+
+CPP_GATEWAY_PROTOTYPE(sci_getfield);
+CPP_GATEWAY_PROTOTYPE(sci_setfield);
+
+#endif /* !__DATA_STRUCTURES_GW_HXX__ */
index a77c646..421744b 100644 (file)
@@ -18,8 +18,8 @@
 /*--------------------------------------------------------------------------*/
 DATA_STRUCTURES_IMPEXP int gw_data_structures2(void);
 /*--------------------------------------------------------------------------*/
-int sci_getfield(char *fname,unsigned long fname_len);
-int sci_setfield(char *fname,unsigned long fname_len);
+//int sci_getfield(char *fname,unsigned long fname_len);
+//int sci_setfield(char *fname,unsigned long fname_len);
 /*--------------------------------------------------------------------------*/
 #endif /*  __GW_DATA_STRUCTURES2__ */
 /*--------------------------------------------------------------------------*/
index 13ef038..61592bd 100644 (file)
 /*--------------------------------------------------------------------------*/
 static gw_generic_table Tab[] =
 {
-       {sci_getfield, "getfield"},
-       {sci_setfield, "setfield"}
+    {NULL, ""}, //getfield
+    {NULL, ""} //setfield
 };
 /*--------------------------------------------------------------------------*/
 int gw_data_structures2(void)
 {
-       return 0;
+    return 0;
 }
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/data_structures/sci_gateway/c/sci_getfield.c b/scilab/modules/data_structures/sci_gateway/c/sci_getfield.c
deleted file mode 100644 (file)
index 6314bef..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007-2008 - 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 "machine.h"
-#include "gw_data_structures2.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intgetfield)(); /* fortran */
-/*--------------------------------------------------------------------------*/
-int sci_getfield(char *fname,unsigned long fname_len)
-{
-       //C2F(intgetfield)();
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/data_structures/sci_gateway/cpp/data_structures_gw.cpp b/scilab/modules/data_structures/sci_gateway/cpp/data_structures_gw.cpp
new file mode 100644 (file)
index 0000000..3f1e164
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013 - Scilab Enterprises - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "data_structures_gw.hxx"
+#include "context.hxx"
+
+#define MODULE_NAME L"data_structures"
+
+extern "C"
+{
+#include "gw_data_structures1.h"
+#include "gw_data_structures2.h"
+}
+
+int DataStructuresModule::Load()
+{
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getfield", &sci_getfield, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"setfield", &sci_setfield, MODULE_NAME));
+    return 1;
+}
diff --git a/scilab/modules/data_structures/sci_gateway/cpp/sci_getfield.cpp b/scilab/modules/data_structures/sci_gateway/cpp/sci_getfield.cpp
new file mode 100644 (file)
index 0000000..b08b6d8
--- /dev/null
@@ -0,0 +1,99 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - Antoine Elias
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "data_structures_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "mlist.hxx"
+#include "tlist.hxx"
+
+extern "C"
+{
+#include "Scierror.h"
+#include "MALLOC.h"
+#include "localization.h"
+#include "freeArrayOfString.h"
+}
+
+/*-----------------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_getfield(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() != 2)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "getfield", 2);
+        return types::Function::Error;
+    }
+
+    types::InternalType* pIndex = in[0];
+    types::List* pL = in[1]->getAs<types::List>();
+    std::vector<types::InternalType*> vOut;
+
+    if (pL->isList() == false && pL->isMList() == false && pL->isTList() == false)
+    {
+        Scierror(999, _("%s:  Wrong type for input argument #%d: List expected.\n"), "getfield", 2);
+        return types::Function::Error;
+    }
+
+    if (pIndex->isString())
+    {
+        //extraction by fieldnames
+        if (pL->isMList() == false && pL->isTList() == false)
+        {
+            Scierror(999, _("%s: Soft coded field names not yet implemented.\n"), "getfield");
+            return types::Function::Error;
+        }
+
+        types::TList* pT = pL->getAs<types::TList>();
+        types::String* pS = pIndex->getAs<types::String>();
+
+        std::list<std::wstring> stFields;
+
+        //check output arguments count
+        for (int i = 0 ; i < pS->getSize() ; i++)
+        {
+            std::wstring wst = pS->get(i);
+            if (pT->exists(wst) == false)
+            {
+                Scierror(999, _("%s: Invalid index.\n"), "getfield");
+                return types::Function::Error;
+            }
+
+            stFields.push_back(pS->get(i));
+        }
+
+        vOut = pT->extractStrings(stFields);
+    }
+    else
+    {
+        //extraction by index
+        types::typed_list Args;
+        Args.push_back(pIndex);
+        vOut = pL->extract(&Args);
+    }
+
+
+    if (_iRetCount < vOut.size())
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), "getfield", vOut.size());
+        return types::Function::Error;
+    }
+
+    for (int i = 0 ; i < vOut.size() ; i++)
+    {
+        out.push_back(vOut[i]);
+    }
+
+    return types::Function::OK;
+}
+/*-----------------------------------------------------------------------------------*/
diff --git a/scilab/modules/data_structures/sci_gateway/cpp/sci_setfield.cpp b/scilab/modules/data_structures/sci_gateway/cpp/sci_setfield.cpp
new file mode 100644 (file)
index 0000000..bf3b442
--- /dev/null
@@ -0,0 +1,84 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - Antoine Elias
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "data_structures_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "list.hxx"
+#include "mlist.hxx"
+#include "tlist.hxx"
+
+extern "C"
+{
+#include "Scierror.h"
+#include "MALLOC.h"
+#include "localization.h"
+#include "freeArrayOfString.h"
+}
+
+/*-----------------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_setfield(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() != 3)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), "setfield", 2);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 1)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d expected.\n"), "setfield", 0);
+        return types::Function::Error;
+    }
+
+
+    types::InternalType* pIndex = in[0];
+    types::InternalType* pData = in[1];
+    types::List* pL = in[2]->getAs<types::List>();
+
+    if (pL->isList() == false && pL->isMList() == false && pL->isTList() == false)
+    {
+        Scierror(999, _("%s:  Wrong type for input argument #%d: List expected.\n"), "setfield", 3);
+        return types::Function::Error;
+    }
+
+    if (pIndex->isString())
+    {
+        //insertion by fieldname
+        types::String* pS = pIndex->getAs<types::String>();
+        if ((pL->isMList() == false && pL->isTList() == false) || pS->getSize() != 1)
+        {
+            Scierror(999, _("%s: Not implemented in scilab...\n"), "setfield");
+            return types::Function::Error;
+        }
+
+        types::TList* pT = pL->getAs<types::TList>();
+
+        std::wstring stField = pS->get(0);
+        if (pT->set(stField, pData) == false)
+        {
+            Scierror(999, _("%s: Invalid index.\n"), "setfield");
+            return types::Function::Error;
+        }
+    }
+    else
+    {
+        //insertion by index
+        types::typed_list Args;
+        Args.push_back(pIndex);
+        pL->insert(&Args, pData);
+    }
+
+    return types::Function::OK;
+}
+/*-----------------------------------------------------------------------------------*/
index 93e1696..d4a7fd6 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;../../../symbol/includes;../../../types/includes;../../../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DATA_STRUCTURES_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -105,7 +105,7 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;../../../symbol/includes;../../../types/includes;../../../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DATA_STRUCTURES_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -132,7 +132,7 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;../../../symbol/includes;../../../types/includes;../../../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DATA_STRUCTURES_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -166,7 +166,7 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../string/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../data_structures/includes;../../../api_scilab/includes;../../../operations/includes;../../../symbol/includes;../../../types/includes;../../../ast/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DATA_STRUCTURES_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -194,6 +194,9 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\data_structures_gw.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_getfield.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_setfield.cpp" />
     <ClCompile Include="DllmainData_structures.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_data_structures1.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_data_structures2.c" />
@@ -202,17 +205,16 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
       <Optimization Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Disabled</Optimization>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_definedfields.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_getfield.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_glist.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_lsslist.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_lstcat.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_lstsize.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_rlist.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_setfield.c" />
     <ClCompile Include="strpos.c" />
     <ClCompile Include="stcreate.c" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="..\..\includes\data_structures_gw.hxx" />
     <ClInclude Include="..\..\includes\dynlib_data_structures.h" />
     <ClInclude Include="..\..\includes\gw_data_structures1.h" />
     <ClInclude Include="..\..\includes\gw_data_structures2.h" />
@@ -252,6 +254,12 @@ lib /DEF:"$(ProjectDir)linpack_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platf
       <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\symbol\symbol.vcxproj">
+      <Project>{2c60033b-0dbd-4ca4-80d3-176c9be9ce2f}</Project>
+    </ProjectReference>
+    <ProjectReference Include="..\..\..\types\types.vcxproj">
+      <Project>{64e090da-dcb5-4f4d-93d7-e88ddec9c2ef}</Project>
+    </ProjectReference>
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index 82b1111..616bccc 100644 (file)
@@ -38,9 +38,6 @@
     <ClCompile Include="..\..\sci_gateway\c\sci_definedfields.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_getfield.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_glist.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_rlist.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_setfield.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="stcreate.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="strpos.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\data_structures_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_getfield.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_setfield.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_data_structures.h">
@@ -82,6 +85,9 @@
     <ClInclude Include="stcreate.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\data_structures_gw.hxx">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="data_structures_f_Import.def">
index a084de4..2246323 100644 (file)
       <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\data_structures\src\c\data_structures.vcxproj">
+      <Project>{b7a168a0-dfc0-4c6d-b0cc-6079912a4a76}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\dynamic_link\sci_gateway\cpp\dynamic_link_gw.vcxproj">
       <Project>{f93ff3ee-217a-4554-ab17-2f8d56b4bf4b}</Project>
     </ProjectReference>
index c34bdcc..9c96a2a 100644 (file)
@@ -47,4 +47,5 @@
 #include "../../graphics/includes/graphics_gw.hxx"
 #include "../../interpolation/includes/interpolation_gw.hxx"
 #include "../../polynomials/includes/polynomials_gw.hxx"
+#include "../../data_structures/includes/data_structures_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index bee4583..e8b9990 100644 (file)
@@ -327,6 +327,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"graphic_export", &GraphicExportModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"polynomials", &PolynomialsModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"arnoldi", &ArnoldiModule::Load));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"data_structures", &DataStructuresModule::Load));
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
index 21b0f0b..bf84a25 100644 (file)
@@ -85,7 +85,7 @@ assert_checkalmostequal ( xcomputed , xexpected , %eps);
 // =================================================================================================
 A=[100,1;1,10.];
 b=[101;11];
-[xcomputed, flag, err, iter, res]=qmr(A,b,x0=[1.;1.]);
+[xcomputed, flag, err, iter, res]=qmr(A,b, [1.;1.]);
 assert_checkequal ( iter , 1 );
 // 9. Test the special case where b=0
 // ====================================
@@ -254,10 +254,7 @@ b = [11;11];
 x0 = [1;1];
 M1=[1,0;0,1];
 M2 = eye(2,2);
-maxit = 10
- maxit  =
-    10.  
+maxit = 10;
 [xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit);
 xexpected=[1;1];
 assert_checkalmostequal ( xcomputed , xexpected , %eps);
index fc2a392..91174f0 100644 (file)
@@ -95,7 +95,7 @@ assert_checkalmostequal ( xcomputed , xexpected , %eps);
 // =================================================================================================\r
 A=[100,1;1,10.];\r
 b=[101;11];\r
-[xcomputed, flag, err, iter, res]=qmr(A,b,x0=[1.;1.]);\r
+[xcomputed, flag, err, iter, res]=qmr(A,b, [1.;1.]);\r
 assert_checkequal ( iter , 1 );\r
 \r
 // 9. Test the special case where b=0\r
@@ -282,7 +282,7 @@ b = [11;11];
 x0 = [1;1];\r
 M1=[1,0;0,1];\r
 M2 = eye(2,2);\r
-maxit = 10\r
+maxit = 10;\r
 [xcomputed, flag, err, iter, res]=qmr(func_qmr,b,x0,M1,M2,maxit);\r
 xexpected=[1;1];\r
 assert_checkalmostequal ( xcomputed , xexpected , %eps);\r
@@ -615,4 +615,5 @@ assert_checkalmostequal ( xcomputed , xexpected , %eps);
 \r
 \r
 \r
-\r\r
+\r
+\r
index 8acb99f..86cff68 100644 (file)
@@ -96,8 +96,7 @@ TYPES_GATEWAY_CPP_SOURCES = \
        sci_gateway/cpp/sci_tlist.cpp \
        sci_gateway/cpp/sci_mlist.cpp \
        sci_gateway/cpp/sci_isfield.cpp \
-       sci_gateway/cpp/sci_fieldnames.cpp \
-       sci_gateway/cpp/sci_getfield.cpp
+       sci_gateway/cpp/sci_fieldnames.cpp
 
 
 if ENABLE_DEBUG
index ee0705c..08d9cd0 100644 (file)
@@ -219,7 +219,6 @@ am__libscitypes_la_SOURCES_DIST = sci_gateway/cpp/types_gw.cpp \
        sci_gateway/cpp/sci_typeof.cpp sci_gateway/cpp/sci_tlist.cpp \
        sci_gateway/cpp/sci_mlist.cpp sci_gateway/cpp/sci_isfield.cpp \
        sci_gateway/cpp/sci_fieldnames.cpp \
-       sci_gateway/cpp/sci_getfield.cpp \
        sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp \
        sci_gateway/cpp/sci_inspectorGetItem.cpp \
        sci_gateway/cpp/sci_inspectorGetItemCount.cpp \
@@ -240,8 +239,7 @@ am__objects_6 = libscitypes_la-types_gw.lo libscitypes_la-sci_list.lo \
        libscitypes_la-sci_makecell.lo libscitypes_la-sci_usertype.lo \
        libscitypes_la-sci_typeof.lo libscitypes_la-sci_tlist.lo \
        libscitypes_la-sci_mlist.lo libscitypes_la-sci_isfield.lo \
-       libscitypes_la-sci_fieldnames.lo \
-       libscitypes_la-sci_getfield.lo $(am__objects_5)
+       libscitypes_la-sci_fieldnames.lo $(am__objects_5)
 am_libscitypes_la_OBJECTS = $(am__objects_6)
 libscitypes_la_OBJECTS = $(am_libscitypes_la_OBJECTS)
 am_testTypes_OBJECTS = testTypes-test-types.$(OBJEXT)
@@ -670,8 +668,7 @@ TYPES_GATEWAY_CPP_SOURCES = sci_gateway/cpp/types_gw.cpp \
        sci_gateway/cpp/sci_usertype.cpp \
        sci_gateway/cpp/sci_typeof.cpp sci_gateway/cpp/sci_tlist.cpp \
        sci_gateway/cpp/sci_mlist.cpp sci_gateway/cpp/sci_isfield.cpp \
-       sci_gateway/cpp/sci_fieldnames.cpp \
-       sci_gateway/cpp/sci_getfield.cpp $(am__append_4)
+       sci_gateway/cpp/sci_fieldnames.cpp $(am__append_4)
 libscitypes_java_la_CFLAGS = $(JAVA_JNI_INCLUDE) \
                        -I$(srcdir)/includes
 
@@ -889,7 +886,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_java_la-getScilabVariable_wrap.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_cell.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_fieldnames.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_getfield.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_insert.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_inspectorDeleteUnreferencedItems.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscitypes_la-sci_inspectorGetFunctionList.Plo@am__quote@
@@ -1337,13 +1333,6 @@ libscitypes_la-sci_fieldnames.lo: sci_gateway/cpp/sci_fieldnames.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) $(libscitypes_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscitypes_la-sci_fieldnames.lo `test -f 'sci_gateway/cpp/sci_fieldnames.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_fieldnames.cpp
 
-libscitypes_la-sci_getfield.lo: sci_gateway/cpp/sci_getfield.cpp
-@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscitypes_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscitypes_la-sci_getfield.lo -MD -MP -MF $(DEPDIR)/libscitypes_la-sci_getfield.Tpo -c -o libscitypes_la-sci_getfield.lo `test -f 'sci_gateway/cpp/sci_getfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getfield.cpp
-@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscitypes_la-sci_getfield.Tpo $(DEPDIR)/libscitypes_la-sci_getfield.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_getfield.cpp' object='libscitypes_la-sci_getfield.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) $(libscitypes_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscitypes_la-sci_getfield.lo `test -f 'sci_gateway/cpp/sci_getfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getfield.cpp
-
 libscitypes_la-sci_inspectorDeleteUnreferencedItems.lo: sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscitypes_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscitypes_la-sci_inspectorDeleteUnreferencedItems.lo -MD -MP -MF $(DEPDIR)/libscitypes_la-sci_inspectorDeleteUnreferencedItems.Tpo -c -o libscitypes_la-sci_inspectorDeleteUnreferencedItems.lo `test -f 'sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_inspectorDeleteUnreferencedItems.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscitypes_la-sci_inspectorDeleteUnreferencedItems.Tpo $(DEPDIR)/libscitypes_la-sci_inspectorDeleteUnreferencedItems.Plo
index 8a56a6d..cc12d80 100644 (file)
@@ -39,7 +39,6 @@ CPP_GATEWAY_PROTOTYPE(sci_typeof);
 CPP_GATEWAY_PROTOTYPE(sci_tlist);
 CPP_GATEWAY_PROTOTYPE(sci_mlist);
 CPP_GATEWAY_PROTOTYPE(sci_isfield);
-CPP_GATEWAY_PROTOTYPE(sci_getfield);
 CPP_GATEWAY_PROTOTYPE(sci_fieldnames);
 
 #ifndef NDEBUG
diff --git a/scilab/modules/types/sci_gateway/cpp/sci_getfield.cpp b/scilab/modules/types/sci_gateway/cpp/sci_getfield.cpp
deleted file mode 100644 (file)
index c5ac5d4..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2011-2011 - DIGITEO - Bruno JOFRET
- *
- *  This file must be used under the terms of the CeCILL.
- *  This source file is licensed as described in the file COPYING, which
- *  you should have received as part of this distribution.  The terms
- *  are also available at
- *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include "types_gw.hxx"
-#include "function.hxx"
-#include "double.hxx"
-#include "list.hxx"
-
-extern "C"
-{
-#include "Scierror.h"
-#include "localization.h"
-#include "charEncoding.h"
-}
-
-using namespace types;
-
-Function::ReturnValue sci_getfield(typed_list &in, int _iRetCount, typed_list &out)
-{
-    if (in.size() != 2)
-    {
-        Scierror(999, _("%s: Wrong number of input argument(s): %d expected.\n"), "getfield", 2);
-        return Function::Error;
-    }
-
-    if (in[0]->isDouble() == false || in[0]->getAs<Double>()->isComplex() == true)
-    {
-        Scierror(999, _("%s:  Wrong type for input argument #%d: Real Matrix expected.\n"), "getfield", 1);
-        return Function::Error;
-    }
-
-    if (in[1]->isList() == false && in[1]->isMList() == false && in[1]->isTList() == false)
-    {
-        Scierror(999, _("%s:  Wrong type for input argument #%d: List expected.\n"), "getfield", 2);
-        return Function::Error;
-    }
-
-    // FIXME : Scilab < 6 allows mlist wrapped types like struct, hypermat, aso...
-    // Need to investigate if this feature is mandatory.
-
-    Double *pInDouble = in[0]->getAs<Double>();
-
-    if (_iRetCount != pInDouble->getSize())
-    {
-        Scierror(999, _("%s: Wrong number of output argument(s): %d expected.\n"), "getfield", pInDouble->getSize());
-        return Function::Error;
-    }
-
-    List *pInList = in[1]->getAs<List>();
-    double *pdblReal = pInDouble->get();
-
-    for (int i = 0 ; i < pInDouble->getSize() ; ++i)
-    {
-        const int iIndex = ((int) pdblReal[i]) - 1;
-        InternalType *pIT = pInList->get(iIndex);
-        if (pIT != NULL)
-        {
-            out.push_back(pIT);
-        }
-        else
-        {
-            Scierror(21, _("%s: Invalid index: Computed index was %d.\n"), "getfield", iIndex + 1);
-            return Function::Error;
-        }
-    }
-
-    return Function::OK;
-}
index 60bd7e5..f9573a0 100644 (file)
@@ -27,7 +27,6 @@ int TypesModule::Load()
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"tlist", &sci_tlist, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"mlist", &sci_mlist, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"isfield", &sci_isfield, MODULE_NAME));
-    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getfield", &sci_getfield, MODULE_NAME));
     symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"fieldnames", &sci_fieldnames, MODULE_NAME));
 
 #ifndef NDEBUG
index 7f4d233..51fa96f 100644 (file)
@@ -1,4 +1,4 @@
-<?xml version="1.0" encoding="utf-8"?>
+<?xml version="1.0" encoding="utf-8"?>
 <Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <ItemGroup Label="ProjectConfigurations">
     <ProjectConfiguration Include="Debug|Win32">
   <ItemGroup>
     <ClCompile Include="sci_cell.cpp" />
     <ClCompile Include="sci_fieldnames.cpp" />
-    <ClCompile Include="sci_getfield.cpp" />
     <ClCompile Include="sci_insert.cpp" />
     <ClCompile Include="sci_inspectorDeleteUnreferencedItems.cpp">
       <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">true</ExcludedFromBuild>
index fd76aaa..7dcadb0 100644 (file)
     </Filter>
   </ItemGroup>
   <ItemGroup>
-    <ClCompile Include="..\sci_cell.cpp">
+    <ClCompile Include="sci_cell.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_fieldnames.cpp">
+    <ClCompile Include="sci_fieldnames.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_insert.cpp">
+    <ClCompile Include="sci_insert.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_isfield.cpp">
+    <ClCompile Include="sci_inspectorDeleteUnreferencedItems.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_list.cpp">
+    <ClCompile Include="sci_inspectorGetItem.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_makecell.cpp">
+    <ClCompile Include="sci_inspectorGetItemCount.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_mlist.cpp">
+    <ClCompile Include="sci_inspectorGetUnreferencedItem.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_null.cpp">
+    <ClCompile Include="sci_inspectorShowItem.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_struct.cpp">
+    <ClCompile Include="sci_inspectorShowUnreferencedItem.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_tlist.cpp">
+    <ClCompile Include="sci_isfield.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_typeof.cpp">
+    <ClCompile Include="sci_list.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_usertype.cpp">
+    <ClCompile Include="sci_makecell.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\types_gw.cpp">
+    <ClCompile Include="sci_mlist.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_getfield.cpp">
+    <ClCompile Include="sci_null.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorGetItemCount.cpp">
+    <ClCompile Include="sci_struct.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorShowItem.cpp">
+    <ClCompile Include="sci_tlist.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorGetItem.cpp">
+    <ClCompile Include="sci_typeof.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorGetUnreferencedItem.cpp">
+    <ClCompile Include="sci_usertype.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorDeleteUnreferencedItems.cpp">
+    <ClCompile Include="types_gw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\sci_inspectorShowUnreferencedItem.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\sci_inspectorGetFunctionList.cpp">
+    <ClCompile Include="sci_inspectorGetFunctionList.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
   <ItemGroup>
-    <ClInclude Include="..\..\..\includes\dynlib_types_gw.h">
+    <ClInclude Include="..\..\includes\dynlib_types_gw.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\sci_tlist_or_mlist.hxx">
+    <ClInclude Include="sci_tlist_or_mlist.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\..\includes\types_gw.hxx">
+    <ClInclude Include="..\..\includes\types_gw.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
   <ItemGroup>
-    <Library Include="..\..\..\..\..\bin\libintl.lib" />
+    <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
 </Project>
\ No newline at end of file
index 905c12b..848e9ac 100644 (file)
@@ -72,7 +72,7 @@ List::List(List *_oListCopyMe)
     for (int i = 0 ; i < _oListCopyMe->getData()->size() ; i++)
     {
         InternalType* pIT = (*_oListCopyMe->getData())[i];
-        append(pIT);
+        append(pIT->clone());
     }
 
     m_iSize = static_cast<int>(m_plData->size());
@@ -101,8 +101,7 @@ int List::getSize()
 */
 void List::append(InternalType *_typedValue)
 {
-    _typedValue->IncreaseRef();
-    m_plData->push_back(_typedValue);
+    m_plData->push_back(_typedValue->clone());
     m_iSize = static_cast<int>(m_plData->size());
 }
 
@@ -176,7 +175,7 @@ std::vector<InternalType*>  List::extract(typed_list* _pArgs)
             break;
         }
         InternalType* pIT = (*m_plData)[idx - 1];
-        outList.push_back(pIT);
+        outList.push_back(pIT->clone());
     }
 
     for (int iArg = 0 ; iArg < pArg.size() ; iArg++)
@@ -229,13 +228,9 @@ InternalType* List::insert(typed_list* _pArgs, InternalType* _pSource)
         else if (idx <= m_plData->size())
         {
             InternalType* pIT = (*m_plData)[idx - 1];
-            if (pIT)
+            if (pIT && pIT->isDeletable())
             {
-                pIT->DecreaseRef();
-                if (pIT->isDeletable())
-                {
-                    delete pIT;
-                }
+                delete pIT;
             }
             m_plData->erase(m_plData->begin() + idx - 1);
         }
@@ -250,16 +245,13 @@ InternalType* List::insert(typed_list* _pArgs, InternalType* _pSource)
             throw ast::ScilabError(os.str());
         }
 
-        InternalType* pInsert = _pSource->getAs<ListInsert>()->getInsert();
-        pInsert->IncreaseRef();
+        InternalType* pInsert = _pSource->getAs<ListInsert>()->getInsert()->clone();
         if (idx > m_plData->size())
         {
             //try to insert after the last index, increase list size and assign value
             while (m_plData->size() < idx)
             {
                 //incease list size and fill with "Undefined"
-                InternalType* pUndef = new ListUndefined();
-                pUndef->IncreaseRef();
                 m_plData->push_back(new ListUndefined());
             }
             (*m_plData)[idx - 1] = pInsert;
@@ -281,8 +273,8 @@ InternalType* List::insert(typed_list* _pArgs, InternalType* _pSource)
         {
             pInsert = _pSource;
         }
-        pInsert->IncreaseRef();
-        m_plData->insert(m_plData->begin(), pInsert);
+
+        m_plData->insert(m_plData->begin(), pInsert->clone());
     }
     else
     {
@@ -293,14 +285,12 @@ InternalType* List::insert(typed_list* _pArgs, InternalType* _pSource)
         }
 
         InternalType* pIT = (*m_plData)[idx - 1];
-        pIT->DecreaseRef();
-        if (pIT->isDeletable())
+        if (pIT && pIT->isDeletable())
         {
             delete pIT;
         }
 
-        _pSource->IncreaseRef();
-        (*m_plData)[idx - 1] = _pSource;
+        (*m_plData)[idx - 1] = _pSource->clone();
     }
 
     m_iSize = (int)m_plData->size();
index 252d341..b3b72af 100644 (file)
 
 namespace types
 {
-    /**
-    ** Constructor & Destructor (public)
-    */
-    TList::TList() : List()
-    {
+/**
+** Constructor & Destructor (public)
+*/
+TList::TList() : List()
+{
 #ifndef NDEBUG
-        Inspector::addItem(this);
+    Inspector::addItem(this);
 #endif
-    }
+}
 
-    TList::~TList()
-    {
+TList::~TList()
+{
 #ifndef NDEBUG
-        Inspector::removeItem(this);
+    Inspector::removeItem(this);
 #endif
-    }
-    /**
-    ** Private Copy Constructor and data Access
-    */
-    TList::TList(TList *_oTListCopyMe)
-    {
-        std::vector<InternalType *>::iterator itValues;
-        m_plData = new std::vector<InternalType *>;
+}
+/**
+** Private Copy Constructor and data Access
+*/
+TList::TList(TList *_oTListCopyMe)
+{
+    std::vector<InternalType *>::iterator itValues;
+    m_plData = new std::vector<InternalType *>;
 
-        for(int i = 0 ; i < _oTListCopyMe->getData()->size() ; i++)
-        {
-            InternalType* pIT = (*_oTListCopyMe->getData())[i];
-            append(pIT);
-        }
+    for (int i = 0 ; i < _oTListCopyMe->getData()->size() ; i++)
+    {
+        InternalType* pIT = (*_oTListCopyMe->getData())[i];
+        append(pIT->clone());
+    }
 
-        m_iSize = static_cast<int>(m_plData->size());
+    m_iSize = static_cast<int>(m_plData->size());
 #ifndef NDEBUG
-        Inspector::addItem(this);
+    Inspector::addItem(this);
 #endif
-    }
+}
 
-    /**
-    ** Clone
-    ** Create a new List and Copy all values.
-    */
-    InternalType* TList::clone()
-    {
-        return new TList(this);
-    }
+/**
+** Clone
+** Create a new List and Copy all values.
+*/
+InternalType* TList::clone()
+{
+    return new TList(this);
+}
 
-    bool TList::exists(const std::wstring& _sKey)
+bool TList::exists(const std::wstring& _sKey)
+{
+    if (getSize() < 1)
     {
-        if(getSize() < 1)
-        {
-            return false;
-        }
-
-        String* pS = (*m_plData)[0]->getAs<types::String>();
-
-        //first field is the tlist type
-        for(int i = 1 ; i < pS->getSize() ; i++)
-        {
-            if(wcscmp(pS->get(i), _sKey.c_str()) == 0)
-            {
-                return true;
-            }
-        }
         return false;
     }
 
-    InternalType* TList::get(const std::wstring& _sKey)
-    {
-        return List::get(getIndexFromString(_sKey));
-    }
+    String* pS = (*m_plData)[0]->getAs<types::String>();
 
-    int TList::getIndexFromString(const std::wstring& _sKey)
+    //first field is the tlist type
+    for (int i = 1 ; i < pS->getSize() ; i++)
     {
-        if(getSize() < 1)
+        if (wcscmp(pS->get(i), _sKey.c_str()) == 0)
         {
-            return -1;
+            return true;
         }
+    }
+    return false;
+}
 
-        String* pS = (*m_plData)[0]->getAs<types::String>();
-        //first field is the tlist type
-        for(int i = 1 ; i < pS->getSize() ; i++)
-        {
-            if(wcscmp(pS->get(i), _sKey.c_str()) == 0)
-            {
-                return i;
-            }
-        }
+InternalType* TList::get(const std::wstring& _sKey)
+{
+    return List::get(getIndexFromString(_sKey));
+}
+
+int TList::getIndexFromString(const std::wstring& _sKey)
+{
+    if (getSize() < 1)
+    {
         return -1;
     }
 
-    std::vector<InternalType*> TList::extractStrings(const std::list<std::wstring>& _stFields)
+    String* pS = (*m_plData)[0]->getAs<types::String>();
+    //first field is the tlist type
+    for (int i = 1 ; i < pS->getSize() ; i++)
     {
-        std::vector<InternalType*> Result;
-
-        std::list<std::wstring>::const_iterator it;
-        for(it = _stFields.begin() ; it != _stFields.end() ; it++)
+        if (wcscmp(pS->get(i), _sKey.c_str()) == 0)
         {
-            if(exists(*it) == false)
-            {
-                return Result;
-            }
+            return i;
         }
-
-        for(it = _stFields.begin() ; it != _stFields.end() ; it++)
-        {
-            Result.push_back(get(*it));
-        }
-        return Result;
     }
+    return -1;
+}
+
+std::vector<InternalType*> TList::extractStrings(const std::list<std::wstring>& _stFields)
+{
+    std::vector<InternalType*> Result;
 
-    std::wstring TList::getTypeStr()
+    std::list<std::wstring>::const_iterator it;
+    for (it = _stFields.begin() ; it != _stFields.end() ; it++)
     {
-        if(getSize() < 1)
+        if (exists(*it) == false)
         {
-            return L"";
+            return Result;
         }
-
-        return (*m_plData)[0]->getAs<types::String>()->get(0);
     }
 
-    std::wstring TList::getShortTypeStr()
+    for (it = _stFields.begin() ; it != _stFields.end() ; it++)
     {
-        return getTypeStr();
+        Result.push_back(get(*it));
     }
+    return Result;
+}
 
-    bool TList::set(const std::wstring& _sKey, InternalType* _pIT)
+std::wstring TList::getTypeStr()
+{
+    if (getSize() < 1)
     {
-        return set(getIndexFromString(_sKey), _pIT);
+        return L"";
     }
 
-    bool TList::set(const int _iIndex, InternalType* _pIT)
-    {
-        if(_iIndex < 0)
-        {
-            return false;
-        }
+    return (*m_plData)[0]->getAs<types::String>()->get(0);
+}
 
-        while(m_plData->size() <_iIndex)
-        {//incease list size and fill with "Undefined"
-            m_plData->push_back(new ListUndefined());
-            m_iSize = getSize();
-        }
+std::wstring TList::getShortTypeStr()
+{
+    return getTypeStr();
+}
 
-        //manage ref on the old value
-        InternalType* pOld = (*m_plData)[_iIndex];
-        if(pOld)
-        {
-            pOld->DecreaseRef();
-            if(pOld->isDeletable())
-            {
-                delete pOld;
-            }
-        }
+bool TList::set(const std::wstring& _sKey, InternalType* _pIT)
+{
+    return set(getIndexFromString(_sKey), _pIT);
+}
 
-        _pIT->IncreaseRef();
-        (*m_plData)[_iIndex] = _pIT;
-        return true;
+bool TList::set(const int _iIndex, InternalType* _pIT)
+{
+    if (_iIndex < 0)
+    {
+        return false;
     }
+
+    while (m_plData->size() < _iIndex)
+    {
+        //incease list size and fill with "Undefined"
+        m_plData->push_back(new ListUndefined());
+        m_iSize = getSize();
+    }
+
+    InternalType* pOld = (*m_plData)[_iIndex];
+    if (pOld && pOld->isDeletable())
+    {
+        delete pOld;
+    }
+
+    (*m_plData)[_iIndex] = _pIT->clone();
+    return true;
+}
 }