Map ulink to YaSp. 69/4169/7
Bruno JOFRET [Tue, 7 Jun 2011 09:18:31 +0000 (11:18 +0200)]
Rewrite link, c_link, ilib_verbose and getdynlibext to C++ gateway.

Change-Id: I6cb02ee5622d5afa28eeb9d4a461f0fe1b0931ef

25 files changed:
scilab/aclocal.m4
scilab/configure
scilab/configure.ac
scilab/modules/core/includes/machine.h.in
scilab/modules/core/includes/machine.h.vc
scilab/modules/dynamic_link/Makefile.am
scilab/modules/dynamic_link/Makefile.in
scilab/modules/dynamic_link/includes/dynamic_link_gw.hxx
scilab/modules/dynamic_link/includes/gw_dynamic_link.h
scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c
scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c [deleted file]
scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c [deleted file]
scilab/modules/dynamic_link/sci_gateway/c/sci_ilib_verbose.c [deleted file]
scilab/modules/dynamic_link/sci_gateway/c/sci_link.c [deleted file]
scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c [deleted file]
scilab/modules/dynamic_link/sci_gateway/cpp/dynamic_link_gw.cpp
scilab/modules/dynamic_link/sci_gateway/cpp/dynamic_link_gw.vcxproj
scilab/modules/dynamic_link/sci_gateway/cpp/dynamic_link_gw.vcxproj.filters
scilab/modules/dynamic_link/sci_gateway/cpp/sci_c_link.cpp [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/cpp/sci_getdynlibext.cpp [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/cpp/sci_ilib_verbose.cpp [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/cpp/sci_ulink.cpp [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link.vcxproj
scilab/modules/dynamic_link/src/c/dynamic_link.vcxproj.filters

index 69b4f6f..fb246da 100644 (file)
@@ -13,8 +13,8 @@
 
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.67],,
+[m4_warning([this file was generated for autoconf 2.67.
 You have another version of autoconf.  It may work, but is not guaranteed to.
 If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically `autoreconf'.])])
index 1fd3d5b..7782595 100755 (executable)
@@ -37624,6 +37624,11 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+cat >>confdefs.h <<_ACEOF
+#define SHARED_LIB_EXTW L"$shrext_cmds"
+_ACEOF
+
+
 #################
 ## stop on warning
 #################
index 08fb5f9..93bc292 100644 (file)
@@ -1730,6 +1730,7 @@ AH_BOTTOM([
 
 # Define the standard extension of a dynamic library
 AC_DEFINE_UNQUOTED([SHARED_LIB_EXT],["$shrext_cmds"],[Extension of a shared library])
+AC_DEFINE_UNQUOTED([SHARED_LIB_EXTW],[L"$shrext_cmds"],[Extension of a shared library ( wide string )])
 
 #################
 ## stop on warning
index aad4aea..384afea 100644 (file)
 /* Extension of a shared library */
 #undef SHARED_LIB_EXT
 
+/* Extension of a shared library ( wide string ) */
+#undef SHARED_LIB_EXTW
+
 /* The size of `int', as computed by sizeof. */
 #undef SIZEOF_INT
 
index bdf9be9..8272932 100644 (file)
@@ -75,6 +75,7 @@
 */
 
 #define SHARED_LIB_EXT ".dll"
+#define SHARED_LIB_EXTW L".dll"
 
 /* PATH_SEPARATOR : Under Windows by default is ; */
 #define PATH_SEPARATOR ";"
index 9a2d108..12566d6 100644 (file)
@@ -4,46 +4,54 @@
 # This file is distributed under the same license as the Scilab package.
 
 
-DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \
-src/c/dynamic_link.c \
-src/c/dl_genErrorMessage.c \
-src/c/GetFunctionByName.c \
-src/c/ilib_verbose.c
-
-GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \
-sci_gateway/c/sci_getdynlibext.c \
-sci_gateway/c/sci_addinter.c \
-sci_gateway/c/sci_call.c \
-sci_gateway/c/sci_link.c \
-sci_gateway/c/sci_ulink.c \
-sci_gateway/c/sci_c_link.c \
-sci_gateway/c/sci_ilib_verbose.c
-
-GATEWAY_CPP_SOURCES =  sci_gateway/cpp/dynamic_link_gw.cpp
-
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f
+DYNAMIC_LINK_C_SOURCES = \
+    src/c/addinter.c \
+    src/c/dynamic_link.c \
+    src/c/dl_genErrorMessage.c \
+    src/c/GetFunctionByName.c \
+    src/c/ilib_verbose.c
+
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/gw_dynamic_link.c \
+    sci_gateway/c/sci_addinter.c \
+    sci_gateway/c/sci_call.c
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/dynamic_link_gw.cpp \
+    sci_gateway/cpp/sci_link.cpp \
+    sci_gateway/cpp/sci_c_link.cpp \
+    sci_gateway/cpp/sci_ulink.cpp \
+    sci_gateway/cpp/sci_ilib_verbose.cpp \
+    sci_gateway/cpp/sci_getdynlibext.cpp
+
+
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/sci_fort.f
 
 libscidynamic_link_la_CFLAGS = \
--I$(top_srcdir)/modules/output_stream/includes \
--I$(top_srcdir)/libs/MALLOC/includes/ \
--I$(top_srcdir)/modules/fileio/includes \
--I$(top_srcdir)/modules/localization/includes \
--I$(top_srcdir)/modules/string/includes \
--I$(top_srcdir)/modules/io/includes \
--I$(top_srcdir)/modules/operations/includes \
--I$(top_srcdir)/libs/dynamiclibrary/includes \
--I$(srcdir)/src/c/ \
--I$(top_srcdir)/modules/api_scilab/includes \
--I$(top_srcdir)/modules/system_env/includes \
--I$(srcdir)/includes/
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/libs/MALLOC/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/io/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/libs/dynamiclibrary/includes \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/system_env/includes \
+    -I$(srcdir)/includes/
 
 libscidynamic_link_la_CPPFLAGS = \
-                                       -I$(srcdir)/includes/ \
-                                       -I$(top_srcdir)/modules/api_scilab/includes \
-                                       -I$(top_srcdir)/modules/operations/includes \
-                                       -I$(top_srcdir)/modules/symbol/includes \
-                                       -I$(top_srcdir)/modules/types/includes \
-                                       -I$(top_srcdir)/modules/abstractSyntaxTree/includes
+       -I$(srcdir)/includes/ \
+       -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+       -I$(top_srcdir)/modules/operations/includes \
+       -I$(top_srcdir)/modules/symbol/includes \
+       -I$(top_srcdir)/modules/types/includes \
+       -I$(top_srcdir)/modules/output_stream/includes \
+       -I$(top_srcdir)/modules/functions_manager/includes \
+       -I$(top_srcdir)/modules/abstractSyntaxTree/includes
 
 pkglib_LTLIBRARIES = libscidynamic_link.la
 noinst_LTLIBRARIES = libscidynamic_link-algo.la
index 19975ad..25bc325 100644 (file)
@@ -132,15 +132,15 @@ libscidynamic_link_la_DEPENDENCIES = libscidynamic_link-algo.la \
        $(top_builddir)/libs/MALLOC/libscimalloc.la \
        $(top_builddir)/modules/output_stream/libscioutput_stream.la
 am__objects_2 = libscidynamic_link_la-gw_dynamic_link.lo \
-       libscidynamic_link_la-sci_getdynlibext.lo \
        libscidynamic_link_la-sci_addinter.lo \
-       libscidynamic_link_la-sci_call.lo \
+       libscidynamic_link_la-sci_call.lo
+am__objects_3 = sci_fort.lo
+am__objects_4 = libscidynamic_link_la-dynamic_link_gw.lo \
        libscidynamic_link_la-sci_link.lo \
-       libscidynamic_link_la-sci_ulink.lo \
        libscidynamic_link_la-sci_c_link.lo \
-       libscidynamic_link_la-sci_ilib_verbose.lo
-am__objects_3 = sci_fort.lo
-am__objects_4 = libscidynamic_link_la-dynamic_link_gw.lo
+       libscidynamic_link_la-sci_ulink.lo \
+       libscidynamic_link_la-sci_ilib_verbose.lo \
+       libscidynamic_link_la-sci_getdynlibext.lo
 am_libscidynamic_link_la_OBJECTS = $(am__objects_2) $(am__objects_3) \
        $(am__objects_4)
 libscidynamic_link_la_OBJECTS = $(am_libscidynamic_link_la_OBJECTS)
@@ -445,44 +445,53 @@ top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
 yacc_present = @yacc_present@
-DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \
-src/c/dynamic_link.c \
-src/c/dl_genErrorMessage.c \
-src/c/GetFunctionByName.c \
-src/c/ilib_verbose.c
-
-GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \
-sci_gateway/c/sci_getdynlibext.c \
-sci_gateway/c/sci_addinter.c \
-sci_gateway/c/sci_call.c \
-sci_gateway/c/sci_link.c \
-sci_gateway/c/sci_ulink.c \
-sci_gateway/c/sci_c_link.c \
-sci_gateway/c/sci_ilib_verbose.c
-
-GATEWAY_CPP_SOURCES = sci_gateway/cpp/dynamic_link_gw.cpp
-GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f
+DYNAMIC_LINK_C_SOURCES = \
+    src/c/addinter.c \
+    src/c/dynamic_link.c \
+    src/c/dl_genErrorMessage.c \
+    src/c/GetFunctionByName.c \
+    src/c/ilib_verbose.c
+
+GATEWAY_C_SOURCES = \
+    sci_gateway/c/gw_dynamic_link.c \
+    sci_gateway/c/sci_addinter.c \
+    sci_gateway/c/sci_call.c
+
+GATEWAY_CPP_SOURCES = \
+    sci_gateway/cpp/dynamic_link_gw.cpp \
+    sci_gateway/cpp/sci_link.cpp \
+    sci_gateway/cpp/sci_c_link.cpp \
+    sci_gateway/cpp/sci_ulink.cpp \
+    sci_gateway/cpp/sci_ilib_verbose.cpp \
+    sci_gateway/cpp/sci_getdynlibext.cpp
+
+GATEWAY_FORTRAN_SOURCES = \
+    sci_gateway/fortran/sci_fort.f
+
 libscidynamic_link_la_CFLAGS = \
--I$(top_srcdir)/modules/output_stream/includes \
--I$(top_srcdir)/libs/MALLOC/includes/ \
--I$(top_srcdir)/modules/fileio/includes \
--I$(top_srcdir)/modules/localization/includes \
--I$(top_srcdir)/modules/string/includes \
--I$(top_srcdir)/modules/io/includes \
--I$(top_srcdir)/modules/operations/includes \
--I$(top_srcdir)/libs/dynamiclibrary/includes \
--I$(srcdir)/src/c/ \
--I$(top_srcdir)/modules/api_scilab/includes \
--I$(top_srcdir)/modules/system_env/includes \
--I$(srcdir)/includes/
+    -I$(top_srcdir)/modules/output_stream/includes \
+    -I$(top_srcdir)/libs/MALLOC/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes \
+    -I$(top_srcdir)/modules/localization/includes \
+    -I$(top_srcdir)/modules/string/includes \
+    -I$(top_srcdir)/modules/io/includes \
+    -I$(top_srcdir)/modules/operations/includes \
+    -I$(top_srcdir)/libs/dynamiclibrary/includes \
+    -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+    -I$(top_srcdir)/modules/system_env/includes \
+    -I$(srcdir)/includes/
 
 libscidynamic_link_la_CPPFLAGS = \
-                                       -I$(srcdir)/includes/ \
-                                       -I$(top_srcdir)/modules/api_scilab/includes \
-                                       -I$(top_srcdir)/modules/operations/includes \
-                                       -I$(top_srcdir)/modules/symbol/includes \
-                                       -I$(top_srcdir)/modules/types/includes \
-                                       -I$(top_srcdir)/modules/abstractSyntaxTree/includes
+       -I$(srcdir)/includes/ \
+       -I$(srcdir)/src/c/ \
+    -I$(top_srcdir)/modules/api_scilab/includes \
+       -I$(top_srcdir)/modules/operations/includes \
+       -I$(top_srcdir)/modules/symbol/includes \
+       -I$(top_srcdir)/modules/types/includes \
+       -I$(top_srcdir)/modules/output_stream/includes \
+       -I$(top_srcdir)/modules/functions_manager/includes \
+       -I$(top_srcdir)/modules/abstractSyntaxTree/includes
 
 pkglib_LTLIBRARIES = libscidynamic_link.la
 noinst_LTLIBRARIES = libscidynamic_link-algo.la
@@ -793,13 +802,6 @@ libscidynamic_link_la-gw_dynamic_link.lo: sci_gateway/c/gw_dynamic_link.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-gw_dynamic_link.lo `test -f 'sci_gateway/c/gw_dynamic_link.c' || echo '$(srcdir)/'`sci_gateway/c/gw_dynamic_link.c
 
-libscidynamic_link_la-sci_getdynlibext.lo: sci_gateway/c/sci_getdynlibext.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_getdynlibext.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Tpo -c -o libscidynamic_link_la-sci_getdynlibext.lo `test -f 'sci_gateway/c/sci_getdynlibext.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getdynlibext.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Tpo $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_getdynlibext.c' object='libscidynamic_link_la-sci_getdynlibext.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_getdynlibext.lo `test -f 'sci_gateway/c/sci_getdynlibext.c' || echo '$(srcdir)/'`sci_gateway/c/sci_getdynlibext.c
-
 libscidynamic_link_la-sci_addinter.lo: sci_gateway/c/sci_addinter.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_addinter.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_addinter.Tpo -c -o libscidynamic_link_la-sci_addinter.lo `test -f 'sci_gateway/c/sci_addinter.c' || echo '$(srcdir)/'`sci_gateway/c/sci_addinter.c
 @am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_addinter.Tpo $(DEPDIR)/libscidynamic_link_la-sci_addinter.Plo
@@ -814,34 +816,6 @@ libscidynamic_link_la-sci_call.lo: sci_gateway/c/sci_call.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_call.lo `test -f 'sci_gateway/c/sci_call.c' || echo '$(srcdir)/'`sci_gateway/c/sci_call.c
 
-libscidynamic_link_la-sci_link.lo: sci_gateway/c/sci_link.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_link.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_link.Tpo -c -o libscidynamic_link_la-sci_link.lo `test -f 'sci_gateway/c/sci_link.c' || echo '$(srcdir)/'`sci_gateway/c/sci_link.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_link.Tpo $(DEPDIR)/libscidynamic_link_la-sci_link.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_link.c' object='libscidynamic_link_la-sci_link.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_link.lo `test -f 'sci_gateway/c/sci_link.c' || echo '$(srcdir)/'`sci_gateway/c/sci_link.c
-
-libscidynamic_link_la-sci_ulink.lo: sci_gateway/c/sci_ulink.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_ulink.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_ulink.Tpo -c -o libscidynamic_link_la-sci_ulink.lo `test -f 'sci_gateway/c/sci_ulink.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ulink.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_ulink.Tpo $(DEPDIR)/libscidynamic_link_la-sci_ulink.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_ulink.c' object='libscidynamic_link_la-sci_ulink.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_ulink.lo `test -f 'sci_gateway/c/sci_ulink.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ulink.c
-
-libscidynamic_link_la-sci_c_link.lo: sci_gateway/c/sci_c_link.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_c_link.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_c_link.Tpo -c -o libscidynamic_link_la-sci_c_link.lo `test -f 'sci_gateway/c/sci_c_link.c' || echo '$(srcdir)/'`sci_gateway/c/sci_c_link.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_c_link.Tpo $(DEPDIR)/libscidynamic_link_la-sci_c_link.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_c_link.c' object='libscidynamic_link_la-sci_c_link.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_c_link.lo `test -f 'sci_gateway/c/sci_c_link.c' || echo '$(srcdir)/'`sci_gateway/c/sci_c_link.c
-
-libscidynamic_link_la-sci_ilib_verbose.lo: sci_gateway/c/sci_ilib_verbose.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -MT libscidynamic_link_la-sci_ilib_verbose.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Tpo -c -o libscidynamic_link_la-sci_ilib_verbose.lo `test -f 'sci_gateway/c/sci_ilib_verbose.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ilib_verbose.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Tpo $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='sci_gateway/c/sci_ilib_verbose.c' object='libscidynamic_link_la-sci_ilib_verbose.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(libscidynamic_link_la_CFLAGS) $(CFLAGS) -c -o libscidynamic_link_la-sci_ilib_verbose.lo `test -f 'sci_gateway/c/sci_ilib_verbose.c' || echo '$(srcdir)/'`sci_gateway/c/sci_ilib_verbose.c
-
 .cpp.o:
 @am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@@ -870,6 +844,41 @@ libscidynamic_link_la-dynamic_link_gw.lo: sci_gateway/cpp/dynamic_link_gw.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-dynamic_link_gw.lo `test -f 'sci_gateway/cpp/dynamic_link_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/dynamic_link_gw.cpp
 
+libscidynamic_link_la-sci_link.lo: sci_gateway/cpp/sci_link.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidynamic_link_la-sci_link.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_link.Tpo -c -o libscidynamic_link_la-sci_link.lo `test -f 'sci_gateway/cpp/sci_link.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_link.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_link.Tpo $(DEPDIR)/libscidynamic_link_la-sci_link.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_link.cpp' object='libscidynamic_link_la-sci_link.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-sci_link.lo `test -f 'sci_gateway/cpp/sci_link.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_link.cpp
+
+libscidynamic_link_la-sci_c_link.lo: sci_gateway/cpp/sci_c_link.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidynamic_link_la-sci_c_link.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_c_link.Tpo -c -o libscidynamic_link_la-sci_c_link.lo `test -f 'sci_gateway/cpp/sci_c_link.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_c_link.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_c_link.Tpo $(DEPDIR)/libscidynamic_link_la-sci_c_link.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_c_link.cpp' object='libscidynamic_link_la-sci_c_link.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-sci_c_link.lo `test -f 'sci_gateway/cpp/sci_c_link.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_c_link.cpp
+
+libscidynamic_link_la-sci_ulink.lo: sci_gateway/cpp/sci_ulink.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidynamic_link_la-sci_ulink.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_ulink.Tpo -c -o libscidynamic_link_la-sci_ulink.lo `test -f 'sci_gateway/cpp/sci_ulink.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ulink.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_ulink.Tpo $(DEPDIR)/libscidynamic_link_la-sci_ulink.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_ulink.cpp' object='libscidynamic_link_la-sci_ulink.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-sci_ulink.lo `test -f 'sci_gateway/cpp/sci_ulink.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ulink.cpp
+
+libscidynamic_link_la-sci_ilib_verbose.lo: sci_gateway/cpp/sci_ilib_verbose.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidynamic_link_la-sci_ilib_verbose.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Tpo -c -o libscidynamic_link_la-sci_ilib_verbose.lo `test -f 'sci_gateway/cpp/sci_ilib_verbose.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ilib_verbose.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Tpo $(DEPDIR)/libscidynamic_link_la-sci_ilib_verbose.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_ilib_verbose.cpp' object='libscidynamic_link_la-sci_ilib_verbose.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-sci_ilib_verbose.lo `test -f 'sci_gateway/cpp/sci_ilib_verbose.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ilib_verbose.cpp
+
+libscidynamic_link_la-sci_getdynlibext.lo: sci_gateway/cpp/sci_getdynlibext.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscidynamic_link_la-sci_getdynlibext.lo -MD -MP -MF $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Tpo -c -o libscidynamic_link_la-sci_getdynlibext.lo `test -f 'sci_gateway/cpp/sci_getdynlibext.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getdynlibext.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Tpo $(DEPDIR)/libscidynamic_link_la-sci_getdynlibext.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='sci_gateway/cpp/sci_getdynlibext.cpp' object='libscidynamic_link_la-sci_getdynlibext.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) $(libscidynamic_link_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscidynamic_link_la-sci_getdynlibext.lo `test -f 'sci_gateway/cpp/sci_getdynlibext.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getdynlibext.cpp
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
index 4dbeaed..1f7970f 100644 (file)
@@ -9,11 +9,15 @@
  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
-#include "dynlib_dynamic_link_gw.h"
 
 #ifndef __DYNAMIC_LINK_GW_HXX__
 #define __DYNAMIC_LINK_GW_HXX__
 
+#include "dynlib_dynamic_link_gw.h"
+
+#include "funcmanager.hxx"
+#include "context.hxx"
+
 class DynamicLinkModule
 {
 private:
@@ -24,4 +28,10 @@ public:
     DYNAMIC_LINK_GW_IMPEXP static bool Load();
 };
 
+CPP_GATEWAY_PROTOTYPE(sci_getdynlibext);
+CPP_GATEWAY_PROTOTYPE(sci_link);
+CPP_GATEWAY_PROTOTYPE(sci_ilib_verbose);
+CPP_GATEWAY_PROTOTYPE(sci_c_link);
+CPP_GATEWAY_PROTOTYPE(sci_ulink);
+
 #endif /* !__DYNAMIC_LINK_GW_HXX__ */
index a5add06..8d531b3 100644 (file)
@@ -16,7 +16,6 @@
 #define __GW_DYNAMIC_LINK__
 
 #include "dynlib_dynamic_link.h"
-#include "dynlib_dynamic_link_gw.h"
 #include "api_scilab.h"
 /*--------------------------------------------------------------------------*/
 DYNAMIC_LINK_IMPEXP int gw_dynamic_link(void);
@@ -27,14 +26,6 @@ DYNAMIC_LINK_IMPEXP int gw_dynamic_link(void);
 DYNAMIC_LINK_IMPEXP int sci_addinter(char *fname,unsigned long fname_len);
 DYNAMIC_LINK_IMPEXP int sci_fort(char *fname,unsigned long fname_len);
 DYNAMIC_LINK_IMPEXP int sci_call(char *fname,unsigned long fname_len);
-DYNAMIC_LINK_IMPEXP int sci_ulink(char *fname,unsigned long fname_len);
-
-/*--------------------------------------------------------------------------*/
-//YaSp
-DYNAMIC_LINK_GW_IMPEXP int sci_link(char *fname, int* _piKey);
-DYNAMIC_LINK_GW_IMPEXP int sci_c_link(char *fname, int* _piKey);
-DYNAMIC_LINK_GW_IMPEXP int sci_getdynlibext(char *fname, int* _piKey);
-DYNAMIC_LINK_GW_IMPEXP int sci_ilib_verbose(char *fname, int* _piKey);
 
 #endif /* __GW_DYNAMIC_LINK__ */
 /*--------------------------------------------------------------------------*/
index 115756e..a361eaa 100644 (file)
@@ -23,7 +23,7 @@ static gw_generic_table Tab[] =
        {sci_fort,"fort"},
        {sci_call,"call"},
        {NULL ,""}, //link
-       {sci_ulink,"ulink"},
+       {NULL, ""}, //ulink
        {NULL, ""}, //c_link
        {NULL, ""} // ilib_verbose
 };
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c
deleted file mode 100644 (file)
index 0e5af41..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*--------------------------------------------------------------------------*/
-#include "gw_dynamic_link.h"
-#include "stack-c.h"
-#include "api_scilab.h"
-#include "api_oldstack.h"
-#include "dynamic_link.h"
-#include "MALLOC.h"
-#include "localization.h"
-#include "Scierror.h"
-/*--------------------------------------------------------------------------*/
-int sci_c_link(char *fname, int* _piKey)
-{
-    SciErr sciErr;
-    int iRet = 0;
-    int ilib = 0;
-    int* piAddress;
-    int iType;
-
-    char *routinename   = NULL;
-    int paramoutINT     = 0;
-    BOOL FindFunction   = FALSE;
-
-    CheckRhs(1,2);
-    CheckLhs(1,2);
-
-    /* [test,ilib]=c_link(routine-name)  */
-    /* test = c_link(routine-name)  */
-    /* test = c_link(routine-name,num)  */
-
-    if(Rhs == 2)
-    {
-        sciErr = getVarAddressFromPosition(_piKey, 2, &piAddress);
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return sciErr.iErr;
-        }
-        sciErr = getVarType(_piKey, piAddress, &iType);
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return sciErr.iErr;
-        }
-
-        if(isDoubleType(_piKey, piAddress))
-        {
-            double pdblReal = 0;
-            if(getScalarDouble(_piKey, piAddress, &pdblReal))
-            {
-                Scierror(999, _("%s : second argument must be a unique id of a shared library.\n"),fname);
-                return 1;
-            }
-
-            ilib = (int)pdblReal;
-        }
-        else
-        {
-            Scierror(999 ,_("%s : second argument must be a unique id of a shared library.\n"),fname);
-            return 0;
-        }
-    }
-    else 
-    {
-        ilib = -1;
-    }
-
-    sciErr = getVarAddressFromPosition(_piKey, 1, &piAddress);
-    if(sciErr.iErr)
-    {
-        printError(&sciErr, 0);
-        return sciErr.iErr;
-    }
-
-    if(isStringType(_piKey, piAddress) == FALSE)
-    {
-        Scierror(999, _("%s: Wrong type for input argument #%d: A string expected.\n"), fname, 1);
-        return 1;
-    }
-
-    if(getAllocatedSingleString(_piKey, piAddress, &routinename))
-    {
-        return 1;
-    }
-
-    FindFunction = c_link(routinename, &ilib);
-    FREE(routinename);
-
-    if(FindFunction)
-    {
-        paramoutINT = (int)(TRUE);
-    }
-
-    if(createScalarBoolean(_piKey, Rhs + 1, paramoutINT))
-    {
-        return 1;
-    }
-
-    LhsVar(1) = Rhs + 1;
-
-    if(Lhs == 2)
-    {
-        if(createScalarDouble(_piKey, Rhs + 2, ilib))
-        {
-            return 1;
-        }
-
-        LhsVar(2) = Rhs + 2;
-    }
-
-    PutLhsVar();
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c
deleted file mode 100644 (file)
index cc57508..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*--------------------------------------------------------------------------*/
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "api_scilab.h"
-#include "api_oldstack.h"
-#include "gw_dynamic_link.h"
-/*--------------------------------------------------------------------------*/
-int sci_getdynlibext(char *fname, int* _piKey)
-{
-       CheckRhs(0,0);
-       CheckLhs(1,1);
-
-    createSingleString(_piKey, Rhs + 1, SHARED_LIB_EXT);
-
-       LhsVar(1) = Rhs+1;
-       PutLhsVar();
-
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_ilib_verbose.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_ilib_verbose.c
deleted file mode 100644 (file)
index 40ecf9d..0000000
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
-* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-* 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
-*
-*/
-
-/*--------------------------------------------------------------------------*/
-#include "gw_dynamic_link.h"
-#include "stack-c.h"
-#include "api_scilab.h"
-#include "api_oldstack.h"
-#include "ilib_verbose.h"
-#include "localization.h"
-#include "Scierror.h"
-/*--------------------------------------------------------------------------*/
-int sci_ilib_verbose(char *fname, int* _piKey)
-{
-    SciErr sciErr;
-    int iRet        = 0;
-    int* piAddress  = NULL;
-    double dblLevel = 0;
-    int iLevel      = 0;
-
-    CheckRhs(0,1);
-    CheckLhs(1,1);
-
-    if(Rhs == 0)
-    {
-        if(createScalarDouble(_piKey, Rhs + 1, (double)getIlibVerboseLevel()))
-        {
-            return 1;
-        }
-
-        LhsVar(1) = Rhs + 1;
-    }
-    else
-    {
-        sciErr = getVarAddressFromPosition(_piKey, 1, &piAddress);
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return sciErr.iErr;
-        }
-
-        if(isDoubleType(_piKey, piAddress) == 0)
-        {
-            Scierror(999,_("%s: Wrong type for input argument #%d: A int expected.\n"),fname,1);
-            return 1;
-        }
-
-        if(getScalarDouble(_piKey, piAddress, &dblLevel))
-        {
-            return 1;
-        }
-
-        iLevel = (int)dblLevel;
-        if(dblLevel != (double)iLevel)
-        {
-            Scierror(999,_("%s: Wrong value for input argument #%d: A int expected.\n"),fname,1);
-            return 0;
-        }
-
-        if(!setIlibVerboseLevel((ilib_verbose_level)iLevel))
-        {
-            Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), fname, 1, "0,1,2");
-            return 1;
-        }
-        else
-        {
-            LhsVar(1) = 0;
-        }
-    }
-
-    PutLhsVar();
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c
deleted file mode 100644 (file)
index ca4da72..0000000
+++ /dev/null
@@ -1,258 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*-----------------------------------------------------------------------------------*/
-#include <string.h>
-#include "gw_dynamic_link.h"
-#include "stack-c.h"
-#include "api_scilab.h"
-#include "api_oldstack.h"
-#include "Scierror.h"
-#include "dynamic_link.h"
-#include "MALLOC.h"
-#include "localization.h"
-#include "dl_genErrorMessage.h"
-#include "freeArrayOfString.h"
-#include "os_strdup.h"
-#include "os_wcsdup.h"
-/*-----------------------------------------------------------------------------------*/
-static int linkNoRhs(int *_piKey);
-static int linkOneRhsShow(int *_piKey);
-/*-----------------------------------------------------------------------------------*/
-int sci_link(char *fname, int *_piKey)
-{
-    SciErr sciErr;
-    BOOL fflag              = TRUE;
-    int idsharedlibrary     = -1;
-    char *SharedLibraryName = NULL;
-    wchar_t param3flag      = L'f';
-
-    char **pstSubName       = NULL;
-    int iRowsSubName        = 0;
-    int iColsSubName        = 0;
-    int iSizeSubName        = 0;
-
-    int returnedID          = -1;
-    int iErr                = 0;
-
-    CheckRhs(0,3);
-    CheckLhs(1,1);
-
-    if(Rhs == 0)
-    {
-        return linkNoRhs(_piKey);
-    }
-    else
-    {
-        if(Rhs >= 1)
-        {
-            int* piAddress1 = NULL;
-            sciErr = getVarAddressFromPosition(_piKey, 1, &piAddress1);
-            if(sciErr.iErr)
-            {
-                printError(&sciErr, 0);
-                return 1;
-            }
-
-            if(isDoubleType(_piKey, piAddress1))
-            {
-                double pdblReal = 0;
-                if(getScalarDouble(_piKey, piAddress1, &pdblReal))
-                {
-                    Scierror(999, _("%s : Wrong value for argument #%d: %s\n"), fname, 1, _("Unique id of a shared library expected."));
-                    return 1;
-                }
-            }
-            else if(isStringType(_piKey, piAddress1))
-            {
-                if(getAllocatedSingleString(_piKey, piAddress1, &SharedLibraryName))
-                {
-                    FREE(SharedLibraryName);
-                    return 1;
-                }
-
-                if((Rhs == 1) && (strcmp(SharedLibraryName,"show") == 0))
-                {
-                    return linkOneRhsShow(_piKey);
-                }
-            }
-            else
-            {
-                Scierror(999, _("%s: Wrong type for input argument #%d: A scalar or a string expected.\n"), fname);
-                return 1;
-            }
-        }
-
-        if(Rhs >= 2)
-        {
-            int* piAddress2 = NULL;
-            sciErr = getVarAddressFromPosition(_piKey, 2, &piAddress2);
-            if(sciErr.iErr)
-            {
-                printError(&sciErr, 0);
-                return 1;
-            }
-
-            //string scalar or vector
-            if(isStringType(_piKey, piAddress2) && (isVector(_piKey, piAddress2) || isScalar(_piKey, piAddress2)))
-            {
-                if(getAllocatedMatrixOfString(_piKey, piAddress2, &iRowsSubName, &iColsSubName, &pstSubName))
-                {
-                    return 1;
-                }
-
-                iSizeSubName = iRowsSubName * iColsSubName;
-            }
-            else
-            {
-                Scierror(999, _("%s: Wrong type for input argument #%d: A string or a string vector expected.\n"));
-                return 1;
-            }
-        }
-
-        if(Rhs == 3)
-        {
-            int* piAddress3     = NULL;
-            wchar_t* pwstData   = NULL;
-            int iRows           = 0;
-            int iCols           = 0;
-
-            sciErr = getVarAddressFromPosition(_piKey, 3, &piAddress3);
-            if(sciErr.iErr)
-            {
-                printError(&sciErr, 0);
-                return 1;
-            }
-
-            if(getAllocatedSingleWideString(_piKey, piAddress3, &pwstData))
-            {
-                return 1;
-            }
-
-            if((wcscmp(pwstData, L"f") == 0) || (wcscmp(pwstData, L"c") == 0))
-            {
-                if(pwstData[0] != L'f')
-                {
-                    fflag = FALSE;
-                }
-            }
-            else
-            {
-                freeAllocatedSingleWideString(pwstData);
-                Scierror(999,_("%s Wrong value for input argument #%d: '%s' or '%s' expected.\n"), fname, 3, "f", "c");
-                return 0;
-            }
-        }
-
-
-        returnedID = scilabLink(idsharedlibrary, SharedLibraryName, pstSubName, iSizeSubName, fflag, &iErr);
-        if(iErr == 0)
-        {
-            if(createScalarDouble(_piKey, Rhs + 1, returnedID))
-            {
-                return 1;
-            }
-            LhsVar(1) = Rhs + 1;
-            PutLhsVar();
-        }
-        else
-        {
-            dl_genErrorMessage(fname, iErr, SharedLibraryName);
-        }
-
-        if(Rhs >= 2)
-        {
-            freeArrayOfString(pstSubName, iSizeSubName);
-        }
-
-        if(SharedLibraryName)
-        {
-            FREE(SharedLibraryName);
-            SharedLibraryName = NULL;
-        }
-    }
-
-    return 0;
-}
-/*-----------------------------------------------------------------------------------*/
-static int linkNoRhs(int* _piKey)
-{
-    SciErr sciErr;
-    int iRet = 0;
-    int sizeFunctionsList = 0;
-    char ** FunctionsList = NULL;
-
-    FunctionsList = getNamesOfFunctionsInSharedLibraries(&sizeFunctionsList);
-
-    if( (FunctionsList) && (sizeFunctionsList > 0) )
-    {
-        sciErr = createMatrixOfString(_piKey, Rhs + 1, 1, sizeFunctionsList, FunctionsList);
-        freeArrayOfString(FunctionsList,sizeFunctionsList);
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return sciErr.iErr;
-        }
-        LhsVar(1) = Rhs+1;
-        PutLhsVar();
-    }
-    else
-    {
-        iRet = createEmptyMatrix(_piKey, Rhs + 1);
-        if(iRet)
-        {
-            return iRet;
-        }
-        LhsVar(1) = Rhs+1;
-        PutLhsVar();
-    }
-    return 0;
-}
-/*-----------------------------------------------------------------------------------*/
-static int linkOneRhsShow(int *_piKey)
-{
-    SciErr sciErr;
-    int iRet = 0;
-    int m1 = 0, n1 = 0, l1 = 0;
-    int *IdsList = NULL;
-    int sizeIds = 0;
-
-    ShowDynLinks();
-    IdsList = getAllIdSharedLib(&sizeIds);
-
-    if( (sizeIds>0) && (IdsList) )
-    {
-        sciErr = createMatrixOfInteger32(_piKey, Rhs + 1, 1, sizeIds, IdsList);
-        if(IdsList)
-        {
-            FREE(IdsList);
-            IdsList=NULL;
-        }
-        if(sciErr.iErr)
-        {
-            printError(&sciErr, 0);
-            return sciErr.iErr;
-        }
-    }
-    else
-    {
-        iRet = createEmptyMatrix(_piKey, Rhs + 1);
-        if(iRet)
-        {
-            return iRet;
-        }
-    }
-    LhsVar(1) = Rhs + 1;
-    PutLhsVar();
-    return 0;
-}
-/*-----------------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c
deleted file mode 100644 (file)
index 19df346..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- * Copyright (C) INRIA - Allan CORNET
- * 
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at    
- * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- *
- */
-
-/*--------------------------------------------------------------------------*/
-#include <string.h>
-#include <stdlib.h>
-#include "gw_dynamic_link.h"
-#include "stack-c.h"
-#include "localization.h"
-#include "Scierror.h"
-#include "dynamic_link.h"
-/*--------------------------------------------------------------------------*/
-int sci_ulink(char *fname,unsigned long fname_len)
-{
-       Rhs = Max(0, Rhs);
-
-       CheckRhs(0,1);
-       CheckLhs(1,1);
-
-       /* environment variable used (linux) to detect a PROFILING tools */
-       /* in this case, we do not ulink external dynamic libraries */
-       if (getenv("PROFILE_SCILAB_DYNAMIC_LINK") == NULL)
-       {
-               if (Rhs == 0)
-               {       
-                       unlinkallsharedlib();
-               }
-               else
-               {
-                       if ( GetType(1) == sci_matrix )
-                       {
-                               int l1 = 0,n1 = 0,m1 = 0;
-                               double *params = NULL;
-                               int i = 0;
-                               GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);
-                               params = stk(l1);
-                               for(i = 0; i < m1*n1; i++)
-                               {
-                                       int ilib = (int) params[i];
-                                       unlinksharedlib(&ilib);
-                               }
-                       }
-                       else
-                       {
-                               Scierror(999,_("%s: Wrong type for input argument #%d: Integer expected.\n"), fname,1);
-                               return 0;
-                       }
-               }
-       }
-
-       LhsVar(1) = 0;
-       C2F(putlhsvar)();
-
-       return 0;
-
-}
-/*--------------------------------------------------------------------------*/
index f5fe9c4..f7cce97 100644 (file)
@@ -24,6 +24,7 @@ bool DynamicLinkModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getdynlibext", &sci_getdynlibext, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"link", &sci_link, MODULE_NAME));
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ulink", &sci_ulink, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"c_link", &sci_c_link, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ilib_verbose", &sci_ilib_verbose, MODULE_NAME));
     return true;
