autocompletion on variable and functions in YaSp and completion module plugged. 19/11919/10
Cedric Delamarre [Wed, 3 Jul 2013 15:21:20 +0000 (17:21 +0200)]
Change-Id: I42d637b769b094749f802321193e4129f912ef0e

89 files changed:
scilab/modules/call_scilab/src/c/call_scilab.c
scilab/modules/completion/Makefile.am
scilab/modules/completion/Makefile.in
scilab/modules/completion/includes/completion_gw.hxx [new file with mode: 0644]
scilab/modules/completion/includes/getmacrosdictionary.h [deleted file]
scilab/modules/completion/includes/gw_completion.h [deleted file]
scilab/modules/completion/includes/toolsdictionary.h [moved from scilab/modules/completion/src/c/toolsdictionary.h with 100% similarity]
scilab/modules/completion/sci_gateway/c/gw_completion.c [deleted file]
scilab/modules/completion/sci_gateway/c/sci_completion.c [deleted file]
scilab/modules/completion/sci_gateway/completion_gateway.xml
scilab/modules/completion/sci_gateway/cpp/sci_completion.cpp [new file with mode: 0644]
scilab/modules/completion/src/c/completion.c
scilab/modules/completion/src/c/completion.vcxproj
scilab/modules/completion/src/c/completion.vcxproj.filters
scilab/modules/completion/src/c/core_Import.def
scilab/modules/completion/src/c/getfieldsdictionary.c [deleted file]
scilab/modules/completion/src/c/getmacrosdictionary.c [deleted file]
scilab/modules/completion/src/cpp/getfieldsdictionary.cpp [new file with mode: 0644]
scilab/modules/completion/src/nocompletion/nocompletion.c
scilab/modules/completion/tests/nonreg_tests/bug_2848.tst
scilab/modules/completion/tests/nonreg_tests/bug_3051.tst
scilab/modules/completion/tests/unit_tests/completion.tst
scilab/modules/completion/tests/utilities/build_primitives.sce
scilab/modules/completion/tests/utilities/sci_completeline.c
scilab/modules/completion/tests/utilities/sci_getcommonpart.c
scilab/modules/completion/tests/utilities/sci_getfields.c
scilab/modules/completion/tests/utilities/sci_getfilepartlevel.c
scilab/modules/completion/tests/utilities/sci_getpartlevel.c
scilab/modules/console/src/c/cmdLine/autoCompletionCli.c
scilab/modules/console/src/c/console.vcxproj
scilab/modules/console/src/c/console.vcxproj.filters
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/includes/Funtab.h [deleted file]
scilab/modules/core/includes/callinterf.h
scilab/modules/core/includes/getfunctionsname.h [moved from scilab/modules/core/includes/getfunctionslist.h with 83% similarity]
scilab/modules/core/includes/getmacrosname.h [moved from scilab/modules/functions/includes/getmacroslist.h with 73% similarity]
scilab/modules/core/includes/getvariablesname.h
scilab/modules/core/includes/hashtable_itr.h [deleted file]
scilab/modules/core/includes/intmacr2tree.h [deleted file]
scilab/modules/core/includes/sciquit.h [deleted file]
scilab/modules/core/src/c/Funtab.c [deleted file]
scilab/modules/core/src/c/LoadFunctionsTab.c [deleted file]
scilab/modules/core/src/c/TerminateCore.c [deleted file]
scilab/modules/core/src/c/TerminateCore.h [deleted file]
scilab/modules/core/src/c/core.vcxproj
scilab/modules/core/src/c/core.vcxproj.filters
scilab/modules/core/src/c/getdynamicdebuginfo.c
scilab/modules/core/src/c/getvariablesname.c [deleted file]
scilab/modules/core/src/c/hashtable/hashtable_itr.c [deleted file]
scilab/modules/core/src/c/hashtable_core.h [deleted file]
scilab/modules/core/src/c/sciquit.c [deleted file]
scilab/modules/core/src/cpp/InitScilab.cpp
scilab/modules/core/src/cpp/getfunctionsname.cpp [new file with mode: 0644]
scilab/modules/core/src/cpp/getmacrosname.cpp [new file with mode: 0644]
scilab/modules/core/src/cpp/getvariablesname.cpp [new file with mode: 0644]
scilab/modules/core/src/cpp/hashtable_core.cpp [deleted file]
scilab/modules/core/src/cpp/search_functions.cpp [deleted file]
scilab/modules/dynamic_link/src/cpp/addinter.cpp
scilab/modules/fileio/src/c/findfiles.c
scilab/modules/functions/Makefile.am
scilab/modules/functions/Makefile.in
scilab/modules/functions/src/c/functions.vcxproj
scilab/modules/functions/src/c/functions.vcxproj.filters
scilab/modules/functions/src/c/getmacroslist.c [deleted file]
scilab/modules/functions/src/c/searchmacroinlibraries.h [deleted file]
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/includes/module_declaration.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/functions_manager/src/cpp/funcmanager.cpp
scilab/modules/io/sci_gateway/cpp/sci_genlib.cpp
scilab/modules/scinotes/src/c/ScilabKeywords.c
scilab/modules/symbol/includes/context.hxx
scilab/modules/symbol/includes/scope.hxx
scilab/modules/symbol/includes/variables.hxx
scilab/modules/symbol/src/cpp/context.cpp
scilab/modules/symbol/src/cpp/scope.cpp
scilab/modules/symbol/src/cpp/variables.cpp
scilab/modules/types/includes/graphichandle.hxx
scilab/modules/types/includes/tlist.hxx
scilab/modules/types/src/cpp/tlist.cpp
scilab/modules/windows_tools/src/c/scilab_windows/console_main.c [deleted file]
scilab/modules/windows_tools/src/c/scilab_windows/console_main.h [deleted file]
scilab/modules/windows_tools/src/c/scilab_windows/core_Import.def
scilab/modules/windows_tools/src/c/scilab_windows/scilab_main.c
scilab/modules/windows_tools/src/c/scilab_windows/scilab_windows.vcxproj
scilab/modules/windows_tools/src/c/scilab_windows/scilab_windows.vcxproj.filters
scilab/modules/windows_tools/src/c/scilab_windows/windows_main.c [deleted file]
scilab/modules/windows_tools/src/c/scilab_windows/windows_main.h [deleted file]

index c448548..399bbff 100644 (file)
 #include "scilabDefaults.h"
 #include "sci_tmpdir.h"
 #include "scirun.h"
-#include "sciquit.h"
 #include "storeCommand.h"
 #include "FigureList.h"
-#include "../../core/src/c/TerminateCore.h"
 #include "api_scilab.h"
 #include "call_scilab_engine_state.h"
 #include "os_strdup.h"
index 97b6e84..e39e8c8 100644 (file)
@@ -18,8 +18,6 @@ endif
 COMPLETION_C_SOURCES = src/c/completion.c \
 src/c/completion_generic.c \
 src/c/getfilesdictionary.c \
-src/c/getfieldsdictionary.c \
-src/c/getmacrosdictionary.c \
 src/c/toolsdictionary.c \
 src/c/completion_wrap_java.c \
 src/c/getPartLine.c \
@@ -32,11 +30,11 @@ COMPLETION_CPP_SOURCES = \
 src/cpp/completionDictionary.cpp \
 src/cpp/FieldsManager.cpp \
 src/cpp/XMLFieldsGetter.cpp \
-src/cpp/getfields.cpp
+src/cpp/getfields.cpp \
+src/cpp/getfieldsdictionary.cpp
 
 # List of the gateway c files
-GATEWAY_C_SOURCES = sci_gateway/c/sci_completion.c \
-sci_gateway/c/gw_completion.c
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_completion.cpp
 
 # Includes need for the compilation
 libscicompletion_la_CPPFLAGS = \
@@ -44,7 +42,6 @@ libscicompletion_la_CPPFLAGS = \
     -I$(srcdir)/src/c/ \
     -I$(srcdir)/src/cpp/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
-    -I$(top_srcdir)/modules/functions/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/graphics/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
@@ -71,11 +68,11 @@ noinst_LTLIBRARIES = libscicompletion-algo.la
 
 # All the sources needed by libscicompletion.la
 libscicompletion_algo_la_SOURCES = $(COMPLETION_JNI_SOURCES) $(COMPLETION_C_SOURCES) $(COMPLETION_CPP_SOURCES)
-libscicompletion_la_SOURCES = $(GATEWAY_C_SOURCES)
+libscicompletion_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscicompletion_algo_la_CPPFLAGS = $(libscicompletion_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC= $(COMPLETION_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC= $(COMPLETION_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscicompletion_la_CPPFLAGS)
 
 ## Libraries necessary
@@ -98,7 +95,7 @@ libscicompletion_la_sci_gateway_DATA = sci_gateway/completion_gateway.xml
 
 #### completion : include files ####
 libscicompletion_la_includedir=$(pkgincludedir)
-libscicompletion_la_include_HEADERS = includes/gw_completion.h \
+libscicompletion_la_include_HEADERS = \
 includes/completion.h \
 includes/getCommonPart.h \
 includes/getPartLine.h \
index 4b34efc..9bfd4a1 100644 (file)
@@ -144,19 +144,17 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscicompletion_algo_la_LIBADD =
 am__libscicompletion_algo_la_SOURCES_DIST = src/jni/Completion_wrap.c \
        src/c/completion.c src/c/completion_generic.c \
-       src/c/getfilesdictionary.c src/c/getfieldsdictionary.c \
-       src/c/getmacrosdictionary.c src/c/toolsdictionary.c \
+       src/c/getfilesdictionary.c src/c/toolsdictionary.c \
        src/c/completion_wrap_java.c src/c/getPartLine.c \
        src/c/getCommonPart.c src/c/completeLine.c \
        src/c/completeLine_wrap_java.c \
        src/cpp/completionDictionary.cpp src/cpp/FieldsManager.cpp \
-       src/cpp/XMLFieldsGetter.cpp src/cpp/getfields.cpp
+       src/cpp/XMLFieldsGetter.cpp src/cpp/getfields.cpp \
+       src/cpp/getfieldsdictionary.cpp
 @GUI_TRUE@am__objects_1 = libscicompletion_algo_la-Completion_wrap.lo
 am__objects_2 = libscicompletion_algo_la-completion.lo \
        libscicompletion_algo_la-completion_generic.lo \
        libscicompletion_algo_la-getfilesdictionary.lo \
-       libscicompletion_algo_la-getfieldsdictionary.lo \
-       libscicompletion_algo_la-getmacrosdictionary.lo \
        libscicompletion_algo_la-toolsdictionary.lo \
        libscicompletion_algo_la-completion_wrap_java.lo \
        libscicompletion_algo_la-getPartLine.lo \
@@ -166,14 +164,14 @@ am__objects_2 = libscicompletion_algo_la-completion.lo \
 am__objects_3 = libscicompletion_algo_la-completionDictionary.lo \
        libscicompletion_algo_la-FieldsManager.lo \
        libscicompletion_algo_la-XMLFieldsGetter.lo \
-       libscicompletion_algo_la-getfields.lo
+       libscicompletion_algo_la-getfields.lo \
+       libscicompletion_algo_la-getfieldsdictionary.lo
 am_libscicompletion_algo_la_OBJECTS = $(am__objects_1) \
        $(am__objects_2) $(am__objects_3)
 libscicompletion_algo_la_OBJECTS =  \
        $(am_libscicompletion_algo_la_OBJECTS)
 libscicompletion_la_DEPENDENCIES = libscicompletion-algo.la
-am__objects_4 = libscicompletion_la-sci_completion.lo \
-       libscicompletion_la-gw_completion.lo
+am__objects_4 = libscicompletion_la-sci_completion.lo
 am_libscicompletion_la_OBJECTS = $(am__objects_4)
 libscicompletion_la_OBJECTS = $(am_libscicompletion_la_OBJECTS)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
@@ -489,8 +487,6 @@ yacc_present = @yacc_present@
 COMPLETION_C_SOURCES = src/c/completion.c \
 src/c/completion_generic.c \
 src/c/getfilesdictionary.c \
-src/c/getfieldsdictionary.c \
-src/c/getmacrosdictionary.c \
 src/c/toolsdictionary.c \
 src/c/completion_wrap_java.c \
 src/c/getPartLine.c \
@@ -504,13 +500,12 @@ COMPLETION_CPP_SOURCES = \
 src/cpp/completionDictionary.cpp \
 src/cpp/FieldsManager.cpp \
 src/cpp/XMLFieldsGetter.cpp \
-src/cpp/getfields.cpp
+src/cpp/getfields.cpp \
+src/cpp/getfieldsdictionary.cpp
 
 
 # List of the gateway c files
-GATEWAY_C_SOURCES = sci_gateway/c/sci_completion.c \
-sci_gateway/c/gw_completion.c
-
+GATEWAY_CPP_SOURCES = sci_gateway/cpp/sci_completion.cpp
 
 # Includes need for the compilation
 libscicompletion_la_CPPFLAGS = \
@@ -518,7 +513,6 @@ libscicompletion_la_CPPFLAGS = \
     -I$(srcdir)/src/c/ \
     -I$(srcdir)/src/cpp/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
-    -I$(top_srcdir)/modules/functions/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/graphics/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
@@ -545,11 +539,11 @@ noinst_LTLIBRARIES = libscicompletion-algo.la
 
 # All the sources needed by libscicompletion.la
 libscicompletion_algo_la_SOURCES = $(COMPLETION_JNI_SOURCES) $(COMPLETION_C_SOURCES) $(COMPLETION_CPP_SOURCES)
-libscicompletion_la_SOURCES = $(GATEWAY_C_SOURCES)
+libscicompletion_la_SOURCES = $(GATEWAY_CPP_SOURCES)
 libscicompletion_algo_la_CPPFLAGS = $(libscicompletion_la_CPPFLAGS)
 
 # For the code check (splint)
-CHECK_SRC = $(COMPLETION_C_SOURCES) $(GATEWAY_C_SOURCES)
+CHECK_SRC = $(COMPLETION_C_SOURCES) $(GATEWAY_CPP_SOURCES)
 INCLUDE_FLAGS = $(libscicompletion_la_CPPFLAGS)
 libscicompletion_la_LIBADD = libscicompletion-algo.la
 
@@ -570,7 +564,7 @@ libscicompletion_la_sci_gateway_DATA = sci_gateway/completion_gateway.xml
 
 #### completion : include files ####
 libscicompletion_la_includedir = $(pkgincludedir)
-libscicompletion_la_include_HEADERS = includes/gw_completion.h \
+libscicompletion_la_include_HEADERS = \
 includes/completion.h \
 includes/getCommonPart.h \
 includes/getPartLine.h \
@@ -744,7 +738,7 @@ clean-pkglibLTLIBRARIES:
 libscicompletion-algo.la: $(libscicompletion_algo_la_OBJECTS) $(libscicompletion_algo_la_DEPENDENCIES) $(EXTRA_libscicompletion_algo_la_DEPENDENCIES) 
        $(CXXLINK)  $(libscicompletion_algo_la_OBJECTS) $(libscicompletion_algo_la_LIBADD) $(LIBS)
 libscicompletion.la: $(libscicompletion_la_OBJECTS) $(libscicompletion_la_DEPENDENCIES) $(EXTRA_libscicompletion_la_DEPENDENCIES) 
-       $(LINK) -rpath $(pkglibdir) $(libscicompletion_la_OBJECTS) $(libscicompletion_la_LIBADD) $(LIBS)
+       $(CXXLINK) -rpath $(pkglibdir) $(libscicompletion_la_OBJECTS) $(libscicompletion_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -766,9 +760,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_algo_la-getfields.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_algo_la-getfilesdictionary.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_algo_la-getmacrosdictionary.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_algo_la-toolsdictionary.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_la-gw_completion.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicompletion_la-sci_completion.Plo@am__quote@
 
 .c.o:
@@ -820,20 +812,6 @@ libscicompletion_algo_la-getfilesdictionary.lo: src/c/getfilesdictionary.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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_algo_la-getfilesdictionary.lo `test -f 'src/c/getfilesdictionary.c' || echo '$(srcdir)/'`src/c/getfilesdictionary.c
 
-libscicompletion_algo_la-getfieldsdictionary.lo: src/c/getfieldsdictionary.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicompletion_algo_la-getfieldsdictionary.lo -MD -MP -MF $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Tpo -c -o libscicompletion_algo_la-getfieldsdictionary.lo `test -f 'src/c/getfieldsdictionary.c' || echo '$(srcdir)/'`src/c/getfieldsdictionary.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Tpo $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getfieldsdictionary.c' object='libscicompletion_algo_la-getfieldsdictionary.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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_algo_la-getfieldsdictionary.lo `test -f 'src/c/getfieldsdictionary.c' || echo '$(srcdir)/'`src/c/getfieldsdictionary.c
-
-libscicompletion_algo_la-getmacrosdictionary.lo: src/c/getmacrosdictionary.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicompletion_algo_la-getmacrosdictionary.lo -MD -MP -MF $(DEPDIR)/libscicompletion_algo_la-getmacrosdictionary.Tpo -c -o libscicompletion_algo_la-getmacrosdictionary.lo `test -f 'src/c/getmacrosdictionary.c' || echo '$(srcdir)/'`src/c/getmacrosdictionary.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicompletion_algo_la-getmacrosdictionary.Tpo $(DEPDIR)/libscicompletion_algo_la-getmacrosdictionary.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getmacrosdictionary.c' object='libscicompletion_algo_la-getmacrosdictionary.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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_algo_la-getmacrosdictionary.lo `test -f 'src/c/getmacrosdictionary.c' || echo '$(srcdir)/'`src/c/getmacrosdictionary.c
-
 libscicompletion_algo_la-toolsdictionary.lo: src/c/toolsdictionary.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicompletion_algo_la-toolsdictionary.lo -MD -MP -MF $(DEPDIR)/libscicompletion_algo_la-toolsdictionary.Tpo -c -o libscicompletion_algo_la-toolsdictionary.lo `test -f 'src/c/toolsdictionary.c' || echo '$(srcdir)/'`src/c/toolsdictionary.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicompletion_algo_la-toolsdictionary.Tpo $(DEPDIR)/libscicompletion_algo_la-toolsdictionary.Plo
@@ -876,20 +854,6 @@ libscicompletion_algo_la-completeLine_wrap_java.lo: src/c/completeLine_wrap_java
 @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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_algo_la-completeLine_wrap_java.lo `test -f 'src/c/completeLine_wrap_java.c' || echo '$(srcdir)/'`src/c/completeLine_wrap_java.c
 
-libscicompletion_la-sci_completion.lo: sci_gateway/c/sci_completion.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicompletion_la-sci_completion.lo -MD -MP -MF $(DEPDIR)/libscicompletion_la-sci_completion.Tpo -c -o libscicompletion_la-sci_completion.lo `test -f 'sci_gateway/c/sci_completion.c' || echo '$(srcdir)/'`sci_gateway/c/sci_completion.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicompletion_la-sci_completion.Tpo $(DEPDIR)/libscicompletion_la-sci_completion.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_completion.c' object='libscicompletion_la-sci_completion.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) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_la-sci_completion.lo `test -f 'sci_gateway/c/sci_completion.c' || echo '$(srcdir)/'`sci_gateway/c/sci_completion.c
-
-libscicompletion_la-gw_completion.lo: sci_gateway/c/gw_completion.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicompletion_la-gw_completion.lo -MD -MP -MF $(DEPDIR)/libscicompletion_la-gw_completion.Tpo -c -o libscicompletion_la-gw_completion.lo `test -f 'sci_gateway/c/gw_completion.c' || echo '$(srcdir)/'`sci_gateway/c/gw_completion.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicompletion_la-gw_completion.Tpo $(DEPDIR)/libscicompletion_la-gw_completion.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/gw_completion.c' object='libscicompletion_la-gw_completion.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) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicompletion_la-gw_completion.lo `test -f 'sci_gateway/c/gw_completion.c' || echo '$(srcdir)/'`sci_gateway/c/gw_completion.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -939,6 +903,20 @@ libscicompletion_algo_la-getfields.lo: src/cpp/getfields.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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicompletion_algo_la-getfields.lo `test -f 'src/cpp/getfields.cpp' || echo '$(srcdir)/'`src/cpp/getfields.cpp
 
+libscicompletion_algo_la-getfieldsdictionary.lo: src/cpp/getfieldsdictionary.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicompletion_algo_la-getfieldsdictionary.lo -MD -MP -MF $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Tpo -c -o libscicompletion_algo_la-getfieldsdictionary.lo `test -f 'src/cpp/getfieldsdictionary.cpp' || echo '$(srcdir)/'`src/cpp/getfieldsdictionary.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Tpo $(DEPDIR)/libscicompletion_algo_la-getfieldsdictionary.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/getfieldsdictionary.cpp' object='libscicompletion_algo_la-getfieldsdictionary.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) $(libscicompletion_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicompletion_algo_la-getfieldsdictionary.lo `test -f 'src/cpp/getfieldsdictionary.cpp' || echo '$(srcdir)/'`src/cpp/getfieldsdictionary.cpp
+
+libscicompletion_la-sci_completion.lo: sci_gateway/cpp/sci_completion.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicompletion_la-sci_completion.lo -MD -MP -MF $(DEPDIR)/libscicompletion_la-sci_completion.Tpo -c -o libscicompletion_la-sci_completion.lo `test -f 'sci_gateway/cpp/sci_completion.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_completion.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicompletion_la-sci_completion.Tpo $(DEPDIR)/libscicompletion_la-sci_completion.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_completion.cpp' object='libscicompletion_la-sci_completion.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) $(libscicompletion_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicompletion_la-sci_completion.lo `test -f 'sci_gateway/cpp/sci_completion.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_completion.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
diff --git a/scilab/modules/completion/includes/completion_gw.hxx b/scilab/modules/completion/includes/completion_gw.hxx
new file mode 100644 (file)
index 0000000..cb565f4
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013 - Scilab Enterprises - 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
+ *
+ */
+
+#ifndef __COMPLETION_GW_HXX__
+#define __COMPLETION_GW_HXX__
+
+#include "cpp_gateway_prototype.hxx"
+
+extern "C"
+{
+#include "dynlib_completion.h"
+}
+
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_completion, COMPLETION_IMPEXP);
+
+#endif /* !__COMPLETION_GW_HXX__ */
diff --git a/scilab/modules/completion/includes/getmacrosdictionary.h b/scilab/modules/completion/includes/getmacrosdictionary.h
deleted file mode 100644 (file)
index b8f12ca..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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
- *
- */
-#ifndef __GETMACROSDICTIONARY_H__
-#define __GETMACROSDICTIONARY_H__
-
-/**
-* get scilab macros dictionary
-* @param[out] size of returned array
-* @return array of strings
-*/
-char **getmacrosdictionary(int *sizearray);
-
-#endif /* __GETMACROSDICTIONARY_H__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/completion/includes/gw_completion.h b/scilab/modules/completion/includes/gw_completion.h
deleted file mode 100644 (file)
index e58f2a8..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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
- *
- */
-#ifndef __GW_COMPLETION_H__
-#define __GW_COMPLETION_H__
-/*--------------------------------------------------------------------------*/
-#include "dynlib_completion.h"
-/*--------------------------------------------------------------------------*/
-COMPLETION_IMPEXP int gw_completion(void);
-/*--------------------------------------------------------------------------*/
-/* Declaration of all the profile function declared and */
-/* used in sci_gateway */
-COMPLETION_IMPEXP int sci_completion(char *fname, unsigned long fname_len);
-/*--------------------------------------------------------------------------*/
-#endif /* __GW_COMPLETION_H__ */
-
diff --git a/scilab/modules/completion/sci_gateway/c/gw_completion.c b/scilab/modules/completion/sci_gateway/c/gw_completion.c
deleted file mode 100644 (file)
index ff75465..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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 "gw_completion.h"
-#include "api_scilab.h"
-#include "MALLOC.h"
-#include "callFunctionFromGateway.h"
-/*--------------------------------------------------------------------------*/
-int gw_completion(void)
-{
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/completion/sci_gateway/c/sci_completion.c b/scilab/modules/completion/sci_gateway/c/sci_completion.c
deleted file mode 100644 (file)
index 826de6e..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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 "gw_completion.h"
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "localization.h"
-#include "completion.h"
-#include "Scierror.h"
-#include "toolsdictionary.h"
-#include "freeArrayOfString.h"
-/*--------------------------------------------------------------------------*/
-static int returnEmptyMatrix(int pos);
-static int putResultOnStack(int pos, char **result, int sizeresult);
-/*--------------------------------------------------------------------------*/
-int sci_completion(char *fname, unsigned long fname_len)
-{
-    //int m1 = 0, n1 = 0;
-    //char *partOfWord = NULL;
-    //char ** Inputs1 = NULL;
-
-    //CheckRhs(1, 2);
-    //CheckLhs(1, 6);
-
-    //if (GetType(1) == sci_strings)
-    //{
-    //    GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &m1, &n1, &Inputs1);
-    //    if ( (m1 == n1) && (n1 == 1) )
-    //    {
-    //        partOfWord = Inputs1[0];
-    //    }
-    //    else
-    //    {
-    //        freeArrayOfString(Inputs1, m1 * n1);
-    //        Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-    //        return 0;
-    //    }
-    //}
-    //else
-    //{
-    //    Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), fname, 1);
-    //    return 0;
-    //}
-
-    //if (Lhs == 1)
-    //{
-    //    if (Rhs == 1)
-    //    {
-    //        char **Results = NULL;
-    //        int sizeResults = 0;
-
-    //        Results = completion(partOfWord, &sizeResults);
-    //        putResultOnStack(1, Results, sizeResults);
-    //        freePointerDictionary(Results, sizeResults);
-    //        PutLhsVar();
-    //    }
-    //    else /* Rhs == 2 */
-    //    {
-    //        if (GetType(2) == sci_strings)
-    //        {
-    //            char **Inputs2 = NULL;
-    //            char *param2 = NULL;
-    //            char **Results = NULL;
-    //            int sizeResults = 0, m2 = 0, n2 = 0;
-
-    //            GetRhsVar(2, MATRIX_OF_STRING_DATATYPE, &m2, &n2, &Inputs2);
-    //            if ( (m2 == n2) && (n2 == 1) )
-    //            {
-    //                param2 = Inputs2[0];
-    //            }
-    //            else
-    //            {
-    //                freeArrayOfString(Inputs1, m1 * n1);
-    //                freeArrayOfString(Inputs2, m2 * n2);
-    //                Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-    //                return 0;
-    //            }
-
-    //            if ( strcmp(param2, "functions") == 0 )
-    //            {
-    //                Results = completionOnFunctions(partOfWord, &sizeResults);
-    //            }
-    //            else if ( strcmp(param2, "commands") == 0 )
-    //            {
-    //                Results = completionOnCommandWords(partOfWord, &sizeResults);
-    //            }
-    //            else if ( strcmp(param2, "variables") == 0 )
-    //            {
-    //                Results = completionOnVariablesWithoutMacros(partOfWord, &sizeResults);
-    //            }
-    //            else if ( strcmp(param2, "macros") == 0 )
-    //            {
-    //                Results = completionOnMacros(partOfWord, &sizeResults);
-    //            }
-    //            else if ( strcmp(param2, "graphic_properties") == 0 )
-    //            {
-    //                Results = completionOnHandleGraphicsProperties(partOfWord, &sizeResults);
-    //            }
-    //            else if ( strcmp(param2, "files") == 0 )
-    //            {
-    //                Results = completionOnFiles(partOfWord, &sizeResults);
-    //            }
-    //            else
-    //            {
-    //                freeArrayOfString(Inputs1, m1 * n1);
-    //                freeArrayOfString(Inputs2, m2 * n2);
-    //                Scierror(999, _("%s: Wrong value for input argument: '%s', '%s', '%s', '%s', '%s' or '%s' expected.\n"), fname, "functions", "commands", "variables", "macros", "graphic_properties", "files");
-    //                return 0;
-    //            }
-    //            putResultOnStack(1, Results, sizeResults);
-    //            freePointerDictionary(Results, sizeResults);
-    //            freeArrayOfString(Inputs1, m1 * n1);
-    //            Inputs1 = NULL;
-
-    //            freeArrayOfString(Inputs2, m2 * n2);
-    //            Inputs2 = NULL;
-    //            PutLhsVar();
-
-    //        }
-    //        else
-    //        {
-    //            freeArrayOfString(Inputs1, m1 * n1);
-    //            Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), fname, 2);
-    //            return 0;
-    //        }
-    //    }
-    //}
-    //else
-    //{
-    //    char **FunctionsList = NULL;
-    //    int sizeFunctionsList = 0;
-
-    //    if (Rhs == 2)
-    //    {
-    //        freeArrayOfString(Inputs1, m1 * n1);
-    //        Scierror(999, _("%s: Wrong number of output argument(s).\n"), fname);
-    //        return 0;
-    //    }
-
-    //    FunctionsList = completionOnFunctions(partOfWord, &sizeFunctionsList);
-    //    putResultOnStack(1, FunctionsList, sizeFunctionsList);
-    //    freePointerDictionary(FunctionsList, sizeFunctionsList);
-
-    //    if (Lhs > 1)
-    //    {
-    //        char **CommandsList = NULL;
-    //        int sizeCommandsList = 0;
-
-    //        CommandsList = completionOnCommandWords(partOfWord, &sizeCommandsList);
-    //        putResultOnStack(2, CommandsList, sizeCommandsList);
-
-    //        freePointerDictionary(CommandsList, sizeCommandsList);
-    //    }
-
-    //    if (Lhs > 2)
-    //    {
-    //        char **VariablesList = NULL;
-    //        int sizeVariablesList = 0;
-
-    //        VariablesList = completionOnVariablesWithoutMacros(partOfWord, &sizeVariablesList);
-    //        putResultOnStack(3, VariablesList, sizeVariablesList);
-
-    //        freePointerDictionary(VariablesList, sizeVariablesList);
-    //    }
-
-    //    if (Lhs > 3)
-    //    {
-    //        char **MacrosList = NULL;
-    //        int sizeMacrosList = 0;
-
-    //        MacrosList = completionOnMacros(partOfWord, &sizeMacrosList);
-    //        putResultOnStack(4, MacrosList, sizeMacrosList);
-
-    //        freePointerDictionary(MacrosList, sizeMacrosList);
-    //    }
-
-    //    if (Lhs > 4)
-    //    {
-    //        char **HandleGraphicsPropertiesList = NULL;
-    //        int sizeHandleGraphicsPropertiesList = 0;
-
-    //        HandleGraphicsPropertiesList = completionOnHandleGraphicsProperties(partOfWord, &sizeHandleGraphicsPropertiesList);
-    //        putResultOnStack(5, HandleGraphicsPropertiesList, sizeHandleGraphicsPropertiesList);
-
-    //        freePointerDictionary(HandleGraphicsPropertiesList, sizeHandleGraphicsPropertiesList);
-    //    }
-
-    //    if (Lhs > 5)
-    //    {
-    //        char **PathsList = NULL;
-    //        int sizePathsList = 0;
-
-    //        PathsList = completionOnFiles(partOfWord, &sizePathsList);
-    //        putResultOnStack(6, PathsList, sizePathsList);
-
-    //        freePointerDictionary(PathsList, sizePathsList);
-    //    }
-
-    //    PutLhsVar();
-    //}
-    //if (Inputs1)
-    //{
-    //    freeArrayOfString(Inputs1, m1 * n1);
-    //}
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-static int returnEmptyMatrix(int pos)
-{
-    int l1 = 0, m1 = 0, n1 = 0;
-    CreateVarFromPtr(Rhs + pos, MATRIX_OF_DOUBLE_DATATYPE, &n1, &m1, &l1);
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-static int putResultOnStack(int pos, char **result, int sizeresult)
-{
-    if (result)
-    {
-        int m1 = 0, n1 = 0;
-        m1 = sizeresult;
-        n1 = 1;
-        CreateVarFromPtr(Rhs + pos, MATRIX_OF_STRING_DATATYPE, &m1, &n1, result);
-    }
-    else
-    {
-        returnEmptyMatrix(pos);
-    }
-    LhsVar(pos) = Rhs + pos;
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
index 453c04a..3a028ab 100644 (file)
@@ -1,33 +1,23 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
 <!--
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Allan CORNET
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2013 - Scilab Enterprises - Cedric DELAMARRE
  *
- -->
-<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">
-<GATEWAY name="completion">
-    
-    <!--
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
  Scilab
  Interface description. In this file, we define the list of the function which
  will be available into Scilab and the link to the "native" function.
 
- gatewayId is the position in the hashtable 'Interfaces' defined in the
- file SCI/modules/core/src/c/callinterf.h
-
- primitiveId is the position in the hashtable '<module>Table Tab[]' defined
- in the file modules/<module>/sci_gateway/c/gw_<module>.c
-
- primitiveName is the name of the Scilab function
-
  Don't touch if you do not know what you are doing
 -->
-    
-    <PRIMITIVE gatewayId="54" primitiveId="1" primitiveName="completion" />
-</GATEWAY>
+<module name="completion">
+    <gateway name="sci_completion" function="completion" type="1" />
+</module>
diff --git a/scilab/modules/completion/sci_gateway/cpp/sci_completion.cpp b/scilab/modules/completion/sci_gateway/cpp/sci_completion.cpp
new file mode 100644 (file)
index 0000000..b191b43
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - 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 "completion_gw.hxx"
+#include "function.hxx"
+#include "string.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "MALLOC.h"
+#include "localization.h"
+#include "completion.h"
+#include "Scierror.h"
+#include "toolsdictionary.h"
+}
+/*--------------------------------------------------------------------------*/
+static types::InternalType* doCompletion(char* _pcSomechars, char** (*pvFunction)(char*, int*));
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_completion(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    types::String* pStrSomechars = NULL;
+    char* pcSomechars = NULL;
+
+    if (in.size() < 1 || in.size() > 2)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d to %d expected."), "completion", 1, 2);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 6)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected."), "completion", 1, 6);
+        return types::Function::Error;
+    }
+
+    if (in[0]->isString() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), "completion", 1);
+        return types::Function::Error;
+    }
+
+    pStrSomechars = in[0]->getAs<types::String>();
+
+    if (pStrSomechars->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), "completion", 1);
+        return types::Function::Error;
+    }
+
+    pcSomechars = wide_string_to_UTF8(pStrSomechars->get(0));
+
+    if (in.size() == 1)
+    {
+        if (_iRetCount == 1)
+        {
+            out.push_back(doCompletion(pcSomechars, &completion));
+        }
+        else
+        {
+            out.resize(_iRetCount);
+            switch (_iRetCount)
+            {
+                case 6 :
+                    out[5] = doCompletion(pcSomechars, &completionOnFiles);
+                case 5 :
+                    out[4] = doCompletion(pcSomechars, &completionOnHandleGraphicsProperties);
+                case 4 :
+                    out[3] = doCompletion(pcSomechars, &completionOnMacros);
+                case 3 :
+                    out[2] = doCompletion(pcSomechars, &completionOnVariables);
+                case 2 :
+                    out[1] = doCompletion(pcSomechars, &completionOnCommandWords);
+                default :
+                    out[0] = doCompletion(pcSomechars, &completionOnFunctions);
+            }
+        }
+    }
+    else // if(in.size() == 2)
+    {
+        if (_iRetCount != 1)
+        {
+            Scierror(78, _("%s: Wrong number of output argument(s): %d expected."), "completion", 1);
+            return types::Function::Error;
+        }
+
+        if (in[1]->isString() == false)
+        {
+            Scierror(999, _("%s: Wrong type for input argument #%d: String expected.\n"), "completion", 2);
+            return types::Function::Error;
+        }
+
+        types::String* pStrDictionary = in[1]->getAs<types::String>();
+
+        if (pStrDictionary->isScalar() == false)
+        {
+            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), "completion", 2);
+            return types::Function::Error;
+        }
+
+        wchar_t* wcsDictionary = pStrDictionary->get(0);
+        if ( wcscmp(wcsDictionary, L"functions") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnFunctions));
+        }
+        else if ( wcscmp(wcsDictionary, L"commands") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnCommandWords));
+        }
+        else if ( wcscmp(wcsDictionary, L"variables") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnVariables));
+        }
+        else if ( wcscmp(wcsDictionary, L"macros") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnMacros));
+        }
+        else if ( wcscmp(wcsDictionary, L"graphic_properties") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnHandleGraphicsProperties));
+        }
+        else if ( wcscmp(wcsDictionary, L"files") == 0 )
+        {
+            out.push_back(doCompletion(pcSomechars, &completionOnFiles));
+        }
+        else
+        {
+            Scierror(999, _("%s: Wrong value for input argument: '%s', '%s', '%s', '%s', '%s' or '%s' expected.\n"),
+                     "completion", "functions", "commands", "variables", "macros", "graphic_properties", "files");
+            return types::Function::Error;
+        }
+    }
+
+    FREE(pcSomechars);
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
+static types::InternalType* doCompletion(char* _pcSomechars, char** (*pvFunction)(char*, int*))
+{
+    char** pstrResults  = NULL;
+    int iSizeResults    = 0;
+
+    pstrResults = (*pvFunction)(_pcSomechars, &iSizeResults);
+
+    if (iSizeResults)
+    {
+        types::String* pStrOut = new types::String(iSizeResults, 1);
+        pStrOut->set(pstrResults);
+        freePointerDictionary(pstrResults, iSizeResults);
+        return pStrOut;
+    }
+    else
+    {
+        return types::Double::Empty();
+    }
+}
+/*--------------------------------------------------------------------------*/
index 84e627b..f742d77 100644 (file)
@@ -15,8 +15,8 @@
 #include "MALLOC.h"
 #include "getvariablesname.h"
 #include "commandwords.h"