index 247dcda..d6d0978 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;../../../functions_manager/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;../../../functions_manager/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;../../../functions_manager/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;../../src/c;../../../api_scilab/includes;../../../symbol/includes;../../../types/includes;../../../core/includes;../../../abstractSyntaxTree/includes;../../../localization/includes;../../../operations/includes;../../../output_stream/includes;../../../../libs/intl;../../../string/includes;../../../../libs/MALLOC/includes;../../../functions_manager/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_GW_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
     </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
-    <ClCompile Include="..\c\sci_c_link.c" />
-    <ClCompile Include="..\c\sci_getdynlibext.c" />
-    <ClCompile Include="..\c\sci_ilib_verbose.c" />
-    <ClCompile Include="..\c\sci_link.c" />
     <ClCompile Include="dynamic_link_gw.cpp" />
+    <ClCompile Include="sci_c_link.cpp" />
+    <ClCompile Include="sci_getdynlibext.cpp" />
+    <ClCompile Include="sci_ilib_verbose.cpp" />
+    <ClCompile Include="sci_link.cpp" />
+    <ClCompile Include="sci_ulink.cpp" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynamic_link_gw.hxx" />
     <ClInclude Include="..\..\includes\dynlib_dynamic_link_gw.h" />
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\..\abstractSyntaxTree\abstractSyntaxTree-tools\abstractSyntaxTree-tools.vcxproj">
+      <Project>{1f4a0344-99ed-461b-bd53-1593788fb34d}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\api_scilab\api_scilab.vcxproj">
       <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
     </ProjectReference>
     </ProjectReference>
   </ItemGroup>
   <ItemGroup>
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+    <Library Include="..\..\..\..\bin\lapack.lib" />
     <Library Include="..\..\..\..\bin\libintl.lib" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