-#include "getfunctionslist.h"
-#include "getmacrosdictionary.h"
+#include "getfunctionsname.h"
+#include "getmacrosname.h"
 #include "completion_generic.h"
 #include "getfilesdictionary.h"
 #include "getfieldsdictionary.h"
@@ -24,6 +24,7 @@
 #include "getDictionaryGetProperties.h"
 #include "toolsdictionary.h"
 #include "os_strdup.h"
+#include "stdio.h"
 /*--------------------------------------------------------------------------*/
 char **completionOnDictionary(char **dictionary, int sizedictionary, char *somechars, int *sizearrayreturned);
 /*--------------------------------------------------------------------------*/
@@ -98,11 +99,10 @@ char **completionOnFunctions(char *somechars, int *sizeArrayReturned)
     char **dictionary = NULL;
     int sizedictionary = 0;
 
-    dictionary = GetFunctionsList(&sizedictionary);
+    dictionary = getFunctionsName(&sizedictionary);
 
     if (dictionary)
     {
-        dictionary = SortDictionary(dictionary, sizedictionary);
         ListWords = completionOnDictionary(dictionary, sizedictionary, somechars, sizeArrayReturned);
         freePointerDictionary(dictionary, sizedictionary);
     }
@@ -116,22 +116,21 @@ char **completionOnFunctions(char *somechars, int *sizeArrayReturned)
 char **completionOnCommandWords(char *somechars, int *sizeArrayReturned)
 {
     char **ListWords = NULL;
-    //char **dictionary = NULL;
-    //int sizedictionary = 0;
-
-    //dictionary = getcommandkeywords(&sizedictionary);
-
-    //if (dictionary)
-    //{
-    //    dictionary = SortDictionary(dictionary, sizedictionary);
-    //    dictionary = RemoveDuplicateDictionary(dictionary, &sizedictionary);
-    //    ListWords = completionOnDictionary(dictionary, sizedictionary, somechars, sizeArrayReturned);
-    //    freePointerDictionary(dictionary, sizedictionary);
-    //}
-    //else
-    //{
-    //    *sizeArrayReturned = 0;
-    //}
+    char **dictionary = NULL;
+    int sizedictionary = 0;
+
+    dictionary = getcommandkeywords(&sizedictionary);
+
+    if (dictionary)
+    {
+        dictionary = SortDictionary(dictionary, sizedictionary);
+        ListWords = completionOnDictionary(dictionary, sizedictionary, somechars, sizeArrayReturned);
+        freePointerDictionary(dictionary, sizedictionary);
+    }
+    else
+    {
+        *sizeArrayReturned = 0;
+    }
     return ListWords;
 }
 /*--------------------------------------------------------------------------*/
@@ -141,12 +140,10 @@ char **completionOnMacros(char *somechars, int *sizeArrayReturned)
     char **dictionary = NULL;
     int sizedictionary = 0;
 
-    dictionary = getmacrosdictionary(&sizedictionary);
+    dictionary = getMacrosName(&sizedictionary);
 
     if (dictionary)
     {
-        dictionary = SortDictionary(dictionary, sizedictionary);
-        dictionary = RemoveDuplicateDictionary(dictionary, &sizedictionary);
         ListWords = completionOnDictionary(dictionary, sizedictionary, somechars, sizeArrayReturned);
         freePointerDictionary(dictionary, sizedictionary);
     }
@@ -159,12 +156,11 @@ char **completionOnMacros(char *somechars, int *sizeArrayReturned)
 /*--------------------------------------------------------------------------*/
 char **completionOnVariables(char *somechars, int *sizeArrayReturned)
 {
+    int i = 0;
     char **ListWords = NULL;
     char **dictionary = NULL;
     int sizedictionary = 0;
-
     dictionary = getVariablesName(&sizedictionary, TRUE);
-
     ListWords = completionOnDictionary(dictionary, sizedictionary, somechars, sizeArrayReturned);
     freePointerDictionary(dictionary, sizedictionary);
 
@@ -190,8 +186,7 @@ char **completionOnVariablesWithoutMacros(char *somechars, int *sizeArrayReturne
         char **dictionaryMacros = NULL;
         int sizedictionaryMacros = 0;
 
-        dictionaryMacros = getmacrosdictionary(&sizedictionaryMacros);
-        dictionaryMacros = SortDictionary(dictionaryMacros, sizedictionaryMacros);
+        dictionaryMacros = getMacrosName(&sizedictionaryMacros);
 
         /* Search if we have more than one definition */
         for ( i = 0; i < sizedictionaryVariables; i++)
index 77e4463..6352d6d 100644 (file)
@@ -80,7 +80,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../../libs/libxml2;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../windows_tools/includes;../../../fileio/includes;../../../graphics/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../api_scilab/includes;../../../functions/includes;../../../xml/includes;../../../xml/src/cpp;../../../string/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/libxml2;../../../../libs/intl;../../../string/includes;../../../ast/includes;../../../types/includes;../../../xml/includes;../../../xml/src/cpp;../../../api_scilab/includes;../../../core/includes;../../../operations/includes;../../../dynamic_link/includes;../../../localization/includes;../../../output_stream/includes;../../../fileio/includes;../../../graphics/includes;../../../symbol/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;COMPLETION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../../libs/libxml2;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../windows_tools/includes;../../../fileio/includes;../../../graphics/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../api_scilab/includes;../../../functions/includes;../../../xml/includes;../../../xml/src/cpp;../../../string/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/libxml2;../../../../libs/intl;../../../string/includes;../../../ast/includes;../../../types/includes;../../../xml/includes;../../../xml/src/cpp;../../../api_scilab/includes;../../../core/includes;../../../operations/includes;../../../dynamic_link/includes;../../../localization/includes;../../../output_stream/includes;../../../fileio/includes;../../../graphics/includes;../../../symbol/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;COMPLETION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../../libs/libxml2;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../windows_tools/includes;../../../fileio/includes;../../../graphics/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../api_scilab/includes;../../../functions/includes;../../../xml/includes;../../../xml/src/cpp;../../../string/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/libxml2;../../../../libs/intl;../../../string/includes;../../../ast/includes;../../../types/includes;../../../xml/includes;../../../xml/src/cpp;../../../api_scilab/includes;../../../core/includes;../../../operations/includes;../../../dynamic_link/includes;../../../localization/includes;../../../output_stream/includes;../../../fileio/includes;../../../graphics/includes;../../../symbol/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;COMPLETION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/intl;../../../../libs/libxml2;../../../core/includes;../../../output_stream/includes;../../../localization/includes;../../../windows_tools/includes;../../../fileio/includes;../../../graphics/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../api_scilab/includes;../../../functions/includes;../../../xml/includes;../../../xml/src/cpp;../../../string/includes;../../../operations/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/libxml2;../../../../libs/intl;../../../string/includes;../../../ast/includes;../../../types/includes;../../../xml/includes;../../../xml/src/cpp;../../../api_scilab/includes;../../../core/includes;../../../operations/includes;../../../dynamic_link/includes;../../../localization/includes;../../../output_stream/includes;../../../fileio/includes;../../../graphics/includes;../../../symbol/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;COMPLETION_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_completion.cpp" />
     <ClCompile Include="..\cpp\FieldsManager.cpp" />
     <ClCompile Include="..\cpp\getfields.cpp" />
+    <ClCompile Include="..\cpp\getfieldsdictionary.cpp" />
     <ClCompile Include="..\cpp\XMLFieldsGetter.cpp" />
     <ClCompile Include="completeLine.c" />
     <ClCompile Include="completeLine_wrap_java.c" />
     <ClCompile Include="completion_wrap_java.c" />
     <ClCompile Include="DllmainCompletion.c" />
     <ClCompile Include="getCommonPart.c" />
-    <ClCompile Include="getfieldsdictionary.c" />
     <ClCompile Include="getfilesdictionary.c" />
-    <ClCompile Include="getmacrosdictionary.c" />
     <ClCompile Include="getPartLine.c" />
-    <ClCompile Include="..\..\sci_gateway\c\gw_completion.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_completion.c" />
     <ClCompile Include="toolsdictionary.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\completeLine.h" />
     <ClInclude Include="..\..\includes\getfields.h" />
+    <ClInclude Include="..\..\includes\toolsdictionary.h" />
     <ClInclude Include="..\cpp\FieldsGetter.hxx" />
     <ClInclude Include="..\cpp\FieldsManager.hxx" />
     <ClInclude Include="..\cpp\XMLFieldsGetter.hxx" />
     <ClInclude Include="..\..\includes\getCommonPart.h" />
     <ClInclude Include="..\..\includes\getfieldsdictionary.h" />
     <ClInclude Include="getfilesdictionary.h" />
-    <ClInclude Include="..\..\includes\getmacrosdictionary.h" />
     <ClInclude Include="..\..\includes\getPartLine.h" />
-    <ClInclude Include="..\..\includes\gw_completion.h" />
-    <ClInclude Include="toolsdictionary.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\locales\completion.pot" />
+    <None Include="..\..\sci_gateway\completion_gateway.xml" />
     <None Include="..\jni\Completion.i" />
     <None Include="core_import.def" />
     <None Include="..\..\completion.iss" />
-    <None Include="..\..\sci_gateway\completion_gateway.xml" />
     <None Include="..\..\Makefile.am" />
   </ItemGroup>
   <ItemGroup>
       <Project>{ecffeb0c-1eda-45ee-9a10-b18143852e17}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\operations\operations.vcxproj">
+      <Project>{1bb396f7-ce61-4cfc-9c22-266b2cfb2e74}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\output_stream\src\c\output_stream.vcxproj">
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     <ProjectReference Include="..\..\..\string\src\c\string.vcxproj">
       <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>
     </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>
     <ProjectReference Include="..\..\..\xml\xml.vcxproj">
       <Project>{ef5402da-29fd-4f1b-b98b-d284d4e27c15}</Project>
     </ProjectReference>
index 79cd4e1..324ab2d 100644 (file)
     <ClCompile Include="getCommonPart.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="getfieldsdictionary.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="getfilesdictionary.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="getPartLine.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\gw_completion.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_completion.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="toolsdictionary.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\cpp\XMLFieldsGetter.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="getmacrosdictionary.c">
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_completion.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\getfieldsdictionary.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
     <ClInclude Include="..\..\includes\getPartLine.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\gw_completion.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
-    <ClInclude Include="toolsdictionary.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\getfields.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\cpp\XMLFieldsGetter.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\getmacrosdictionary.h">
+    <ClInclude Include="..\..\includes\toolsdictionary.h">
       <Filter>Header Files</Filter>
     </ClInclude>
   </ItemGroup>
       <Filter>Libraries Dependencies\Imports</Filter>
     </None>
     <None Include="..\..\completion.iss" />
-    <None Include="..\..\sci_gateway\completion_gateway.xml" />
     <None Include="..\..\Makefile.am" />
     <None Include="..\..\locales\completion.pot">
       <Filter>localization</Filter>
     </None>
+    <None Include="..\..\sci_gateway\completion_gateway.xml" />
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="completion.rc">
index c0fab79..af9d739 100644 (file)
@@ -3,12 +3,11 @@
 
 EXPORTS
 ;core
-GetFunctionsList
 getVariablesName
-com_
 freeArrayOfString
-vstk_
-intersci_
 MyHeapAlloc
 MyHeapFree
 MyHeapRealloc
+getFunctionsName
+getcommandkeywords
+getMacrosName
diff --git a/scilab/modules/completion/src/c/getfieldsdictionary.c b/scilab/modules/completion/src/c/getfieldsdictionary.c
deleted file mode 100644 (file)
index fc4bcdd..0000000
+++ /dev/null
@@ -1,186 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2010-2011 - Calixte DENIZET
-*
-* 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> /* strcmp */
-#include <stdlib.h> /* qsort */
-#include "Scierror.h"
-#include "api_scilab.h"
-#include "MALLOC.h"
-#include "getfieldsdictionary.h"
-#include "getPartLine.h"
-#include "completion.h"
-#include "freeArrayOfString.h"
-
-#include "getfields.h"
-
-static int isInitialized = 0;
-
-/*--------------------------------------------------------------------------*/
-static int cmpNames(const void *a, const void *b)
-{
-    return strcmp(*(const char **)a, *(const char **)b);
-}
-/*--------------------------------------------------------------------------*/
-char **getfieldsdictionary(char *lineBeforeCaret, char *pattern, int *size)
-{
-    SciErr sciErr;
-    int *piAddr = NULL;
-    int *piLen = NULL;
-    int piType = 0;
-    int rows = 0;
-    int cols = 0;
-    int rc = 0;
-    int i;
-    int last = 0;
-    char **pstData = NULL;
-    char **fields = NULL;
-    char *var = NULL;
-    char *lineBeforePoint = NULL;
-    int pos = (int)(strlen(lineBeforeCaret) - strlen(pattern) - 1);
-
-    if (!isInitialized)
-    {
-        initializeFieldsGetter(1);
-        isInitialized = 1;
-    }
-
-    if (pos <= 0 || lineBeforeCaret[pos] != '.')
-    {
-        return NULL;
-    }
-
-    lineBeforePoint = (char*)MALLOC(sizeof(char) * (pos + 1));
-    if (lineBeforePoint == NULL)
-    {
-        return NULL;
-    }
-    memcpy(lineBeforePoint, lineBeforeCaret, pos);
-    lineBeforePoint[pos] = '\0';
-    var = getPartLevel(lineBeforePoint);
-    FREE(lineBeforePoint);
-    lineBeforePoint = NULL;
-
-    sciErr = getNamedVarType(NULL, var, &piType);
-    if (sciErr.iErr && piType != sci_mlist && piType != sci_tlist && piType != sci_handles)
-    {
-        FREE(var);
-        var = NULL;
-        return NULL;
-    }
-
-    if (piType == sci_mlist || piType == sci_tlist)
-    {
-        getVarAddressFromName(NULL, var, &piAddr);
-        FREE(var);
-        var = NULL;
-        if (sciErr.iErr)
-        {
-            return NULL;
-        }
-
-        sciErr = getMatrixOfStringInList(NULL, piAddr, 1, &rows, &cols, NULL, NULL);
-        if (sciErr.iErr)
-        {
-            return NULL;
-        }
-
-        rc = rows * cols;
-        if (rc == 1)
-        {
-            return NULL;
-        }
-
-        piLen = (int*)MALLOC(sizeof(int) * rc);
-        sciErr = getMatrixOfStringInList(NULL, piAddr, 1, &rows, &cols, piLen, NULL);
-        if (sciErr.iErr)
-        {
-            FREE(piLen);
-            return NULL;
-        }
-
-        pstData = (char**)MALLOC(sizeof(char*) * (rc + 1));
-        pstData[rc] = NULL;
-        for (i = 0 ; i < rc ; i++)
-        {
-            pstData[i] = (char*)MALLOC(sizeof(char) * (piLen[i] + 1));
-        }
-
-
-#pragma message("!! WARNING !! : getfielddictionnary may crash YaSp.")
-        sciErr = getMatrixOfStringInList(NULL, piAddr, 1, &rows, &cols, piLen, pstData);
-        if (sciErr.iErr)
-        {
-            FREE(piLen);
-            piLen = NULL;
-            freeArrayOfString(pstData, rc);
-            return NULL;
-        }
-        FREE(piLen);
-
-        fields = (char**)getFieldsForType(pstData[0], piAddr);
-        if (fields)
-        {
-            freeArrayOfString(pstData, rc);
-            pstData = fields;
-            for (rc = 0; fields[rc]; rc++)
-            {
-                ;
-            }
-        }
-
-        // We remove all the entries which don't begin with fieldpart
-        // and the first entry (and the second if it is a struct)
-        if (!strcmp(pstData[0], "st"))
-        {
-            FREE(pstData[0]);
-            pstData[0] = NULL;
-            FREE(pstData[1]);
-            pstData[1] = NULL;
-            if (rc == 2)
-            {
-                FREE(pstData);
-                return NULL;
-            }
-            i = 2;
-        }
-        else
-        {
-            FREE(pstData[0]);
-            pstData[0] = NULL;
-            i = 1;
-        }
-
-        for (; i < rc ; i++)
-        {
-            if (strstr(pstData[i], pattern) != pstData[i])
-            {
-                FREE(pstData[i]);
-                pstData[i] = NULL;
-            }
-            else
-            {
-                pstData[last] = pstData[i];
-                pstData[i] = NULL;
-                last++;
-            }
-        }
-
-        *size = last;
-        qsort(pstData, *size, sizeof(char*), cmpNames);
-    }
-    else
-    {
-        pstData = completionOnHandleGraphicsProperties(pattern, size);
-    }
-
-    return pstData;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/completion/src/c/getmacrosdictionary.c b/scilab/modules/completion/src/c/getmacrosdictionary.c
deleted file mode 100644 (file)
index bf04a5d..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Allan CORNET
- * Copyright (C) 2009 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#include <stdlib.h>
-#include "getmacrosdictionary.h"
-#include "getmacroslist.h"
-/*--------------------------------------------------------------------------*/
-char **getmacrosdictionary(int *sizearray)
-{
-    return getmacroslist(sizearray);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/completion/src/cpp/getfieldsdictionary.cpp b/scilab/modules/completion/src/cpp/getfieldsdictionary.cpp
new file mode 100644 (file)
index 0000000..44d8bbd
--- /dev/null
@@ -0,0 +1,179 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2010-2011 - Calixte DENIZET
+*
+* 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
+*
+*/
+
+extern "C"
+{
+#include <string.h> /* strcmp */
+#include <stdlib.h> /* qsort */
+#include "Scierror.h"
+#include "api_scilab.h"
+#include "MALLOC.h"
+#include "getfieldsdictionary.h"
+#include "getPartLine.h"
+#include "completion.h"
+#include "freeArrayOfString.h"
+#include "charEncoding.h"
+#include "getfields.h"
+}
+
+#include "context.hxx"
+#include "struct.hxx"
+#include "tlist.hxx"
+
+static int isInitialized = 0;
+
+/*--------------------------------------------------------------------------*/
+static int cmpNames(const void *a, const void *b)
+{
+    return strcmp(*(const char **)a, *(const char **)b);
+}
+/*--------------------------------------------------------------------------*/
+char **getfieldsdictionary(char *lineBeforeCaret, char *pattern, int *size)
+{
+    int rc = 0;
+    char **pstData = NULL;
+    char **fields = NULL;
+    char *pstVar = NULL;
+    wchar_t* pwstVar = NULL;
+
+    char *lineBeforePoint = NULL;
+    int pos = (int)(strlen(lineBeforeCaret) - strlen(pattern) - 1);
+
+    if (!isInitialized)
+    {
+        initializeFieldsGetter();
+        isInitialized = 1;
+    }
+
+    if (pos <= 0 || lineBeforeCaret[pos] != '.')
+    {
+        return NULL;
+    }
+
+    lineBeforePoint = (char*)MALLOC(sizeof(char) * (pos + 1));
+    if (lineBeforePoint == NULL)
+    {
+        return NULL;
+    }
+
+    memcpy(lineBeforePoint, lineBeforeCaret, pos);
+    lineBeforePoint[pos] = '\0';
+    pstVar = getPartLevel(lineBeforePoint);
+
+    pwstVar = to_wide_string(pstVar);
+    FREE(pstVar);
+
+    FREE(lineBeforePoint);
+    lineBeforePoint = NULL;
+
+    symbol::Context* pCtx = symbol::Context::getInstance();
+
+    types::InternalType* pIT = pCtx->get(symbol::Symbol(pwstVar));
+    FREE(pwstVar);
+    if (pIT == NULL)
+    {
+        return NULL;
+    }
+
+    //cells are containers but there are no fields
+    if (pIT->isContainer() == false || pIT->isCell())
+    {
+        return NULL;
+    }
+
+    if (pIT->isHandle())
+    {
+        return completionOnHandleGraphicsProperties(pattern, size);
+    }
+
+    types::String* pFields = NULL;
+    int iSize = 0;
+    if (pIT->isStruct())
+    {
+        types::Struct* pStr = pIT->getAs<types::Struct>();
+        pFields = pStr->getFieldNames();
+        if (pFields == 0)
+        {
+            return NULL;
+        }
+
+        iSize = pFields->getSize();
+
+        pstData = (char**)MALLOC(sizeof(char*) * iSize);
+
+        for (int i = 0 ; i < iSize ; i++)
+        {
+            pstData[i] = wide_string_to_UTF8(pFields->get(i));
+        }
+    }
+    else if (pIT->isTList() || pIT->isMList())
+    {
+        types::TList* pL = pIT->getAs<types::TList>();
+        pFields = pL->getFieldNames();
+
+        //bypass the value, is the (t/m)list type
+        iSize = pFields->getSize() - 1;
+        if (iSize == 0)
+        {
+            return NULL;
+        }
+
+        pstData = (char**)MALLOC(sizeof(char*) * iSize);
+
+        for (int i = 0 ; i < iSize ; i++)
+        {
+            pstData[i] = wide_string_to_UTF8(pFields->get(i + 1));
+        }
+    }
+    else
+    {
+        return NULL;
+    }
+
+
+    fields = (char**)getFieldsForType(pstData[0], NULL);
+    if (fields)
+    {
+        freeArrayOfString(pstData, rc);
+        pstData = fields;
+        for (rc = 0; fields[rc]; rc++)
+        {
+            ;
+        }
+    }
+
+    int iLast = 0;
+    for (int i = 0 ; i < iSize ; i++)
+    {
+        if (strstr(pstData[i], pattern) != pstData[i])
+        {
+            FREE(pstData[i]);
+            pstData[i] = NULL;
+        }
+        else if (pstData[iLast] != pstData[i])
+        {
+            pstData[iLast] = pstData[i];
+            pstData[i] = NULL;
+            iLast++;
+        }
+        else
+        {
+            iLast++;
+        }
+    }
+
+    *size = iLast;
+    qsort(pstData, *size, sizeof(char*), cmpNames);
+
+    return pstData;
+}
+/*--------------------------------------------------------------------------*/
index 91d3dc6..cfe58a8 100644 (file)
@@ -12,7 +12,6 @@
 #include "completion.h"
 #include "Scierror.h"
 #include "localization.h"
-#include "gw_completion.h"
 /*--------------------------------------------------------------------------*/
 int gw_completion(void)
 {
index 0807feb..af7737d 100644 (file)
 //    macro, its name appears twice in the completion list: as a macro and as a variable.
 
 
-[a, b, c, d] = completion("with");
+[a, b, c, d] = completion("with")
 assert_checkequal(c, []);
 
 with_tk();
-[a, b, c, d]=completion("with");
+[a, b, c, d]=completion("with")
 assert_checkequal(c, []);
 
 clear with_tk
-[a, b, c, d]=completion("with");
+[a, b, c, d]=completion("with")
 assert_checkequal(c, []);
 
 with_tk();
@@ -41,8 +41,7 @@ ref_c = [];
 ref_d = ["with_foo"; ..
          "with_javasci"; ..
          "with_macros_source"; ..
-         "with_modelica_compiler"; ..
-         "with_tk"];
+         "with_modelica_compiler";];
 
 assert_checkequal(a, ref_a);
 assert_checkequal(b, ref_b);
index 82ca39d..eae6cee 100644 (file)
@@ -11,7 +11,7 @@
 // http://bugzilla.scilab.org/show_bug.cgi?id=3051
 //
 // <-- Short Description -->
-// 
+//
 
 // <-- CLI SHELL MODE -->
 
@@ -29,7 +29,7 @@ r = completion(currentline);
 if ~and(r == ref) then pause,end
 
 if getcommonpart(r) <> 'gethistory' then pause,end
-                    
+
 cd SCI/contrib/;
 //cd toolbo[TAB]
 currentline = 'cd toolbo';
@@ -41,7 +41,7 @@ if r2 <> 'toolbox_skeleton' + filesep() then pause,end
 
 if size(r2,'*') <> 1 then
     // remove toolbox_skeleton.iss not in release
-    r2 = r2(1);
+    r2 = r2(2);
 end
 r = completeline(currentline,r2,getpartlevel(currentline),getfilepartlevel(currentline),%t);
 if r <> 'cd toolbox_skeleton' + filesep() then pause,end
index e5041a8..ef36838 100644 (file)
@@ -147,7 +147,7 @@ r = completion('abo');
 assert_checkequal(r, ['abort'; 'about']);
 
 r = completion('abo', 'functions');
-assert_checkequal(r, 'about');
+assert_checkequal(r, ['abort'; 'about']);
 
 r = completion('abo', 'commands');
 assert_checkequal(r, 'abort');
@@ -176,7 +176,7 @@ assert_checkequal(graphic_properties, ['horizontalalignment']);
 assert_checkequal(files, []);
 
 [functions,commands,variables,macros,graphic_properties,files] = completion('abo');
-assert_checkequal(functions, ['about']);
+assert_checkequal(functions, ['abort'; 'about']);
 assert_checkequal(commands, ['abort']);
 assert_checkequal(variables, []);
 assert_checkequal(macros, []);
index e52b3d2..775520c 100644 (file)
@@ -50,7 +50,7 @@ table = ["completeline"    ,"sci_completeline"    ;
 "getfields"       ,"sci_getfields" ];
 
 
-libname = ilib_build(ilib_name,table,files,libs,[],"",cflags);
+ilib_build(ilib_name,table,files,libs,[],"",cflags);
 
 cd(previous_dir);
 
index bb5ecfb..79f179d 100644 (file)
 *
 */
 /*--------------------------------------------------------------------------*/
-#define __USE_DEPRECATED_STACK_FUNCTIONS__
-#include "stack-c.h"
+#include "api_scilab.h"
 #include "completeLine.h"
 #include "localization.h"
 #include "Scierror.h"
 #include "BOOL.h"
-#include "freeArrayOfString.h"
 #include "MALLOC.h"
 /*--------------------------------------------------------------------------*/
-int sci_completeline(char *fname, unsigned long fname_len)
+int sci_completeline(char *fname, void *pvApiCtx)
 {
-    char *postCaretLine = NULL;
-    char **InputString_Parameter6 = NULL;
+    SciErr sciErr;
+    int* piAddr1 = NULL;
+    int* piAddr2 = NULL;
+    int* piAddr3 = NULL;
+    int* piAddr4 = NULL;
+    int* piAddr5 = NULL;
+    int* piAddr6 = NULL;
 
-    CheckRhs(5, 6);
-    CheckLhs(1, 1);
+    char *currentline       = NULL;
+    char *stringToAdd       = NULL;
+    char *filePattern       = NULL;
+    char *defaultPattern    = NULL;
+    int stringToAddIsPath   = FALSE;
+    char *postCaretLine     = NULL;
+    char *result            = NULL;
 
-    if (Rhs == 6)
+    CheckInputArgument(pvApiCtx, 5, 6);
+    CheckOutputArgument(pvApiCtx, 1, 1);
+
+    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr1);
+    if (sciErr.iErr)
     {
-        if (GetType(6) == sci_strings)
-        {
-            int m6 = 0;
-            int n6 = 0;
-
-            GetRhsVar(6, MATRIX_OF_STRING_DATATYPE, &m6, &n6, &InputString_Parameter6);
-            if ( (m6 == 1) && (n6 == 1) )
-            {
-                postCaretLine = InputString_Parameter6[0];
-            }
-            else
-            {
-                freeArrayOfString(InputString_Parameter6, m6 * n6);
-                Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 6);
-                return 0;
-            }
-        }
-        else
-        {
-            Scierror(999, _("%s: Wrong type for input arguments.\n"), fname);
-            return 0;
-        }
+        printError(&sciErr, 0);
+        return 1;
     }
-    else
+
+    if (getAllocatedSingleString(pvApiCtx, piAddr1, &currentline))
     {
-        InputString_Parameter6 = (char**)MALLOC(sizeof(char*) * 1);
-        InputString_Parameter6[0] = (char*)MALLOC(sizeof(char) * ((int)strlen("") + 1));
-        strcpy(InputString_Parameter6[0], "");
-        postCaretLine = InputString_Parameter6[0];
+        Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 1);
+        return 1;
     }
 
-    if ( (GetType(1) == sci_strings) &&
-            (GetType(2) == sci_strings) &&
-            (GetType(3) == sci_strings) &&
-            (GetType(4) == sci_strings) &&
-            (GetType(5) == sci_boolean) )
+    sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddr2);
+    if (sciErr.iErr)
     {
-        char *currentline = NULL;
-        char *stringToAdd = NULL;
-        char *filePattern = NULL;
-        char *defaultPattern = NULL;
-        BOOL stringToAddIsPath = FALSE;
-        int l5 = 0;
-        int m = 0, n = 0;
-
-        char **InputString_Parameter1 = NULL;
-        char **InputString_Parameter2 = NULL;
-        char **InputString_Parameter3 = NULL;
-        char **InputString_Parameter4 = NULL;
-
-        char *result = NULL;
-
-        GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString_Parameter1);
-        if ( (m == 1) && (n == 1) )
-        {
-            currentline = InputString_Parameter1[0];
-        }
-        else
-        {
-            freeArrayOfString(InputString_Parameter1, m * n);
-            freeArrayOfString(InputString_Parameter6, 1);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-            return 0;
-        }
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        GetRhsVar(2, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString_Parameter2);
-        if ( (m == 1) && (n == 1) )
-        {
-            stringToAdd = InputString_Parameter2[0];
-        }
-        else
-        {
-            freeArrayOfString(InputString_Parameter1, 1);
-            freeArrayOfString(InputString_Parameter2, m * n);
-            freeArrayOfString(InputString_Parameter6, 1);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 2);
-            return 0;
-        }
+    if (getAllocatedSingleString(pvApiCtx, piAddr2, &stringToAdd))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 2);
+        return 1;
+    }
 
-        GetRhsVar(3, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString_Parameter3);
-        if ( (m == 1) && (n == 1) )
-        {
-            filePattern = InputString_Parameter3[0];
-        }
-        else
-        {
-            freeArrayOfString(InputString_Parameter1, 1);
-            freeArrayOfString(InputString_Parameter2, 1);
-            freeArrayOfString(InputString_Parameter3, m * n);
-            freeArrayOfString(InputString_Parameter6, 1);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 3);
-            return 0;
-        }
+    sciErr = getVarAddressFromPosition(pvApiCtx, 3, &piAddr3);
+    if (sciErr.iErr)
+    {
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        GetRhsVar(4, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString_Parameter4);
-        if ( (m == 1) && (n == 1) )
-        {
-            defaultPattern = InputString_Parameter4[0];
-        }
-        else
-        {
-            freeArrayOfString(InputString_Parameter1, 1);
-            freeArrayOfString(InputString_Parameter2, 1);
-            freeArrayOfString(InputString_Parameter3, 1);
-            freeArrayOfString(InputString_Parameter4, m * n);
-            freeArrayOfString(InputString_Parameter6, 1);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 4);
-            return 0;
-        }
+    if (getAllocatedSingleString(pvApiCtx, piAddr3, &filePattern))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 3);
+        return 1;
+    }
 
-        GetRhsVar(5, MATRIX_OF_BOOLEAN_DATATYPE, &m, &n, &l5);
-        if ( (m == 1) && (n == 1) )
-        {
-            stringToAddIsPath = (BOOL) * istk(l5);
-        }
-        else
-        {
-            freeArrayOfString(InputString_Parameter1, 1);
-            freeArrayOfString(InputString_Parameter2, 1);
-            freeArrayOfString(InputString_Parameter3, 1);
-            freeArrayOfString(InputString_Parameter4, 1);
-            freeArrayOfString(InputString_Parameter6, 1);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A boolean expected.\n"), fname, 4);
-            return 0;
-        }
+    sciErr = getVarAddressFromPosition(pvApiCtx, 4, &piAddr4);
+    if (sciErr.iErr)
+    {
+        printError(&sciErr, 0);
+        return 1;
+    }
+
+    if (getAllocatedSingleString(pvApiCtx, piAddr4, &defaultPattern))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 4);
+        return 1;
+    }
+
+    sciErr = getVarAddressFromPosition(pvApiCtx, 5, &piAddr5);
+    if (sciErr.iErr)
+    {
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        result = completeLine(currentline, stringToAdd, filePattern, defaultPattern, stringToAddIsPath, postCaretLine);
+    if(getScalarBoolean(pvApiCtx, piAddr5, &stringToAddIsPath))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A boolean expected.\n"), fname, 5);
+        return 1;
+    }
 
-        if (result == NULL)
+    if (*getNbInputArgument(pvApiCtx) == 6)
+    {
+        sciErr = getVarAddressFromPosition(pvApiCtx, 6, &piAddr6);
+        if (sciErr.iErr)
         {
-            int l = 0;
-            m = 0, n = 0;
-            CreateVar(Rhs + 1, STRING_DATATYPE,  &m, &n, &l);
+            printError(&sciErr, 0);
+            return 1;
         }
-        else
+
+        if (getAllocatedSingleString(pvApiCtx, piAddr6, &postCaretLine))
         {
-            n = 1;
-            CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, (m = (int)strlen(result), &m), &n, &result);
-            if (result)
-            {
-                FREE(result);
-                result = NULL;
-            }
+            Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 6);
+            return 1;
         }
-        LhsVar(1) = Rhs + 1;
+    }
+    else
+    {
+        postCaretLine = (char*)MALLOC(sizeof(char));
+        postCaretLine[0] = '\0';
+    }
 
-        freeArrayOfString(InputString_Parameter1, 1);
-        freeArrayOfString(InputString_Parameter2, 1);
-        freeArrayOfString(InputString_Parameter3, 1);
-        freeArrayOfString(InputString_Parameter4, 1);
-        freeArrayOfString(InputString_Parameter6, 1);
+    result = completeLine(currentline, stringToAdd, filePattern, defaultPattern, (BOOL)stringToAddIsPath, postCaretLine);
 
+    if (result == NULL)
+    {
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, "");
     }
     else
     {
-        Scierror(999, _("%s: Wrong type for input arguments.\n"), fname);
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, result);
+        FREE(result);
+        result = NULL;
     }
+
+    freeAllocatedSingleString(currentline);
+    freeAllocatedSingleString(stringToAdd);
+    freeAllocatedSingleString(filePattern);
+    freeAllocatedSingleString(defaultPattern);
+    if(postCaretLine)
+    {
+        freeAllocatedSingleString(postCaretLine);
+    }
+
+    AssignOutputVariable(pvApiCtx, 1) = *getNbInputArgument(pvApiCtx) + 1; // rhs + 1
+    returnArguments(pvApiCtx);
+
     return 0;
 }
 /*--------------------------------------------------------------------------*/
index cd40300..a917d54 100644 (file)
 *
 */
 /*--------------------------------------------------------------------------*/
-#define __USE_DEPRECATED_STACK_FUNCTIONS__
-#include "stack-c.h"
+#include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
 #include "BOOL.h"
-#include "freeArrayOfString.h"
 #include "MALLOC.h"
 #include "getCommonPart.h"
 /*--------------------------------------------------------------------------*/
-int sci_getcommonpart(char *fname, unsigned long fname_len)
+int sci_getcommonpart(char *fname, void *pvApiCtx)
 {
-    CheckRhs(1, 1);
-    CheckLhs(1, 1);
+    SciErr sciErr;
+    int* piAddr         = NULL;
+    char** pstrInput    = NULL;
+    char* pcOutput      = NULL;
+    int iRows           = 0;
+    int iCols           = 0;
+    int iSize           = 0;
 
-    if (GetType(1) == sci_strings)
+    CheckInputArgument(pvApiCtx, 1, 1);
+    CheckOutputArgument(pvApiCtx, 1, 1);
+
+    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+    if (sciErr.iErr)
     {
-        int m = 0, n = 0;
-        char **InputString = NULL;
-        char *Output = NULL;
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString);
-        if ( ( (m == 1) && (n != 1) ) || ( (m != 1) && (n == 1) ) )
-        {
-            Output = getCommonPart(InputString, m * n);
-            freeArrayOfString(InputString, m * n);
+    if (getAllocatedMatrixOfString(pvApiCtx, piAddr, &iRows, &iCols, &pstrInput))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A string expected.\n"), fname, 1);
+        return 1;
+    }
 
-            if (Output == NULL)
-            {
-                int l = 0;
-                m = 0, n = 0;
-                CreateVar(Rhs + 1, STRING_DATATYPE,  &m, &n, &l);
-            }
-            else
-            {
-                n = 1;
-                CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, (m = (int)strlen(Output), &m), &n, &Output);
-                if (Output)
-                {
-                    FREE(Output);
-                    Output = NULL;
-                }
-            }
+    iSize = iRows * iCols;
 
-            LhsVar(1) = Rhs + 1;
+    if (((iRows == 1) && (iCols != 1) ) || ((iRows != 1) && (iCols == 1)))
+    {
+        pcOutput = getCommonPart(pstrInput, iSize);
+        freeAllocatedMatrixOfString(iRows, iCols, pstrInput);
+
+        if (pcOutput == NULL)
+        {
+            createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, "");
         }
         else
         {
-            freeArrayOfString(InputString, m * n);
-            Scierror(999, _("%s: Wrong size for input argument %d.\n"), fname, 1);
+            createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, pcOutput);
+            FREE(pcOutput);
+            pcOutput = NULL;
         }
+
+        AssignOutputVariable(pvApiCtx, 1) = 2; // rhs + 1
+        returnArguments(pvApiCtx);
     }
     else
     {
-        Scierror(999, _("%s: Wrong type for input arguments.\n"), fname);
+        freeAllocatedMatrixOfString(iRows, iCols, pstrInput);
+        Scierror(999, _("%s: Wrong size for input argument %d.\n"), fname, 1);
     }
+
     return 0;
 }
 /*--------------------------------------------------------------------------*/
+
index 763c1c6..bf7d054 100644 (file)
 #include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
-#include "freeArrayOfString.h"
 #include "MALLOC.h"
 #include "completion.h"
 #include "getPartLine.h"
 /*--------------------------------------------------------------------------*/
-int sci_getfields(char *fname, unsigned long fname_len)
+int sci_getfields(char *fname, void *pvApiCtx)
 {
     SciErr sciErr;
     int *piAddr = NULL;
@@ -80,7 +79,7 @@ int sci_getfields(char *fname, unsigned long fname_len)
         sciErr = createMatrixOfString(pvApiCtx, Rhs + 1, 1, 1, &emptystr);
     }
 
-    freeArrayOfString(fields, sizefields);
+    freeAllocatedMatrixOfString(sizefields, 1, fields);
     if (sciErr.iErr)
     {
         printError(&sciErr, 0);
index 7f461ac..8253c5f 100644 (file)
@@ -10,8 +10,7 @@
 *
 */
 /*--------------------------------------------------------------------------*/
-#define __USE_DEPRECATED_STACK_FUNCTIONS__
-#include "stack-c.h"
+#include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
 #include "BOOL.h"
 #include "MALLOC.h"
 #include "getPartLine.h"
 /*--------------------------------------------------------------------------*/
-int sci_getfilepartlevel(char *fname, unsigned long fname_len)
+int sci_getfilepartlevel(char *fname, void *pvApiCtx)
 {
-    CheckRhs(1, 1);
-    CheckLhs(1, 1);
+    SciErr sciErr;
+    int* piAddr     = NULL;
+    char* pcInput   = NULL;
+    char* pcOutput  = NULL;
 
-    if (GetType(1) == sci_strings)
+    CheckInputArgument(pvApiCtx, 1, 1);
+    CheckOutputArgument(pvApiCtx, 1, 1);
+
+    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+    if (sciErr.iErr)
     {
-        int m = 0, n = 0;
-        char **InputString = NULL;
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString);
-        if ( (m == 1) && (n == 1) )
-        {
-            char *result = NULL;
-            result = getFilePartLevel(InputString[0]);
-            if (result == NULL)
-            {
-                int l = 0;
-                m = 0, n = 0;
-                CreateVar(Rhs + 1, STRING_DATATYPE,  &m, &n, &l);
-            }
-            else
-            {
-                n = 1;
-                CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, (m = (int)strlen(result), &m), &n, &result);
-                if (result)
-                {
-                    FREE(result);
-                    result = NULL;
-                }
-            }
+    if (getAllocatedSingleString(pvApiCtx, piAddr, &pcInput))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A scalar string expected.\n"), fname, 1);
+        return 1;
+    }
 
-            LhsVar(1) = Rhs + 1;
-        }
-        else
-        {
-            freeArrayOfString(InputString, m * n);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-        }
+    pcOutput = getFilePartLevel(pcInput);
+    freeAllocatedSingleString(pcInput);
+
+    if (pcOutput == NULL)
+    {
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, "");
     }
     else
     {
-        Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1);
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, pcOutput);
+        FREE(pcOutput);
+        pcOutput = NULL;
     }
 
+    AssignOutputVariable(pvApiCtx, 1) = 2; // rhs + 1
+    returnArguments(pvApiCtx);
+
     return 0;
 }
 /*--------------------------------------------------------------------------*/
index e5ac2b3..75b9301 100644 (file)
@@ -10,8 +10,7 @@
 *
 */
 /*--------------------------------------------------------------------------*/
-#define __USE_DEPRECATED_STACK_FUNCTIONS__
-#include "stack-c.h"
+#include "api_scilab.h"
 #include "localization.h"
 #include "Scierror.h"
 #include "BOOL.h"
 #include "MALLOC.h"
 #include "getPartLine.h"
 /*--------------------------------------------------------------------------*/
-int sci_getpartlevel(char *fname, unsigned long fname_len)
+int sci_getpartlevel(char *fname, void *pvApiCtx)
 {
-    CheckRhs(1, 1);
-    CheckLhs(1, 1);
+    SciErr sciErr;
+    int* piAddr     = NULL;
+    char* pcInput   = NULL;
+    char* pcOutput  = NULL;
 
-    if (GetType(1) == sci_strings)
+    CheckInputArgument(pvApiCtx, 1, 1);
+    CheckOutputArgument(pvApiCtx, 1, 1);
+
+    sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddr);
+    if (sciErr.iErr)
     {
-        int m = 0, n = 0;
-        char **InputString = NULL;
+        printError(&sciErr, 0);
+        return 1;
+    }
 
-        GetRhsVar(1, MATRIX_OF_STRING_DATATYPE, &m, &n, &InputString);
-        if ( (m == 1) && (n == 1) )
-        {
-            char *result = NULL;
-            result = getPartLevel(InputString[0]);
+    if (getAllocatedSingleString(pvApiCtx, piAddr, &pcInput))
+    {
+        Scierror(999, _("%s: Wrong type for argument #%d: A scalar string expected.\n"), fname, 1);
+        return 1;
+    }
 
-            if (result == NULL)
-            {
-                int l = 0;
-                m = 0, n = 0;
-                CreateVar(Rhs + 1, STRING_DATATYPE,  &m, &n, &l);
-            }
-            else
-            {
-                n = 1;
-                CreateVarFromPtr(Rhs + 1, STRING_DATATYPE, (m = (int)strlen(result), &m), &n, &result);
-                if (result)
-                {
-                    FREE(result);
-                    result = NULL;
-                }
-            }
-            LhsVar(1) = Rhs + 1;
-        }
-        else
-        {
-            freeArrayOfString(InputString, m * n);
-            Scierror(999, _("%s: Wrong size for input argument #%d: A string expected.\n"), fname, 1);
-        }
+    pcOutput = getPartLevel(pcInput);
+    freeAllocatedSingleString(pcInput);
+
+    if (pcOutput == NULL)
+    {
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, "");
     }
     else
     {
-        Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1);
+        createSingleString(pvApiCtx, *getNbInputArgument(pvApiCtx) + 1, pcOutput);
+        FREE(pcOutput);
+        pcOutput = NULL;
     }
 
+    AssignOutputVariable(pvApiCtx, 1) = 2; // rhs + 1
+    returnArguments(pvApiCtx);
+
     return 0;
 }
 /*--------------------------------------------------------------------------*/
index 0e0f72c..806efdb 100644 (file)
@@ -33,7 +33,6 @@
 #include "ConsoleRead.h"
 #include "SetConsolePrompt.h"
 #include "TermReadAndProcess.h"
-#include "sciquit.h"
 #include "getCommonPart.h"
 
 static void doCompletion(char *wk_buf, unsigned int *cursor, unsigned int *cursor_max);
index 33a48c8..2bdcfc5 100644 (file)
     <ClInclude Include="ScilabLinesUpdate.h" />
     <ClInclude Include="TermReadAndProcess.h" />
     <ClInclude Include="tohome.h" />
+    <ClInclude Include="windows\TermCompletion.h" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
index c128f07..419cc53 100644 (file)
     <ClInclude Include="..\..\includes\scilabRead.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="windows\TermCompletion.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="console.rc" />
index 460c65d..e82a07c 100644 (file)
@@ -14,27 +14,22 @@ src/c/cs2st.c \
 src/c/getval.c \
 src/c/md5.c \
 src/c/texmacs.c \
-src/c/sciquit.c \
 src/c/str2sci.c \
 src/c/getmodules.c \
 src/c/getmemory.c \
-src/c/Funtab.c \
 src/c/scimem.c \
 src/c/isanan.c \
 src/c/xscion.c \
 src/c/returnanan.c \
-src/c/LoadFunctionsTab.c \
 src/c/loadversion.c \
 src/c/version.c \
 src/c/InitializeCore.c \