index 1c501fb..6c6445f 100644 (file)
     <ClCompile Include="dynamic_link_gw.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\c\sci_c_link.c">
+    <ClCompile Include="sci_c_link.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\c\sci_ilib_verbose.c">
+    <ClCompile Include="sci_getdynlibext.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\c\sci_link.c">
+    <ClCompile Include="sci_ilib_verbose.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\c\sci_getdynlibext.c">
+    <ClCompile Include="sci_link.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="sci_ulink.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
   </ItemGroup>
@@ -40,5 +43,7 @@
   </ItemGroup>
   <ItemGroup>
     <Library Include="..\..\..\..\bin\libintl.lib" />
+    <Library Include="..\..\..\..\bin\blasplus.lib" />
+    <Library Include="..\..\..\..\bin\lapack.lib" />
   </ItemGroup>
 </Project>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_c_link.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_c_link.cpp
new file mode 100644 (file)
index 0000000..46989ca
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - Allan CORNET
+ * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+#include "bool.hxx"
+
+extern "C"
+{
+#include "dynamic_link.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_c_link(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iLib = -1;
+    char* pstFunctionName = NULL;
+
+    if(in.size() < 1 || in.size() > 2)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"c_link", 1, 2);
+        return types::Function::Error;
+    }
+
+    if(_iRetCount > 2)
+    {
+        ScierrorW(78,_W("%ls: Wrong number of output argument(s): %d to %d expected.\n"), L"c_link", 1, 2);
+        return types::Function::Error;
+    }
+
+    if(in.size() == 2)
+    {
+        types::Double* pDId = in[1]->getAs<types::Double>();
+        if(pDId == NULL || pDId->isScalar() == false)
+        {
+            Scierror(999 ,_("%s : second argument must be a unique id of a shared library.\n"), L"c_link");
+            return types::Function::Error;
+        }
+
+        iLib = (int)pDId->get(0);
+    }
+
+
+    types::String* pSLibName = in[0]->getAs<types::String>();
+    if(pSLibName == NULL || pSLibName->isScalar() == false)
+    {
+        ScierrorW(999 ,_W("%ls : Wrong type for input argument #%d: A string expected.\n"), L"c_link", 1);
+        return types::Function::Error;
+    }
+
+    pstFunctionName = wide_string_to_UTF8(pSLibName->get(0));
+    BOOL bFind = c_link(pstFunctionName, &iLib);
+    FREE(pstFunctionName);
+
+    out.push_back(new types::Bool(bFind));
+    if(_iRetCount == 2)
+    {
+        out.push_back(new types::Double(iLib));
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_getdynlibext.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_getdynlibext.cpp
new file mode 100644 (file)
index 0000000..0f73076
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - Allan CORNET
+ * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+
+#include "function.hxx"
+#include "string.hxx"
+extern "C"
+{
+#include "Scierror.h"
+#include "localization.h"
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_getdynlibext(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if(in.size() != 0)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d expected.\n"), L"getdynlibext", 0);
+        return types::Function::Error;
+    }
+
+    out.push_back(new types::String(SHARED_LIB_EXTW));
+    return types::Function::OK;
+       //CheckRhs(0,0);
+       //CheckLhs(1,1);
+
+ //   createSingleString(_piKey, Rhs + 1, SHARED_LIB_EXT);
+
+       //LhsVar(1) = Rhs+1;
+       //PutLhsVar();
+
+       //return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_ilib_verbose.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_ilib_verbose.cpp
new file mode 100644 (file)
index 0000000..7fc9166
--- /dev/null
@@ -0,0 +1,120 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) DIGITEO - 2009 - Allan CORNET
+ * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "function.hxx"
+#include "double.hxx"
+extern "C"
+{
+#include "ilib_verbose.h"
+#include "localization.h"
+#include "Scierror.h"
+}
+
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_ilib_verbose(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+
+    if(in.size() > 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"ilib_verbose", 0, 1);
+        return types::Function::Error;
+    }
+
+    if(in.size() == 0)
+    {
+        out.push_back(new types::Double((double)getIlibVerboseLevel()));
+        return types::Function::OK;
+    }
+
+    types::Double* pDVerbose = in[0]->getAs<types::Double>();
+    if(pDVerbose == NULL || pDVerbose->isScalar() == false)
+    {
+        ScierrorW(999, _W("%ls: Wrong value for input argument #%d: A int expected.\n"), L"ilib_verbose", 1);
+        return types::Function::Error;
+    }
+
+    int iLevel = (int)pDVerbose->get(0);
+    if((double)iLevel != pDVerbose->get(0))
+    {//not really a int
+        ScierrorW(999, _W("%ls: Wrong value for input argument #%d: A int expected.\n"), L"ilib_verbose", 1);
+        return types::Function::Error;
+    }
+
+    if(!setIlibVerboseLevel((ilib_verbose_level)iLevel))
+    {
+        ScierrorW(999, _W("%ls: Wrong value for input argument #%d: Must be in the set {%s}.\n"), L"ilib_verbose", 1, L"0,1,2");
+        return types::Function::Error;
+    }
+
+    return types::Function::OK;
+    //SciErr sciErr;
+    //int iRet        = 0;
+    //int* piAddress  = NULL;
+    //double dblLevel = 0;
+    //int iLevel      = 0;
+
+    //CheckRhs(0,1);
+    //CheckLhs(1,1);
+
+    //if(Rhs == 0)
+    //{
+    //    if(createScalarDouble(_piKey, Rhs + 1, (double)getIlibVerboseLevel()))
+    //    {
+    //        return 1;
+    //    }
+
+    //    LhsVar(1) = Rhs + 1;
+    //}
+    //else
+    //{
+    //    sciErr = getVarAddressFromPosition(_piKey, 1, &piAddress);
+    //    if(sciErr.iErr)
+    //    {
+    //        printError(&sciErr, 0);
+    //        return sciErr.iErr;
+    //    }
+
+    //    if(isDoubleType(_piKey, piAddress) == 0)
+    //    {
+    //        Scierror(999,_("%s: Wrong type for input argument #%d: A int expected.\n"),fname,1);
+    //        return 1;
+    //    }
+
+    //    if(getScalarDouble(_piKey, piAddress, &dblLevel))
+    //    {
+    //        return 1;
+    //    }
+
+    //    iLevel = (int)dblLevel;
+    //    if(dblLevel != (double)iLevel)
+    //    {
+    //        Scierror(999,_("%s: Wrong value for input argument #%d: A int expected.\n"),fname,1);
+    //        return 0;
+    //    }
+
+    //    if(!setIlibVerboseLevel((ilib_verbose_level)iLevel))
+    //    {
+    //        Scierror(999, _("%s: Wrong value for input argument #%d: Must be in the set {%s}.\n"), fname, 1, "0,1,2");
+    //        return 1;
+    //    }
+    //    else
+    //    {
+    //        LhsVar(1) = 0;
+    //    }
+    //}
+
+    //PutLhsVar();
+    //return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_link.cpp
new file mode 100644 (file)
index 0000000..c45ad0d
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - Allan CORNET
+ * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*-----------------------------------------------------------------------------------*/
+#include "function.hxx"
+#include "double.hxx"
+#include "string.hxx"
+
+extern "C"
+{
+#include "Scierror.h"
+#include "dynamic_link.h"
+#include "MALLOC.h"
+#include "localization.h"
+#include "dl_genErrorMessage.h"
+#include "freeArrayOfString.h"
+}
+/*-----------------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_link(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    int iSizeSubNames   = 0;
+    char** pstSubNames  = NULL;
+    char* pstLibName    = NULL;
+    BOOL bFortran       = TRUE;
+    int iIDSharedLib    = -1;
+
+    if(in.size() > 3)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"c_link", 0, 3);
+        return types::Function::Error;
+    }
+
+    if(in.size() == 0)
+    {
+        int sizeFunctionsList = 0;
+        char ** FunctionsList = NULL;
+
+        FunctionsList = getNamesOfFunctionsInSharedLibraries(&sizeFunctionsList);
+        if(sizeFunctionsList == 0 || FunctionsList == NULL)
+        {
+            out.push_back(types::Double::Empty());
+            return types::Function::OK;
+        }
+
+        types::String* pSFunctionNames = new types::String(1 ,sizeFunctionsList);
+        for(int i = 0 ; i < sizeFunctionsList ; i++)
+        {
+            wchar_t* pwstFunc = to_wide_string(FunctionsList[i]);
+            pSFunctionNames->set(i, pwstFunc);
+            FREE(pwstFunc);
+        }
+
+        out.push_back(pSFunctionNames);
+        return types::Function::OK;
+    }
+
+    if(in.size() == 3)
+    {//flag
+        types::String* pSFlag = in[2]->getAs<types::String>();
+        if(pSFlag == NULL || pSFlag->isScalar() == false)
+        {
+            ScierrorW(999 ,_W("%ls : Wrong type for input argument #%d: A string expected.\n"), L"link", 3);
+            return types::Function::Error;
+        }
+
+        wchar_t* pwstFlag = pSFlag->get(0);
+        if(wcscmp(pwstFlag, L"f") == 0 || wcscmp(pwstFlag, L"c") == 0)
+        {
+            if(wcscmp(pwstFlag, L"c") == 0)
+            {
+                bFortran = FALSE;
+            }
+        }
+        else
+        {
+            ScierrorW(999, _W("%ls Wrong value for input argument #%d: '%ls' or '%ls' expected.\n"), L"link", 3, L"f", L"c");
+            return types::Function::Error;
+        }
+
+    }
+
+    if(in.size() >= 2)
+    {//sub names
+        types::String* pSSubNames = in[1]->getAs<types::String>();
+        if(pSSubNames == NULL || ( pSSubNames->isVector() == false && pSSubNames->isScalar() == false))
+        {
+            ScierrorW(999, _W("%ls Wrong type for input argument #%d: A string or a string vector expected.\n"), L"link", 2);
+            return types::Function::Error;
+        }
+
+        iSizeSubNames = pSSubNames->getSize();
+        pstSubNames = (char**)MALLOC(iSizeSubNames * sizeof(char*));
+        for(int i = 0 ; i < iSizeSubNames ; i++)
+        {
+            pstSubNames[i] = wide_string_to_UTF8(pSSubNames->get(i));
+        }
+    }
+
+    if(in.size() >= 1)
+    {
+        if(in[0]->getType() == types::InternalType::RealDouble)
+        {
+            types::Double* pDSharedLib = in[0]->getAs<types::Double>();
+            if(pDSharedLib == NULL || pDSharedLib->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls : Wrong value for argument #%d: %ls\n"), L"link", 1, _W("Unique id of a shared library expected."));
+                return types::Function::Error;
+            }
+
+            iIDSharedLib = (int)pDSharedLib->get(0);
+        }
+        else if(in[0]->getType() == types::InternalType::RealString)
+        {
+            types::String* pS = in[0]->getAs<types::String>();
+            if(pS == NULL || pS->isScalar() == false)
+            {
+                ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A string expected.\n"), L"link", 1);
+                return types::Function::Error;
+            }
+            
+            if(wcscmp(pS->get(0), L"show") == 0)
+            {//show option
+                int *piIds      = NULL;
+                int iSizeIds    = 0;
+
+                ShowDynLinks();
+                piIds = getAllIdSharedLib(&iSizeIds);
+                if(iSizeIds == 0 || piIds == NULL)
+                {
+                    out.push_back(types::Double::Empty());
+                    return types::Function::OK;
+                }
+
+                types::Double* pDIds = new types::Double(1, iSizeIds);
+                for(int i = 0 ; i < iSizeIds ; i++)
+                {
+                    pDIds->set(i, (double)piIds[i]);
+                }
+
+                out.push_back(pDIds);
+                return types::Function::OK;
+            }
+
+            //library name
+            pstLibName = wide_string_to_UTF8(pS->get(0));
+        }
+        else
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: A scalar or a string expected.\n"), L"link", 1);
+            return types::Function::Error;
+        }
+    }
+
+    int iErr    = 0;
+    int iRetID  = scilabLink(iIDSharedLib, pstLibName, pstSubNames, iSizeSubNames, bFortran, &iErr);
+
+    if(in.size() >= 2)
+    {
+        freeArrayOfString(pstSubNames, iSizeSubNames);
+    }
+
+    if(iErr)
+    {
+        dl_genErrorMessage("link", iErr, pstLibName);
+        if(pstLibName)
+        {
+            FREE(pstLibName);
+            pstLibName = NULL;
+        }
+        return types::Function::Error;
+    }
+
+    if(pstLibName)
+    {
+        FREE(pstLibName);
+        pstLibName = NULL;
+    }
+    
+    out.push_back(new types::Double(iRetID));
+    return types::Function::OK;
+}
+/*-----------------------------------------------------------------------------------*/
diff --git a/scilab/modules/dynamic_link/sci_gateway/cpp/sci_ulink.cpp b/scilab/modules/dynamic_link/sci_gateway/cpp/sci_ulink.cpp
new file mode 100644 (file)
index 0000000..1550d12
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - Allan CORNET
+ * Copyright (C) DIGITEO - 2011 - Antoine ELIAS
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution.  The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "function.hxx"
+#include "double.hxx"
+
+extern "C"
+{
+#include "localization.h"
+#include "Scierror.h"
+#include "dynamic_link.h"
+}
+/*--------------------------------------------------------------------------*/
+types::Function::ReturnValue sci_ulink(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    /* environment variable used (linux) to detect a PROFILING tools */
+    /* in this case, we do not ulink external dynamic libraries */
+    if(getenv("PROFILE_SCILAB_DYNAMIC_LINK") != NULL)
+    {
+        return types::Function::OK;
+    }
+
+    if(in.size() > 1)
+    {
+        ScierrorW(77, _W("%ls: Wrong number of input argument(s): %d to %d expected.\n"), L"ulink", 0, 1);
+        return types::Function::Error;
+    }
+
+    if(in.size() == 0)
+    {
+        unlinkallsharedlib();
+    }
+    else if(in.size() == 1)
+    {
+        types::Double* pDIds = in[0]->getAs<types::Double>();
+        if(pDIds == NULL)
+        {
+            ScierrorW(999, _W("%ls: Wrong type for input argument #%d: Matrix expected.\n"), L"ulink", 1);
+            return types::Function::Error;
+        }
+
+        for(int i = 0 ; i < pDIds->getSize() ; i++)
+        {
+            int ilib = (int) pDIds->get(i);
+            unlinksharedlib(&ilib);
+        }
+    }
+
+    return types::Function::OK;
+}
+/*--------------------------------------------------------------------------*/
index 29314e2..0294a16 100644 (file)
@@ -248,7 +248,6 @@ lib /DEF:"$(ProjectDir)Io_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(PlatformShor
     <ClCompile Include="ilib_verbose.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_addinter.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_call.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_ulink.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\addinter.h" />
index 2a894ac..1f768da 100644 (file)
@@ -47,9 +47,6 @@
     <ClCompile Include="..\..\sci_gateway\c\sci_call.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_ulink.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="dllinfo.c">
       <Filter>Source Files</Filter>
     </ClCompile>