-src/c/TerminateCore.c \
 src/c/coretable.c \
 src/c/GetXmlFileEncoding.c \
 src/c/islittleendian.c \
 src/c/ifexpr.c \
 src/c/getcommandlineargs.c \
 src/c/callFunctionFromGateway.c \
-src/c/getvariablesname.c \
 src/c/commandwords.c \
 src/c/freeArrayOfString.c \
 src/c/getstaticdebuginfo.c \
@@ -63,13 +58,10 @@ src/c/InitializePreferences.c \
 src/c/getmaxMALLOC.c \
 src/c/sci_mem_alloc.c \
 src/c/hashtable/hashtable.c \
-src/c/hashtable/hashtable_itr.c \
 src/c/hashtable/hashtable_utility.c
 
 CORE_CPP_SOURCES = \
-src/cpp/hashtable_core.cpp \
 src/cpp/namstr.cpp \
-src/cpp/search_functions.cpp \
 src/cpp/demangle.cpp \
 src/cpp/backtrace_print.cpp \
 src/cpp/storeCommand.cpp \
@@ -77,6 +69,9 @@ src/cpp/banner.cpp \
 src/cpp/with_module.cpp \
 src/cpp/runner.cpp \
 src/cpp/tasks.cpp \
+src/cpp/getvariablesname.cpp \
+src/cpp/getmacrosname.cpp \
+src/cpp/getfunctionsname.cpp \
 src/cpp/InitScilab.cpp
 
 
@@ -205,7 +200,6 @@ libscicore_la_CPPFLAGS = \
 -I$(top_srcdir)/modules/history_manager/includes/ \
 -I$(top_srcdir)/modules/preferences/includes/ \
 -I$(top_srcdir)/modules/external_objects/includes/ \
--I$(top_srcdir)/modules/functions/includes/ \
 -I$(top_srcdir)/modules/jvm/includes/ \
 -I$(top_srcdir)/modules/gui/includes/ \
 -I$(top_srcdir)/modules/graphics/includes/ \
@@ -279,7 +273,6 @@ includes/MALLOC.h \
 includes/PATH_MAX.h \
 includes/scilabDefaults.h \
 includes/scisparse.h \
-includes/sciquit.h \
 includes/stack-c.h \
 includes/sci_types.h \
 includes/stack-def.h \
@@ -293,7 +286,6 @@ includes/version.h \
 includes/getversion.h \
 includes/backtrace_print.h \
 includes/sci_mem_alloc.h \
-includes/hashtable_itr.h \
 includes/hashtable.h \
 includes/hashtable_utility.h
 
index bcb3edf..0ea6f44 100644 (file)
@@ -149,15 +149,13 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscicore_algo_la_LIBADD =
 am__libscicore_algo_la_SOURCES_DIST = src/c/csignal.c src/c/cs2st.c \
-       src/c/getval.c src/c/md5.c src/c/texmacs.c src/c/sciquit.c \
-       src/c/str2sci.c src/c/getmodules.c src/c/getmemory.c \
-       src/c/Funtab.c src/c/scimem.c src/c/isanan.c src/c/xscion.c \
-       src/c/returnanan.c src/c/LoadFunctionsTab.c \
+       src/c/getval.c src/c/md5.c src/c/texmacs.c src/c/str2sci.c \
+       src/c/getmodules.c src/c/getmemory.c src/c/scimem.c \
+       src/c/isanan.c src/c/xscion.c src/c/returnanan.c \
        src/c/loadversion.c src/c/version.c src/c/InitializeCore.c \
-       src/c/TerminateCore.c src/c/coretable.c \
-       src/c/GetXmlFileEncoding.c src/c/islittleendian.c \
-       src/c/ifexpr.c src/c/getcommandlineargs.c \
-       src/c/callFunctionFromGateway.c src/c/getvariablesname.c \
+       src/c/coretable.c src/c/GetXmlFileEncoding.c \
+       src/c/islittleendian.c src/c/ifexpr.c \
+       src/c/getcommandlineargs.c src/c/callFunctionFromGateway.c \
        src/c/commandwords.c src/c/freeArrayOfString.c \
        src/c/getstaticdebuginfo.c src/c/getdynamicdebuginfo.c \
        src/c/gw_dynamic_generic.c src/c/dynamic_gateways.c \
@@ -170,13 +168,13 @@ am__libscicore_algo_la_SOURCES_DIST = src/c/csignal.c src/c/cs2st.c \
        src/c/suspendProcess.c src/c/setlines.c src/c/setformat.c \
        src/c/InitializePreferences.c src/c/getmaxMALLOC.c \
        src/c/sci_mem_alloc.c src/c/hashtable/hashtable.c \
-       src/c/hashtable/hashtable_itr.c \
        src/c/hashtable/hashtable_utility.c src/c/scimem64.c \
-       src/cpp/hashtable_core.cpp src/cpp/namstr.cpp \
-       src/cpp/search_functions.cpp src/cpp/demangle.cpp \
+       src/cpp/namstr.cpp src/cpp/demangle.cpp \
        src/cpp/backtrace_print.cpp src/cpp/storeCommand.cpp \
        src/cpp/banner.cpp src/cpp/with_module.cpp src/cpp/runner.cpp \
-       src/cpp/tasks.cpp src/cpp/InitScilab.cpp src/fortran/clunit.f \
+       src/cpp/tasks.cpp src/cpp/getvariablesname.cpp \
+       src/cpp/getmacrosname.cpp src/cpp/getfunctionsname.cpp \
+       src/cpp/InitScilab.cpp src/fortran/clunit.f \
        src/fortran/getlin.f src/fortran/allowptr.f \
        src/fortran/isany.f src/fortran/setgetmode.f \
        src/fortran/showstack.f src/fortran/setippty.f \
@@ -200,23 +198,19 @@ am__libscicore_algo_la_SOURCES_DIST = src/c/csignal.c src/c/cs2st.c \
 am__objects_2 = libscicore_algo_la-csignal.lo \
        libscicore_algo_la-cs2st.lo libscicore_algo_la-getval.lo \
        libscicore_algo_la-md5.lo libscicore_algo_la-texmacs.lo \
-       libscicore_algo_la-sciquit.lo libscicore_algo_la-str2sci.lo \
-       libscicore_algo_la-getmodules.lo \
-       libscicore_algo_la-getmemory.lo libscicore_algo_la-Funtab.lo \
-       libscicore_algo_la-scimem.lo libscicore_algo_la-isanan.lo \
-       libscicore_algo_la-xscion.lo libscicore_algo_la-returnanan.lo \
-       libscicore_algo_la-LoadFunctionsTab.lo \
+       libscicore_algo_la-str2sci.lo libscicore_algo_la-getmodules.lo \
+       libscicore_algo_la-getmemory.lo libscicore_algo_la-scimem.lo \
+       libscicore_algo_la-isanan.lo libscicore_algo_la-xscion.lo \
+       libscicore_algo_la-returnanan.lo \
        libscicore_algo_la-loadversion.lo \
        libscicore_algo_la-version.lo \
        libscicore_algo_la-InitializeCore.lo \
-       libscicore_algo_la-TerminateCore.lo \
        libscicore_algo_la-coretable.lo \
        libscicore_algo_la-GetXmlFileEncoding.lo \
        libscicore_algo_la-islittleendian.lo \
        libscicore_algo_la-ifexpr.lo \
        libscicore_algo_la-getcommandlineargs.lo \
        libscicore_algo_la-callFunctionFromGateway.lo \
-       libscicore_algo_la-getvariablesname.lo \
        libscicore_algo_la-commandwords.lo \
        libscicore_algo_la-freeArrayOfString.lo \
        libscicore_algo_la-getstaticdebuginfo.lo \
@@ -242,16 +236,16 @@ am__objects_2 = libscicore_algo_la-csignal.lo \
        libscicore_algo_la-getmaxMALLOC.lo \
        libscicore_algo_la-sci_mem_alloc.lo \
        libscicore_algo_la-hashtable.lo \
-       libscicore_algo_la-hashtable_itr.lo \
        libscicore_algo_la-hashtable_utility.lo $(am__objects_1)
-am__objects_3 = libscicore_algo_la-hashtable_core.lo \
-       libscicore_algo_la-namstr.lo \
-       libscicore_algo_la-search_functions.lo \
+am__objects_3 = libscicore_algo_la-namstr.lo \
        libscicore_algo_la-demangle.lo \
        libscicore_algo_la-backtrace_print.lo \
        libscicore_algo_la-storeCommand.lo \
        libscicore_algo_la-banner.lo libscicore_algo_la-with_module.lo \
        libscicore_algo_la-runner.lo libscicore_algo_la-tasks.lo \
+       libscicore_algo_la-getvariablesname.lo \
+       libscicore_algo_la-getmacrosname.lo \
+       libscicore_algo_la-getfunctionsname.lo \
        libscicore_algo_la-InitScilab.lo
 @USE_DYNAMIC_STACK_TRUE@am__objects_4 = relocstack.lo
 am__objects_5 = clunit.lo getlin.lo allowptr.lo isany.lo setgetmode.lo \
@@ -607,33 +601,28 @@ top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
 CORE_C_SOURCES = src/c/csignal.c src/c/cs2st.c src/c/getval.c \
-       src/c/md5.c src/c/texmacs.c src/c/sciquit.c src/c/str2sci.c \
-       src/c/getmodules.c src/c/getmemory.c src/c/Funtab.c \
-       src/c/scimem.c src/c/isanan.c src/c/xscion.c \
-       src/c/returnanan.c src/c/LoadFunctionsTab.c \
-       src/c/loadversion.c src/c/version.c src/c/InitializeCore.c \
-       src/c/TerminateCore.c src/c/coretable.c \
+       src/c/md5.c src/c/texmacs.c src/c/str2sci.c src/c/getmodules.c \
+       src/c/getmemory.c src/c/scimem.c src/c/isanan.c src/c/xscion.c \
+       src/c/returnanan.c src/c/loadversion.c src/c/version.c \
+       src/c/InitializeCore.c src/c/coretable.c \
        src/c/GetXmlFileEncoding.c src/c/islittleendian.c \
        src/c/ifexpr.c src/c/getcommandlineargs.c \
-       src/c/callFunctionFromGateway.c src/c/getvariablesname.c \
-       src/c/commandwords.c src/c/freeArrayOfString.c \
-       src/c/getstaticdebuginfo.c src/c/getdynamicdebuginfo.c \
-       src/c/gw_dynamic_generic.c src/c/dynamic_gateways.c \
-       src/c/readGateway.c src/c/comparehandles.c \
-       src/c/setPrecisionFPU.c src/c/LaunchScilabSignal.c \
-       src/c/getos.c src/c/mode_exec.c src/c/transposeMatrix.c \
-       src/c/recursionFunction.c src/c/eqid.c src/c/exitCodeValue.c \
-       src/c/getversion.c src/c/dynamic_tclsci.c \
-       src/c/dynamic_parallel.c src/c/backtrace.c src/c/signal_mgmt.c \
-       src/c/suspendProcess.c src/c/setlines.c src/c/setformat.c \
+       src/c/callFunctionFromGateway.c src/c/commandwords.c \
+       src/c/freeArrayOfString.c src/c/getstaticdebuginfo.c \
+       src/c/getdynamicdebuginfo.c src/c/gw_dynamic_generic.c \
+       src/c/dynamic_gateways.c src/c/readGateway.c \
+       src/c/comparehandles.c src/c/setPrecisionFPU.c \
+       src/c/LaunchScilabSignal.c src/c/getos.c src/c/mode_exec.c \
+       src/c/transposeMatrix.c src/c/recursionFunction.c src/c/eqid.c \
+       src/c/exitCodeValue.c src/c/getversion.c \
+       src/c/dynamic_tclsci.c src/c/dynamic_parallel.c \
+       src/c/backtrace.c src/c/signal_mgmt.c src/c/suspendProcess.c \
+       src/c/setlines.c src/c/setformat.c \
        src/c/InitializePreferences.c src/c/getmaxMALLOC.c \
        src/c/sci_mem_alloc.c src/c/hashtable/hashtable.c \
-       src/c/hashtable/hashtable_itr.c \
        src/c/hashtable/hashtable_utility.c $(am__append_1)
 CORE_CPP_SOURCES = \
-src/cpp/hashtable_core.cpp \
 src/cpp/namstr.cpp \
-src/cpp/search_functions.cpp \
 src/cpp/demangle.cpp \
 src/cpp/backtrace_print.cpp \
 src/cpp/storeCommand.cpp \
@@ -641,6 +630,9 @@ src/cpp/banner.cpp \
 src/cpp/with_module.cpp \
 src/cpp/runner.cpp \
 src/cpp/tasks.cpp \
+src/cpp/getvariablesname.cpp \
+src/cpp/getmacrosname.cpp \
+src/cpp/getfunctionsname.cpp \
 src/cpp/InitScilab.cpp
 
 CORE_FORTRAN_SOURCES = src/fortran/clunit.f src/fortran/getlin.f \
@@ -730,7 +722,6 @@ libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
        -I$(top_srcdir)/modules/history_manager/includes/ \
        -I$(top_srcdir)/modules/preferences/includes/ \
        -I$(top_srcdir)/modules/external_objects/includes/ \
-       -I$(top_srcdir)/modules/functions/includes/ \
        -I$(top_srcdir)/modules/jvm/includes/ \
        -I$(top_srcdir)/modules/gui/includes/ \
        -I$(top_srcdir)/modules/graphics/includes/ \
@@ -788,7 +779,6 @@ includes/MALLOC.h \
 includes/PATH_MAX.h \
 includes/scilabDefaults.h \
 includes/scisparse.h \
-includes/sciquit.h \
 includes/stack-c.h \
 includes/sci_types.h \
 includes/stack-def.h \
@@ -802,7 +792,6 @@ includes/version.h \
 includes/getversion.h \
 includes/backtrace_print.h \
 includes/sci_mem_alloc.h \
-includes/hashtable_itr.h \
 includes/hashtable.h \
 includes/hashtable_utility.h
 
@@ -967,14 +956,11 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-Funtab.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-GetXmlFileEncoding.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-InitScilab.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-InitializeCore.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-InitializePreferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-LaunchScilabSignal.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-LoadFunctionsTab.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-TerminateCore.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-backtrace.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-backtrace_print.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-banner.Plo@am__quote@
@@ -993,6 +979,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-freeArrayOfString.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getcommandlineargs.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getdynamicdebuginfo.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getmacrosname.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getmaxMALLOC.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getmemory.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getmodules.Plo@am__quote@
@@ -1003,8 +991,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-getversion.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-gw_dynamic_generic.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-hashtable.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-hashtable_core.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-hashtable_itr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-hashtable_utility.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-ifexpr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-isanan.Plo@am__quote@
@@ -1020,8 +1006,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-sci_mem_alloc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-scimem.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-scimem64.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-sciquit.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-search_functions.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-setPrecisionFPU.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-setformat.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicore_algo_la-setlines.Plo@am__quote@
@@ -1127,13 +1111,6 @@ libscicore_algo_la-texmacs.lo: src/c/texmacs.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-texmacs.lo `test -f 'src/c/texmacs.c' || echo '$(srcdir)/'`src/c/texmacs.c
 
-libscicore_algo_la-sciquit.lo: src/c/sciquit.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-sciquit.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-sciquit.Tpo -c -o libscicore_algo_la-sciquit.lo `test -f 'src/c/sciquit.c' || echo '$(srcdir)/'`src/c/sciquit.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-sciquit.Tpo $(DEPDIR)/libscicore_algo_la-sciquit.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/sciquit.c' object='libscicore_algo_la-sciquit.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-sciquit.lo `test -f 'src/c/sciquit.c' || echo '$(srcdir)/'`src/c/sciquit.c
-
 libscicore_algo_la-str2sci.lo: src/c/str2sci.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-str2sci.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-str2sci.Tpo -c -o libscicore_algo_la-str2sci.lo `test -f 'src/c/str2sci.c' || echo '$(srcdir)/'`src/c/str2sci.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-str2sci.Tpo $(DEPDIR)/libscicore_algo_la-str2sci.Plo
@@ -1155,13 +1132,6 @@ libscicore_algo_la-getmemory.lo: src/c/getmemory.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-getmemory.lo `test -f 'src/c/getmemory.c' || echo '$(srcdir)/'`src/c/getmemory.c
 
-libscicore_algo_la-Funtab.lo: src/c/Funtab.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-Funtab.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-Funtab.Tpo -c -o libscicore_algo_la-Funtab.lo `test -f 'src/c/Funtab.c' || echo '$(srcdir)/'`src/c/Funtab.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-Funtab.Tpo $(DEPDIR)/libscicore_algo_la-Funtab.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/Funtab.c' object='libscicore_algo_la-Funtab.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-Funtab.lo `test -f 'src/c/Funtab.c' || echo '$(srcdir)/'`src/c/Funtab.c
-
 libscicore_algo_la-scimem.lo: src/c/scimem.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-scimem.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-scimem.Tpo -c -o libscicore_algo_la-scimem.lo `test -f 'src/c/scimem.c' || echo '$(srcdir)/'`src/c/scimem.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-scimem.Tpo $(DEPDIR)/libscicore_algo_la-scimem.Plo
@@ -1190,13 +1160,6 @@ libscicore_algo_la-returnanan.lo: src/c/returnanan.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-returnanan.lo `test -f 'src/c/returnanan.c' || echo '$(srcdir)/'`src/c/returnanan.c
 
-libscicore_algo_la-LoadFunctionsTab.lo: src/c/LoadFunctionsTab.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-LoadFunctionsTab.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-LoadFunctionsTab.Tpo -c -o libscicore_algo_la-LoadFunctionsTab.lo `test -f 'src/c/LoadFunctionsTab.c' || echo '$(srcdir)/'`src/c/LoadFunctionsTab.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-LoadFunctionsTab.Tpo $(DEPDIR)/libscicore_algo_la-LoadFunctionsTab.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/LoadFunctionsTab.c' object='libscicore_algo_la-LoadFunctionsTab.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-LoadFunctionsTab.lo `test -f 'src/c/LoadFunctionsTab.c' || echo '$(srcdir)/'`src/c/LoadFunctionsTab.c
-
 libscicore_algo_la-loadversion.lo: src/c/loadversion.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-loadversion.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-loadversion.Tpo -c -o libscicore_algo_la-loadversion.lo `test -f 'src/c/loadversion.c' || echo '$(srcdir)/'`src/c/loadversion.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-loadversion.Tpo $(DEPDIR)/libscicore_algo_la-loadversion.Plo
@@ -1218,13 +1181,6 @@ libscicore_algo_la-InitializeCore.lo: src/c/InitializeCore.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-InitializeCore.lo `test -f 'src/c/InitializeCore.c' || echo '$(srcdir)/'`src/c/InitializeCore.c
 
-libscicore_algo_la-TerminateCore.lo: src/c/TerminateCore.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-TerminateCore.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-TerminateCore.Tpo -c -o libscicore_algo_la-TerminateCore.lo `test -f 'src/c/TerminateCore.c' || echo '$(srcdir)/'`src/c/TerminateCore.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-TerminateCore.Tpo $(DEPDIR)/libscicore_algo_la-TerminateCore.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/TerminateCore.c' object='libscicore_algo_la-TerminateCore.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-TerminateCore.lo `test -f 'src/c/TerminateCore.c' || echo '$(srcdir)/'`src/c/TerminateCore.c
-
 libscicore_algo_la-coretable.lo: src/c/coretable.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-coretable.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-coretable.Tpo -c -o libscicore_algo_la-coretable.lo `test -f 'src/c/coretable.c' || echo '$(srcdir)/'`src/c/coretable.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-coretable.Tpo $(DEPDIR)/libscicore_algo_la-coretable.Plo
@@ -1267,13 +1223,6 @@ libscicore_algo_la-callFunctionFromGateway.lo: src/c/callFunctionFromGateway.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-callFunctionFromGateway.lo `test -f 'src/c/callFunctionFromGateway.c' || echo '$(srcdir)/'`src/c/callFunctionFromGateway.c
 
-libscicore_algo_la-getvariablesname.lo: src/c/getvariablesname.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-getvariablesname.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-getvariablesname.Tpo -c -o libscicore_algo_la-getvariablesname.lo `test -f 'src/c/getvariablesname.c' || echo '$(srcdir)/'`src/c/getvariablesname.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-getvariablesname.Tpo $(DEPDIR)/libscicore_algo_la-getvariablesname.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getvariablesname.c' object='libscicore_algo_la-getvariablesname.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-getvariablesname.lo `test -f 'src/c/getvariablesname.c' || echo '$(srcdir)/'`src/c/getvariablesname.c
-
 libscicore_algo_la-commandwords.lo: src/c/commandwords.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-commandwords.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-commandwords.Tpo -c -o libscicore_algo_la-commandwords.lo `test -f 'src/c/commandwords.c' || echo '$(srcdir)/'`src/c/commandwords.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-commandwords.Tpo $(DEPDIR)/libscicore_algo_la-commandwords.Plo
@@ -1470,13 +1419,6 @@ libscicore_algo_la-hashtable.lo: src/c/hashtable/hashtable.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-hashtable.lo `test -f 'src/c/hashtable/hashtable.c' || echo '$(srcdir)/'`src/c/hashtable/hashtable.c
 
-libscicore_algo_la-hashtable_itr.lo: src/c/hashtable/hashtable_itr.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-hashtable_itr.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-hashtable_itr.Tpo -c -o libscicore_algo_la-hashtable_itr.lo `test -f 'src/c/hashtable/hashtable_itr.c' || echo '$(srcdir)/'`src/c/hashtable/hashtable_itr.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-hashtable_itr.Tpo $(DEPDIR)/libscicore_algo_la-hashtable_itr.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/hashtable/hashtable_itr.c' object='libscicore_algo_la-hashtable_itr.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscicore_algo_la-hashtable_itr.lo `test -f 'src/c/hashtable/hashtable_itr.c' || echo '$(srcdir)/'`src/c/hashtable/hashtable_itr.c
-
 libscicore_algo_la-hashtable_utility.lo: src/c/hashtable/hashtable_utility.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscicore_algo_la-hashtable_utility.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-hashtable_utility.Tpo -c -o libscicore_algo_la-hashtable_utility.lo `test -f 'src/c/hashtable/hashtable_utility.c' || echo '$(srcdir)/'`src/c/hashtable/hashtable_utility.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicore_algo_la-hashtable_utility.Tpo $(DEPDIR)/libscicore_algo_la-hashtable_utility.Plo
@@ -1554,13 +1496,6 @@ libscicore_la-sci_readgateway.lo: sci_gateway/c/sci_readgateway.c
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
 
-libscicore_algo_la-hashtable_core.lo: src/cpp/hashtable_core.cpp
-@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-hashtable_core.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-hashtable_core.Tpo -c -o libscicore_algo_la-hashtable_core.lo `test -f 'src/cpp/hashtable_core.cpp' || echo '$(srcdir)/'`src/cpp/hashtable_core.cpp
-@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-hashtable_core.Tpo $(DEPDIR)/libscicore_algo_la-hashtable_core.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/hashtable_core.cpp' object='libscicore_algo_la-hashtable_core.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-hashtable_core.lo `test -f 'src/cpp/hashtable_core.cpp' || echo '$(srcdir)/'`src/cpp/hashtable_core.cpp
-
 libscicore_algo_la-namstr.lo: src/cpp/namstr.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-namstr.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-namstr.Tpo -c -o libscicore_algo_la-namstr.lo `test -f 'src/cpp/namstr.cpp' || echo '$(srcdir)/'`src/cpp/namstr.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-namstr.Tpo $(DEPDIR)/libscicore_algo_la-namstr.Plo
@@ -1568,13 +1503,6 @@ libscicore_algo_la-namstr.lo: src/cpp/namstr.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-namstr.lo `test -f 'src/cpp/namstr.cpp' || echo '$(srcdir)/'`src/cpp/namstr.cpp
 
-libscicore_algo_la-search_functions.lo: src/cpp/search_functions.cpp
-@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-search_functions.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-search_functions.Tpo -c -o libscicore_algo_la-search_functions.lo `test -f 'src/cpp/search_functions.cpp' || echo '$(srcdir)/'`src/cpp/search_functions.cpp
-@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-search_functions.Tpo $(DEPDIR)/libscicore_algo_la-search_functions.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/search_functions.cpp' object='libscicore_algo_la-search_functions.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-search_functions.lo `test -f 'src/cpp/search_functions.cpp' || echo '$(srcdir)/'`src/cpp/search_functions.cpp
-
 libscicore_algo_la-demangle.lo: src/cpp/demangle.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-demangle.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-demangle.Tpo -c -o libscicore_algo_la-demangle.lo `test -f 'src/cpp/demangle.cpp' || echo '$(srcdir)/'`src/cpp/demangle.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-demangle.Tpo $(DEPDIR)/libscicore_algo_la-demangle.Plo
@@ -1624,6 +1552,27 @@ libscicore_algo_la-tasks.lo: src/cpp/tasks.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-tasks.lo `test -f 'src/cpp/tasks.cpp' || echo '$(srcdir)/'`src/cpp/tasks.cpp
 
+libscicore_algo_la-getvariablesname.lo: src/cpp/getvariablesname.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-getvariablesname.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-getvariablesname.Tpo -c -o libscicore_algo_la-getvariablesname.lo `test -f 'src/cpp/getvariablesname.cpp' || echo '$(srcdir)/'`src/cpp/getvariablesname.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-getvariablesname.Tpo $(DEPDIR)/libscicore_algo_la-getvariablesname.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/getvariablesname.cpp' object='libscicore_algo_la-getvariablesname.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-getvariablesname.lo `test -f 'src/cpp/getvariablesname.cpp' || echo '$(srcdir)/'`src/cpp/getvariablesname.cpp
+
+libscicore_algo_la-getmacrosname.lo: src/cpp/getmacrosname.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-getmacrosname.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-getmacrosname.Tpo -c -o libscicore_algo_la-getmacrosname.lo `test -f 'src/cpp/getmacrosname.cpp' || echo '$(srcdir)/'`src/cpp/getmacrosname.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-getmacrosname.Tpo $(DEPDIR)/libscicore_algo_la-getmacrosname.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/getmacrosname.cpp' object='libscicore_algo_la-getmacrosname.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-getmacrosname.lo `test -f 'src/cpp/getmacrosname.cpp' || echo '$(srcdir)/'`src/cpp/getmacrosname.cpp
+
+libscicore_algo_la-getfunctionsname.lo: src/cpp/getfunctionsname.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-getfunctionsname.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-getfunctionsname.Tpo -c -o libscicore_algo_la-getfunctionsname.lo `test -f 'src/cpp/getfunctionsname.cpp' || echo '$(srcdir)/'`src/cpp/getfunctionsname.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-getfunctionsname.Tpo $(DEPDIR)/libscicore_algo_la-getfunctionsname.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/cpp/getfunctionsname.cpp' object='libscicore_algo_la-getfunctionsname.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) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscicore_algo_la-getfunctionsname.lo `test -f 'src/cpp/getfunctionsname.cpp' || echo '$(srcdir)/'`src/cpp/getfunctionsname.cpp
+
 libscicore_algo_la-InitScilab.lo: src/cpp/InitScilab.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicore_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscicore_algo_la-InitScilab.lo -MD -MP -MF $(DEPDIR)/libscicore_algo_la-InitScilab.Tpo -c -o libscicore_algo_la-InitScilab.lo `test -f 'src/cpp/InitScilab.cpp' || echo '$(srcdir)/'`src/cpp/InitScilab.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscicore_algo_la-InitScilab.Tpo $(DEPDIR)/libscicore_algo_la-InitScilab.Plo
diff --git a/scilab/modules/core/includes/Funtab.h b/scilab/modules/core/includes/Funtab.h
deleted file mode 100644 (file)
index 7b9cb41..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Sylvestre LEDRU
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#ifndef __FUNTAB_H__
-#define __FUNTAB_H__
-
-/**
- *    Hash table for scilab functions
- *    job is used to specify a job
- *   @param job : indicateur  de l'operation a effectuer
- *   1 recherche du pointeur fptr associe au nom id, le sous programme
- *           retourne la valeur du pointeur dans fptr. S'il n'y a pas
- *           de fonction correspondant a id funtab retourne fptr=0
- *           si id est un nom incorrect funtab retourne fptr=-1
- *   2 recherche du nom id associe au pointeur fptr s'il n'y a pas
- *           de fonction associee a ce pointeur funtab retourne
- *           id(1)=0
- *   3 ajout du nom donne par id avec le pointeur donne par fptr
- *           en cas d'erreur (nom incorrecte ou capacite de la table
- *           depasse funtab appele error et retourne avec err>0
- *   4 suppression du nom donne par id, le sous programme retourne
- *           la valeur du pointeur associe dans fptr. S'il n'y a pas
- *           de fonction correspondant a id funtab retourne fptr=0
- *           si id est un nom incorrect funtab retourne fptr=-1
- *   @param id  :vecteur de taille nsiz contenant le code scilab du nom
- *   @param fptr
- */
-int C2F(funtab)(int *id, int *fptr, int *job, char *namefunction, unsigned long namefunction_len);
-
-#endif /* __FUNTAB_H__ */
index e037bef..fe1a87b 100644 (file)
@@ -75,7 +75,7 @@
 /* 51 */                                               #include "../../fftw/includes/gw_fftw.h"
 /* 52 */                                               #include "../../jvm/includes/gw_jvm.h"
 /* 53 */                                               #include "../../console/includes/gw_console.h"
-/* 54 */                                               #include "../../completion/includes/gw_completion.h"
+/* 54 */                                               //#include "../../completion/includes/gw_completion.h"
 /* 55 */                                               #include "../../history_manager/includes/gw_history_manager.h"
 /* 56 */                                               #include "dynamic_gateways.h" /* spreadsheet */
 /* 57 */                                               #include "dynamic_gateways.h" /* graphic_export */
@@ -9,15 +9,16 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-#ifndef __GETFUNCTIONSLIST_H__
-#define __GETFUNCTIONSLIST_H__
+#ifndef __GETFUNCTIONSNAME_H__
+#define __GETFUNCTIONSNAME_H__
 
 /**
  * Return the list of the functions
  * @param[out] sizeList the size of the function list
  * @return all the functions
  */
-char **GetFunctionsList(int *sizeList);
+char **getFunctionsName(int *sizeList);
+
 /*--------------------------------------------------------------------------*/
-#endif /* __GETFUNCTIONSLIST_H__ */
+#endif /* __GETFUNCTIONSNAME_H__ */
 /*--------------------------------------------------------------------------*/
@@ -9,18 +9,16 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-#ifndef __GETMACROSLIST_H__
-#define __GETMACROSLIST_H__
-
-#include "dynlib_functions.h"
+#ifndef __GETMACROSNAME_H__
+#define __GETMACROSNAME_H__
 
 /**
 * get scilab macros list (sorted by name)
-* macros on stack and in libraries
+* macros on scilab and in libraries
 * @param[out] size of returned array
 * @return array of strings
 */
-FUNCTIONS_SCILAB_IMPEXP char **getmacroslist(int *sizearray);
+char **getMacrosName(int *sizearray);
 
-#endif /* __GETMACROSLIST_H__ */
+#endif /* __GETMACROSNAME_H__ */
 /*--------------------------------------------------------------------------*/
index 0fe1abc..7e196e3 100644 (file)
 #include "BOOL.h" /* BOOL */
 
 /**
-* get names of all variables (global+local) on stack
-* duplicated names (global+local) are removed
+* get names of all variables (global+local) on scilab
 * @param[out]size of array
 * @param[in] BOOL to sort output
 * @return an array of strings
 */
 char **getVariablesName(int *sizearray, BOOL sorted);
 
-/**
-* get names of all local variables on stack
-* @param[out]size of array
-* @param[in] BOOL to sort output
-* @return an array of strings
-*/
-char **getLocalVariablesName(int *sizearray, BOOL sorted);
-
-/**
-* get names of all global variables on stack
-* @param[out]size of array
-* @param[in] BOOL to sort output
-* @return an array of strings
-*/
-char **getGlobalVariablesName(int *sizearray, BOOL sorted);
-
 #endif /*__GETVARIABLESNAME_H__ */
 /*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/includes/hashtable_itr.h b/scilab/modules/core/includes/hashtable_itr.h
deleted file mode 100644 (file)
index a9a4a45..0000000
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Copyright (C) 2002, 2004 Christopher Clark <firstname.lastname@cl.cam.ac.uk> */
-
-#ifndef __HASHTABLE_ITR_CWC22__
-#define __HASHTABLE_ITR_CWC22__
-#include "hashtable.h"
-#include "hashtable_private.h" /* needed to enable inlining */
-
-
-/*--------------------------------------------------------------------------*/
-/* This struct is only concrete here to allow the inlining of two of the
- * accessor functions. */
-struct hashtable_itr
-{
-    struct hashtable *h;
-    struct entry *e;
-    struct entry *parent;
-    unsigned int index;
-};
-
-
-/*--------------------------------------------------------------------------*/
-/* hashtable_iterator
- */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h);
-
-/*--------------------------------------------------------------------------*/
-/* hashtable_iterator_key
- * - return the value of the (key,value) pair at the current position */
-
-extern void * hashtable_iterator_key(struct hashtable_itr *i);
-
-/*--------------------------------------------------------------------------*/
-/* value - return the value of the (key,value) pair at the current position */
-
-extern void * hashtable_iterator_value(struct hashtable_itr *i);
-
-/*--------------------------------------------------------------------------*/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr);
-
-/*--------------------------------------------------------------------------*/
-/* remove - remove current element and advance the iterator to the next element
- *          NB: if you need the value to free it, read it before
- *          removing. ie: beware memory leaks!
- *          returns zero if advanced to end of table */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr);
-
-/*--------------------------------------------------------------------------*/
-/* search - overwrite the supplied iterator, to point to the entry
- *          matching the supplied key.
-            h points to the hashtable to be searched.
- *          returns zero if not found. */
-int
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k);
-
-#define DEFINE_HASHTABLE_ITERATOR_SEARCH(fnname, keytype) \
-int fnname (struct hashtable_itr *i, struct hashtable *h, keytype *k) \
-{ \
-    return (hashtable_iterator_search(i,h,k)); \
-}
-
-
-
-#endif /* __HASHTABLE_ITR_CWC22__*/
-
-/*
- * Copyright (c) 2002, 2004, Christopher Clark
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
diff --git a/scilab/modules/core/includes/intmacr2tree.h b/scilab/modules/core/includes/intmacr2tree.h
deleted file mode 100644 (file)
index b7488b7..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2004 - INRIA - Vincent COUVERT
- *
- * 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
- *
- */
-/**************************************************/
-/* intmacr2tree.h                                 */
-/* Functions used for macr2tree() Scilab function */
-/**************************************************/
-
-/* Generic header files */
-#include <string.h>
-#include <stdio.h>
-#include <math.h>
-#include "machine.h"
-#include "stack-c.h" /* stack-def.h, stack1.h, stack2.h, stack3.h included */
-#include "Funtab.h"
-
-/**********************/
-/* External functions */
-/**********************/
-
-/* Defined in SCI/modules/core/src/c/str2sci.c */
-extern void str2sci(char** x, int n, int m); /* Write a C-string in Scilab stack */
-
-/* Defined in SCI/modules/core/src/fortran/itosci.f */
-extern void C2F(itosci)(int *intptr, int *nbrows, int *nbcols); /* Write a int in Scilab stack */
-
-/* Defined in SCI/modules/core/src/fortran/dtosci.f */
-extern void C2F(dtosci)(double *dbleptr, int *nbrows, int *nbcols); /* Write a double in Scilab stack */
-
-/* Defined in SCI/modules/core/src/fortran/cvname.f */
-extern int C2F(cvnamel)(int *id, char *str, int *jobptr, int *str_len);
-/* *jobptr==0: Get Scilab codes from C-string */
-/* *jobptr==1: Get C-string from Scilab codes */
-
-/* Defined in SCI/modules/core/src/fortran/mklist.f */
-extern int C2F(mktlist)(int *nbitems);
-
-/* Some useful definitions unexistant in stack-c.h */
-#define idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz)
-#define CvNameL(id,str,jobptr,str_len) C2F(cvnamel)(id,str,jobptr,str_len);
-#define CvStr(n,line,str,jobptr,str_len) C2F(cvstr)(n,line,str,jobptr,str_len);
-
-/**********************/
-/* Internal functions */
-/**********************/
-
-/****************************************************************
- Function name: macr2tree
- Decription:
- Create on Scilab stack a "tree" composed of imbricated lists
- and tlists using Scilab pseudo codes of Scilab macro
- Resulting "tree" is a new representation for Scilab macro
- Particularly useful for M2SCI
- Tree is emuled by a "program" tlist:
-  tlist(["program","name","outputs","inputs","statements","nblines"],..
-                   macro_name,..
-                           list_of_output_variable_tlists,..
-                                     list_of_input_variable_tlists,..
-                                             list_of_macro_statements,..
-                                                           total_number_of_lines_in_macro)
- Input:
-  - fname: name of calling function for error message
- Output:
-  - No output
- Returned value:
-  - 0 if execution succeeds
-  - not null if execution fails
-****************************************************************/
-int C2F(macr2tree) (char *fname, unsigned long fname_len);
diff --git a/scilab/modules/core/includes/sciquit.h b/scilab/modules/core/includes/sciquit.h
deleted file mode 100644 (file)
index 08d97d3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#ifndef __SCIQUIT__
-#define __SCIQUIT__
-
-#include "machine.h"
-
-/**
- * Clean up and end Scilab
- * from fortran
- */
-void sciquit(void);
-
-/**
- *  Cleanup (terminate) all the different features/modules of scilab
- * (GUI, TCL/TK, JVM ...)
- * @return 0 is the end of function is reached
- */
-int ExitScilab(void);
-
-#endif /*__SCIQUIT__*/
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/Funtab.c b/scilab/modules/core/src/c/Funtab.c
deleted file mode 100644 (file)
index 047f683..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-/*--------------------------------------------------------------------------*/
-/* Scilab function table */
-/*--------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include "hashtable_core.h"
-#include "Funtab.h"
-/*--------------------------------------------------------------------------*/
-int C2F(funtab)(int *id, int *fptr, int *job, char *namefunction, unsigned long namefunction_len)
-{
-    switch ( *job)
-    {
-        case SCI_HFUNCTIONS_FIND :
-            *fptr = 0;
-            action_hashtable_scilab_functions(id, NULL, fptr, SCI_HFUNCTIONS_FIND);
-            break;
-
-        case SCI_HFUNCTIONS_BACKSEARCH :
-            action_hashtable_scilab_functions(id, NULL, fptr, SCI_HFUNCTIONS_BACKSEARCH);
-            break;
-
-        case SCI_HFUNCTIONS_ENTER :
-            if ( (namefunction) && (namefunction_len) )
-            {
-                if (strcmp(namefunction, "NULL_NAME") == 0)
-                {
-                    /* we add function referenced only by id */
-                    /* this function has no name */
-                    action_hashtable_scilab_functions(id, NULL, fptr, SCI_HFUNCTIONS_ENTER);
-                }
-                else
-                {
-                    /* we have a function named */
-                    action_hashtable_scilab_functions(id, namefunction, fptr, SCI_HFUNCTIONS_ENTER);
-                }
-            }
-            else
-            {
-                /* namefunction == NULL or namefunction = 0 */
-                /* we add function referenced only by id */
-                /* this function has no name */
-                action_hashtable_scilab_functions(id, NULL, fptr, SCI_HFUNCTIONS_ENTER);
-            }
-            break;
-
-        case SCI_HFUNCTIONS_DELETE :
-            action_hashtable_scilab_functions(id, NULL, fptr, SCI_HFUNCTIONS_DELETE);
-            break;
-
-        default :
-            break;
-
-    }
-    return(0);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/LoadFunctionsTab.c b/scilab/modules/core/src/c/LoadFunctionsTab.c
deleted file mode 100644 (file)
index aefde74..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- * Copyright (C) 2010 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include "machine.h"
-#include "stack-def.h"
-#include "MALLOC.h"
-#include "hashtable_core.h"
-#include "getmodules.h"
-#include "readGateway.h"
-#include "LoadFunctionsTab.h"
-#include "freeArrayOfString.h"
-/*--------------------------------------------------------------------------*/
-static int firstentryLoadTable = 0;
-/*--------------------------------------------------------------------------*/
-extern int C2F(cvname)(int *, char *, int *, unsigned long int);
-/*--------------------------------------------------------------------------*/
-static int Add_a_Scilab_primitive_in_hashtable(char *str, int *GATEWAY_ID, int *PRIMITIVE_ID);
-static BOOL Load_primitives_from_gateway_xml_file(char *modulename);
-/*--------------------------------------------------------------------------*/
-void unLockLoadFunctionsTab(void)
-{
-    /* used in call_scilab see TerminateScilab */
-    firstentryLoadTable = 0;
-}
-/*--------------------------------------------------------------------------*/
-void LoadFunctionsTab(void)
-{
-    struct MODULESLIST *Modules = NULL;
-    int j = 0;
-
-    if (firstentryLoadTable != 0 )
-    {
-        return;
-    }
-
-    Modules = getmodules();
-    /**
-    * We are not freeing Modules in order to speed up the next call of
-    * getmodule freed in sciquit.c
-    */
-
-    for (j = 0; j < Modules->numberofModules; j++)
-    {
-        Load_primitives_from_gateway_xml_file(Modules->ModuleList[j]);
-    }
-    firstentryLoadTable = 1;
-
-}
-/*--------------------------------------------------------------------------*/
-static int Add_a_Scilab_primitive_in_hashtable(char *str, int *GATEWAY_ID, int *PRIMITIVE_ID)
-{
-    int scilabFunPtr;
-    int id[nsiz];
-    int zero = 0;
-    /* convert string name to scilab name */
-    C2F(cvname)(id, str, &zero, (unsigned long)strlen(str));
-
-    /* fptr returned by funptr are coded by this algo :( */
-    /* example: funptr('clc') return 53001*/
-    /* 53 gateway ID */
-    /* 1  function ID */
-    /* we can have 999 functions in a gateway */
-    /* Limitation to remove with scilab 6 */
-    scilabFunPtr = (*GATEWAY_ID) * 1000 + *PRIMITIVE_ID;
-    return( action_hashtable_scilab_functions(id, str, &scilabFunPtr, SCI_HFUNCTIONS_ENTER));
-}
-/*--------------------------------------------------------------------------*/
-static BOOL Load_primitives_from_gateway_xml_file(char *modulename)
-{
-    BOOL bOK = FALSE;
-
-    if (modulename)
-    {
-        struct gateway_struct *currentGateway = NULL;
-        currentGateway = readGateway(modulename);
-
-        if (currentGateway)
-        {
-            int i = 0;
-            for (i = 0; i < currentGateway->dimLists; i++)
-            {
-                if (currentGateway->primitivesList[i])
-                {
-                    int GATEWAY_ID = currentGateway->gatewayIdList[i];
-                    int PRIMITIVE_ID = currentGateway->primiviteIdList[i];
-
-                    Add_a_Scilab_primitive_in_hashtable(currentGateway->primitivesList[i],
-                                                        &GATEWAY_ID,
-                                                        &PRIMITIVE_ID);
-                }
-            }
-
-            /* FREE struct currentGateway */
-            freeArrayOfString(currentGateway->primitivesList, currentGateway->dimLists);
-            if (currentGateway->primiviteIdList)
-            {
-                FREE(currentGateway->primiviteIdList);
-                currentGateway->primiviteIdList = NULL;
-            }
-            if (currentGateway->gatewayIdList)
-            {
-                FREE(currentGateway->gatewayIdList);
-                currentGateway->gatewayIdList = NULL;
-            }
-            FREE(currentGateway);
-            currentGateway = NULL;
-
-            bOK = TRUE;
-        }
-    }
-    return bOK;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/TerminateCore.c b/scilab/modules/core/src/c/TerminateCore.c
deleted file mode 100644 (file)
index 6bd8f38..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2007 - INRIA - Allan CORNET
-* Copyright (C) 2010 - DIGITEO - Allan CORNET
-*
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at
-* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-*
-*/
-#include <libxml/parser.h>
-
-#include "TerminateCore.h"
-/*--------------------------------------------------------------------------*/
-#include "realmain.h" /* Get_no_startup_flag */
-#include "scirun.h" /* scirun */
-#include "getmodules.h"
-#include "scimem.h" /* freegmem */
-#include "sci_tmpdir.h" /* tmpdirc */
-#include "hashtable_core.h" /* destroy_hashtable_scilab_functions */
-#include "filesmanagement.h"
-#include "sci_mode.h"
-#include "dynamic_gateways.h" /* freeAllDynamicGateways */
-/*--------------------------------------------------------------------------*/
-BOOL TerminateCorePart1(void)
-{
-
-    // Call scilab.quit before exit.
-#if 0
-    if ( Get_no_startup_flag() == 0)
-    {
-        char *quit_script = NULL;
-
-        /* bug 3672 */
-        if (getScilabMode() == SCILAB_STD)
-        {
-            quit_script = get_sci_data_strings(QUIT_ERRCATCH_ID);
-        }
-        else
-        {
-            quit_script = get_sci_data_strings(QUIT_ID);
-        }
-
-        /* launch scilab.quit script */
-        C2F(scirun)(quit_script, (long int)strlen(quit_script));
-    }
-#endif
-    return TRUE;
-}
-/*--------------------------------------------------------------------------*/
-BOOL TerminateCorePart2(void)
-{
-    // Free stack and global stack
-    C2F(freestacklastmemory)();
-    C2F(freeglobalstacklastmemory)();
-
-    freeStackCurrentMemory();
-    freeGlobalStackCurrentMemory();
-
-
-    DisposeModulesInfo();
-
-    destroy_hashtable_scilab_functions();
-
-    /* Close all scilab's files */
-    TerminateScilabFilesList();
-
-    /*
-    * Cleanup function for the XML library.
-    */
-    xmlCleanupParser();
-
-    /** clean tmpfiles **/
-    clearTMPDIR();
-
-    /* free dynamic gateways and dynamic libraries */
-    freeAllDynamicGateways();
-
-    return TRUE;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/TerminateCore.h b/scilab/modules/core/src/c/TerminateCore.h
deleted file mode 100644 (file)
index fe16266..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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
- *
- */
-#ifndef _TERMINATECORE_H__
-#define _TERMINATECORE_H__
-#include "BOOL.h"
-
-/**
- * @TODO add comment
- *
- * @param void
- * @return <ReturnValue>
- */
-BOOL TerminateCorePart1(void);
-/**
- * @TODO add comment
- *
- * @param void
- * @return <ReturnValue>
- */
-BOOL TerminateCorePart2(void);
-
-#endif /* _TERMINATECORE_H__ */
-/*--------------------------------------------------------------------------*/
index ffa2d7f..b8d0786 100644 (file)
@@ -240,6 +240,9 @@ cd ..
   <ItemGroup>
     <ClCompile Include="..\..\..\mexlib\src\cpp\mexlib.cpp" />
     <ClCompile Include="..\cpp\banner.cpp" />
+    <ClCompile Include="..\cpp\getfunctionsname.cpp" />
+    <ClCompile Include="..\cpp\getmacrosname.cpp" />
+    <ClCompile Include="..\cpp\getvariablesname.cpp" />
     <ClCompile Include="..\cpp\InitScilab.cpp" />
     <ClCompile Include="..\cpp\runner.cpp" />
     <ClCompile Include="..\cpp\storeCommand.cpp" />
@@ -261,7 +264,6 @@ cd ..
     <ClCompile Include="exitCodeValue.c" />
     <ClCompile Include="force_link.c" />
     <ClCompile Include="freeArrayOfString.c" />
-    <ClCompile Include="Funtab.c" />
     <ClCompile Include="getcommandlineargs.c" />
     <ClCompile Include="getdynamicdebuginfo.c" />
     <ClCompile Include="getdynamicDebugInfo_Windows.c" />
@@ -273,16 +275,13 @@ cd ..
     <ClCompile Include="getstaticdebuginfo.c" />
     <ClCompile Include="getstaticDebugInfo_Windows.c" />
     <ClCompile Include="getval.c" />
-    <ClCompile Include="getvariablesname.c" />
     <ClCompile Include="getversion.c" />
     <ClCompile Include="GetXmlFileEncoding.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_core.c" />
     <ClCompile Include="gw_dynamic_generic.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_user.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_user2.c" />
-    <ClCompile Include="..\cpp\hashtable_core.cpp" />
     <ClCompile Include="hashtable\hashtable.c" />
-    <ClCompile Include="hashtable\hashtable_itr.c" />
     <ClCompile Include="hashtable\hashtable_utility.c" />
     <ClCompile Include="ifexpr.c" />
     <ClCompile Include="InitializeCore.c" />
@@ -291,7 +290,6 @@ cd ..
     <ClCompile Include="isanan.c" />
     <ClCompile Include="islittleendian.c" />
     <ClCompile Include="LaunchScilabSignal.c" />
-    <ClCompile Include="LoadFunctionsTab.c" />
     <ClCompile Include="loadversion.c" />
     <ClCompile Include="md5.c" />
     <ClCompile Include="mode_exec.c" />
@@ -300,15 +298,12 @@ cd ..
     <ClCompile Include="recursionFunction.c" />
     <ClCompile Include="returnanan.c" />
     <ClCompile Include="scimem.c" />
-    <ClCompile Include="sciquit.c" />
     <ClCompile Include="scirun.c" />
-    <ClCompile Include="..\cpp\search_functions.cpp" />
     <ClCompile Include="setformat.c" />
     <ClCompile Include="setieee.c" />
     <ClCompile Include="setlines.c" />
     <ClCompile Include="setPrecisionFPU.c" />
     <ClCompile Include="str2sci.c" />
-    <ClCompile Include="TerminateCore.c" />
     <ClCompile Include="texmacs.c" />
     <ClCompile Include="transposeMatrix.c" />
     <ClCompile Include="version.c" />
@@ -347,10 +342,10 @@ cd ..
     <ClInclude Include="..\..\includes\existfunction.h" />
     <ClInclude Include="..\..\includes\exit_status.hxx" />
     <ClInclude Include="..\..\includes\freeArrayOfString.h" />
-    <ClInclude Include="..\..\includes\Funtab.h" />
     <ClInclude Include="..\..\includes\getcommandlineargs.h" />
     <ClInclude Include="..\..\includes\GetExceptionCode.h" />
-    <ClInclude Include="..\..\includes\getfunctionslist.h" />
+    <ClInclude Include="..\..\includes\getfunctionsname.h" />
+    <ClInclude Include="..\..\includes\getmacrosname.h" />
     <ClInclude Include="..\..\includes\getmaxMALLOC.h" />
     <ClInclude Include="..\..\includes\getmemory.h" />
     <ClInclude Include="..\..\includes\getmodules.h" />
@@ -362,7 +357,6 @@ cd ..
     <ClInclude Include="..\..\includes\gw_user.h" />
     <ClInclude Include="..\..\includes\gw_user2.h" />
     <ClInclude Include="..\..\includes\hashtable.h" />
-    <ClInclude Include="..\..\includes\hashtable_itr.h" />
     <ClInclude Include="..\..\includes\hashtable_private.h" />
     <ClInclude Include="..\..\includes\hashtable_utility.h" />
     <ClInclude Include="..\..\includes\inffic.h" />
@@ -370,7 +364,6 @@ cd ..
     <ClInclude Include="..\..\includes\InitializePreferences.h" />
     <ClInclude Include="..\..\includes\initMacOSXEnv.h" />
     <ClInclude Include="..\..\includes\InitScilab.h" />
-    <ClInclude Include="..\..\includes\intmacr2tree.h" />
     <ClInclude Include="..\..\includes\isanan.h" />
     <ClInclude Include="..\..\includes\islittleendian.h" />
     <ClInclude Include="..\..\includes\LaunchScilabSignal.h" />
@@ -386,7 +379,6 @@ cd ..
     <ClInclude Include="..\..\includes\runner.hxx" />
     <ClInclude Include="..\..\includes\scilabDefaults.h" />
     <ClInclude Include="..\..\includes\scimem.h" />
-    <ClInclude Include="..\..\includes\sciquit.h" />
     <ClInclude Include="..\..\includes\scirun.h" />
     <ClInclude Include="..\..\includes\scisparse.h" />
     <ClInclude Include="..\..\includes\sci_types.h" />
@@ -432,7 +424,6 @@ cd ..
     <ClInclude Include="getstaticDebugInfo_Windows.h" />
     <ClInclude Include="getval.h" />
     <ClInclude Include="gw_dynamic_generic.h" />
-    <ClInclude Include="hashtable_core.h" />
     <ClInclude Include="ifexpr.h" />
     <ClInclude Include="inittypenames.h" />
     <ClInclude Include="LoadFunctionsTab.h" />
@@ -444,7 +435,6 @@ cd ..
     <ClInclude Include="run.h" />
     <ClInclude Include="str2sci.h" />
     <ClInclude Include="terme.h" />
-    <ClInclude Include="TerminateCore.h" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\..\..\libs\GetWindowsVersion\GetWindowsVersion.vcxproj">
index f145b6a..4eaee6c 100644 (file)
@@ -56,9 +56,6 @@
     <ClCompile Include="freeArrayOfString.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="Funtab.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="getcommandlineargs.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -86,9 +83,6 @@
     <ClCompile Include="getval.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="getvariablesname.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="getversion.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\gw_user2.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\cpp\hashtable_core.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="ifexpr.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="LaunchScilabSignal.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="LoadFunctionsTab.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="loadversion.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="scimem.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="sciquit.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\cpp\search_functions.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="str2sci.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="TerminateCore.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="texmacs.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="hashtable\hashtable.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="hashtable\hashtable_itr.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="hashtable\hashtable_utility.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\cpp\banner.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\cpp\getfunctionsname.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\getmacrosname.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\getvariablesname.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\core.iss" />
     <ClInclude Include="..\..\includes\freeArrayOfString.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\Funtab.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\getcommandlineargs.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\GetExceptionCode.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\getfunctionslist.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\getmemory.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\initMacOSXEnv.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\intmacr2tree.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\isanan.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\scimem.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\sciquit.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\scirun.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="gw_dynamic_generic.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="hashtable_core.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="ifexpr.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="terme.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="TerminateCore.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\cpp\partition.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\hashtable.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\hashtable_itr.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\hashtable_private.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="..\..\includes\InitScilab.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\getfunctionsname.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
+    <ClInclude Include="..\..\includes\getmacrosname.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\core.iss" />
index 0cf51ba..334a030 100644 (file)
@@ -278,10 +278,11 @@ nextline:
 
 char **getDynamicDebugInfo(int *sizeArray, int* pvApiCtx)
 {
+    SciErr sciErr;
+    int i = 0;
     char *value = NULL;
     char **outputDynamicList = NULL;
-    int i, position = 0;
-    SciErr sciErr;
+    int position = 0;
     int iType = 0;
     static debug_message dynamicDebug[NB_DEBUG_ELEMENT];
 
diff --git a/scilab/modules/core/src/c/getvariablesname.c b/scilab/modules/core/src/c/getvariablesname.c
deleted file mode 100644 (file)
index 2880a91..0000000
+++ /dev/null
@@ -1,209 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - 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 <stdlib.h>
-#include "getvariablesname.h"
-#include "stackinfo.h"
-#include "MALLOC.h"
-/*--------------------------------------------------------------------------*/
-static void SortStrings(char **Strings, int SizeStrings);
-static void RemoveDuplicateStrings(char **Strings, int *SizeStrings);
-/*--------------------------------------------------------------------------*/
-char **getVariablesName(int *sizearray, BOOL sorted)
-{
-    char **variables = NULL;
-
-    char **localvariables = NULL;
-    int sizelocalvariables = 0;
-
-    char **globalvariables = NULL;
-    int sizeglobalvariables = 0;
-
-    localvariables = getLocalVariablesName(&sizelocalvariables, sorted);
-    globalvariables = getGlobalVariablesName(&sizeglobalvariables, sorted);
-
-    if (localvariables || globalvariables)
-    {
-        int i = 0;
-        variables = (char **)MALLOC(sizeof(char*) * (sizelocalvariables + sizeglobalvariables + 1));
-        for (i = 0; i < sizelocalvariables ; i++)
-        {
-            variables[i] = localvariables[i];
-        }
-        for (i = sizelocalvariables; i < sizelocalvariables + sizeglobalvariables; i++)
-        {
-            variables[i] = globalvariables[i - sizelocalvariables];
-        }
-        if (localvariables)
-        {
-            FREE(localvariables);
-            localvariables = NULL;
-        }
-        if (globalvariables)
-        {
-            FREE(globalvariables);
-            globalvariables = NULL;
-        }
-    }
-
-    if (variables)
-    {
-        *sizearray = sizelocalvariables + sizeglobalvariables;
-        if (sorted)
-        {
-            SortStrings(variables, *sizearray);
-        }
-        RemoveDuplicateStrings(variables, sizearray);
-    }
-    else
-    {
-        *sizearray = 0;
-    }
-    return variables;
-}
-/*----------------------------------------------------------------------------------*/
-char **getLocalVariablesName(int *sizearray, BOOL sorted)
-{
-    char **variablesLocal = NULL;
-    //int Ltotal = 0;
-    //int Lused = 0;
-    //int j = 0;
-
-    //C2F(getvariablesinfo)(&Ltotal, &Lused);
-
-    //if (Lused > 0)
-    //{
-    //    variablesLocal = (char **)MALLOC(sizeof(char*) * (Lused + 1));
-    //    if (variablesLocal)
-    //    {
-    //        for (j = 1; j < Lused + 1; ++j)
-    //        {
-    //            variablesLocal[j - 1] = getLocalNamefromId(j);
-    //        }
-    //        *sizearray = Lused;
-    //        if (sorted)
-    //        {
-    //            SortStrings(variablesLocal, *sizearray);
-    //        }
-    //    }
-    //    else
-    //    {
-    //        *sizearray = 0;
-    //    }
-    //}
-    //else
-    //{
-    //    *sizearray = 0;
-    //}
-
-    return variablesLocal;
-}
-/*--------------------------------------------------------------------------*/
-char **getGlobalVariablesName(int *sizearray, BOOL sorted)
-{
-    char **variablesGlobal = NULL;
-    //int Gtotal = 0;
-    //int Gused = 0;
-    //int j = 0;
-
-    //C2F(getgvariablesinfo)(&Gtotal, &Gused);
-
-    //if (Gused > 0)
-    //{
-    //    variablesGlobal = (char **)MALLOC(sizeof(char*) * (Gused + 1));
-    //    if (variablesGlobal)
-    //    {
-    //        for (j = 0; j < Gused; ++j)
-    //        {
-    //            variablesGlobal[j] = getGlobalNamefromId(j);
-    //        }
-    //        *sizearray = Gused;
-    //        if (sorted)
-    //        {
-    //            SortStrings(variablesGlobal, *sizearray);
-    //        }
-    //    }
-    //    else
-    //    {
-    //        *sizearray = 0;
-    //    }
-    //}
-    //else
-    //{
-    //    *sizearray = 0;
-    //}
-
-    return variablesGlobal;
-}
-/*--------------------------------------------------------------------------*/
-static void SortStrings(char **Strings, int SizeStrings)
-{
-    int fin, i;
-    for (fin = SizeStrings - 1; fin > 0; fin--)
-    {
-        int Sorted = FALSE;
-        for (i = 0; i < fin; i++)
-        {
-            if (strcmp(Strings[i], Strings[i + 1]) > 0)
-            {
-                char *StringTmp;
-
-                StringTmp = Strings[i];
-
-                Strings[i] = Strings[i + 1];
-                Strings[i + 1] = StringTmp;
-
-                Sorted = TRUE;
-            }
-        }
-        if (!Sorted)
-        {
-            break;
-        }
-    }
-}
-/*--------------------------------------------------------------------------*/
-static void RemoveDuplicateStrings(char **Strings, int *SizeStrings)
-{
-    int fin, i;
-    int newsize = *SizeStrings;
-    for (fin = *SizeStrings - 1; fin > 0; fin--)
-    {
-        int Sorted = FALSE;
-        for (i = 0; i < fin; i++)
-        {
-            if (Strings[i])
-            {
-                if (strcmp(Strings[i], Strings[i + 1]) == 0)
-                {
-                    FREE(Strings[i + 1]);
-                    Strings[i + 1] = NULL;
-                    Sorted = TRUE;
-                    newsize--;
-                }
-            }
-            else
-            {
-                Strings[i] = Strings[i + 1];
-                Strings[i + 1] = NULL;
-                Sorted = TRUE;
-            }
-        }
-        if (!Sorted)
-        {
-            break;
-        }
-    }
-
-    *SizeStrings = newsize;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/hashtable/hashtable_itr.c b/scilab/modules/core/src/c/hashtable/hashtable_itr.c
deleted file mode 100644 (file)
index 824e464..0000000
+++ /dev/null
@@ -1,205 +0,0 @@
-/* Copyright (C) 2002, 2004 Christopher Clark  <firstname.lastname@cl.cam.ac.uk> */
-
-#include "hashtable.h"
-#include "hashtable_private.h"
-#include "hashtable_itr.h"
-#include <stdlib.h> /* defines NULL */
-#include "../../modules/core/includes/MALLOC.h"
-/*--------------------------------------------------------------------------*/
-/* hashtable_iterator    - iterator constructor */
-
-struct hashtable_itr *
-hashtable_iterator(struct hashtable *h)
-{
-    unsigned int i, tablelength;
-    struct hashtable_itr *itr = (struct hashtable_itr *) MALLOC(sizeof(struct hashtable_itr));
-    if (NULL == itr)
-    {
-        return NULL;
-    }
-    itr->h = h;
-    itr->e = NULL;
-    itr->parent = NULL;
-    tablelength = h->tablelength;
-    itr->index = tablelength;
-    if (0 == h->entrycount)
-    {
-        return itr;
-    }
-
-    for (i = 0; i < tablelength; i++)
-    {
-        if (NULL != h->table[i])
-        {
-            itr->e = h->table[i];
-            itr->index = i;
-            break;
-        }
-    }
-    return itr;
-}
-
-/*--------------------------------------------------------------------------*/
-/* key      - return the key of the (key,value) pair at the current position */
-/* value    - return the value of the (key,value) pair at the current position */
-
-void *
-hashtable_iterator_key(struct hashtable_itr *i)
-{
-    return i->e->k;
-}
-
-void *
-hashtable_iterator_value(struct hashtable_itr *i)
-{
-    return i->e->v;
-}
-
-/*--------------------------------------------------------------------------*/
-/* advance - advance the iterator to the next element
- *           returns zero if advanced to end of table */
-
-int
-hashtable_iterator_advance(struct hashtable_itr *itr)
-{
-    unsigned int j, tablelength;
-    struct entry **table;
-    struct entry *next;
-    if (NULL == itr->e)
-    {
-        return 0;    /* stupidity check */
-    }
-
-    next = itr->e->next;
-    if (NULL != next)
-    {
-        itr->parent = itr->e;
-        itr->e = next;
-        return -1;
-    }
-    tablelength = itr->h->tablelength;
-    itr->parent = NULL;
-    if (tablelength <= (j = ++(itr->index)))
-    {
-        itr->e = NULL;
-        return 0;
-    }
-    table = itr->h->table;
-    while (NULL == (next = table[j]))
-    {
-        if (++j >= tablelength)
-        {
-            itr->index = tablelength;
-            itr->e = NULL;
-            return 0;
-        }
-    }
-    itr->index = j;
-    itr->e = next;
-    return -1;
-}
-
-/*--------------------------------------------------------------------------*/
-/* remove - remove the entry at the current iterator position
- *          and advance the iterator, if there is a successive
- *          element.
- *          If you want the value, read it before you remove:
- *          beware memory leaks if you don't.
- *          Returns zero if end of iteration. */
-
-int
-hashtable_iterator_remove(struct hashtable_itr *itr)
-{
-    struct entry *remember_e, *remember_parent;
-    int ret;
-
-    /* Do the removal */
-    if (NULL == (itr->parent))
-    {
-        /* element is head of a chain */
-        itr->h->table[itr->index] = itr->e->next;
-    }
-    else
-    {
-        /* element is mid-chain */
-        itr->parent->next = itr->e->next;
-    }
-    /* itr->e is now outside the hashtable */
-    remember_e = itr->e;
-    itr->h->entrycount--;
-    freekey(remember_e->k);
-
-    /* Advance the iterator, correcting the parent */
-    remember_parent = itr->parent;
-    ret = hashtable_iterator_advance(itr);
-    if (itr->parent == remember_e)
-    {
-        itr->parent = remember_parent;
-    }
-    FREE(remember_e);
-    return ret;
-}
-
-/*--------------------------------------------------------------------------*/
-int /* returns zero if not found */
-hashtable_iterator_search(struct hashtable_itr *itr,
-                          struct hashtable *h, void *k)
-{
-    struct entry *e, *parent;
-    unsigned int hashvalue, index_;
-
-    hashvalue = hashtable_hash(h, k);
-    index_ = indexFor(h->tablelength, hashvalue);
-
-    e = h->table[index_];
-    parent = NULL;
-    while (NULL != e)
-    {
-        /* Check hash value to short circuit heavier comparison */
-        if ((hashvalue == e->h) && (h->eqfn(k, e->k)))
-        {
-            itr->index = index_;
-            itr->e = e;
-            itr->parent = parent;
-            itr->h = h;
-            return -1;
-        }
-        parent = e;
-        e = e->next;
-    }
-    return 0;
-}
-
-
-/*
- * Copyright (c) 2002, 2004, Christopher Clark
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * * Neither the name of the original author; nor the names of any contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER
- * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
diff --git a/scilab/modules/core/src/c/hashtable_core.h b/scilab/modules/core/src/c/hashtable_core.h
deleted file mode 100644 (file)
index aafe705..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA
- * Copyright (C) DIGITEO - 2009 - 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 __HASHTABLE_CORE_H__
-#define __HASHTABLE_CORE_H__
-/*--------------------------------------------------------------------------*/
-#include "addinter.h"
-#include "BOOL.h"
-/*--------------------------------------------------------------------------*/
-typedef enum
-{
-    SCI_HFUNCTIONS_FIND = 1,
-    SCI_HFUNCTIONS_BACKSEARCH = 2,
-    SCI_HFUNCTIONS_ENTER = 3,
-    SCI_HFUNCTIONS_DELETE = 4
-} SCI_HFUNCTIONS_ACTION;
-/*--------------------------------------------------------------------------*/
-/**
- * scilab 5.2 can manage 550000 primitives (max) MAXELEMENTFUNCTIONLIST
- * initialized to DEFAULT_ELEMENTFUNCTIONLIST (800) by default
- * dynamic reallocation when we add a function if it is necessary
- */
-#define MAXELEMENTFUNCTIONLIST (DynInterfStart + MAXDYNINTERF) * NumberMaxFunctionsByGateway
-#define DEFAULT_ELEMENTFUNCTIONLIST 800
-/*--------------------------------------------------------------------------*/
-/**
- * Create the hashtable of Scilab functions
- * @return TRUE or FALSE
- */
-BOOL create_hashtable_scilab_functions(void);
-
-/**
- * Destroy the hashtable of Scilab functions
- */
-void destroy_hashtable_scilab_functions(void);
-
-/**
- * Perform an action on the hashtable of Scilab functions
- * @param[in,out] key hash key
- * @param[in,out] name function name
- * @param[in,out] scilab_funptr coded by GATEWAY_ID * 1000 + PRIMITIVE_ID
- * @param[in] action SCI_HFUNCTIONS_ACTION
- * @return TRUE or FALSE
- */
-BOOL action_hashtable_scilab_functions(int *key, char *name, int *scilab_funptr, SCI_HFUNCTIONS_ACTION action);
-/*--------------------------------------------------------------------------*/
-#endif /* __HASHTABLE_CORE_H__ */
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/sciquit.c b/scilab/modules/core/src/c/sciquit.c
deleted file mode 100644 (file)
index e9c957c..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2006 - INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-#ifdef sun
-#ifndef SYSV
-#include <sys/ieeefp.h>
-#endif
-#endif
-#include "sciquit.h"
-/*--------------------------------------------------------------------------*/
-#include "TerminateCore.h"
-#include "../../../graphics/includes/TerminateGraphics.h"
-#include "dynamic_tclsci.h"
-#include "../../../gui/includes/TerminateGui.h"
-#include "../../../jvm/includes/TerminateJVM.h"
-#include "getScilabPreference.h"
-#ifdef _MSC_VER
-#include "../../../windows_tools/includes/TerminateWindows_tools.h"
-#include "../../../windows_tools/includes/MutexClosingScilab.h"
-#include "../../../windows_tools/src/c/scilab_windows/killScilabProcess.h"
-#endif
-#include "../../../gui/includes/TerminateGui.h"
-#include "sci_mode.h"
-#ifndef _MSC_VER
-#include "initConsoleMode.h"
-#endif
-/*--------------------------------------------------------------------------*/
-int ExitScilab(void)
-{
-    scilabMode CurrentScilabMode;
-
-    clearScilabPreferences();
-    TerminateCorePart1();
-
-    CurrentScilabMode = getScilabMode();
-    if (CurrentScilabMode != SCILAB_NWNI)
-    {
-        dynamic_TerminateTclTk();
-        TerminateGraphics();
-        TerminateJVM();
-    }
-
-    TerminateCorePart2();
-
-#ifdef _MSC_VER
-    TerminateWindows_tools();
-#endif
-
-#ifndef _MSC_VER
-    /* Reset Shell Settings before leaving Scilab. */
-    if (CurrentScilabMode == SCILAB_NWNI || CurrentScilabMode == SCILAB_NW)
-    {
-        initConsoleMode(ATTR_RESET);
-    }
-#endif
-    return 0;
-}
-
-/*--------------------------------------------------------------------------*/
-void sciquit(void)
-{
-#ifdef _MSC_VER
-    /* bug 3672 */
-    /* Create a Mutex (closing scilab)
-     * used by files association
-     */
-    createMutexClosingScilab();
-#endif
-
-#ifdef sun
-#ifndef SYSV
-    char **out;
-
-    ieee_flags("clearall", "exception", "all", &out);
-#endif
-#endif
-
-#ifdef _MSC_VER
-    /* close mutex (closing scilab)
-     * used by files association
-     */
-    terminateMutexClosingScilab();
-#endif
-}
-
-/*--------------------------------------------------------------------------*/
index 1bfbbd1..3ea728a 100644 (file)
@@ -79,7 +79,6 @@ static void Add_true(void);
 static void Add_false(void);
 static void Add_Nan(void);
 static void Add_Inf(void);
-static void Add_WITH_DEMOS(void);      //temporary variable
 static void Add_All_Variables(void);
 static void Add_Double_Constant(std::wstring _szName, double _dblReal, double _dblImg, bool _bComplex);
 static void Add_Poly_Constant(std::wstring _szName, std::wstring _szPolyVar, int _iRank, types::Double * _pdblReal);
@@ -648,12 +647,6 @@ static void Add_All_Variables(void)
     Add_false();
     Add_Nan();
     Add_Inf();
-    Add_WITH_DEMOS();
-}
-
-static void Add_WITH_DEMOS(void)
-{
-    Add_Boolean_Constant(L"WITH_DEMOS", false);
 }
 
 static void Add_Nan(void)
diff --git a/scilab/modules/core/src/cpp/getfunctionsname.cpp b/scilab/modules/core/src/cpp/getfunctionsname.cpp
new file mode 100644 (file)
index 0000000..bece74d
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - 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 "context.hxx"
+
+extern "C" {
+#include "MALLOC.h"
+#include "getfunctionsname.h"
+}
+/*----------------------------------------------------------------------------------*/
+char **getFunctionsName(int *sizearray)
+{
+    std::list<std::wstring> plMacrosList = symbol::Context::getInstance()->getFunctionsName();
+    std::list<std::wstring>::iterator it;
+    *sizearray = (int)plMacrosList.size();
+    char** functions = (char**)MALLOC(*sizearray * sizeof(char*));
+
+    plMacrosList.sort();
+
+    int i = 0;
+    for (it = plMacrosList.begin(); it != plMacrosList.end(); it++, i++)
+    {
+        functions[i] = wide_string_to_UTF8((*it).c_str());
+    }
+
+    return functions;
+}
diff --git a/scilab/modules/core/src/cpp/getmacrosname.cpp b/scilab/modules/core/src/cpp/getmacrosname.cpp
new file mode 100644 (file)
index 0000000..11b1857
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - 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 "context.hxx"
+
+extern "C" {
+#include "MALLOC.h"
+#include "getmacrosname.h"
+}
+/*----------------------------------------------------------------------------------*/
+char **getMacrosName(int *sizearray)
+{
+    std::list<std::wstring> plMacrosList = symbol::Context::getInstance()->getMacrosName();
+    std::list<std::wstring>::iterator it;
+    *sizearray = (int)plMacrosList.size();
+    char** macros = (char**)MALLOC(*sizearray * sizeof(char*));
+
+    plMacrosList.sort();
+
+    int i = 0;
+    for (it = plMacrosList.begin(); it != plMacrosList.end(); it++, i++)
+    {
+        macros[i] = wide_string_to_UTF8((*it).c_str());
+    }
+
+    return macros;
+}
+/*----------------------------------------------------------------------------------*/
+
diff --git a/scilab/modules/core/src/cpp/getvariablesname.cpp b/scilab/modules/core/src/cpp/getvariablesname.cpp
new file mode 100644 (file)
index 0000000..59bafc6
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2013 - Scilab Enterprises - 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 "context.hxx"
+
+extern "C" {
+#include "MALLOC.h"
+#include "getvariablesname.h"
+}
+/*----------------------------------------------------------------------------------*/
+char **getVariablesName(int *sizearray, BOOL sorted)
+{
+    std::list<std::wstring> plVarNames = symbol::Context::getInstance()->getVarsName();
+    std::list<std::wstring>::iterator it;
+    *sizearray = (int)plVarNames.size();
+    char** variables = (char**)MALLOC(*sizearray * sizeof(char*));
+
+    if (sorted)
+    {
+        plVarNames.sort();
+    }
+
+    int i = 0;
+    for (it = plVarNames.begin(); it != plVarNames.end(); it++, i++)
+    {
+        variables[i] = wide_string_to_UTF8((*it).c_str());
+    }
+
+    return variables;
+}
+
diff --git a/scilab/modules/core/src/cpp/hashtable_core.cpp b/scilab/modules/core/src/cpp/hashtable_core.cpp
deleted file mode 100644 (file)
index 1337568..0000000
+++ /dev/null
@@ -1,288 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2010 - DIGITEO - Bernard HUGUENEY
-*
-* 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
-*
-*/
-/*----------------------------------------------------------------------------*/
-extern "C" {
-#include "hashtable_core.h"
-#include "stack-def.h"
-#include "MALLOC.h"
-#include "LoadFunctionsTab.h"
-#include "getfunctionslist.h"
-#include "existfunction.h"
-#include "addinter.h"
-
-    unsigned int hashtable_core_maxFilled = 0;
-    extern int C2F(cvname)(int *, char *, int const*, unsigned long int);
-#include "os_strdup.h"
-}
-/*----------------------------------------------------------------------------*/
-#include <iterator>
-#include <vector>
-#include <algorithm>
-#include <functional>
-#include <cstring> // for std::memset
-#include "partition.hxx" // for scilab::core::partition_point_n
-#include "unrolled_algorithms.hxx" //for eq_n less_n copy_n
-/*----------------------------------------------------------------------------*/
-#define MAXLENGHTFUNCTIONNAME  nlgh + 8 /* 24 in fact in scilab +1 for '\0' round to nearest multiple of 8*/
-/*----------------------------------------------------------------------------*/
-using namespace scilab::core;
-/*----------------------------------------------------------------------------*/
-namespace
-{
-struct entry
-{
-    entry()
-    {
-        std::memset(key, 0, sizeof(key) + sizeof(data) + 1); // no alignement issues, init ints to 0 and namefunction to ""
-    }
-    entry(int d, char const* name): data(d)
-    {
-        int const zero(0);
-        if (name)
-        {
-            strncpy(namefunction, name, MAXLENGHTFUNCTIONNAME);
-        }
-        else
-        {
-            namefunction[0] = '\0'; // "" name
-        }
-        C2F(cvname)(key, namefunction, &zero, static_cast<unsigned long>(strlen(namefunction)));
-    }
-    int key[nsiz];
-    int data;
-    char namefunction[MAXLENGHTFUNCTIONNAME];
-};
-
-/*
-* functions entries are stored in a sorted vector
-*/
-typedef std::vector<entry> table_t;
-
-static  table_t table;
-
-/*
-* small functors used to search in the vector
-* (could be removed with boost:: or C++0x lambdas )
-*
-*/
-struct key_less_than : std::unary_function<entry const&, bool>
-{
-    key_less_than(int const* const k): key(k) {}
-    bool operator()(entry const& e) const
-    {
-        return less_n<nsiz>(key, e.key);
-    }
-    int const* const key;
-};
-
-struct not_less_than_key : std::unary_function<entry const&, bool>
-{
-    not_less_than_key(int const* const k): key(k) {}
-    bool operator()(entry const& e) const
-    {
-        return !less_n<nsiz>(e.key, key);
-    }
-    int const* const key;
-};
-
-
-struct equal_data
-{
-    equal_data(int const d) : data(d) {}
-    bool operator()(entry const& e) const
-    {
-        return e.data == data ;
-    }
-    int const data;
-};
-}
-/*----------------------------------------------------------------------------*/
-/*
-* preallocate memory for  DEFAULT_ELEMENTFUNCTIONLIST entries in table
-*/
-/*----------------------------------------------------------------------------*/
-BOOL create_hashtable_scilab_functions(void)
-{
-    try
-    {
-        table_t tmp(0);
-        tmp.reserve( DEFAULT_ELEMENTFUNCTIONLIST );
-        table.swap(tmp);
-    }
-    catch ( std::bad_alloc& e)
-    {
-        e.what();
-        return FALSE;
-    }
-    return TRUE;
-}
-/*----------------------------------------------------------------------------*/
-/*
-* free memory for table
-*/
-/*----------------------------------------------------------------------------*/
-void destroy_hashtable_scilab_functions()
-{
-    table_t tmp(0); // swap trick needed because resize() does *not* release memory
-    table.swap(tmp);
-    unLockLoadFunctionsTab();
-}
-/*----------------------------------------------------------------------------*/
-static BOOL doFindFunction(int *key, char *name, int *scilab_funptr)
-{
-    int tmp[nsiz];
-    int const* keyToSearch = key;
-    if (name)
-    {
-        /* faster than a strcmp */
-        int job = 0; /* convert name to id */
-        C2F(cvname)(tmp, name, &job, static_cast<unsigned long>(std::strlen(name)));
-        keyToSearch = tmp;
-    }
-    // find lower bound : first elt not <
-    table_t::const_iterator i = partition_point_n(table.begin(), table.size(), not_less_than_key(keyToSearch));
-    if (i != table.end() && eq_n<nsiz>(keyToSearch, i->key))
-    {
-        *scilab_funptr = i->data;
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
-/*----------------------------------------------------------------------------*/
-// linear search according to data field in entries
-static BOOL doBackSearchFunction(int *key, int *scilab_funptr)
-{
-    table_t::const_iterator i = std::find_if(table.begin(), table.end()
-                                , equal_data(*scilab_funptr));
-    if ( i != table.end())
-    {
-        copy_n<nsiz>(i->key, key);
-        return TRUE;
-    }
-    else
-    {
-        return FALSE;
-    }
-}
-/*----------------------------------------------------------------------------*/
-static BOOL doEnterFunction(int *key, char *name, int *scilab_funptr)
-{
-    if (table.size() < MAXELEMENTFUNCTIONLIST)
-    {
-        entry tmp(*scilab_funptr, name);
-        // insert before upper bound : first elt such that key<elt
-        table.insert(partition_point_n(table.begin(), table.size()
-                                       , key_less_than(tmp.key)), tmp);
-        if (table.size() > hashtable_core_maxFilled)
-        {
-            hashtable_core_maxFilled = (unsigned int)table.size();
-        }
-        return TRUE;
-    }
-    return FALSE;
-}
-/*----------------------------------------------------------------------------*/
-static BOOL doDeleteFunction(int *key, int *scilab_funptr)
-{
-    // search entry with given scilab_funptr starting from the lower bound
-    // according to given key
-    table_t::iterator i(std::find_if(partition_point_n(table.begin(), table.size()
-                                     , not_less_than_key(key))
-                                     , table.end(), equal_data(*scilab_funptr)));
-
-    if ( i != table.end() )
-    {
-        // entry found -> erase it
-        table.erase(i);
-        return TRUE;
-    }
-    else
-    {
-        // not found
-        return FALSE;
-    }
-}
-/*----------------------------------------------------------------------------*/
-BOOL action_hashtable_scilab_functions(int *key, char *name, int *scilab_funptr
-                                       , SCI_HFUNCTIONS_ACTION action)
-{
-    switch (action)
-    {
-        case SCI_HFUNCTIONS_FIND:
-            return doFindFunction(key, name, scilab_funptr);
-
-        case SCI_HFUNCTIONS_BACKSEARCH:
-            return doBackSearchFunction(key, scilab_funptr);
-
-        case SCI_HFUNCTIONS_ENTER:
-            return doEnterFunction(key, name, scilab_funptr);
-
-        case SCI_HFUNCTIONS_DELETE:
-            return doDeleteFunction(key, scilab_funptr);
-    }
-    return FALSE;
-}
-/*----------------------------------------------------------------------------*/
-// small functors, could be removed with boost or c++0X lambdas
-struct has_namefunction : std::unary_function<entry const&, bool>
-{
-    bool operator()(entry const& e) const
-    {
-        return e.namefunction[0] != '\0' ;   // <=> strlen(e.namefunction) > 0
-    }
-};
-
-struct copy_name : std::unary_function<entry const&, char**>
-{
-    copy_name(char** n): names(n) { }
-    char** operator()(entry const& e)
-    {
-        if (e.namefunction[0] != '\0')
-        {
-            *names = os_strdup(e.namefunction);
-            ++names;
-        }
-        return names;
-    }
-
-    char** names;
-};
-/*----------------------------------------------------------------------------*/
-char **GetFunctionsList(int *sizeList)
-{
-    *sizeList = (int)std::count_if(table.begin(), table.end(), has_namefunction());
-    char **ListFunctions = static_cast<char**>(MALLOC(sizeof(char*) * (*sizeList)));
-    if ( ListFunctions )
-    {
-        std::for_each(table.begin(), table.end(), copy_name(ListFunctions));
-    }
-    return ListFunctions;
-}
-/*--------------------------------------------------------------------------*/
-struct equal_name : std::unary_function<entry const&, bool>
-{
-    equal_name(char const* const n): name(n) {}
-    bool operator()(entry const& e) const
-    {
-        return std::strncmp(e.namefunction, name, MAXLENGHTFUNCTIONNAME) == 0 ;
-    }
-    char const* const name;
-};
-/*----------------------------------------------------------------------------*/
-BOOL ExistFunction(char *name)
-{
-    return (std::find_if(table.begin(), table.end(), equal_name(name)) == table.end()) ? FALSE : TRUE ;
-}
-/*----------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/cpp/search_functions.cpp b/scilab/modules/core/src/cpp/search_functions.cpp
deleted file mode 100644 (file)
index ad5d81c..0000000
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2010 - DIGITEO - Bernard HUGUENEY
- *
- * 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
- *
- */
-#ifdef _MSC_VER
-#include <Windows.h>
-#endif
-
-#include <cstdlib>
-#include <algorithm>
-#include "unrolled_algorithms.hxx"
-extern "C" {
-#include "stack-c.h"
-#include "stack-def.h" /* C2F(basbrk) */
-#include "intmacr2tree.h" /*#define idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz) */
-
-    void C2F(siflibs)(int* id, int* k_ptr, int* istr, int* lbibn, int* nbibn,
-                      int* ilp, int* nn, int* should_return);
-    void C2F(sivars)(int* id, int* should_return);
-    void C2F(namstr)(int* id, int* str, int* n, int const* job);
-}
-
-
-/*
- * These are C++ reimplementations of some (as few as possible) code from funs.f
- * The goal was to improve speed with :
- * 1°) avoiding a call to namstr_ when only the first (two) caracters where needed
- * 2°) allowing the compiler to replace eqid() calls with inlined faster C++ implementation of eq_n<nsiz>
- */
-
-namespace
-{
-char const f_true = 1;
-char const f_false = 0;
-int const percent = 56;
-int const nclas = 29;
-int const from_id = 1;
-
-/* directly convert from id to upper char */
-int upper_char(int id)
-{
-    /* scilab character encoding is using signed bytes packed into an int.
-     * testing for the 7th bit with & 0x80 gives us the sign
-     * & 0xff extracts the byte if positive,
-     * |0xffffff00 extracts the byte if negative (assuming two's complement negative numbers representations)
-     * abs() takes the upper value in scilab character encoding.
-     */
-    return std::abs((int)((id & 0x80) ? (id | 0xffffff00) :  (id & 0xff)));
-}
-
-/* gives the discriminating char (either first of second if first=percent) */
-int id_char(int const* id)
-{
-    int ch(upper_char(*id));
-    if (ch == percent)
-    {
-        return upper_char((*id) >> 8);
-    }
-    return ch;
-}
-}
-/* search for an id in the libraries
- * as we reimplement part of Fortran function, we now use a 'bool' (for Fortran) should_return to tell calling
- * function that it should return at once.
- * other variables are lifted straight from Fortran code.
- */
-void C2F(siflibs)(int* id, int* k_ptr, int* istr, int* lbibn_ptr, int* nbibn_ptr,
-                  int* ilp_ptr, int* nn_ptr, int* should_return)
-{
-
-    int k, ilp, nbibn, lbibn;
-
-    *should_return = f_false;
-
-    for (k = Bot; k < C2F(vstk).isiz; ++k)
-    {
-        int il = iadr(*Lstk(k));
-        int ip;
-
-        if (*istk(il) == sci_lib)
-        {
-            nbibn = *istk(il + 1);
-            lbibn = il + 2;
-            il += nbibn + 2;
-            ilp = il + 1;
-#ifdef _MSC_VER
-            ip = min(nclas, max(1, id_char(id) - 9));
-#else
-            ip =  std::min(nclas, std::max(1, id_char(id) - 9));
-#endif
-            if (ip <= nclas)
-            {
-
-                int n = *istk(ilp + ip) - *istk(ilp + ip - 1);
-                if (n != 0)
-                {
-                    int iln = ilp + nclas + 1 + (*istk(ilp + ip - 1) - 1) * nsiz;
-
-                    for (int i = 1; i <= n; ++i, iln += nsiz)
-                    {
-                        if (eq_n<nsiz>(id, istk(iln)))
-                        {
-                            /* 39 */
-                            if ((Fin == -1) || (Fin == -3))
-                            {
-                                C2F(com).fun = k;
-                                Fin = i;
-                                *should_return = f_true;
-                                return;
-                            }
-
-                            Fin = i;
-                            if (C2F(errgst).err1 != 0)
-                            {
-                                C2F(com).fun = Fin = 0;
-                                *should_return = f_true;
-                                return;
-                            }
-
-                            C2F(namstr)(id, istr, nn_ptr, &from_id);
-                            *k_ptr = k;
-                            *lbibn_ptr = lbibn;
-                            *nbibn_ptr = nbibn;
-                            *ilp_ptr = ilp;
-                            *should_return = f_false;
-                            return;
-                        }
-                    }
-                }
-
-            }
-
-        }
-
-    }
-    C2F(com).fun = Fin = 0;
-    *should_return = f_true;
-    return;
-}
-
-/* search for an id in vars, also lifted from Fortran code in funs.f
- 30   k=bot-1
- 31   k=k+1
-      if(k.gt.isiz) goto 35
-      if(.not.eqid(idstk(1,k),id)) goto 31
-      il=iadr(lstk(k))
-c     modif 1.3 SS
-      if(istk(il).ne.11.and.istk(il).ne.13) then
-         fin=0
-         fun=0
-         return
-      endif
-      fin=k
-      fun=-1
-      return
-*/
-void C2F(sivars)(int* id, int* should_return)
-{
-    int* const lstk_ptr = (int*)C2F(vstk).lstk - 1;
-
-    int k;
-    /*  idstk(x,y) (C2F(vstk).idstk+(x-1)+(y-1)*nsiz) */
-    int* id_addr = C2F(vstk).idstk;
-    for (*should_return = f_false, k = Bot, id_addr += (k - 1) * nsiz;
-            k <=  C2F(vstk).isiz && !eq_n<nsiz>(id_addr, id);
-            ++k, id_addr += nsiz)
-    {
-    }
-
-    if (k <=  C2F(vstk).isiz)
-    {
-        /* eq_id */
-        int il = lstk_ptr[k];
-        il = il + il - 1; /* iadr() */
-        if ((*istk(il) != sci_u_function) && (*istk(il) != sci_c_function))
-        {
-            C2F(com).fun = Fin = 0;
-        }
-        else
-        {
-            C2F(com).fun = -1;
-            Fin = k;
-        }
-        *should_return = f_true;
-    }
-    return;
-}
index 207b5c2..079fa98 100644 (file)
 
 extern "C"
 {
-#include <string.h>
-#include <stdio.h>
 #include <stdlib.h>
-
-#include "core_math.h"
 #include "dynamic_link.h"
-#include "men_Sutils.h"
 #include "addinter.h"
-
-#include "do_error_number.h"
-#include "stack-c.h"
-#include "MALLOC.h" /* MALLOC */
-#include "sciprint.h"
-#include "Funtab.h"
-#include "warningmode.h"
-#include "GetenvB.h"
-#include "localization.h"
-#include "Scierror.h"
-#ifdef _MSC_VER
-#include "ExceptionMessage.h"
-#endif
 }
 
 int AddInterfaceToScilab(wchar_t* _pwstDynamicLibraryName, wchar_t* _pwstModuleName, wchar_t** _pwstEntryPointName, int _iEntryPointSize)
index 8de6799..ce710d4 100644 (file)
@@ -98,14 +98,18 @@ char** findfiles(char *path, char *filespec, int *sizeListReturned, BOOL warning
     wchar_t* pstFileSpec = to_wide_string(filespec);
     wListFiles = findfilesW(pstPath, pstFileSpec, sizeListReturned, warning);
 
-    ListFiles = (char**)MALLOC(sizeof(char*) * *sizeListReturned);
-
-    for (i = 0 ; i < *sizeListReturned ; i++)
+    if (*sizeListReturned)
     {
-        ListFiles[i] = wide_string_to_UTF8(wListFiles[i]);
-        FREE(wListFiles[i]);
+        ListFiles = (char**)MALLOC(sizeof(char*) * *sizeListReturned);
+
+        for (i = 0 ; i < *sizeListReturned ; i++)
+        {
+            ListFiles[i] = wide_string_to_UTF8(wListFiles[i]);
+            FREE(wListFiles[i]);
+        }
+        FREE(wListFiles);
     }
-    FREE(wListFiles);
+
     FREE(pstPath);
     FREE(pstFileSpec);
     return ListFiles;
index 4fb5b60..22a8571 100644 (file)
@@ -3,8 +3,8 @@
 #
 # This file is distributed under the same license as the Scilab package.
 
-FUNCTIONS_C_SOURCES = src/c/getmacroslist.c
-       
+FUNCTIONS_C_SOURCES =
+
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_functions.c
 
index 3842751..a1cafc4 100644 (file)
@@ -134,7 +134,7 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscifunctions_la_sci_gatewaydir)"
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscifunctions_algo_la_LIBADD =
-am__objects_1 = libscifunctions_algo_la-getmacroslist.lo
+am__objects_1 =
 am_libscifunctions_algo_la_OBJECTS = $(am__objects_1)
 libscifunctions_algo_la_OBJECTS =  \
        $(am_libscifunctions_algo_la_OBJECTS)
@@ -450,7 +450,7 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-FUNCTIONS_C_SOURCES = src/c/getmacroslist.c
+FUNCTIONS_C_SOURCES = 
 GATEWAY_C_SOURCES = \
 sci_gateway/c/gw_functions.c
 
@@ -672,7 +672,6 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifunctions_algo_la-getmacroslist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifunctions_la-gw_functions.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifunctions_la-sci_exec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscifunctions_la-sci_execstr.Plo@am__quote@
@@ -703,13 +702,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
-libscifunctions_algo_la-getmacroslist.lo: src/c/getmacroslist.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscifunctions_algo_la-getmacroslist.lo -MD -MP -MF $(DEPDIR)/libscifunctions_algo_la-getmacroslist.Tpo -c -o libscifunctions_algo_la-getmacroslist.lo `test -f 'src/c/getmacroslist.c' || echo '$(srcdir)/'`src/c/getmacroslist.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifunctions_algo_la-getmacroslist.Tpo $(DEPDIR)/libscifunctions_algo_la-getmacroslist.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getmacroslist.c' object='libscifunctions_algo_la-getmacroslist.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) $(libscifunctions_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscifunctions_algo_la-getmacroslist.lo `test -f 'src/c/getmacroslist.c' || echo '$(srcdir)/'`src/c/getmacroslist.c
-
 libscifunctions_la-gw_functions.lo: sci_gateway/c/gw_functions.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscifunctions_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscifunctions_la-gw_functions.lo -MD -MP -MF $(DEPDIR)/libscifunctions_la-gw_functions.Tpo -c -o libscifunctions_la-gw_functions.lo `test -f 'sci_gateway/c/gw_functions.c' || echo '$(srcdir)/'`sci_gateway/c/gw_functions.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscifunctions_la-gw_functions.Tpo $(DEPDIR)/libscifunctions_la-gw_functions.Plo
index 28a95b8..8eadd20 100644 (file)
@@ -187,17 +187,14 @@ lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="DllmainFunctions.c" />
-    <ClCompile Include="getmacroslist.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_functions.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_functions.h" />
-    <ClInclude Include="..\..\includes\getmacroslist.h" />
     <ClInclude Include="..\..\includes\gw_functions.h" />
     <ClInclude Include="..\..\includes\isScilabFunction.h" />
     <ClInclude Include="..\..\includes\librarieslist.h" />
     <ClInclude Include="..\..\includes\libraryinfo.h" />
-    <ClInclude Include="searchmacroinlibraries.h" />
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\locales\functions.pot" />
index c409292..b3ed10a 100644 (file)
@@ -26,9 +26,6 @@
     <ClCompile Include="DllmainFunctions.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="getmacroslist.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\gw_functions.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -37,9 +34,6 @@
     <ClInclude Include="..\..\includes\dynlib_functions.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="..\..\includes\getmacroslist.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\gw_functions.h">
       <Filter>Header Files</Filter>
     </ClInclude>
@@ -49,9 +43,6 @@
     <ClInclude Include="..\..\includes\libraryinfo.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="searchmacroinlibraries.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\includes\isScilabFunction.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/scilab/modules/functions/src/c/getmacroslist.c b/scilab/modules/functions/src/c/getmacroslist.c
deleted file mode 100644 (file)
index c6c2935..0000000
+++ /dev/null
@@ -1,274 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) 2007 - INRIA - Allan CORNET
- * Copyright (C) 2009-2010 - DIGITEO - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-#include <string.h>
-#include <stdlib.h>
-#include "api_scilab.h"
-#include "sci_types.h"
-#include "getmacroslist.h"
-#include "librarieslist.h"
-#include "libraryinfo.h"
-#include "MALLOC.h"
-#include "freeArrayOfString.h"
-#include "getvariablesname.h"
-#include "os_strdup.h"
-/*--------------------------------------------------------------------------*/
-static char **getmacrosonstacklist(int *sizearray);
-static char **getmacrosinlibrarieslist(int *sizearray);
-static int getsizemacrosinlibrarieslist(void);
-static void RemoveDuplicateStrings(char **Strings, int *SizeStrings);
-static int cmpstr( const void *a , const void *b);
-/*--------------------------------------------------------------------------*/
-char **getmacroslist(int *sizearray)
-{
-    char **macroslist = NULL;
-    // FIXME : Rewrite me for YaSp
-#ifdef __REWRITE_ME_FOR_YASP__
-
-    char **macrosonstack = NULL;
-    int sizemacrosonstack = 0;
-    char **macrosinlibraries = NULL;
-    int sizemacrosinlibraries = 0;
-
-    *sizearray = 0;
-
-    macrosonstack = getmacrosonstacklist(&sizemacrosonstack);
-    macrosinlibraries = getmacrosinlibrarieslist(&sizemacrosinlibraries);
-
-    if (macrosinlibraries || macrosonstack)
-    {
-        int nbMacros = sizemacrosonstack + sizemacrosinlibraries;
-        if (sizemacrosonstack)
-        {
-            macroslist = (char**)REALLOC(macrosinlibraries, sizeof(char*) * nbMacros);
-            if (macroslist)
-            {
-                int i = 0;
-                int j = 0;
-                for (i = sizemacrosinlibraries; i < nbMacros; i++)
-                {
-                    macroslist[i] = os_strdup(macrosonstack[j++]);
-                }
-
-                qsort(macroslist, nbMacros, sizeof(char*), cmpstr);
-                RemoveDuplicateStrings(macroslist, &nbMacros);
-                macroslist = (char**)REALLOC(macroslist, sizeof(char*) * nbMacros);
-                *sizearray = nbMacros;
-            }
-            else
-            {
-                macroslist = macrosinlibraries;
-                *sizearray = sizemacrosinlibraries;
-            }
-        }
-        else
-        {
-            macroslist = macrosinlibraries;
-            *sizearray = sizemacrosinlibraries;
-        }
-    }
-
-    if (macrosonstack)
-    {
-        freeArrayOfString(macrosonstack, sizemacrosonstack);
-        macrosonstack = NULL;
-    }
-#endif /* !__REWRITE_ME_FOR_YASP__ */
-    return macroslist;
-}
-/*--------------------------------------------------------------------------*/
-static char **getmacrosonstacklist(int *sizearray)
-{
-    char **macroslist = NULL;
-    // FIXME : Rewrite me for YaSp
-#ifdef __REWRITE_ME_FOR_YASP__
-    char **localvariables = NULL;
-    int sizelocalvariables = 0;
-
-    *sizearray = 0;
-    localvariables = getLocalVariablesName(&sizelocalvariables, FALSE);
-    if (localvariables)
-    {
-        int i = 0;
-        int nbMacros = 0;
-
-        for (i = 0; i < sizelocalvariables; i++)
-        {
-            int iType = 0;
-            SciErr sciErr = getNamedVarType(pvApiCtx, localvariables[i], &iType);
-            if (!sciErr.iErr)
-            {
-                if (iType == sci_c_function)
-                {
-                    nbMacros++;
-                }
-            }
-        }
-
-        if (nbMacros)
-        {
-            macroslist = (char**)MALLOC(sizeof(char*) * nbMacros);
-        }
-
-        if (macroslist)
-        {
-            nbMacros = 0;
-            for (i = 0; i < sizelocalvariables; i++)
-            {
-                int iType = 0;
-                SciErr sciErr = getNamedVarType(pvApiCtx, localvariables[i], &iType);
-                if (!sciErr.iErr)
-                {
-                    if (iType == sci_c_function)
-                    {
-                        macroslist[nbMacros++] = os_strdup(localvariables[i]);
-                    }
-                }
-            }
-            *sizearray = nbMacros;
-        }
-
-        freeArrayOfString(localvariables, sizelocalvariables);
-        localvariables = NULL;
-    }
-#endif /* !__REWRITE_ME_FOR_YASP__ */
-    return macroslist;
-}
-/*--------------------------------------------------------------------------*/
-static char **getmacrosinlibrarieslist(int *sizearray)
-{
-    char **dictionary = NULL;
-    int sizedictionary = getsizemacrosinlibrarieslist();
-
-    *sizearray = 0;
-
-    if (sizedictionary > 0)
-    {
-        int sizelibraries = 0;
-        char **libraries = getlibrarieslist(&sizelibraries);
-
-        dictionary = (char**)MALLOC(sizeof(char*) * sizedictionary);
-
-        if (dictionary)
-        {
-            int m = 0;
-            if (libraries)
-            {
-                int i = 0;
-                for (i = 0; i < sizelibraries; i++)
-                {
-                    int j = 0;
-                    char **macros = NULL;
-                    int sizemacros = 0;
-
-                    macros = getlistmacrosfromlibrary(libraries[i], &sizemacros);
-
-                    if (macros)
-                    {
-                        for (j = 0; j < sizemacros; j++)
-                        {
-                            dictionary[m] = macros[j];
-                            m++;
-                        }
-                        FREE(macros);
-                        macros = NULL;
-                    }
-                }
-                *sizearray = sizedictionary;
-            }
-        }
-        else
-        {
-            *sizearray = 0;
-        }
-        freeArrayOfString(libraries, sizelibraries);
-    }
-    return dictionary;
-}
-/*--------------------------------------------------------------------------*/
-static int getsizemacrosinlibrarieslist(void)
-{
-    int sizedictionary = 0;
-    int sizelibraries = 0;
-    char **libraries = getlibrarieslist(&sizelibraries);
-
-    if (libraries)
-    {
-        int i = 0;
-        for (i = 0; i < sizelibraries; i++)
-        {
-            if (libraries[i])
-            {
-                char **macros = NULL;
-                int sizemacros = 0;
-
-                macros = getlistmacrosfromlibrary(libraries[i], &sizemacros);
-                if (macros)
-                {
-                    sizedictionary = sizedictionary + sizemacros;
-
-                    freeArrayOfString(macros, sizemacros);
-                }
-
-                FREE(libraries[i]);
-                libraries[i] = NULL;
-            }
-
-        }
-        FREE(libraries);
-        libraries = NULL;
-    }
-    return sizedictionary;
-}
-/*--------------------------------------------------------------------------*/
-static void RemoveDuplicateStrings(char **Strings, int *SizeStrings)
-{
-    int fin = 0, i = 0;
-    int newsize = *SizeStrings;
-
-    for (fin = *SizeStrings - 1; fin > 0; fin--)
-    {
-        int Sorted = FALSE;
-
-        for (i = 0; i < fin; i++)
-        {
-            if (Strings[i])
-            {
-                if (strcmp(Strings[i], Strings[i + 1]) == 0)
-                {
-                    FREE(Strings[i + 1]);
-                    Strings[i + 1] = NULL;
-                    Sorted = TRUE;
-                    newsize--;
-                }
-            }
-            else
-            {
-                Strings[i] = Strings[i + 1];
-                Strings[i + 1] = NULL;
-                Sorted = TRUE;
-            }
-        }
-
-        if (!Sorted)
-        {
-            break;
-        }
-    }
-    *SizeStrings = newsize;
-}
-/*--------------------------------------------------------------------------*/
-static int cmpstr( const void *a , const void *b)
-{
-    return strcmp(*(const char **)a, *(const char **)b );
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/functions/src/c/searchmacroinlibraries.h b/scilab/modules/functions/src/c/searchmacroinlibraries.h
deleted file mode 100644 (file)
index 5ba1558..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) 2009 - DIGITEO - Allan CORNET
-*
-* This file must be used under the terms of the CeCILL.
-* This source file is licensed as described in the file COPYING, which
-* you should have received as part of this distribution.  The terms
-* are also available at
-* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
-*
-*/
-/*--------------------------------------------------------------------------*/
-#ifndef __SEARCHMACROINLIBRARIES_H__
-#define __SEARCHMACROINLIBRARIES_H__
-
-/**
-* search a macro in all scilab libraries
-* and returns all libraries names
-* @param[in] macro name
-* @param[out] size of returned array
-* @return array of char where macro founded
-*/
-
-char **searchmacroinlibraries(char *macro, int *sizeReturnedArray);
-
-#endif /* __SEARCHMACROINLIBRARIES_H__ */
-/*--------------------------------------------------------------------------*/
\ No newline at end of file
index 1baee68..7d15955 100644 (file)
@@ -167,4 +167,10 @@ public :
     static int Load();
 };
 
+class CompletionModule : public GenericModule
+{
+public :
+    static int Load();
+};
+
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index 9c96a2a..e4fa858 100644 (file)
@@ -48,4 +48,5 @@
 #include "../../interpolation/includes/interpolation_gw.hxx"
 #include "../../polynomials/includes/polynomials_gw.hxx"
 #include "../../data_structures/includes/data_structures_gw.hxx"
+#include "../../completion/includes/completion_gw.hxx"
 #endif /* !__MODULE_DECLARATION_HXX__ */
index b346c4f..9e8eaad 100644 (file)
@@ -541,3 +541,23 @@ int CallScilabModule::Load()
 
     return 1;
 }
+
+int CompletionModule::Load()
+{
+    wstring wstModuleName = L"completion";
+#ifdef _MSC_VER
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_2);
+#else
+    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
+#endif
+    vectGateway vect = loadGatewaysName(wstModuleName);
+
+    for (int i = 0 ; i < (int)vect.size() ; i++)
+    {
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+    }
+
+    FREE(pwstLibName);
+
+    return 1;
+}
index 95fd7c7..acefb57 100644 (file)
@@ -329,6 +329,7 @@ bool FuncManager::CreateModuleList(void)
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"arnoldi", &ArnoldiModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"data_structures", &DataStructuresModule::Load));
     m_ModuleMap.insert(pair<wstring, GW_MOD>(L"call_scilab", &CallScilabModule::Load));
+    m_ModuleMap.insert(pair<wstring, GW_MOD>(L"completion", &CompletionModule::Load));
 
     if (ConfigVariable::getScilabMode() != SCILAB_NWNI)
     {
index bb7ff12..5732f55 100644 (file)
@@ -181,6 +181,9 @@ Function::ReturnValue sci_genlib(types::typed_list &in, int _iRetCount, types::t
                         os_swprintf(pstVerbose, 65535, _W("%ls: Warning: %ls information cannot be added to file %ls. File ignored\n"), L"genlib", pFD->name_get().name_get().c_str(), pstPath[k]);
                         scilabWriteW(pstVerbose);
                     }
+
+                    symbol::Context::getInstance()->AddMacroFile(new MacroFile(pFD->name_get().name_get(), stFullPath, pstLibName));
+
                 }
             }
 
index 8b57591..672f96d 100644 (file)
@@ -15,8 +15,8 @@
 
 #include "getvariablesname.h"
 #include "commandwords.h"
-#include "getfunctionslist.h"
-#include "getmacroslist.h"
+#include "getfunctionsname.h"
+#include "getmacrosname.h"
 #include "BOOL.h"
 #include "ScilabKeywords.h"
 #include "MALLOC.h"
@@ -97,7 +97,7 @@ char **GetFunctionsName(void)
     return FunctionsName;
 #if 0
     int returnedArraySize = 0;
-    char **FunctionsName = GetFunctionsList(&returnedArraySize);
+    char **FunctionsName = getFunctionsName(&returnedArraySize);
     if (FunctionsName)
     {
         FunctionsName = (char**)REALLOC(FunctionsName, sizeof(char*) * (returnedArraySize + 1));
@@ -122,7 +122,7 @@ char **GetMacrosName(void)
 
 #if 0
     int returnedArraySize = 0;
-    char **MacrosName = getmacroslist(&returnedArraySize);
+    char **MacrosName = getMacrosName(&returnedArraySize);
     if (MacrosName)
     {
         MacrosName = (char**)REALLOC(MacrosName, sizeof(char*) * (returnedArraySize + 1));
index fb0a28a..2dbdc65 100644 (file)
@@ -66,6 +66,10 @@ public :
     /*return function list in the module _stModuleName*/
     std::list<symbol::Symbol>& getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd = true);
 
+    std::list<std::wstring>& getVarsName();
+    std::list<std::wstring>& getMacrosName();
+    std::list<std::wstring>& getFunctionsName();
+
     /* global functions */
 
     /*return global variable visibility status*/
index 0861dac..f995972 100644 (file)
@@ -83,6 +83,9 @@ public :
 
     /*tools*/
     std::list<symbol::Symbol>& getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd);
+    std::list<std::wstring>& getVarsName();
+    std::list<std::wstring>& getMacrosName();
+    std::list<std::wstring>& getFunctionsName();
     void print(std::wostream& ostr) const;
 };
 
@@ -94,4 +97,4 @@ inline std::wostream& operator<< (std::wostream& ostr, const Scopes& _scopes)
 
 }
 
-#endif /* !__NEWSCOPE_HXX__ */
\ No newline at end of file
+#endif /* !__NEWSCOPE_HXX__ */
index 7b6307a..ad58868 100644 (file)
@@ -58,6 +58,9 @@ public :
     types::InternalType* getInSpecificLevel(const Symbol& _key, int _iLevel) const;
 
     std::list<symbol::Symbol>& getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd) const;
+    std::list<std::wstring>& getVarsName();
+    std::list<std::wstring>& getMacrosName();
+    std::list<std::wstring>& getFunctionsName();
 
     /*globals*/
     bool isGlobalVisible(const symbol::Symbol& _key) const;
@@ -81,4 +84,4 @@ public :
     }
 };
 }
-#endif /* !__VARIABLES_HXX__ */
\ No newline at end of file
+#endif /* !__VARIABLES_HXX__ */
index 5931bab..f7d49dc 100644 (file)
@@ -80,6 +80,21 @@ std::list<symbol::Symbol>& Context::getFunctionList(const std::wstring& _stModul
     return m_scopes->getFunctionList(_stModuleName, _bFromEnd);
 }
 
+std::list<std::wstring>& Context::getVarsName()
+{
+    return m_scopes->getVarsName();
+}
+
+std::list<std::wstring>& Context::getMacrosName()
+{
+    return m_scopes->getMacrosName();
+}
+
+std::list<std::wstring>& Context::getFunctionsName()
+{
+    return m_scopes->getFunctionsName();
+}
+
 bool Context::put(const symbol::Symbol& _key, types::InternalType &type)
 {
     m_scopes->put(_key, type);
index 85d9e69..e2889af 100644 (file)
@@ -189,6 +189,21 @@ std::list<symbol::Symbol>& Scopes::getFunctionList(const std::wstring& _stModule
     return m_vars.getFunctionList(_stModuleName, _bFromEnd);
 }
 
+std::list<std::wstring>& Scopes::getVarsName()
+{
+    return m_vars.getVarsName();
+}
+
+std::list<std::wstring>& Scopes::getMacrosName()
+{
+    return m_vars.getMacrosName();
+}
+
+std::list<std::wstring>& Scopes::getFunctionsName()
+{
+    return m_vars.getFunctionsName();
+}
+
 void Scopes::print(std::wostream& ostr) const
 {
     ScopesList::const_iterator it = m_scopes.begin();
index 56d0796..7b6790c 100644 (file)
@@ -226,6 +226,60 @@ bool Variables::remove(const Symbol& _key)
 
 }
 
+std::list<std::wstring>& Variables::getVarsName()
+{
+    std::list<std::wstring>* plOut = new std::list<std::wstring>();
+    types::InternalType* pIT = NULL;
+    VarMap::const_iterator it = m_vars.begin();
+
+    for (; it != m_vars.end(); it++)
+    {
+        pIT = it->second->front()->m_pIT;
+        if (pIT && pIT->isCallable() == false)
+        {
+            plOut->push_back(it->first.name_get().c_str());
+        }
+    }
+
+    return *plOut;
+}
+
+std::list<std::wstring>& Variables::getMacrosName()
+{
+    std::list<std::wstring>* plOut = new std::list<std::wstring>();
+    types::InternalType* pIT = NULL;
+    VarMap::const_iterator it = m_vars.begin();
+
+    for (; it != m_vars.end(); it++)
+    {
+        pIT = it->second->front()->m_pIT;
+        if (pIT && (pIT->isMacro() || pIT->isMacroFile()))
+        {
+            plOut->push_back(it->first.name_get().c_str());
+        }
+    }
+
+    return *plOut;
+}
+
+std::list<std::wstring>& Variables::getFunctionsName()
+{
+    std::list<std::wstring>* plOut = new std::list<std::wstring>();
+    types::InternalType* pIT = NULL;
+    VarMap::const_iterator it = m_vars.begin();
+
+    for (; it != m_vars.end(); it++)
+    {
+        pIT = it->second->front()->m_pIT;
+        if (pIT && pIT->isFunction())
+        {
+            plOut->push_back(it->first.name_get().c_str());
+        }
+    }
+
+    return *plOut;
+}
+
 std::list<symbol::Symbol>& Variables::getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd) const
 {
     bool bAll = _stModuleName == L"";
index 94143d5..c9e105e 100644 (file)
@@ -35,6 +35,11 @@ public :
         return true;
     }
 
+    bool                    isContainer()
+    {
+        return true;
+    }
+
     bool                    operator==(const InternalType& it);
     bool                    operator!=(const InternalType& it);
 
index 7981c6c..e786679 100644 (file)
@@ -16,6 +16,7 @@
 #include <list>
 #include <vector>
 #include "list.hxx"
+#include "string.hxx"
 #include "dynlib_types.h"
 
 namespace types
@@ -58,6 +59,8 @@ public :
     /* return type as short string ( s, i, ce, l, ... )*/
     virtual std::wstring            getShortTypeStr();
 
+    String*                         getFieldNames();
+
 private :
 };
 }
index b3b72af..57d2f9f 100644 (file)
@@ -75,7 +75,7 @@ bool TList::exists(const std::wstring& _sKey)
         return false;
     }
 
-    String* pS = (*m_plData)[0]->getAs<types::String>();
+    String* pS = getFieldNames();
 
     //first field is the tlist type
     for (int i = 1 ; i < pS->getSize() ; i++)
@@ -100,7 +100,7 @@ int TList::getIndexFromString(const std::wstring& _sKey)
         return -1;
     }
 
-    String* pS = (*m_plData)[0]->getAs<types::String>();
+    String* pS = getFieldNames();
     //first field is the tlist type
     for (int i = 1 ; i < pS->getSize() ; i++)
     {
@@ -139,7 +139,7 @@ std::wstring TList::getTypeStr()
         return L"";
     }
 
-    return (*m_plData)[0]->getAs<types::String>()->get(0);
+    return getFieldNames()->get(0);
 }
 
 std::wstring TList::getShortTypeStr()
@@ -175,4 +175,10 @@ bool TList::set(const int _iIndex, InternalType* _pIT)
     (*m_plData)[_iIndex] = _pIT->clone();
     return true;
 }
+
+String* TList::getFieldNames()
+{
+    return (*m_plData)[0]->getAs<types::String>();
+}
+
 }
diff --git a/scilab/modules/windows_tools/src/c/scilab_windows/console_main.c b/scilab/modules/windows_tools/src/c/scilab_windows/console_main.c
deleted file mode 100644 (file)
index 7921258..0000000
+++ /dev/null
@@ -1,188 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA - Allan CORNET
-* Copyright (C) DIGITEO - 2010-2012 - 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 <Windows.h>
-#include <shellapi.h>
-#include "console_main.h"
-#include "core_math.h"
-#include "getcommandlineargs.h"
-#include "sci_mode.h"
-#include "forbiddenToUseScilab.h"
-#include "realmain.h"
-#include "version.h"
-#include "getScilabDirectory.h"
-#include "MALLOC.h"
-#include "sciquit.h"
-#include "scilab_main.h"
-#include "console.h"
-#include "WndThread.h"
-#include "localization.h"
-#include "LanguagePreferences_Windows.h"
-#include "with_module.h"
-
-/*--------------------------------------------------------------------------*/
-#define MIN_STACKSIZE 180000
-/*--------------------------------------------------------------------------*/
-static LPSTR my_argv[MAXCMDTOKENS];
-static int my_argc = -1;
-static int startupf = 0; /** 0 if we execute startup else 1 **/
-static int  memory = MIN_STACKSIZE;
-/*--------------------------------------------------------------------------*/
-extern void settexmacs(void);
-/*--------------------------------------------------------------------------*/
-int sci_show_banner = 1;
-/*--------------------------------------------------------------------------*/
-int Console_Main(int argc, char **argv)
-{
-    int iExitCode = 0;
-    int argcount = 0, lpath = 0;
-    InitScriptType pathtype = SCILAB_SCRIPT;
-    char *path = NULL;
-    char *ScilabDirectory = NULL;
-    int i = 0;
-
-    my_argc = -1;
-
-    forbiddenToUseScilab();
-
-    setScilabMode(SCILAB_NW);
-
-    setCommandLineArgs(argv, argc);
-
-    for (i = 0; i < argc; i++)
-    {
-        my_argv[i] = argv[i];
-    }
-    my_argc = argc;
-
-    ScilabDirectory = getScilabDirectory(FALSE);
-
-    if (ScilabDirectory == NULL)
-    {
-        // This message must never occur, but ...
-        MessageBox (NULL, "ERROR" , "Cannot determine the Scilab directory (SCI).", MB_ICONSTOP | MB_OK);
-        exit(1);
-    }
-    else
-    {
-        FREE(ScilabDirectory);
-        ScilabDirectory = NULL;
-    }
-
-    argcount = my_argc;
-    while (argcount > 0)
-    {
-        argcount--;
-        if (_stricmp (my_argv[argcount], "-NS") == 0)
-        {
-            startupf = 1;
-        }
-        else if ( _stricmp(my_argv[argcount], "-NB") == 0)
-        {
-            sci_show_banner = 0;
-        }
-        else if (_stricmp (my_argv[argcount], "-NWNI") == 0)
-        {
-            setScilabMode(SCILAB_NWNI);
-        }
-        else if (_stricmp (my_argv[argcount], "-F") == 0 && argcount + 1 < my_argc)
-        {
-            path = my_argv[argcount + 1];
-            lpath = (int) strlen (my_argv[argcount + 1]);
-        }
-        else if (_stricmp (my_argv[argcount], "-E") == 0 && argcount + 1 < my_argc)
-        {
-            path = my_argv[argcount + 1];
-            lpath = (int) strlen (my_argv[argcount + 1]);
-            pathtype = SCILAB_CODE;
-        }
-        else if ( _stricmp(my_argv[argcount], "-MEM") == 0 && argcount + 1 < my_argc)
-        {
-            memory = Max(atoi( my_argv[argcount + 1]), MIN_STACKSIZE );
-        }
-        else if ( _stricmp(my_argv[argcount], "-TEXMACS") == 0 )
-        {
-            setScilabMode(SCILAB_NWNI);
-            settexmacs();
-        }
-        else if ( _stricmp(my_argv[argcount], "-NOGUI") == 0 )
-        {
-            setScilabMode(SCILAB_NWNI);
-        }
-        else if ( (_stricmp (my_argv[argcount], "-VERSION") == 0) ||
-                  (_stricmp (my_argv[argcount], "-VER") == 0) )
-        {
-            disp_scilab_version();
-            exit(1);
-        }
-        else if ( _stricmp(my_argv[argcount], "-L") == 0 && argcount + 1 < my_argc)
-        {
-            char *language = my_argv[argcount + 1];
-            //setLanguageFromCommandLine(language);
-        }
-        else if ( (_stricmp (my_argv[argcount], "-H") == 0) ||
-                  (_stricmp (my_argv[argcount], "-?") == 0) ||
-                  (_stricmp (my_argv[argcount], "-HELP") == 0) )
-        {
-            printf("scilex <Options>: run Scilab.\n");
-            printf("Arguments: passes Arguments to Scilab, This Arguments can be retreived\n  by the Scilab function sciargs.\n");
-            printf("-e Instruction: execute the scilab instruction given in Instruction argument.\n");
-            printf("-f File: execute the scilab script given in File argument.\n");
-            printf("  '-e' and '-f' options are mutually exclusive.\n\n");
-            printf("-l lang: it fixes the user language.\n\n" );
-            printf("-mem N: set the initial stacksize.\n");
-            printf("-ns: if this option is present the startup file scilab.start is not executed.\n");
-            printf("-nb: if this option is present then Scilab loading message is not displayed.\n");
-            printf("-nouserstartup: don't execute user startup files SCIHOME/.scilab or SCIHOME/scilab.ini.\n");
-            printf("-nw: start Scilab without specialized Scilab Window.\n");
-            printf("-nwni: start Scilab without user interaction (batch mode).\n");
-            printf("-nogui: start Scilab without GUI,tcl/tk and user interaction (batch mode).\n");
-            printf("-texmacs: reserved for WinTeXMacs.\n");
-            printf("-version: print product version and exit.\n");
-            printf("\n");
-            exit(1);
-        }
-    }
-
-    if (!with_module(L"jvm"))
-    {
-        /* no module jvm then we force NWNI mode */
-        setScilabMode(SCILAB_NWNI);
-    }
-
-    if (getScilabMode() != SCILAB_NWNI)
-    {
-        CreateScilabHiddenWndThread();
-    }
-
-    if ( (getScilabMode() == SCILAB_NWNI) || (getScilabMode() == SCILAB_NW) )
-    {
-        SaveConsoleColors();
-        if (getScilabMode() == SCILAB_NW)
-        {
-            RenameConsole();
-            UpdateConsoleColors();
-        }
-
-        iExitCode = sci_windows_main (&startupf, path, (InitScriptType)pathtype, &lpath, memory);
-
-    }
-    else
-    {
-        MessageBox(NULL, "-nw or -nwni not found", "ERROR", MB_ICONWARNING);
-        iExitCode = 1;
-    }
-    return iExitCode;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/windows_tools/src/c/scilab_windows/console_main.h b/scilab/modules/windows_tools/src/c/scilab_windows/console_main.h
deleted file mode 100644 (file)
index 8c224b1..0000000
+++ /dev/null
@@ -1,28 +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
-*
-*/
-
-/*--------------------------------------------------------------------------*/
-
-#ifndef __CONSOLE_MAIN_H__
-#define __CONSOLE_MAIN_H__
-
-#include "dynlib_scilab_windows.h"
-
-/**
-* Main for scilab with no gui
-* @param [in] argc : number of arguments
-* @param [in] argv : values of arguments
-* @return 0
-*/
-SCILAB_WINDOWS_IMPEXP int Console_Main(int argc, char **argv);
-
-#endif /* __CONSOLE_MAIN_H__ */
\ No newline at end of file
index afb7831..ec9f1ca 100644 (file)
@@ -3,13 +3,8 @@ LIBRARY    core.dll
 
 EXPORTS
 ;core
-disp_scilab_version
-settexmacs
-setCommandLineArgs
 with_module
-setSCIpath
 InitializeLaunchScilabSignal
-sciquit
 StoreCommand
 MyHeapAlloc
 MyHeapFree
index e0ef71e..b463f9d 100644 (file)
@@ -20,7 +20,6 @@
 #include "sci_mode.h"
 #include "realmain.h"
 #include "sciprint.h"
-#include "sciquit.h"
 #include "LaunchScilabSignal.h"
 /*--------------------------------------------------------------------------*/
 static void interrupt_setup (void);
@@ -56,44 +55,3 @@ void interrupt (int an_int)
     longjmp (env, TRUE);               /* return to prompt  */
 }
 /*--------------------------------------------------------------------------*/
-void sci_clear_and_exit(int n) /* used with handlers */
-{
-#ifdef _DEBUG
-    char Message[256];
-    switch (n)
-    {
-        case SIGINT:
-            wsprintf(Message, "SIGINT Signal detected");
-            break;
-        case SIGILL:
-            wsprintf(Message, "SIGILL Signal detected");
-            break;
-        case SIGFPE:
-            wsprintf(Message, "SIGFPE Signal detected");
-            break;
-        case SIGSEGV:
-            wsprintf(Message, "SIGSEGV Signal detected");
-            break;
-        case SIGTERM:
-            wsprintf(Message, "SIGTERM Signal detected");
-            break;
-        case SIGBREAK:
-            wsprintf(Message, "SIGBREAK Signal detected");
-            break;
-        case SIGABRT:
-            wsprintf(Message, "SIGABRT Signal detected");
-            break;
-        default:
-            wsprintf(Message, "Unknown Signal detected");
-            break;
-    }
-    MessageBox(NULL, Message, "ERROR", MB_ICONWARNING);
-#else
-    /*
-    MessageBox(NULL,"Scilab has performed a illegal operation\nand will be shutdown.\n Please save your work ...",
-    "Warning",MB_ICONWARNING);
-    */
-#endif
-    sciquit();
-}
-/*--------------------------------------------------------------------------*/
index 9881740..2465a5f 100644 (file)
@@ -239,7 +239,6 @@ lib /DEF:"$(ProjectDir)System_env_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Plat
   <ItemGroup>
     <ClCompile Include="buildMainWindowTitle_Windows.c" />
     <ClCompile Include="console.c" />
-    <ClCompile Include="console_main.c" />
     <ClCompile Include="ConvertSlash.c" />
     <ClCompile Include="DllmainScilab_Windows.c" />
     <ClCompile Include="FilesAssociations.c" />
@@ -258,7 +257,6 @@ lib /DEF:"$(ProjectDir)System_env_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Plat
     <ClCompile Include="spawncommand.c" />
     <ClCompile Include="splashScreen.cpp" />
     <ClCompile Include="TextToPrint.c" />
-    <ClCompile Include="windows_main.c" />
     <ClCompile Include="WindowShow.c" />
     <ClCompile Include="wmcopydata.c" />
     <ClCompile Include="WndThread.c" />
@@ -266,7 +264,6 @@ lib /DEF:"$(ProjectDir)System_env_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Plat
   <ItemGroup>
     <ClInclude Include="buildMainWindowTitle_Windows.h" />
     <ClInclude Include="console.h" />
-    <ClInclude Include="console_main.h" />
     <ClInclude Include="..\..\..\includes\ConvertSlash.h" />
     <ClInclude Include="dynlib_scilab_windows.h" />
     <ClInclude Include="FilesAssociations.h" />
@@ -287,7 +284,6 @@ lib /DEF:"$(ProjectDir)System_env_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Plat
     <ClInclude Include="spawncommand.h" />
     <ClInclude Include="splashScreen.h" />
     <ClInclude Include="TextToPrint.h" />
-    <ClInclude Include="windows_main.h" />
     <ClInclude Include="WindowShow.h" />
     <ClInclude Include="wmcopydata.h" />
     <ClInclude Include="WndThread.h" />
index 58ff89b..3be0d4c 100644 (file)
@@ -26,9 +26,6 @@
     <ClCompile Include="console.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="console_main.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="ConvertSlash.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -77,9 +74,6 @@
     <ClCompile Include="TextToPrint.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="windows_main.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="WindowShow.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="console.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="console_main.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="..\..\..\includes\ConvertSlash.h">
       <Filter>Header Files</Filter>
     </ClInclude>
     <ClInclude Include="TextToPrint.h">
       <Filter>Header Files</Filter>
     </ClInclude>
-    <ClInclude Include="windows_main.h">
-      <Filter>Header Files</Filter>
-    </ClInclude>
     <ClInclude Include="WindowShow.h">
       <Filter>Header Files</Filter>
     </ClInclude>
diff --git a/scilab/modules/windows_tools/src/c/scilab_windows/windows_main.c b/scilab/modules/windows_tools/src/c/scilab_windows/windows_main.c
deleted file mode 100644 (file)
index e6b3b8d..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* Copyright (C) INRIA - Allan CORNET
-* Copyright (C) DIGITEO - 2010-2012 - 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 <Windows.h>
-#include <shellapi.h>
-#include "windows_main.h"
-#include "core_math.h"
-#include "getcommandlineargs.h"
-#include "sci_mode.h"
-#include "forbiddenToUseScilab.h"
-#include "realmain.h"
-#include "version.h"
-#include "PATH_MAX.h"
-#include "getScilabDirectory.h"
-#include "MALLOC.h"
-#include "FilesAssociations.h"
-#include "sciquit.h"
-#include "scilab_main.h"
-#include "stristr.h"
-#include "console.h"
-#include "WinConsole.h"
-#include "splashScreen.h"
-#include "WndThread.h"
-#include "os_strdup.h"
-#include "InnosetupMutex.h"
-#include "charEncoding.h"
-#include "WindowShow.h"
-#include "LanguagePreferences_Windows.h"
-/*--------------------------------------------------------------------------*/
-#define MIN_STACKSIZE 180000
-#define WSCILEX "wscilex.exe"
-/*--------------------------------------------------------------------------*/
-static LPSTR my_argv[MAXCMDTOKENS];
-static int my_argc = -1;
-static int startupf = 0; /** 0 if we execute startup else 1 **/
-static int  memory = MIN_STACKSIZE;
-/*--------------------------------------------------------------------------*/
-extern int sci_show_banner ;
-/*--------------------------------------------------------------------------*/
-int Windows_Main (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
-{
-    BOOL ShortCircuitExec = FALSE;
-    BOOL LaunchAFile = FALSE;
-    char *ScilabDirectory = NULL;
-    LPWSTR *szArglist = NULL;
-    char FileName[PATH_MAX * 2];
-    int nArgs = 0;
-    int i = 0;
-    int  argcount = 0, lpath = 0;
-    InitScriptType pathtype = SCILAB_SCRIPT;
-    char *path = NULL;
-
-    forbiddenToUseScilab();
-
-    setScilabMode(SCILAB_STD);
-    setWindowShowMode(iCmdShow);
-
-    ScilabDirectory = getScilabDirectory(FALSE);
-
-    if (ScilabDirectory == NULL)
-    {
-        // This message must never occur, but ...
-        MessageBox (NULL, "ERROR" , "Cannot determine the Scilab directory (SCI).", MB_ICONSTOP | MB_OK);
-        exit(1);
-    }
-    else
-    {
-        FREE(ScilabDirectory);
-        ScilabDirectory = NULL;
-    }
-
-    szArglist = CommandLineToArgvW(GetCommandLineW(), &nArgs);
-    if (szArglist)
-    {
-        for (i = 0; i < nArgs; i++)
-        {
-            my_argv[i] = wide_string_to_UTF8(szArglist[i]);
-        }
-        my_argc = nArgs;
-        LocalFree(szArglist);
-    }
-
-    setCommandLineArgs(my_argv, my_argc);
-
-    for (i = 1; i < my_argc; i++)
-    {
-        if  ( (_stricmp (my_argv[i], "-NW") == 0) || (_stricmp (my_argv[i], "-NWI") == 0) || (_stricmp (my_argv[i], "-TEXMACS") == 0) || (_stricmp (my_argv[i], "-NOGUI") == 0) )
-        {
-            MessageBox(NULL, "Not with Windows Console", "Error", MB_ICONINFORMATION);
-            exit(1);
-        }
-
-        if ( (_stricmp (my_argv[i], "-VERSION") == 0) ||
-                (_stricmp (my_argv[i], "-VER") == 0) )
-        {
-            disp_scilab_version();
-            exit(1);
-        }
-
-        if ( (_stricmp (my_argv[i], "-H") == 0) ||
-                (_stricmp (my_argv[i], "-?") == 0) ||
-                (_stricmp (my_argv[i], "-HELP") == 0) )
-        {
-            char Msg[2048];
-            strcpy(Msg, "Wscilex <Options>: run Scilab.\n");
-            strcat(Msg, "Arguments: passes Arguments to Scilab, This Arguments can be retreived\n  by the Scilab function sciargs.\n");
-            strcat(Msg, "-e Instruction: execute the scilab instruction given in Instruction argument.\n");
-            strcat(Msg, "-f File: execute the scilab script given in File argument.\n");
-            strcat(Msg, "  '-e' and '-f' options are mutually exclusive.\n\n");
-            strcat(Msg, "-l lang: it fixes the user language.\n\n" );
-            strcat(Msg, "-mem N: set the initial stacksize.\n");
-            strcat(Msg, "-ns: if this option is present the startup file scilab.start is not executed.\n");
-            strcat(Msg, "-nb: if this option is present then Scilab loading message is not displayed.\n");
-            strcat(Msg, "-nouserstartup: don't execute user startup files SCIHOME/.scilab or SCIHOME/scilab.ini.\n");
-            strcat(Msg, "-nw: start Scilab without specialized Scilab Window.\n");
-            strcat(Msg, "-nwni: start Scilab without user interaction (batch mode).\n");
-            strcat(Msg, "-nogui: start Scilab without GUI,tcl/tk and user interaction (batch mode).\n");
-            strcat(Msg, "-texmacs: reserved for WinTeXMacs.\n");
-            strcat(Msg, "-version: print product version and exit.\n");
-
-            MessageBox(NULL, Msg, "Help", MB_ICONINFORMATION);
-            exit(1);
-        }
-    }
-
-    argcount = my_argc;
-    if (argcount > 2)
-    {
-        if ( (_stricmp (my_argv[1], "-X") == 0) ||
-                (_stricmp (my_argv[1], "-O") == 0) ||
-                (_stricmp (my_argv[1], "-P") == 0) )
-        {
-            char *Commande = NULL;
-            int CodeAction = -1;
-
-            LaunchAFile = TRUE;
-            strcpy(FileName, my_argv[2]);
-
-            if (_stricmp (my_argv[1], "-O") == 0)
-            {
-                CodeAction = 0;
-            }
-            if (_stricmp (my_argv[1], "-X") == 0)
-            {
-                CodeAction = 1;
-            }
-            if (_stricmp (my_argv[1], "-P") == 0)
-            {
-                CodeAction = 2;
-            }
-
-            Commande = (char*)MALLOC(((PATH_MAX * 2) + 1) * sizeof(char));
-            strcpy(Commande, "empty");
-            CommandByFileExtension(FileName, CodeAction, Commande);
-
-            if (
-                ( ( IsAScicosFile(FileName) == TRUE ) && (CodeAction == 1) ) ||
-                ( ( IsABinOrSavFile(FileName) == TRUE ) && (CodeAction == 1) ) ||
-                ( ( IsASciNotesFile(FileName) == TRUE  ) )
-            )
-            {
-                my_argc = -1;
-                my_argv[++my_argc] = Commande;
-                argcount = my_argc;
-                ShortCircuitExec = TRUE;
-            }
-            else
-            {
-                my_argc = -1;
-                my_argv[++my_argc] = strtok (Commande, " ");
-                while (my_argv[my_argc] != NULL)
-                {
-                    my_argv[++my_argc] = strtok(NULL, " ");
-                }
-                argcount = my_argc;
-            }
-        }
-    }
-
-
-    if ( ShortCircuitExec == TRUE)
-    {
-        char PathWScilex[PATH_MAX * 2];
-        int lenPathWScilex = 0;
-        GetModuleFileName ((HINSTANCE)GetModuleHandle(NULL), PathWScilex, PATH_MAX);
-        lenPathWScilex = (int)strlen(PathWScilex);
-        path = my_argv[argcount] + lenPathWScilex + 3;
-        lpath = (int)strlen (my_argv[argcount] + lenPathWScilex + 3);
-        pathtype = SCILAB_CODE;
-        LaunchAFile = TRUE;
-    }
-    else while (argcount > 0)
-        {
-            char ArgTmp[PATH_MAX * 2];
-
-            argcount--;
-            strcpy(ArgTmp, my_argv[argcount]);
-
-            if (_stricmp (ArgTmp, "-NS") == 0)
-            {
-                startupf = 1;
-            }
-            else if ( _stricmp(ArgTmp, "-NB") == 0)
-            {
-                sci_show_banner = 0;
-            }
-            else if (_stricmp (ArgTmp, "-F") == 0 && argcount + 1 < my_argc)
-            {
-                path = my_argv[argcount + 1];
-                lpath = (int)strlen (my_argv[argcount + 1]);
-            }
-            else if (_stricmp (ArgTmp, "-E") == 0 && argcount + 1 < my_argc)
-            {
-                path = my_argv[argcount + 1];
-                lpath = (int)strlen (my_argv[argcount + 1]);
-                pathtype = SCILAB_CODE;
-            }
-            else if ( _stricmp(ArgTmp, "-MEM") == 0 && argcount + 1 < my_argc)
-            {
-                memory = Max(atoi( my_argv[argcount + 1]), MIN_STACKSIZE );
-            }
-            else if ( _stricmp(ArgTmp, "-L") == 0 && argcount + 1 < my_argc)
-            {
-                char *language = my_argv[argcount + 1];
-                //setLanguageFromCommandLine(language);
-            }
-        }
-
-#ifndef _DEBUG
-    if ( (iCmdShow != SW_HIDE) && (iCmdShow != SW_MINIMIZE) && (iCmdShow != SW_SHOWMINNOACTIVE) )
-    {
-        if ( (sci_show_banner) && (LaunchAFile == FALSE) )
-        {
-            splashScreen();
-        }
-    }
-#endif
-
-    CreateScilabHiddenWndThread();
-    CreateScilabConsole(sci_show_banner);
-    HideScilex(); /* hide console window */
-
-    createInnosetupMutex();
-    return sci_windows_main (&startupf, path, (InitScriptType)pathtype, &lpath, memory);
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/windows_tools/src/c/scilab_windows/windows_main.h b/scilab/modules/windows_tools/src/c/scilab_windows/windows_main.h
deleted file mode 100644 (file)
index 2138076..0000000
+++ /dev/null
@@ -1,31 +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
-*
-*/
-
-/*--------------------------------------------------------------------------*/
-#ifndef __WINDOWS_MAIN_H__
-#define __WINDOWS_MAIN_H__
-
-#include <Windows.h>
-#include "dynlib_scilab_windows.h"
-
-/**
-* Main for scilab with GUI
-* @param [in] current instance of the application.
-* @param [in] previous instance of the application
-* @param [in] command line for the application
-* @param [in] Specifies how the window is to be shown
-* @return 0
-*/
-SCILAB_WINDOWS_IMPEXP int Windows_Main (HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow);
-
-#endif /* __WINDOWS_MAIN_H__ */
-/*--------------------------------------------------------------------------*/