Xcos: pass simulation 82/15682/34
Paul Bignier [Tue, 9 Dec 2014 16:23:50 +0000 (17:23 +0100)]
 * Rewrite sci_curblock, il_state.c, il_sim.c, and sci_scicosim to C++
 * Adapt scicos.c and import.c to work with the new Scilab API

Change-Id: I4c19beb44cfb103601f5bc42c0f148487d4c0493

27 files changed:
scilab/modules/scicos/Makefile.am
scilab/modules/scicos/Makefile.in
scilab/modules/scicos/includes/gw_scicos.h
scilab/modules/scicos/includes/gw_scicos.hxx
scilab/modules/scicos/includes/import.h
scilab/modules/scicos/includes/scicos.h
scilab/modules/scicos/sci_gateway/c/sci_curblock.c [deleted file]
scilab/modules/scicos/sci_gateway/c/sci_scicosim.c [deleted file]
scilab/modules/scicos/sci_gateway/cpp/sci_curblock.cpp [new file with mode: 0644]
scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp [new file with mode: 0644]
scilab/modules/scicos/sci_gateway/fortran/sci_f_curblock.f [deleted file]
scilab/modules/scicos/sci_gateway/scicos_gateway.xml
scilab/modules/scicos/src/c/cli/scicos-cli.vcxproj
scilab/modules/scicos/src/c/cli/scicos-cli.vcxproj.filters
scilab/modules/scicos/src/c/il_sim.c [deleted file]
scilab/modules/scicos/src/c/il_state.c [deleted file]
scilab/modules/scicos/src/c/import.c
scilab/modules/scicos/src/c/scicos.c
scilab/modules/scicos/src/c/scicos.vcxproj
scilab/modules/scicos/src/c/scicos.vcxproj.filters
scilab/modules/scicos/src/c/scicos_internal.h
scilab/modules/scicos/src/cpp/il_sim.cpp [new file with mode: 0644]
scilab/modules/scicos/src/cpp/il_sim.hxx [new file with mode: 0644]
scilab/modules/scicos/src/cpp/il_state.cpp [new file with mode: 0644]
scilab/modules/scicos/src/cpp/il_state.hxx [new file with mode: 0644]
scilab/modules/scicos/src/fortran/scicos_f.vfproj
scilab/modules/scicos/src/fortran/scicos_f2c.vcxproj

index 92356ec..081ef82 100644 (file)
@@ -14,6 +14,8 @@ DISABLE_HELP_CLEAN=yes
 #### Source listing ######
 
 SCICOS_CXX_SOURCES = \
+src/cpp/il_state.cpp \
+src/cpp/il_sim.cpp \
 src/cpp/Controller.cpp \
 src/cpp/LoggerView.cpp \
 src/cpp/Model.cpp \
@@ -44,8 +46,6 @@ src/c/scicos_free.c \
 src/c/sciblk2.c \
 src/c/sciblk4.c \
 src/c/ezxml.c \
-src/c/il_state.c \
-src/c/il_sim.c \
 src/c/createblklist.c \
 src/c/var2sci.c \
 src/c/copyvarfromlistentry.c \
@@ -76,9 +76,11 @@ sci_gateway/cpp/sci_buildouttb.cpp \
 sci_gateway/cpp/sci_ctree2.cpp \
 sci_gateway/cpp/sci_ctree3.cpp \
 sci_gateway/cpp/sci_ctree4.cpp \
+sci_gateway/cpp/sci_curblock.cpp \
 sci_gateway/cpp/sci_duplicate.cpp \
 sci_gateway/cpp/sci_scicos_new.cpp \
 sci_gateway/cpp/sci_scicos_setfield.cpp \
+sci_gateway/cpp/sci_scicosim.cpp \
 sci_gateway/cpp/sci_validvar.cpp \
 sci_gateway/cpp/sci_var2vec.cpp \
 sci_gateway/cpp/sci_vec2var.cpp
@@ -86,7 +88,6 @@ sci_gateway/cpp/sci_vec2var.cpp
 GATEWAY_C_SOURCES = sci_gateway/c/gw_scicos.c \
 sci_gateway/c/sci_callblk.c \
 sci_gateway/c/sci_coserror.c \
-sci_gateway/c/sci_curblock.c \
 sci_gateway/c/sci_curblockc.c \
 sci_gateway/c/sci_data2sig.c \
 sci_gateway/c/sci_diffobjs.c \
@@ -103,7 +104,6 @@ sci_gateway/c/sci_phase_simulation.c \
 sci_gateway/c/sci_pointer_xproperty.c \
 sci_gateway/c/sci_scicos_debug.c \
 sci_gateway/c/sci_scicos_debug_count.c \
-sci_gateway/c/sci_scicosim.c \
 sci_gateway/c/sci_scicos_time.c \
 sci_gateway/c/sci_sctree.c \
 sci_gateway/c/sci_set_blockerror.c \
@@ -111,7 +111,6 @@ sci_gateway/c/sci_set_xproperty.c \
 sci_gateway/c/sci_sig2data.c
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_ctree.f \
-sci_gateway/fortran/sci_f_curblock.f \
 sci_gateway/fortran/sci_f_debug_count.f \
 sci_gateway/fortran/sci_f_getblocklabel.f \
 sci_gateway/fortran/sci_f_scicos_debug.f \
@@ -135,31 +134,30 @@ libsciscicos_cli_la_LDFLAGS = $(AM_LDFLAGS)
 libsciscicos_la_LDFLAGS = $(AM_LDFLAGS)
 
 if XCOS
-libsciscicos_algo_la_CPPFLAGS= \
-    -I$(srcdir)/includes/ \
-    -I$(srcdir)/src/c/ \
-    -I$(srcdir)/src/cpp/ \
-    -I$(srcdir)/src/scicos_sundials/include/ \
-    -I$(srcdir)/src/scicos_sundials/include/sundials/ \
-    -I$(srcdir)/src/scicos_sundials/src/ida/ \
-    -I$(top_srcdir)/modules/output_stream/includes/ \
-    -I$(top_srcdir)/modules/dynamic_link/includes/ \
-    -I$(top_srcdir)/modules/string/includes/ \
-    -I$(top_srcdir)/modules/localization/includes/ \
-    -I$(top_srcdir)/modules/scicos_blocks/includes/ \
-    -I$(top_srcdir)/modules/action_binding/includes/ \
-    -I$(top_srcdir)/modules/time/includes/ \
-    -I$(top_srcdir)/modules/api_scilab/includes/ \
-    -I$(top_srcdir)/modules/ast/includes/ast/ \
-    -I$(top_srcdir)/modules/ast/includes/exps/ \
-    -I$(top_srcdir)/modules/ast/includes/symbol/ \
-    -I$(top_srcdir)/modules/ast/includes/operations/ \
-    -I$(top_srcdir)/modules/ast/includes/system_env/ \
-    -I$(top_srcdir)/modules/ast/includes/types/ \
-    -I$(top_srcdir)/modules/ast/includes/analysis/ \
-    -I$(top_srcdir)/modules/threads/includes/ \
-    $(EIGEN_CPPFLAGS) \
-    $(AM_CPPFLAGS)
+libsciscicos_algo_la_CPPFLAGS= -I$(srcdir)/includes/ \
+                       -I$(srcdir)/src/c/ \
+                       -I$(srcdir)/src/cpp/ \
+                       -I$(srcdir)/src/scicos_sundials/include/ \
+                       -I$(srcdir)/src/scicos_sundials/include/sundials/ \
+                       -I$(srcdir)/src/scicos_sundials/src/ida/ \
+                       -I$(top_srcdir)/modules/output_stream/includes/ \
+                       -I$(top_srcdir)/modules/dynamic_link/includes/ \
+                       -I$(top_srcdir)/modules/string/includes/ \
+                       -I$(top_srcdir)/modules/localization/includes/ \
+                       -I$(top_srcdir)/modules/scicos_blocks/includes/ \
+                       -I$(top_srcdir)/modules/action_binding/includes/ \
+                       -I$(top_srcdir)/modules/time/includes/ \
+                       -I$(top_srcdir)/modules/api_scilab/includes/ \
+                       -I$(top_srcdir)/modules/ast/includes/ast/ \
+                       -I$(top_srcdir)/modules/ast/includes/exps/ \
+                       -I$(top_srcdir)/modules/ast/includes/symbol/ \
+                       -I$(top_srcdir)/modules/ast/includes/operations/ \
+                       -I$(top_srcdir)/modules/ast/includes/system_env/ \
+                       -I$(top_srcdir)/modules/ast/includes/types/ \
+                       -I$(top_srcdir)/modules/ast/includes/analysis/ \
+                       -I$(top_srcdir)/modules/threads/includes/ \
+                       $(EIGEN_CPPFLAGS) \
+                       $(AM_CPPFLAGS)
 else
 libsciscicos_algo_la_CPPFLAGS= -I$(top_srcdir)/modules/output_stream/includes/ \
                        -I$(top_srcdir)/modules/api_scilab/includes/ \
index 0f506c7..508e49e 100644 (file)
@@ -203,8 +203,9 @@ LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 am__DEPENDENCIES_1 =
 libsciscicos_algo_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
 am__libsciscicos_algo_la_SOURCES_DIST = src/c/noscicos/noscicos.c \
-       src/cpp/Controller.cpp src/cpp/LoggerView.cpp \
-       src/cpp/Model.cpp src/cpp/Model_getObjectProperties.cpp \
+       src/cpp/il_state.cpp src/cpp/il_sim.cpp src/cpp/Controller.cpp \
+       src/cpp/LoggerView.cpp src/cpp/Model.cpp \
+       src/cpp/Model_getObjectProperties.cpp \
        src/cpp/Model_setObjectProperties.cpp \
        src/cpp/view_scilab/Adapters.cpp \
        src/cpp/view_scilab/BlockAdapter.cpp \
@@ -221,19 +222,20 @@ am__libsciscicos_algo_la_SOURCES_DIST = src/c/noscicos/noscicos.c \
        src/c/scilab5_needed_stubs.c src/c/tree.c \
        src/c/scicos_malloc.c src/c/scicos_print.c src/c/import.c \
        src/c/scicos.c src/c/scicos_free.c src/c/sciblk2.c \
-       src/c/sciblk4.c src/c/ezxml.c src/c/il_state.c src/c/il_sim.c \
-       src/c/createblklist.c src/c/var2sci.c \
-       src/c/copyvarfromlistentry.c src/c/MlistGetFieldNumber.c \
-       src/c/extractblklist.c src/c/lsodar.c src/c/ddaskr.c \
-       src/fortran/scitovv.f src/fortran/vvtosci.f \
-       src/fortran/skipvars.f src/fortran/coselm.f \
-       src/fortran/scitod.f src/fortran/sctree.f src/fortran/scierr.f \
-       src/fortran/ftree2.f src/fortran/ftree3.f \
+       src/c/sciblk4.c src/c/ezxml.c src/c/createblklist.c \
+       src/c/var2sci.c src/c/copyvarfromlistentry.c \
+       src/c/MlistGetFieldNumber.c src/c/extractblklist.c \
+       src/c/lsodar.c src/c/ddaskr.c src/fortran/scitovv.f \
+       src/fortran/vvtosci.f src/fortran/skipvars.f \
+       src/fortran/coselm.f src/fortran/scitod.f src/fortran/sctree.f \
+       src/fortran/scierr.f src/fortran/ftree2.f src/fortran/ftree3.f \
        src/fortran/list2vars.f src/fortran/ftree4.f \
        src/fortran/scitoi.f src/fortran/scifunc.f
 am__dirstamp = $(am__leading_dot)dirstamp
 am__objects_1 = src/c/noscicos/libsciscicos_algo_la-noscicos.lo
-am__objects_2 = src/cpp/libsciscicos_algo_la-Controller.lo \
+am__objects_2 = src/cpp/libsciscicos_algo_la-il_state.lo \
+       src/cpp/libsciscicos_algo_la-il_sim.lo \
+       src/cpp/libsciscicos_algo_la-Controller.lo \
        src/cpp/libsciscicos_algo_la-LoggerView.lo \
        src/cpp/libsciscicos_algo_la-Model.lo \
        src/cpp/libsciscicos_algo_la-Model_getObjectProperties.lo \
@@ -260,8 +262,6 @@ am__objects_3 = src/c/libsciscicos_algo_la-scilab5_needed_stubs.lo \
        src/c/libsciscicos_algo_la-sciblk2.lo \
        src/c/libsciscicos_algo_la-sciblk4.lo \
        src/c/libsciscicos_algo_la-ezxml.lo \
-       src/c/libsciscicos_algo_la-il_state.lo \
-       src/c/libsciscicos_algo_la-il_sim.lo \
        src/c/libsciscicos_algo_la-createblklist.lo \
        src/c/libsciscicos_algo_la-var2sci.lo \
        src/c/libsciscicos_algo_la-copyvarfromlistentry.lo \
@@ -295,18 +295,19 @@ am__libsciscicos_cli_la_SOURCES_DIST =  \
        sci_gateway/cpp/sci_buildouttb.cpp \
        sci_gateway/cpp/sci_ctree2.cpp sci_gateway/cpp/sci_ctree3.cpp \
        sci_gateway/cpp/sci_ctree4.cpp \
+       sci_gateway/cpp/sci_curblock.cpp \
        sci_gateway/cpp/sci_duplicate.cpp \
        sci_gateway/cpp/sci_scicos_new.cpp \
        sci_gateway/cpp/sci_scicos_setfield.cpp \
+       sci_gateway/cpp/sci_scicosim.cpp \
        sci_gateway/cpp/sci_validvar.cpp \
        sci_gateway/cpp/sci_var2vec.cpp \
        sci_gateway/cpp/sci_vec2var.cpp sci_gateway/c/gw_scicos.c \
        sci_gateway/c/sci_callblk.c sci_gateway/c/sci_coserror.c \
-       sci_gateway/c/sci_curblock.c sci_gateway/c/sci_curblockc.c \
-       sci_gateway/c/sci_data2sig.c sci_gateway/c/sci_diffobjs.c \
-       sci_gateway/c/sci_end_scicosim.c sci_gateway/c/sci_ftree2.c \
-       sci_gateway/c/sci_ftree3.c sci_gateway/c/sci_ftree4.c \
-       sci_gateway/c/sci_getblocklabel.c \
+       sci_gateway/c/sci_curblockc.c sci_gateway/c/sci_data2sig.c \
+       sci_gateway/c/sci_diffobjs.c sci_gateway/c/sci_end_scicosim.c \
+       sci_gateway/c/sci_ftree2.c sci_gateway/c/sci_ftree3.c \
+       sci_gateway/c/sci_ftree4.c sci_gateway/c/sci_getblocklabel.c \
        sci_gateway/c/sci_getscicosvars.c \
        sci_gateway/c/sci_haltscicos.c sci_gateway/c/sci_loadScicos.c \
        sci_gateway/c/sci_model2blk.c \
@@ -314,11 +315,10 @@ am__libsciscicos_cli_la_SOURCES_DIST =  \
        sci_gateway/c/sci_pointer_xproperty.c \
        sci_gateway/c/sci_scicos_debug.c \
        sci_gateway/c/sci_scicos_debug_count.c \
-       sci_gateway/c/sci_scicosim.c sci_gateway/c/sci_scicos_time.c \
-       sci_gateway/c/sci_sctree.c sci_gateway/c/sci_set_blockerror.c \
+       sci_gateway/c/sci_scicos_time.c sci_gateway/c/sci_sctree.c \
+       sci_gateway/c/sci_set_blockerror.c \
        sci_gateway/c/sci_set_xproperty.c sci_gateway/c/sci_sig2data.c \
        sci_gateway/fortran/sci_f_ctree.f \
-       sci_gateway/fortran/sci_f_curblock.f \
        sci_gateway/fortran/sci_f_debug_count.f \
        sci_gateway/fortran/sci_f_getblocklabel.f \
        sci_gateway/fortran/sci_f_scicos_debug.f \
@@ -330,16 +330,17 @@ am__objects_5 = sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_log.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_ctree2.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_ctree3.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_ctree4.lo \
+       sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_duplicate.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_new.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_setfield.lo \
+       sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_validvar.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_var2vec.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_vec2var.lo
 am__objects_6 = sci_gateway/c/libsciscicos_cli_la-gw_scicos.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_callblk.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_coserror.lo \
-       sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_curblockc.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_data2sig.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_diffobjs.lo \
@@ -356,14 +357,12 @@ am__objects_6 = sci_gateway/c/libsciscicos_cli_la-gw_scicos.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_pointer_xproperty.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug_count.lo \
-       sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_scicos_time.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_sctree.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_set_blockerror.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_set_xproperty.lo \
        sci_gateway/c/libsciscicos_cli_la-sci_sig2data.lo
 am__objects_7 = sci_gateway/fortran/sci_f_ctree.lo \
-       sci_gateway/fortran/sci_f_curblock.lo \
        sci_gateway/fortran/sci_f_debug_count.lo \
        sci_gateway/fortran/sci_f_getblocklabel.lo \
        sci_gateway/fortran/sci_f_scicos_debug.lo \
@@ -384,18 +383,19 @@ am__libsciscicos_la_SOURCES_DIST = sci_gateway/cpp/sci_scicos_log.cpp \
        sci_gateway/cpp/sci_buildouttb.cpp \
        sci_gateway/cpp/sci_ctree2.cpp sci_gateway/cpp/sci_ctree3.cpp \
        sci_gateway/cpp/sci_ctree4.cpp \
+       sci_gateway/cpp/sci_curblock.cpp \
        sci_gateway/cpp/sci_duplicate.cpp \
        sci_gateway/cpp/sci_scicos_new.cpp \
        sci_gateway/cpp/sci_scicos_setfield.cpp \
+       sci_gateway/cpp/sci_scicosim.cpp \
        sci_gateway/cpp/sci_validvar.cpp \
        sci_gateway/cpp/sci_var2vec.cpp \
        sci_gateway/cpp/sci_vec2var.cpp sci_gateway/c/gw_scicos.c \
        sci_gateway/c/sci_callblk.c sci_gateway/c/sci_coserror.c \
-       sci_gateway/c/sci_curblock.c sci_gateway/c/sci_curblockc.c \
-       sci_gateway/c/sci_data2sig.c sci_gateway/c/sci_diffobjs.c \
-       sci_gateway/c/sci_end_scicosim.c sci_gateway/c/sci_ftree2.c \
-       sci_gateway/c/sci_ftree3.c sci_gateway/c/sci_ftree4.c \
-       sci_gateway/c/sci_getblocklabel.c \
+       sci_gateway/c/sci_curblockc.c sci_gateway/c/sci_data2sig.c \
+       sci_gateway/c/sci_diffobjs.c sci_gateway/c/sci_end_scicosim.c \
+       sci_gateway/c/sci_ftree2.c sci_gateway/c/sci_ftree3.c \
+       sci_gateway/c/sci_ftree4.c sci_gateway/c/sci_getblocklabel.c \
        sci_gateway/c/sci_getscicosvars.c \
        sci_gateway/c/sci_haltscicos.c sci_gateway/c/sci_loadScicos.c \
        sci_gateway/c/sci_model2blk.c \
@@ -403,11 +403,10 @@ am__libsciscicos_la_SOURCES_DIST = sci_gateway/cpp/sci_scicos_log.cpp \
        sci_gateway/c/sci_pointer_xproperty.c \
        sci_gateway/c/sci_scicos_debug.c \
        sci_gateway/c/sci_scicos_debug_count.c \
-       sci_gateway/c/sci_scicosim.c sci_gateway/c/sci_scicos_time.c \
-       sci_gateway/c/sci_sctree.c sci_gateway/c/sci_set_blockerror.c \
+       sci_gateway/c/sci_scicos_time.c sci_gateway/c/sci_sctree.c \
+       sci_gateway/c/sci_set_blockerror.c \
        sci_gateway/c/sci_set_xproperty.c sci_gateway/c/sci_sig2data.c \
        sci_gateway/fortran/sci_f_ctree.f \
-       sci_gateway/fortran/sci_f_curblock.f \
        sci_gateway/fortran/sci_f_debug_count.f \
        sci_gateway/fortran/sci_f_getblocklabel.f \
        sci_gateway/fortran/sci_f_scicos_debug.f \
@@ -419,16 +418,17 @@ am__objects_8 = sci_gateway/cpp/libsciscicos_la-sci_scicos_log.lo \
        sci_gateway/cpp/libsciscicos_la-sci_ctree2.lo \
        sci_gateway/cpp/libsciscicos_la-sci_ctree3.lo \
        sci_gateway/cpp/libsciscicos_la-sci_ctree4.lo \
+       sci_gateway/cpp/libsciscicos_la-sci_curblock.lo \
        sci_gateway/cpp/libsciscicos_la-sci_duplicate.lo \
        sci_gateway/cpp/libsciscicos_la-sci_scicos_new.lo \
        sci_gateway/cpp/libsciscicos_la-sci_scicos_setfield.lo \
+       sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo \
        sci_gateway/cpp/libsciscicos_la-sci_validvar.lo \
        sci_gateway/cpp/libsciscicos_la-sci_var2vec.lo \
        sci_gateway/cpp/libsciscicos_la-sci_vec2var.lo
 am__objects_9 = sci_gateway/c/libsciscicos_la-gw_scicos.lo \
        sci_gateway/c/libsciscicos_la-sci_callblk.lo \
        sci_gateway/c/libsciscicos_la-sci_coserror.lo \
-       sci_gateway/c/libsciscicos_la-sci_curblock.lo \
        sci_gateway/c/libsciscicos_la-sci_curblockc.lo \
        sci_gateway/c/libsciscicos_la-sci_data2sig.lo \
        sci_gateway/c/libsciscicos_la-sci_diffobjs.lo \
@@ -445,7 +445,6 @@ am__objects_9 = sci_gateway/c/libsciscicos_la-gw_scicos.lo \
        sci_gateway/c/libsciscicos_la-sci_pointer_xproperty.lo \
        sci_gateway/c/libsciscicos_la-sci_scicos_debug.lo \
        sci_gateway/c/libsciscicos_la-sci_scicos_debug_count.lo \
-       sci_gateway/c/libsciscicos_la-sci_scicosim.lo \
        sci_gateway/c/libsciscicos_la-sci_scicos_time.lo \
        sci_gateway/c/libsciscicos_la-sci_sctree.lo \
        sci_gateway/c/libsciscicos_la-sci_set_blockerror.lo \
@@ -940,6 +939,8 @@ DISABLE_HELP_CLEAN = yes
 
 #### Source listing ######
 SCICOS_CXX_SOURCES = \
+src/cpp/il_state.cpp \
+src/cpp/il_sim.cpp \
 src/cpp/Controller.cpp \
 src/cpp/LoggerView.cpp \
 src/cpp/Model.cpp \
@@ -969,8 +970,6 @@ src/c/scicos_free.c \
 src/c/sciblk2.c \
 src/c/sciblk4.c \
 src/c/ezxml.c \
-src/c/il_state.c \
-src/c/il_sim.c \
 src/c/createblklist.c \
 src/c/var2sci.c \
 src/c/copyvarfromlistentry.c \
@@ -1000,9 +999,11 @@ sci_gateway/cpp/sci_buildouttb.cpp \
 sci_gateway/cpp/sci_ctree2.cpp \
 sci_gateway/cpp/sci_ctree3.cpp \
 sci_gateway/cpp/sci_ctree4.cpp \
+sci_gateway/cpp/sci_curblock.cpp \
 sci_gateway/cpp/sci_duplicate.cpp \
 sci_gateway/cpp/sci_scicos_new.cpp \
 sci_gateway/cpp/sci_scicos_setfield.cpp \
+sci_gateway/cpp/sci_scicosim.cpp \
 sci_gateway/cpp/sci_validvar.cpp \
 sci_gateway/cpp/sci_var2vec.cpp \
 sci_gateway/cpp/sci_vec2var.cpp
@@ -1010,7 +1011,6 @@ sci_gateway/cpp/sci_vec2var.cpp
 GATEWAY_C_SOURCES = sci_gateway/c/gw_scicos.c \
 sci_gateway/c/sci_callblk.c \
 sci_gateway/c/sci_coserror.c \
-sci_gateway/c/sci_curblock.c \
 sci_gateway/c/sci_curblockc.c \
 sci_gateway/c/sci_data2sig.c \
 sci_gateway/c/sci_diffobjs.c \
@@ -1027,7 +1027,6 @@ sci_gateway/c/sci_phase_simulation.c \
 sci_gateway/c/sci_pointer_xproperty.c \
 sci_gateway/c/sci_scicos_debug.c \
 sci_gateway/c/sci_scicos_debug_count.c \
-sci_gateway/c/sci_scicosim.c \
 sci_gateway/c/sci_scicos_time.c \
 sci_gateway/c/sci_sctree.c \
 sci_gateway/c/sci_set_blockerror.c \
@@ -1035,7 +1034,6 @@ sci_gateway/c/sci_set_xproperty.c \
 sci_gateway/c/sci_sig2data.c
 
 GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_f_ctree.f \
-sci_gateway/fortran/sci_f_curblock.f \
 sci_gateway/fortran/sci_f_debug_count.f \
 sci_gateway/fortran/sci_f_getblocklabel.f \
 sci_gateway/fortran/sci_f_scicos_debug.f \
@@ -1056,31 +1054,30 @@ libsciscicos_la_LDFLAGS = $(AM_LDFLAGS)
 @XCOS_FALSE@                   -I$(top_srcdir)/modules/scicos/includes/ \
 @XCOS_FALSE@                   $(AM_CPPFLAGS)
 
-@XCOS_TRUE@libsciscicos_algo_la_CPPFLAGS = \
-@XCOS_TRUE@    -I$(srcdir)/includes/ \
-@XCOS_TRUE@    -I$(srcdir)/src/c/ \
-@XCOS_TRUE@    -I$(srcdir)/src/cpp/ \
-@XCOS_TRUE@    -I$(srcdir)/src/scicos_sundials/include/ \
-@XCOS_TRUE@    -I$(srcdir)/src/scicos_sundials/include/sundials/ \
-@XCOS_TRUE@    -I$(srcdir)/src/scicos_sundials/src/ida/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/output_stream/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/dynamic_link/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/string/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/localization/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/scicos_blocks/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/action_binding/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/time/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/api_scilab/includes/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/ast/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/exps/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/symbol/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/operations/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/system_env/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/types/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/ast/includes/analysis/ \
-@XCOS_TRUE@    -I$(top_srcdir)/modules/threads/includes/ \
-@XCOS_TRUE@    $(EIGEN_CPPFLAGS) \
-@XCOS_TRUE@    $(AM_CPPFLAGS)
+@XCOS_TRUE@libsciscicos_algo_la_CPPFLAGS = -I$(srcdir)/includes/ \
+@XCOS_TRUE@                    -I$(srcdir)/src/c/ \
+@XCOS_TRUE@                    -I$(srcdir)/src/cpp/ \
+@XCOS_TRUE@                    -I$(srcdir)/src/scicos_sundials/include/ \
+@XCOS_TRUE@                    -I$(srcdir)/src/scicos_sundials/include/sundials/ \
+@XCOS_TRUE@                    -I$(srcdir)/src/scicos_sundials/src/ida/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/output_stream/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/dynamic_link/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/string/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/localization/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/scicos_blocks/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/action_binding/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/time/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/api_scilab/includes/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/ast/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/exps/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/operations/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/types/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+@XCOS_TRUE@                    -I$(top_srcdir)/modules/threads/includes/ \
+@XCOS_TRUE@                    $(EIGEN_CPPFLAGS) \
+@XCOS_TRUE@                    $(AM_CPPFLAGS)
 
 libsciscicos_cli_la_CPPFLAGS = $(libsciscicos_algo_la_CPPFLAGS)
 libsciscicos_la_CPPFLAGS = $(libsciscicos_algo_la_CPPFLAGS)
@@ -1462,6 +1459,10 @@ src/cpp/$(am__dirstamp):
 src/cpp/$(DEPDIR)/$(am__dirstamp):
        @$(MKDIR_P) src/cpp/$(DEPDIR)
        @: > src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciscicos_algo_la-il_state.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
+src/cpp/libsciscicos_algo_la-il_sim.lo: src/cpp/$(am__dirstamp) \
+       src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libsciscicos_algo_la-Controller.lo: src/cpp/$(am__dirstamp) \
        src/cpp/$(DEPDIR)/$(am__dirstamp)
 src/cpp/libsciscicos_algo_la-LoggerView.lo: src/cpp/$(am__dirstamp) \
@@ -1540,10 +1541,6 @@ src/c/libsciscicos_algo_la-sciblk4.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libsciscicos_algo_la-ezxml.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libsciscicos_algo_la-il_state.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
-src/c/libsciscicos_algo_la-il_sim.lo: src/c/$(am__dirstamp) \
-       src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libsciscicos_algo_la-createblklist.lo: src/c/$(am__dirstamp) \
        src/c/$(DEPDIR)/$(am__dirstamp)
 src/c/libsciscicos_algo_la-var2sci.lo: src/c/$(am__dirstamp) \
@@ -1614,6 +1611,9 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_ctree3.lo:  \
 sci_gateway/cpp/libsciscicos_cli_la-sci_ctree4.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_cli_la-sci_duplicate.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1623,6 +1623,9 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_new.lo:  \
 sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_setfield.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_cli_la-sci_validvar.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1647,9 +1650,6 @@ sci_gateway/c/libsciscicos_cli_la-sci_callblk.lo:  \
 sci_gateway/c/libsciscicos_cli_la-sci_coserror.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciscicos_cli_la-sci_curblockc.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
@@ -1698,9 +1698,6 @@ sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug.lo:  \
 sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug_count.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciscicos_cli_la-sci_scicos_time.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
@@ -1725,9 +1722,6 @@ sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp):
 sci_gateway/fortran/sci_f_ctree.lo:  \
        sci_gateway/fortran/$(am__dirstamp) \
        sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/fortran/sci_f_curblock.lo:  \
-       sci_gateway/fortran/$(am__dirstamp) \
-       sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/fortran/sci_f_debug_count.lo:  \
        sci_gateway/fortran/$(am__dirstamp) \
        sci_gateway/fortran/$(DEPDIR)/$(am__dirstamp)
@@ -1764,6 +1758,9 @@ sci_gateway/cpp/libsciscicos_la-sci_ctree3.lo:  \
 sci_gateway/cpp/libsciscicos_la-sci_ctree4.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciscicos_la-sci_curblock.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_la-sci_duplicate.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1773,6 +1770,9 @@ sci_gateway/cpp/libsciscicos_la-sci_scicos_new.lo:  \
 sci_gateway/cpp/libsciscicos_la-sci_scicos_setfield.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_la-sci_validvar.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1791,9 +1791,6 @@ sci_gateway/c/libsciscicos_la-sci_callblk.lo:  \
 sci_gateway/c/libsciscicos_la-sci_coserror.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciscicos_la-sci_curblock.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciscicos_la-sci_curblockc.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
@@ -1842,9 +1839,6 @@ sci_gateway/c/libsciscicos_la-sci_scicos_debug.lo:  \
 sci_gateway/c/libsciscicos_la-sci_scicos_debug_count.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/c/libsciscicos_la-sci_scicosim.lo:  \
-       sci_gateway/c/$(am__dirstamp) \
-       sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/c/libsciscicos_la-sci_scicos_time.lo:  \
        sci_gateway/c/$(am__dirstamp) \
        sci_gateway/c/$(DEPDIR)/$(am__dirstamp)
@@ -2062,7 +2056,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-gw_scicos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_callblk.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_coserror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblockc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_data2sig.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_diffobjs.Plo@am__quote@
@@ -2080,7 +2073,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_debug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_debug_count.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_time.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_sctree.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_set_blockerror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_set_xproperty.Plo@am__quote@
@@ -2088,7 +2080,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-gw_scicos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_callblk.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_coserror.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblockc.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_data2sig.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_diffobjs.Plo@am__quote@
@@ -2106,7 +2097,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_debug.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_debug_count.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_time.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_sctree.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_set_blockerror.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_set_xproperty.Plo@am__quote@
@@ -2115,10 +2105,12 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_ctree2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_ctree3.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_ctree4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_duplicate.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_log.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_new.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_setfield.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_validvar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_var2vec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_vec2var.Plo@am__quote@
@@ -2126,10 +2118,12 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_ctree2.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_ctree3.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_ctree4.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_curblock.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_duplicate.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicos_log.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicos_new.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicos_setfield.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_validvar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_var2vec.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_vec2var.Plo@am__quote@
@@ -2139,8 +2133,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-ddaskr.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-extractblklist.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-ezxml.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-il_sim.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-il_state.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-import.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-lsodar.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libsciscicos_algo_la-sciblk2.Plo@am__quote@
@@ -2158,6 +2150,8 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciscicos_algo_la-Model.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciscicos_algo_la-Model_getObjectProperties.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciscicos_algo_la-Model_setObjectProperties.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_sim.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_state.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/view_scilab/$(DEPDIR)/libsciscicos_algo_la-Adapters.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/view_scilab/$(DEPDIR)/libsciscicos_algo_la-BlockAdapter.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@src/cpp/view_scilab/$(DEPDIR)/libsciscicos_algo_la-CprAdapter.Plo@am__quote@
@@ -2291,20 +2285,6 @@ src/c/libsciscicos_algo_la-ezxml.lo: src/c/ezxml.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciscicos_algo_la-ezxml.lo `test -f 'src/c/ezxml.c' || echo '$(srcdir)/'`src/c/ezxml.c
 
-src/c/libsciscicos_algo_la-il_state.lo: src/c/il_state.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciscicos_algo_la-il_state.lo -MD -MP -MF src/c/$(DEPDIR)/libsciscicos_algo_la-il_state.Tpo -c -o src/c/libsciscicos_algo_la-il_state.lo `test -f 'src/c/il_state.c' || echo '$(srcdir)/'`src/c/il_state.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciscicos_algo_la-il_state.Tpo src/c/$(DEPDIR)/libsciscicos_algo_la-il_state.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/il_state.c' object='src/c/libsciscicos_algo_la-il_state.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciscicos_algo_la-il_state.lo `test -f 'src/c/il_state.c' || echo '$(srcdir)/'`src/c/il_state.c
-
-src/c/libsciscicos_algo_la-il_sim.lo: src/c/il_sim.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciscicos_algo_la-il_sim.lo -MD -MP -MF src/c/$(DEPDIR)/libsciscicos_algo_la-il_sim.Tpo -c -o src/c/libsciscicos_algo_la-il_sim.lo `test -f 'src/c/il_sim.c' || echo '$(srcdir)/'`src/c/il_sim.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciscicos_algo_la-il_sim.Tpo src/c/$(DEPDIR)/libsciscicos_algo_la-il_sim.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='src/c/il_sim.c' object='src/c/libsciscicos_algo_la-il_sim.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libsciscicos_algo_la-il_sim.lo `test -f 'src/c/il_sim.c' || echo '$(srcdir)/'`src/c/il_sim.c
-
 src/c/libsciscicos_algo_la-createblklist.lo: src/c/createblklist.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libsciscicos_algo_la-createblklist.lo -MD -MP -MF src/c/$(DEPDIR)/libsciscicos_algo_la-createblklist.Tpo -c -o src/c/libsciscicos_algo_la-createblklist.lo `test -f 'src/c/createblklist.c' || echo '$(srcdir)/'`src/c/createblklist.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libsciscicos_algo_la-createblklist.Tpo src/c/$(DEPDIR)/libsciscicos_algo_la-createblklist.Plo
@@ -2375,13 +2355,6 @@ sci_gateway/c/libsciscicos_cli_la-sci_coserror.lo: sci_gateway/c/sci_coserror.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_cli_la-sci_coserror.lo `test -f 'sci_gateway/c/sci_coserror.c' || echo '$(srcdir)/'`sci_gateway/c/sci_coserror.c
 
-sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo: sci_gateway/c/sci_curblock.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Tpo -c -o sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo `test -f 'sci_gateway/c/sci_curblock.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblock.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_curblock.c' object='sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_cli_la-sci_curblock.lo `test -f 'sci_gateway/c/sci_curblock.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblock.c
-
 sci_gateway/c/libsciscicos_cli_la-sci_curblockc.lo: sci_gateway/c/sci_curblockc.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_cli_la-sci_curblockc.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblockc.Tpo -c -o sci_gateway/c/libsciscicos_cli_la-sci_curblockc.lo `test -f 'sci_gateway/c/sci_curblockc.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblockc.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblockc.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_curblockc.Plo
@@ -2494,13 +2467,6 @@ sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug_count.lo: sci_gateway/c/sci_s
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_cli_la-sci_scicos_debug_count.lo `test -f 'sci_gateway/c/sci_scicos_debug_count.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicos_debug_count.c
 
-sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo: sci_gateway/c/sci_scicosim.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Tpo -c -o sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo `test -f 'sci_gateway/c/sci_scicosim.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicosim.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_scicosim.c' object='sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_cli_la-sci_scicosim.lo `test -f 'sci_gateway/c/sci_scicosim.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicosim.c
-
 sci_gateway/c/libsciscicos_cli_la-sci_scicos_time.lo: sci_gateway/c/sci_scicos_time.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_cli_la-sci_scicos_time.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_time.Tpo -c -o sci_gateway/c/libsciscicos_cli_la-sci_scicos_time.lo `test -f 'sci_gateway/c/sci_scicos_time.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicos_time.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_time.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_cli_la-sci_scicos_time.Plo
@@ -2557,13 +2523,6 @@ sci_gateway/c/libsciscicos_la-sci_coserror.lo: sci_gateway/c/sci_coserror.c
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_la-sci_coserror.lo `test -f 'sci_gateway/c/sci_coserror.c' || echo '$(srcdir)/'`sci_gateway/c/sci_coserror.c
 
-sci_gateway/c/libsciscicos_la-sci_curblock.lo: sci_gateway/c/sci_curblock.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_la-sci_curblock.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblock.Tpo -c -o sci_gateway/c/libsciscicos_la-sci_curblock.lo `test -f 'sci_gateway/c/sci_curblock.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblock.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblock.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblock.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_curblock.c' object='sci_gateway/c/libsciscicos_la-sci_curblock.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_la-sci_curblock.lo `test -f 'sci_gateway/c/sci_curblock.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblock.c
-
 sci_gateway/c/libsciscicos_la-sci_curblockc.lo: sci_gateway/c/sci_curblockc.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_la-sci_curblockc.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblockc.Tpo -c -o sci_gateway/c/libsciscicos_la-sci_curblockc.lo `test -f 'sci_gateway/c/sci_curblockc.c' || echo '$(srcdir)/'`sci_gateway/c/sci_curblockc.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblockc.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_curblockc.Plo
@@ -2676,13 +2635,6 @@ sci_gateway/c/libsciscicos_la-sci_scicos_debug_count.lo: sci_gateway/c/sci_scico
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_la-sci_scicos_debug_count.lo `test -f 'sci_gateway/c/sci_scicos_debug_count.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicos_debug_count.c
 
-sci_gateway/c/libsciscicos_la-sci_scicosim.lo: sci_gateway/c/sci_scicosim.c
-@am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_la-sci_scicosim.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicosim.Tpo -c -o sci_gateway/c/libsciscicos_la-sci_scicosim.lo `test -f 'sci_gateway/c/sci_scicosim.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicosim.c
-@am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicosim.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicosim.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      $(AM_V_CC)source='sci_gateway/c/sci_scicosim.c' object='sci_gateway/c/libsciscicos_la-sci_scicosim.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o sci_gateway/c/libsciscicos_la-sci_scicosim.lo `test -f 'sci_gateway/c/sci_scicosim.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicosim.c
-
 sci_gateway/c/libsciscicos_la-sci_scicos_time.lo: sci_gateway/c/sci_scicos_time.c
 @am__fastdepCC_TRUE@   $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT sci_gateway/c/libsciscicos_la-sci_scicos_time.lo -MD -MP -MF sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_time.Tpo -c -o sci_gateway/c/libsciscicos_la-sci_scicos_time.lo `test -f 'sci_gateway/c/sci_scicos_time.c' || echo '$(srcdir)/'`sci_gateway/c/sci_scicos_time.c
 @am__fastdepCC_TRUE@   $(AM_V_at)$(am__mv) sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_time.Tpo sci_gateway/c/$(DEPDIR)/libsciscicos_la-sci_scicos_time.Plo
@@ -2875,6 +2827,20 @@ src/scicos_sundials/src/sundials/libscisundials_la-sundials_extension.lo: src/sc
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LTCXXCOMPILE) -c -o $@ $<
 
+src/cpp/libsciscicos_algo_la-il_state.lo: src/cpp/il_state.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciscicos_algo_la-il_state.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_state.Tpo -c -o src/cpp/libsciscicos_algo_la-il_state.lo `test -f 'src/cpp/il_state.cpp' || echo '$(srcdir)/'`src/cpp/il_state.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_state.Tpo src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_state.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/il_state.cpp' object='src/cpp/libsciscicos_algo_la-il_state.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciscicos_algo_la-il_state.lo `test -f 'src/cpp/il_state.cpp' || echo '$(srcdir)/'`src/cpp/il_state.cpp
+
+src/cpp/libsciscicos_algo_la-il_sim.lo: src/cpp/il_sim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciscicos_algo_la-il_sim.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_sim.Tpo -c -o src/cpp/libsciscicos_algo_la-il_sim.lo `test -f 'src/cpp/il_sim.cpp' || echo '$(srcdir)/'`src/cpp/il_sim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_sim.Tpo src/cpp/$(DEPDIR)/libsciscicos_algo_la-il_sim.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='src/cpp/il_sim.cpp' object='src/cpp/libsciscicos_algo_la-il_sim.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o src/cpp/libsciscicos_algo_la-il_sim.lo `test -f 'src/cpp/il_sim.cpp' || echo '$(srcdir)/'`src/cpp/il_sim.cpp
+
 src/cpp/libsciscicos_algo_la-Controller.lo: src/cpp/Controller.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT src/cpp/libsciscicos_algo_la-Controller.lo -MD -MP -MF src/cpp/$(DEPDIR)/libsciscicos_algo_la-Controller.Tpo -c -o src/cpp/libsciscicos_algo_la-Controller.lo `test -f 'src/cpp/Controller.cpp' || echo '$(srcdir)/'`src/cpp/Controller.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) src/cpp/$(DEPDIR)/libsciscicos_algo_la-Controller.Tpo src/cpp/$(DEPDIR)/libsciscicos_algo_la-Controller.Plo
@@ -3029,6 +2995,13 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_ctree4.lo: sci_gateway/cpp/sci_ctree4.cp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_ctree4.lo `test -f 'sci_gateway/cpp/sci_ctree4.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ctree4.cpp
 
+sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo: sci_gateway/cpp/sci_curblock.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo `test -f 'sci_gateway/cpp/sci_curblock.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_curblock.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_curblock.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_curblock.cpp' object='sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_curblock.lo `test -f 'sci_gateway/cpp/sci_curblock.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_curblock.cpp
+
 sci_gateway/cpp/libsciscicos_cli_la-sci_duplicate.lo: sci_gateway/cpp/sci_duplicate.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_duplicate.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_duplicate.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_duplicate.lo `test -f 'sci_gateway/cpp/sci_duplicate.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_duplicate.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_duplicate.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_duplicate.Plo
@@ -3050,6 +3023,13 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_setfield.lo: sci_gateway/cpp/sci_
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_setfield.lo `test -f 'sci_gateway/cpp/sci_scicos_setfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicos_setfield.cpp
 
+sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo: sci_gateway/cpp/sci_scicosim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo `test -f 'sci_gateway/cpp/sci_scicosim.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicosim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_scicosim.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_scicosim.cpp' object='sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_scicosim.lo `test -f 'sci_gateway/cpp/sci_scicosim.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicosim.cpp
+
 sci_gateway/cpp/libsciscicos_cli_la-sci_validvar.lo: sci_gateway/cpp/sci_validvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_validvar.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_validvar.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_validvar.lo `test -f 'sci_gateway/cpp/sci_validvar.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_validvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_validvar.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_validvar.Plo
@@ -3106,6 +3086,13 @@ sci_gateway/cpp/libsciscicos_la-sci_ctree4.lo: sci_gateway/cpp/sci_ctree4.cpp
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_ctree4.lo `test -f 'sci_gateway/cpp/sci_ctree4.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_ctree4.cpp
 
+sci_gateway/cpp/libsciscicos_la-sci_curblock.lo: sci_gateway/cpp/sci_curblock.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_curblock.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_curblock.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_curblock.lo `test -f 'sci_gateway/cpp/sci_curblock.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_curblock.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_curblock.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_curblock.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_curblock.cpp' object='sci_gateway/cpp/libsciscicos_la-sci_curblock.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_curblock.lo `test -f 'sci_gateway/cpp/sci_curblock.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_curblock.cpp
+
 sci_gateway/cpp/libsciscicos_la-sci_duplicate.lo: sci_gateway/cpp/sci_duplicate.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_duplicate.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_duplicate.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_duplicate.lo `test -f 'sci_gateway/cpp/sci_duplicate.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_duplicate.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_duplicate.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_duplicate.Plo
@@ -3127,6 +3114,13 @@ sci_gateway/cpp/libsciscicos_la-sci_scicos_setfield.lo: sci_gateway/cpp/sci_scic
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_scicos_setfield.lo `test -f 'sci_gateway/cpp/sci_scicos_setfield.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicos_setfield.cpp
 
+sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo: sci_gateway/cpp/sci_scicosim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicosim.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo `test -f 'sci_gateway/cpp/sci_scicosim.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicosim.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicosim.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_scicosim.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_scicosim.cpp' object='sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_scicosim.lo `test -f 'sci_gateway/cpp/sci_scicosim.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_scicosim.cpp
+
 sci_gateway/cpp/libsciscicos_la-sci_validvar.lo: sci_gateway/cpp/sci_validvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_validvar.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_validvar.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_validvar.lo `test -f 'sci_gateway/cpp/sci_validvar.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_validvar.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_validvar.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_validvar.Plo
index 0516b49..105790d 100644 (file)
@@ -39,7 +39,6 @@ SCICOS_IMPEXP int sci_sctree(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_ftree2(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_ftree3(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_ftree4(char *fname, void* pvApiCtx);
-SCICOS_IMPEXP int sci_curblock(char *fname, void* pvApiCtx);
 
 SCICOS_IMPEXP int sci_scicos_time(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_diffobjs(char *fname, void* pvApiCtx);
@@ -47,7 +46,6 @@ SCICOS_IMPEXP int sci_pointer_xproperty(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_phase_simulation(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_set_xproperty(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_set_blockerror(char *fname, void* pvApiCtx);
-SCICOS_IMPEXP int sci_scicosim(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_getscicosvars(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_curblockc(char *fname, void* pvApiCtx);
 SCICOS_IMPEXP int sci_end_scicosim(char *fname, void* pvApiCtx);
index 91deaf4..35fd292 100644 (file)
@@ -20,10 +20,12 @@ CPP_GATEWAY_PROTOTYPE_EXPORT(sci_buildouttb, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_ctree2, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_ctree3, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_ctree4, SCICOS_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_curblock, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_duplicate, SCICOS_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicos_log, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicos_new, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicos_setfield, SCICOS_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicos_log, SCICOS_IMPEXP);
+CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicosim, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_validvar, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_var2vec, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_vec2var, SCICOS_IMPEXP);
index cf9efba..07bfcfe 100644 (file)
@@ -52,9 +52,9 @@ typedef struct
     int* mod;         /* modes of the blocks */
     int *nmod;        /* length of mod register */
     int* modptr;      /* vector of pointers */
-    int* iz;          /* vectors of labels */
+    char** iz;          /* vectors of labels */
     int* izptr;       /* vector of pointers on block labels */
-    int* uid;         /* vectors of uids */
+    char** uid;         /* vectors of uids */
     int* uidptr;      /* vector of pointers on block uids */
     int* inpptr;      /* vector of pointers on block inputs */
     int* inplnk;      /* vector of pointers on input link */
@@ -120,6 +120,6 @@ SCICOS_IMPEXP void C2F(getouttb)(int *nsize, int *nvec, double *outtc);
 
 SCICOS_IMPEXP void C2F(getlabel)(int *kfun, char *label, int *n);
 
-SCICOS_IMPEXP int C2F(getscilabel)(int *kfun, int label[], int *n);
+SCICOS_IMPEXP int C2F(getscilabel)(int *kfun, char *label[], int *n);
 
 #endif /* __IMPORT_H__ */
index 00b41f3..d178373 100644 (file)
@@ -161,7 +161,7 @@ typedef struct
 int C2F(scicos) (double *x_in, int *xptr_in, double *z__,
                  void **work, int *zptr, int *modptr_in,
                  void **oz, int *ozsz, int *oztyp, int *ozptr,
-                 int *iz, int *izptr, int *uid, int *uidptr, double *t0_in,
+                 char **iz, int *izptr, char **uid, int *uidptr, double *t0_in,
                  double *tf_in, double *tevts_in, int *evtspt_in,
                  int *nevts, int *pointi_in, void **outtbptr_in,
                  int *outtbsz_in, int *outtbtyp_in,
diff --git a/scilab/modules/scicos/sci_gateway/c/sci_curblock.c b/scilab/modules/scicos/sci_gateway/c/sci_curblock.c
deleted file mode 100644 (file)
index e138e97..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*  Scicos
-*
-*  Copyright (C) INRIA - Allan CORNET
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* See the file ./license.txt
-*/
-
-/*--------------------------------------------------------------------------*/
-/* INRIA 2008 */
-/* Allan CORNET */
-/*--------------------------------------------------------------------------*/
-#include "machine.h" /* C2F */
-#include "gw_scicos.h"
-/*--------------------------------------------------------------------------*/
-extern int C2F(intcurblk)(); /* fortran subroutine */
-/*--------------------------------------------------------------------------*/
-int sci_curblock(char *fname, void* pvApiCtx)
-{
-    //C2F(intcurblk)();
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/scicos/sci_gateway/c/sci_scicosim.c b/scilab/modules/scicos/sci_gateway/c/sci_scicosim.c
deleted file mode 100644 (file)
index d8e4c45..0000000
+++ /dev/null
@@ -1,2717 +0,0 @@
-/*  Scicos
-*
-*  Copyright (C) INRIA - Allan CORNET
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* See the file ./license.txt
-*/
-
-/*--------------------------------------------------------------------------*/
-#include <stdio.h>
-#include "gw_scicos.h"
-#include "stack-c.h"
-#include "il_state.h"
-#include "il_sim.h"
-#include "Scierror.h"
-#include "cvstr.h"
-#include "scicos-def.h"
-#include "scicos.h"
-#include "import.h"
-#include "localization.h"
-#include "sci_malloc.h"
-
-#ifdef _MSC_VER
-#define snprintf _snprintf
-#endif
-
-/*--------------------------------------------------------------------------*/
-/* intsicosimc scicosim interface routine.
-*
-* [state,t] = scicosim(state,tcur,tf,sim,str,tol)
-*
-* rhs 1 state : Tlist
-*        - 1  : state(1)     : !xcs  x  z  oz iz  tevts  evtspt  pointi  outtb  !
-*        - 2  : state.x      : column vector of real
-*        - 3  : state.z      : column vector of real
-*        - 4  : state.oz     : list of scilab object
-*        - 5  : state.iz     : column vector of real (empty object with flag "finish")
-*        - 6  : state.tevts  : column vector of real
-*        - 7  : state.evtspt : column vector of real
-*        - 8  : state.pointi : real scalar
-*        - 9  : state.outtb  : list of scilab object
-* rhs 2 tcur  : real scalar
-* rhs 3 tf    : real scalar
-* rhs 4 sim   : Tlist
-*        - 1  : sim(1) : !scs    funs    xptr    zptr    ozptr   zcptr   inpptr
-*                         outptr inplnk  outlnk  rpar    rpptr   ipar    ipptr
-*                         opar   opptr   clkptr  ordptr  execlk  ordclk  cord
-*                         oord   zord    critev  nb      ztyp    nblk    ndcblk
-*                         subscr funtyp  iord    labels  modptr  uids !
-*        - 2  : sim.funs   : list of strings and/or scilab function
-*        - 3  : sim.xptr   : column vector of real
-*        - 4  : sim.zptr   : column vector of real
-*        - 5  : sim.ozptr  : column vector of real
-*        - 6  : sim.zcptr  : column vector of real
-*        - 7  : sim.inpptr : column vector of real
-*        - 8  : sim.outptr : column vector of real
-*        - 9  : sim.inplnk : column vector of real
-*        - 10 : sim.outlnk : column vector of real
-*        - 11 : sim.rpar   : column vector of real
-*        - 12 : sim.rpptr  : column vector of real
-*        - 13 : sim.ipar   : column vector of real
-*        - 14 : sim.ipptr  : column vector of real
-*        - 15 : sim.opar   : list of scilab object
-*        - 16 : sim.opptr  : column vector of real
-*        - 17 : sim.clkptr : column vector of real
-*        - 18 : sim.ordptr : column vector of real
-*        - 19 : sim.execlk : matrix of real
-*        - 20 : sim.ordclk : matrix of real
-*        - 21 : sim.cord   : matrix of real
-*        - 22 : sim.oord   : matrix of real
-*        - 23 : sim.zord   : column vector ? of real
-*        - 24 : sim.critev : column vector of real
-*        - 25 : sim.nb     : real scalar
-*        - 26 : sim.ztyp   : column vector of real
-*        - 27 : sim.nblk   : real scalar
-*        - 28 : sim.ndcblk : real scalar
-*        - 29 : sim.subscr : column vector of real
-*        - 30 : sim.funtyp : column vector of real
-*        - 31 : sim.iord   : column vector of real
-*        - 32 : sim.labels : column vector of strings
-*        - 33 : sim.modptr : column vector of real
-*        - 34 : sim.uids : column vector of strings
-*
-* rhs 5 str   : string flag : 'start','run','finish','linear'
-* rhs 6 tol   : real vector of size (7,1) minimum (4,1)
-*               [atol rtol ttol [deltat realtimescale solver hmax]]'
-*
-* 16/03/06, A.Layec : Rewritten from original fortran
-*                     source code intsscicos in intcos.f.
-*
-* 29/03/06, Alan    : Improvement in accordance to c_pass2
-*                     (int32 parameters).
-*
-* 31/05/06, Alan    : Add global variable int *il_state_save
-*                     and int *il_sim_save in intcscicos.h to store
-*                     stack address of list %cpr.state and %cpr.sim
-*                     (to use with get/setscicosvars).
-*
-* 14/06/06, Alan    : Save common intersci before calling scicos
-*                     (to disable scilab crash with scifunc.f).
-*
-* 13/11/06, Alan    : Get back to double parameters for sim and state
-*                     (for better compatibility with scilab-4.x families).
-*                     Remove il_sim_save global variable.
-*
-* 15/12/06, Alan    : Warnings compilation removed.
-*                     This can crash scilab/scicos.
-*                     Please report.
-*
-* xx/02/07, Alan    : Add opar/odstate : scilab lists of arbitrary object
-*                     parameters/states.
-*
-*/
-/*--------------------------------------------------------------------------*/
-#define freeparam \
-       FREE(l_sim_iord);\
-       FREE(l_sim_funtyp);\
-       FREE(l_sim_subscr);\
-       FREE(l_sim_ndcblk);\
-       FREE(l_sim_nblk);\
-       FREE(l_sim_ztyp);\
-       FREE(l_sim_nb);\
-       FREE(l_sim_critev);\
-       FREE(l_sim_zord);\
-       FREE(l_sim_oord);\
-       FREE(l_sim_cord);\
-       FREE(l_sim_ordclk);\
-       FREE(l_sim_execlk);\
-       FREE(l_sim_ordptr);\
-       FREE(l_sim_clkptr);\
-       FREE(l_sim_rpptr);\
-       FREE(l_sim_ipar);\
-       FREE(l_sim_ipptr);\
-       FREE(l_sim_opptr);\
-       FREE(l_sim_outlnk);\
-       FREE(l_sim_inplnk);\
-       FREE(l_sim_outptr);\
-       FREE(l_sim_inpptr);\
-       FREE(l_sim_zcptr);\
-       FREE(l_sim_ozptr);\
-       FREE(l_sim_zptr);\
-       FREE(l_sim_xptr);\
-       FREE(l_sim_modptr);\
-       FREE(l_state_evtspt);\
-       FREE(l_pointi)
-/*--------------------------------------------------------------------------*/
-COSIM_struct C2F(cosim); /* declaration of cosim -valable partout- */
-/*--------------------------------------------------------------------------*/
-extern COSERR_struct coserr;    /* declaration of coserr -defined in scicos- */
-extern int *listentry(int *header, int i); /* mexlib.h */
-extern int C2F(funnum)(char *fname);
-extern int C2F(namstr)();
-/*--------------------------------------------------------------------------*/
-/* variable defined in scicos.c */
-extern CURBLK_struct C2F(curblk);
-/*--------------------------------------------------------------------------*/
-int sci_scicosim(char *fname, void* pvApiCtx)
-{
-#if 0
-    /************************************
-    * variables and constants d?inition
-    ************************************/
-    static int id[nsiz];
-
-    /*declaration of static structure*/
-    static struct
-    {
-        int idb;
-    } C2F(dbcos);   /*declaration of dbcos*/
-
-    typedef struct inter_s_
-    {
-        int iwhere, nbrows, nbcols, itflag, ntypes, lad, ladc, lhsvar;
-    } intersci_state ;
-
-    typedef struct inter_l
-    {
-        intersci_state *state ;
-        int nbvars;
-    } intersci_list ;
-
-    intersci_list *loc = NULL;
-    intersci_state *new = NULL ;
-
-
-    /* declaration of outtb_elem */
-    outtb_el *outtb_elem = NULL;
-    static int nelem  = 0;
-
-    /*auxilary variables for dimension and address*/
-    static int m1 = 0;                  /*state*/
-    static int *il_state = NULL;
-    static int m1e2 = 0, n1e2 = 0;          /*state.x*/
-    static int *il_state_x = NULL;
-    static double *l_state_x = NULL;
-    static int m1e3 = 0, n1e3 = 0;          /*state.z*/
-    static int *il_state_z = NULL;
-    static double *l_state_z = NULL;
-    static int *il_state_oz = NULL;        /*state.oz*/
-    static int noz = 0;
-    static void **oz = NULL;
-    static int *ozsz = NULL;
-    static int *oztyp = NULL;
-    static int m1e5 = 0, n1e5 = 0;          /*state.iz*/
-    static int *il_state_iz = NULL;
-    static void **l_state_iz = NULL;
-    static int m1e6 = 0, n1e6 = 0;          /*state.tevts*/
-    static int *il_state_tevts = NULL;
-    static double *l_state_tevts = NULL;
-    static int m1e7 = 0, n1e7 = 0;          /*state.evtspt*/
-    static int *il_state_evtspt = NULL;
-    static int *l_state_evtspt = NULL;
-    static int m1e8 = 0, n1e8 = 0;          /*state.pointi*/
-    static int *il_pointi = NULL;
-    static int *l_pointi = NULL;
-    static int *il_state_outtb = NULL;     /*state.outtb*/
-    static int nlnk = 0;
-    static void **outtbptr = NULL;
-    static int *outtbsz = NULL;
-    static int *outtbtyp = NULL;
-
-    static int m2 = 0, n2 = 0;              /*tcur*/
-    static int *il_tcur = NULL;
-    static double *l_tcur = NULL;
-
-    static int m3 = 0, n3 = 0;              /*tf*/
-    static int *il_tf = NULL;
-    static double *l_tf = NULL;
-
-    static int m4 = 0, n4 = 0, l4 = 0, il4 = 0;     /*sim*/
-    static int *il_sim = NULL;
-    static int l4e2 = 0, il4e2 = 0;         /*sim.funs*/
-    static int *il_sim_fun = NULL;
-    static int nblk = 0;
-    static int m_xptr = 0, n_xptr = 0;      /*sim.xptr*/
-    static int *il_sim_xptr = NULL;
-    static int *l_sim_xptr = NULL;
-    static int m_zptr = 0, n_zptr = 0;      /*sim.zptr*/
-    static int *il_sim_zptr = NULL;
-    static int *l_sim_zptr = NULL;
-    static int m_ozptr = 0, n_ozptr = 0;    /*sim.ozptr*/
-    static int *il_sim_ozptr = NULL;
-    static int *l_sim_ozptr = NULL;
-
-    static int m_zcptr = 0, n_zcptr = 0;    /*sim.zcptr*/
-    static int *il_sim_zcptr = NULL;
-    static int *l_sim_zcptr = NULL;
-    static int m_inpptr = 0, n_inpptr = 0;  /*sim.inpptr*/
-    static int *il_sim_inpptr = NULL;
-    static int *l_sim_inpptr = NULL;
-    static int m_outptr = 0, n_outptr = 0;  /*sim.outptr*/
-    static int *il_sim_outptr = NULL;
-    static int *l_sim_outptr = NULL;
-    static int m_inplnk = 0, n_inplnk = 0;  /*sim.inplnk*/
-    static int *il_sim_inplnk = NULL;
-    static int *l_sim_inplnk = NULL;
-    static int m_outlnk = 0, n_outlnk = 0;  /*sim.outlnk*/
-    static int *il_sim_outlnk = NULL;
-    static int *l_sim_outlnk = NULL;
-    static int m_rpar = 0, n_rpar = 0;      /*sim.rpar*/
-    static int *il_sim_rpar = NULL;
-    static double *l_sim_rpar = NULL;
-    static int m_rpptr = 0, n_rpptr = 0;    /*sim.rpptr*/
-    static int *il_sim_rpptr = NULL;
-    static int *l_sim_rpptr = NULL;
-    static int m_ipar = 0, n_ipar = 0;      /*sim.ipar*/
-    static int *il_sim_ipar = NULL;
-    static int *l_sim_ipar = NULL;
-    static int m_ipptr = 0, n_ipptr = 0;    /*sim.ipptr*/
-    static int *il_sim_ipptr = NULL;
-    static int *l_sim_ipptr = NULL;
-    static int *il_sim_opar = NULL;        /*sim.opar*/
-    static int nopar = 0;
-    static void **opar = NULL;
-    static int *oparsz = NULL;
-    static int *opartyp = NULL;
-    static int m_opptr = 0, n_opptr = 0;    /*sim.opptr*/
-    static int *il_sim_opptr = NULL;
-    static int *l_sim_opptr = NULL;
-
-    static int m_clkptr = 0, n_clkptr = 0;  /*sim.clkptr*/
-    static int *il_sim_clkptr = NULL;
-    static int *l_sim_clkptr = NULL;
-    static int m_ordptr = 0, n_ordptr = 0;  /*sim.ordptr*/
-    static int *il_sim_ordptr = NULL;
-    static int *l_sim_ordptr = NULL;
-    static int m_execlk = 0, n_execlk = 0;  /*sim.execlk*/
-    static int *il_sim_execlk = NULL;
-    static int *l_sim_execlk = NULL;
-    static int m_ordclk = 0, n_ordclk = 0;  /*sim.ordclk*/
-    static int *il_sim_ordclk = NULL;
-    static int *l_sim_ordclk = NULL;
-    static int m_cord = 0, n_cord = 0;      /*sim.cord*/
-    static int *il_sim_cord = NULL;
-    static int *l_sim_cord = NULL;
-    static int m_oord = 0, n_oord = 0;      /*sim.oord*/
-    static int *il_sim_oord = NULL;
-    static int *l_sim_oord = NULL;
-    static int m_zord = 0, n_zord = 0;      /*sim.zord*/
-    static int *il_sim_zord = NULL;
-    static int *l_sim_zord = NULL;
-    static int m_critev = 0, n_critev = 0;  /*sim.critev*/
-    static int *il_sim_critev = NULL;
-    static int *l_sim_critev = NULL;
-    static int m_nb = 0, n_nb = 0;          /*sim.nb*/
-    static int *il_sim_nb = NULL;
-    static int *l_sim_nb = NULL;
-    static int m_ztyp = 0, n_ztyp = 0;      /*sim.ztyp*/
-    static int *il_sim_ztyp = NULL;
-    static int *l_sim_ztyp = NULL;
-    static int m_nblk = 0, n_nblk = 0;      /*sim.nblk*/
-    static int *il_sim_nblk = NULL;
-    static int *l_sim_nblk = NULL;
-    static int m_ndcblk = 0, n_ndcblk = 0;  /*sim.ndcblk*/
-    static int *il_sim_ndcblk = NULL;
-    static int *l_sim_ndcblk = NULL;
-    static int m_subscr = 0, n_subscr = 0;  /*sim.subscr*/
-    static int *il_sim_subscr = NULL;
-    static int *l_sim_subscr = NULL;
-    static int m_funtyp = 0, n_funtyp = 0;  /*sim.funtyp*/
-    static int *il_sim_funtyp = NULL;
-    static int *l_sim_funtyp = NULL;
-    static int m_iord = 0, n_iord = 0;      /*sim.iord*/
-    static int *il_sim_iord = NULL;
-    static int *l_sim_iord = NULL;
-    static int m_lab = 0, n_lab = 0;        /*sim.labels*/
-    static int *il_sim_lab = NULL;
-    static int *il_sim_labptr = NULL;
-    static int *l_sim_lab = NULL;
-    static int m_modptr = 0, n_modptr = 0;  /*sim.modptr*/
-    static int *il_sim_modptr = NULL;
-    static int *l_sim_modptr = NULL;
-    static int m_uid = 0, n_uid = 0;        /*sim.uids*/
-    static int *il_sim_uid = NULL;
-    static int *il_sim_uidptr = NULL;
-    static int *l_sim_uid = NULL;
-
-    static int m5 = 0, n5 = 0;              /*str*/
-    static int *il_str = NULL;
-    static int *l_str = NULL;
-    static int flag;
-
-    static int m6 = 0, n6 = 0;              /*tol*/
-    static int *il_tol = NULL;
-    static double *l_tol = NULL;
-
-    /*auxilary variables*/
-    static double simpar[7];
-    static int solver = 0;
-    static int *lfunpt = NULL;     /*for function table*/
-    static int lf = 0, ilf = 0, ifun = 0; /*for function table*/
-    static int ierr = 0, istate = 0; /*error variable of scicos.c*/
-
-    /*local variable*/
-    int *subheader = NULL; /*pointer to get address of a subvariable in a list*/
-    int i = 0, j = 0, k = 0;      /*local counter variable*/
-    int sz_str = 0;     /*local variable to store size of string*/
-    int err_check = 0;  /*local variable for cross var. checking dimension*/
-    char* error = NULL;
-    BOOL allocatedError = FALSE;
-#define MAX_ERROR_LEN 512
-
-    /*definition of min/max input/output argument*/
-    static int minlhs = 1, maxlhs = 2;
-    static int minrhs = 6, maxrhs = 6;
-
-    /*************************************
-    * Check number of inputs and outputs
-    *************************************/
-    CheckRhs(minrhs, maxrhs);
-    CheckLhs(minlhs, maxlhs);
-
-    /****************
-    * state (rhs 1)
-    ****************/
-    il_state = (int *) GetData(1);
-
-    /* make a copy of il_state in a global variabe */
-    set_il_state(il_state);
-
-    if (il_state[0] != 16) /*Check if state is a tlist*/
-    {
-        Scierror(56, "%s : First argument must be a Tlist.\n", fname);
-        C2F(iop).err = 1;
-        return 0;
-    }
-    m1 = il_state[1];
-
-    /*2 : state.x      */
-    il_state_x = (int *) (listentry(il_state, 2));
-    l_state_x  = (double *) (il_state_x + 4);
-    m1e2 = il_state_x[1];
-    n1e2 = il_state_x[2];
-
-    /*3 : state.z      */
-    il_state_z = (int *) (listentry(il_state, 3));
-    l_state_z  = (double *) (il_state_z + 4);
-    m1e3 = il_state_z[1];
-    n1e3 = il_state_z[2];
-
-    /*4 : state.oz     */
-    il_state_oz = (int *) (listentry(il_state, 4));
-    if (il_state_oz[0] != 15) /*check if il_state_oz is a list*/
-    {
-        Scierror(56, _("%s : oz element of state must be a list.\n"), fname);
-        C2F(iop).err = 4;
-        return 0;
-    }
-    noz = il_state_oz[1];
-
-    /*5 : state.iz     */
-    il_state_iz = (int *) (listentry(il_state, 5));
-    l_state_iz  = (void **) (il_state_iz + 4);
-    m1e5 = il_state_iz[1];
-    n1e5 = il_state_iz[2];
-
-    /*6 : state.tevts  */
-    il_state_tevts = (int *) (listentry(il_state, 6));
-    l_state_tevts  = (double *) (il_state_tevts + 4);
-    m1e6 = il_state_tevts[1];
-    n1e6 = il_state_tevts[2];
-
-    /*7 : state.evtspt */
-    il_state_evtspt = (int *) (listentry(il_state, 7));
-    m1e7 = il_state_evtspt[1];
-    n1e7 = il_state_evtspt[2];
-    if ((m1e7 * n1e7) <= 0)
-    {
-        l_state_evtspt = NULL;
-    }
-    else
-    {
-        if ((l_state_evtspt = (int *) MALLOC((m1e7 * n1e7) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m1e7 * n1e7); i++)
-            {
-                l_state_evtspt[i] = (int) ((double *)(il_state_evtspt + 4))[i];
-            }
-        }
-    }
-
-    /*8 : state.pointi */
-    il_pointi = (int *) (listentry(il_state, 8));
-    m1e8 = il_pointi[1];
-    n1e8 = il_pointi[2];
-    if ((l_pointi = (int *) MALLOC((m1e8 * n1e8) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_state_evtspt);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m1e8 * n1e8); i++)
-        {
-            l_pointi[i] = (int) ((double *)(il_pointi + 4))[i];
-        }
-    }
-
-    /*9 : state.outtb  */
-    il_state_outtb = (int *) (listentry(il_state, 9));
-    if (il_state_outtb[0] != 15) /*check if il_state_outtb is a list*/
-    {
-        Scierror(56, _("%s : outtb element of state must be a list.\n"), fname);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 4;
-        return 0;
-    }
-    nlnk = il_state_outtb[1]; /*nlnk is the dimension of the list state_louttb*/
-
-    /***************
-    * tcur (rhs 2)
-    ***************/
-    il_tcur = (int *) GetData(2);
-    if (il_tcur[0] != 1) /*Check if tcur is a real or complex matrix*/
-    {
-        Scierror(53, _("%s : Second argument must be a scalar.\n"), fname);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 2;
-        return 0;
-    }
-    l_tcur = (double *) (il_tcur + 4);
-    m2 = il_tcur[1];
-    n2 = il_tcur[2];
-    CheckScalar(2, m2, n2);
-    CheckDims(2, m2, n2, 1, 1);
-
-    /*************
-    * tf (rhs 3)
-    *************/
-    il_tf = (int *) GetData(3);
-    if (il_tf[0] != 1) /*Check if tf is a real or complex matrix*/
-    {
-        Scierror(53, _("%s : Third argument must be a scalar.\n"), fname);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 3;
-        return 0;
-    }
-    l_tf = (double *) (il_tf + 4);
-    m3 = il_tf[1];
-    n3 = il_tf[2];
-    CheckScalar(3, m3, n3);
-    CheckDims(3, m3, n3, 1, 1);
-
-    /*************
-    * sim (rhs 4)
-    *************/
-    il_sim = (int *) GetData(4);
-
-
-    set_il_sim(il_sim);
-
-    if (il_sim[0] != 16) /*Check if sim is a tlist*/
-    {
-        Scierror(56, _("%s : Fourth argument must be a Tlist.\n"), fname);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 4;
-        return 0;
-    }
-    m4 = il_sim[1];
-    n4 = il_sim[2];
-
-    /*2  : sim.funs*/
-    il_sim_fun = (int *) (listentry(il_sim, 2));
-    if (il_sim_fun[0] != 15) /*check if sim.funs is a list*/
-    {
-        Scierror(56, _("%s : Second element of sim must be a list.\n"), fname);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 4;
-        return 0;
-    }
-    nblk = il_sim_fun[1]; /*nblk is the dimension of the list sim.funs*/
-
-    /*3  : sim.xptr   */
-    il_sim_xptr = (int *) (listentry(il_sim, 3));
-    m_xptr = il_sim_xptr[1];
-    n_xptr = il_sim_xptr[2];
-    if (m_xptr * n_xptr == 0)
-    {
-        l_sim_xptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_xptr = (int *) MALLOC((m_xptr * n_xptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_xptr * n_xptr); i++)
-            {
-                l_sim_xptr[i] = (int) ((double *)(il_sim_xptr + 4))[i];
-            }
-        }
-    }
-
-    /*4  : sim.zptr   */
-    il_sim_zptr = (int *) (listentry(il_sim, 4));
-    m_zptr = il_sim_zptr[1];
-    n_zptr = il_sim_zptr[2];
-    if (m_zptr * n_zptr == 0)
-    {
-        l_sim_zptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_zptr = (int *) MALLOC((m_zptr * n_zptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_zptr * n_zptr); i++)
-            {
-                l_sim_zptr[i] = (int) ((double *)(il_sim_zptr + 4))[i];
-            }
-        }
-    }
-
-    /*5  : sim.ozptr   */
-    il_sim_ozptr = (int *) (listentry(il_sim, 5));
-    m_ozptr = il_sim_ozptr[1];
-    n_ozptr = il_sim_ozptr[2];
-    if (m_ozptr * n_ozptr == 0)
-    {
-        l_sim_ozptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_ozptr = (int *) MALLOC((m_ozptr * n_ozptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_ozptr * n_ozptr); i++)
-            {
-                l_sim_ozptr[i] = (int) ((double *)(il_sim_ozptr + 4))[i];
-            }
-        }
-    }
-
-    /*6  : sim.zcptr  */
-    il_sim_zcptr = (int *) (listentry(il_sim, 6));
-    m_zcptr = il_sim_zcptr[1];
-    n_zcptr = il_sim_zcptr[2];
-    if (m_zcptr * n_zcptr == 0)
-    {
-        l_sim_zcptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_zcptr = (int *) MALLOC((m_zcptr * n_zcptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_zcptr * n_zcptr); i++)
-            {
-                l_sim_zcptr[i] = (int) ((double *)(il_sim_zcptr + 4))[i];
-            }
-        }
-    }
-
-    /*7  : sim.inpptr */
-    il_sim_inpptr = (int *) (listentry(il_sim, 7));
-    m_inpptr = il_sim_inpptr[1];
-    n_inpptr = il_sim_inpptr[2];
-    if (m_inpptr * n_inpptr == 0)
-    {
-        l_sim_inpptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_inpptr = (int *) MALLOC((m_inpptr * n_inpptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_inpptr * n_inpptr); i++)
-            {
-                l_sim_inpptr[i] = (int) ((double *)(il_sim_inpptr + 4))[i];
-            }
-        }
-    }
-
-    /*8  : sim.outptr */
-    il_sim_outptr = (int *) (listentry(il_sim, 8));
-    m_outptr = il_sim_outptr[1];
-    n_outptr = il_sim_outptr[2];
-    if (m_outptr * n_outptr == 0)
-    {
-        l_sim_outptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_outptr = (int *) MALLOC((m_outptr * n_outptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_outptr * n_outptr); i++)
-            {
-                l_sim_outptr[i] = (int) ((double *)(il_sim_outptr + 4))[i];
-            }
-        }
-    }
-
-    /*9  : sim.inplnk */
-    il_sim_inplnk = (int *) (listentry(il_sim, 9));
-    m_inplnk = il_sim_inplnk[1];
-    n_inplnk = il_sim_inplnk[2];
-    if (m_inplnk * n_inplnk == 0)
-    {
-        l_sim_inplnk = NULL;
-    }
-    else
-    {
-        if ((l_sim_inplnk = (int *) MALLOC((m_inplnk * n_inplnk) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_inplnk * n_inplnk); i++)
-            {
-                l_sim_inplnk[i] = (int) ((double *)(il_sim_inplnk + 4))[i];
-            }
-        }
-    }
-
-    /*10  : sim.outlnk */
-    il_sim_outlnk = (int *) (listentry(il_sim, 10));
-    m_outlnk = il_sim_outlnk[1];
-    n_outlnk = il_sim_outlnk[2];
-    if (m_outlnk * n_outlnk == 0)
-    {
-        l_sim_outlnk = NULL;
-    }
-    else
-    {
-        if ((l_sim_outlnk = (int *) MALLOC((m_outlnk * n_outlnk) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_outlnk * n_outlnk); i++)
-            {
-                l_sim_outlnk[i] = (int) ((double *)(il_sim_outlnk + 4))[i];
-            }
-        }
-    }
-
-    /*11 : sim.rpar   */
-    il_sim_rpar = (int *) (listentry(il_sim, 11));
-    m_rpar = il_sim_rpar[1];
-    n_rpar = il_sim_rpar[2];
-    if (m_rpar * n_rpar == 0)
-    {
-        l_sim_rpar = NULL;
-    }
-    else
-    {
-        l_sim_rpar = (double *) (il_sim_rpar + 4);
-    }
-
-    /*12 : sim.rpptr  */
-    il_sim_rpptr = (int *) (listentry(il_sim, 12));
-    m_rpptr = il_sim_rpptr[1];
-    n_rpptr = il_sim_rpptr[2];
-    if (m_rpptr * n_rpptr == 0)
-    {
-        l_sim_rpptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_rpptr = (int *) MALLOC((m_rpptr * n_rpptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_rpptr * n_rpptr); i++)
-            {
-                l_sim_rpptr[i] = (int) ((double *)(il_sim_rpptr + 4))[i];
-            }
-        }
-    }
-
-    /*13 : sim.ipar   */
-    il_sim_ipar = (int *) (listentry(il_sim, 13));
-    m_ipar = il_sim_ipar[1];
-    n_ipar = il_sim_ipar[2];
-    if (m_ipar * n_ipar == 0)
-    {
-        l_sim_ipar = NULL;
-    }
-    else
-    {
-        if ((l_sim_ipar = (int *) MALLOC((m_ipar * n_ipar) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_ipar * n_ipar); i++)
-            {
-                l_sim_ipar[i] = (int) ((double *)(il_sim_ipar + 4))[i];
-            }
-        }
-    }
-
-    /*14 : sim.ipptr  */
-    il_sim_ipptr = (int *) (listentry(il_sim, 14));
-    m_ipptr = il_sim_ipptr[1];
-    n_ipptr = il_sim_ipptr[2];
-    if (m_ipptr * n_ipptr == 0)
-    {
-        l_sim_ipptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_ipptr = (int *) MALLOC((m_ipptr * n_ipptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_ipptr * n_ipptr); i++)
-            {
-                l_sim_ipptr[i] = (int) ((double *)(il_sim_ipptr + 4))[i];
-            }
-        }
-    }
-
-    /*15 : sim.opar   */
-    il_sim_opar = (int *) (listentry(il_sim, 15));
-    if (il_sim_opar[0] != 15) /*Check if sim.opar is a list*/
-    {
-        Scierror(56, _("%s : sim.opar must be a list.\n"), fname);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        C2F(iop).err = 4;
-        return 0;
-    }
-    nopar = il_sim_opar[1];
-
-    /*16 : sim.opptr  */
-    il_sim_opptr = (int *) (listentry(il_sim, 16));
-    m_opptr = il_sim_opptr[1];
-    n_opptr = il_sim_opptr[2];
-    if (m_opptr * n_opptr == 0)
-    {
-        l_sim_opptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_opptr = (int *) MALLOC((m_opptr * n_opptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_opptr * n_opptr); i++)
-            {
-                l_sim_opptr[i] = (int) ((double *)(il_sim_opptr + 4))[i];
-            }
-        }
-    }
-
-    /*17 : sim.clkptr */
-    il_sim_clkptr = (int *) (listentry(il_sim, 17));
-    m_clkptr = il_sim_clkptr[1];
-    n_clkptr = il_sim_clkptr[2];
-    if (m_clkptr * n_clkptr == 0)
-    {
-        l_sim_clkptr = NULL;
-    }
-    else
-    {
-        if ((l_sim_clkptr = (int *) MALLOC((m_clkptr * n_clkptr) * sizeof(int))) == NULL )
-        {
-            Scierror(999,  _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_clkptr * n_clkptr); i++)
-            {
-                l_sim_clkptr[i] = (int) ((double *)(il_sim_clkptr + 4))[i];
-            }
-        }
-    }
-
-    /*18 : sim.ordptr */
-    il_sim_ordptr = (int *) (listentry(il_sim, 18));
-    m_ordptr = il_sim_ordptr[1];
-    n_ordptr = il_sim_ordptr[2];
-    if ((l_sim_ordptr = (int *) MALLOC((m_ordptr * n_ordptr) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_ordptr * n_ordptr); i++)
-        {
-            l_sim_ordptr[i] = (int) ((double *)(il_sim_ordptr + 4))[i];
-        }
-    }
-
-    /*19 : sim.execlk */
-    il_sim_execlk = (int *) (listentry(il_sim, 19));
-    m_execlk = il_sim_execlk[1];
-    n_execlk = il_sim_execlk[2];
-    if (m_execlk * n_execlk == 0)
-    {
-        l_sim_execlk = NULL;
-    }
-    else
-    {
-        if ((l_sim_execlk = (int *) MALLOC((m_execlk * n_execlk) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_execlk * n_execlk); i++)
-            {
-                l_sim_execlk[i] = (int) ((double *)(il_sim_execlk + 4))[i];
-            }
-        }
-    }
-
-    /*20 : sim.ordclk */
-    il_sim_ordclk = (int *) (listentry(il_sim, 20));
-    m_ordclk = il_sim_ordclk[1];
-    n_ordclk = il_sim_ordclk[2];
-    if (m_ordclk * n_ordclk == 0)
-    {
-        l_sim_ordclk = NULL;
-    }
-    else
-    {
-        if ((l_sim_ordclk = (int *) MALLOC((m_ordclk * n_ordclk) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_ordclk * n_ordclk); i++)
-            {
-                l_sim_ordclk[i] = (int) ((double *)(il_sim_ordclk + 4))[i];
-            }
-        }
-    }
-
-    /*21 : sim.cord   */
-    il_sim_cord = (int *) (listentry(il_sim, 21));
-    m_cord = il_sim_cord[1];
-    n_cord = il_sim_cord[2];
-    if (m_cord * n_cord == 0)
-    {
-        l_sim_cord = NULL;
-    }
-    else
-    {
-        if ((l_sim_cord = (int *) MALLOC((m_cord * n_cord) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_cord * n_cord); i++)
-            {
-                l_sim_cord[i] = (int) ((double *)(il_sim_cord + 4))[i];
-            }
-        }
-    }
-
-    /*22 : sim.oord   */
-    il_sim_oord = (int *) (listentry(il_sim, 22));
-    m_oord = il_sim_oord[1];
-    n_oord = il_sim_oord[2];
-    if (m_oord * n_oord == 0)
-    {
-        l_sim_oord = NULL;
-    }
-    else
-    {
-        if ((l_sim_oord = (int *) MALLOC((m_oord * n_oord) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_cord);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_oord * n_oord); i++)
-            {
-                l_sim_oord[i] = (int) ((double *)(il_sim_oord + 4))[i];
-            }
-        }
-    }
-
-    /*23 : sim.zord   */
-    il_sim_zord = (int *) (listentry(il_sim, 23));
-    m_zord = il_sim_zord[1];
-    n_zord = il_sim_zord[2];
-    if (m_zord * n_zord == 0)
-    {
-        l_sim_zord = NULL;
-    }
-    else
-    {
-        if ((l_sim_zord = (int *) MALLOC((m_zord * n_zord) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_oord);
-            FREE(l_sim_cord);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_zord * n_zord); i++)
-            {
-                l_sim_zord[i] = (int) ((double *)(il_sim_zord + 4))[i];
-            }
-        }
-    }
-
-    /*24 : sim.critev */
-    il_sim_critev = (int *) (listentry(il_sim, 24));
-    m_critev = il_sim_critev[1];
-    n_critev = il_sim_critev[2];
-    if (m_critev * n_critev == 0)
-    {
-        l_sim_critev = NULL;
-    }
-    else
-    {
-        if ((l_sim_critev = (int *) MALLOC((m_critev * n_critev) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_zord);
-            FREE(l_sim_oord);
-            FREE(l_sim_cord);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_critev * n_critev); i++)
-            {
-                l_sim_critev[i] = (int) ((double *)(il_sim_critev + 4))[i];
-            }
-        }
-    }
-
-    /*25 : sim.nb     */
-    il_sim_nb = (int *) (listentry(il_sim, 25));
-    m_nb = il_sim_nb[1];
-    n_nb = il_sim_nb[2];
-    if ((l_sim_nb = (int *) MALLOC((m_nb * n_nb) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_nb * n_nb); i++)
-        {
-            l_sim_nb[i] = (int) ((double *)(il_sim_nb + 4))[i];
-        }
-    }
-    if (l_sim_nb[0] != nblk) /*value of nb must be equal to nblk*/
-    {
-        Scierror(42, _("%s : Incompatible sim.nb RHS parameter.\n"), fname);
-        return 0;
-    }
-
-    /*26 : sim.ztyp   */
-    il_sim_ztyp = (int *) (listentry(il_sim, 26));
-    m_ztyp = il_sim_ztyp[1];
-    n_ztyp = il_sim_ztyp[2];
-    if ((l_sim_ztyp = (int *) MALLOC((m_ztyp * n_ztyp) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_nb);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_ztyp * n_ztyp); i++)
-        {
-            l_sim_ztyp[i] = (int) ((double *)(il_sim_ztyp + 4))[i];
-        }
-    }
-
-    /*27 : sim.nblk   */
-    il_sim_nblk = (int *) (listentry(il_sim, 27));
-    m_nblk = il_sim_nblk[1];
-    n_nblk = il_sim_nblk[2];
-    if ((l_sim_nblk = (int *) MALLOC((m_nblk * n_nblk) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_ztyp);
-        FREE(l_sim_nb);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_nblk * n_nblk); i++)
-        {
-            l_sim_nblk[i] = (int) ((double *)(il_sim_ztyp + 4))[i];
-        }
-    }
-
-    /*28 : sim.ndcblk */
-    il_sim_ndcblk = (int *) (listentry(il_sim, 28));
-    m_ndcblk = il_sim_ndcblk[1];
-    n_ndcblk = il_sim_ndcblk[2];
-    if ((l_sim_ndcblk = (int *) MALLOC((m_ndcblk * n_ndcblk) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_nblk);
-        FREE(l_sim_ztyp);
-        FREE(l_sim_nb);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_ndcblk * n_ndcblk); i++)
-        {
-            l_sim_ndcblk[i] = (int) ((double *)(il_sim_ndcblk + 4))[i];
-        }
-    }
-
-    /*29 : sim.subscr */
-    il_sim_subscr = (int *) (listentry(il_sim, 29));
-    m_subscr = il_sim_subscr[1];
-    n_subscr = il_sim_subscr[2];
-    if (m_subscr * n_subscr == 0)
-    {
-        l_sim_subscr = NULL;
-    }
-    else
-    {
-        if ((l_sim_subscr = (int *) MALLOC((m_subscr * n_subscr) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_ndcblk);
-            FREE(l_sim_nblk);
-            FREE(l_sim_ztyp);
-            FREE(l_sim_nb);
-            FREE(l_sim_critev);
-            FREE(l_sim_zord);
-            FREE(l_sim_oord);
-            FREE(l_sim_cord);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_subscr * n_subscr); i++)
-            {
-                l_sim_subscr[i] = (int) ((double *)(il_sim_subscr + 4))[i];
-            }
-        }
-    }
-
-    /*30 : sim.funtyp */
-    il_sim_funtyp = (int *) (listentry(il_sim, 30));
-    m_funtyp = il_sim_funtyp[1];
-    n_funtyp = il_sim_funtyp[2];
-    if ((l_sim_funtyp = (int *) MALLOC((m_funtyp * n_funtyp) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_subscr);
-        FREE(l_sim_ndcblk);
-        FREE(l_sim_nblk);
-        FREE(l_sim_ztyp);
-        FREE(l_sim_nb);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_funtyp * n_funtyp); i++)
-        {
-            l_sim_funtyp[i] = (int) ((double *)(il_sim_funtyp + 4))[i];
-        }
-    }
-
-    /*31 : sim.iord   */
-    il_sim_iord = (int *) (listentry(il_sim, 31));
-    m_iord = il_sim_iord[1];
-    n_iord = il_sim_iord[2];
-    if (m_iord * n_iord == 0)
-    {
-        l_sim_iord = NULL;
-    }
-    else
-    {
-        if ((l_sim_iord = (int *) MALLOC((m_iord * n_iord) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(l_sim_funtyp);
-            FREE(l_sim_subscr);
-            FREE(l_sim_ndcblk);
-            FREE(l_sim_nblk);
-            FREE(l_sim_ztyp);
-            FREE(l_sim_nb);
-            FREE(l_sim_critev);
-            FREE(l_sim_zord);
-            FREE(l_sim_oord);
-            FREE(l_sim_cord);
-            FREE(l_sim_ordclk);
-            FREE(l_sim_execlk);
-            FREE(l_sim_ordptr);
-            FREE(l_sim_clkptr);
-            FREE(l_sim_opptr);
-            FREE(l_sim_ipptr);
-            FREE(l_sim_ipar);
-            FREE(l_sim_rpptr);
-            FREE(l_sim_outlnk);
-            FREE(l_sim_inplnk);
-            FREE(l_sim_outptr);
-            FREE(l_sim_inpptr);
-            FREE(l_sim_zcptr);
-            FREE(l_sim_ozptr);
-            FREE(l_sim_zptr);
-            FREE(l_sim_xptr);
-            FREE(l_state_evtspt);
-            FREE(l_pointi);
-            return 0;
-        }
-        else
-        {
-            for (i = 0; i < (m_iord * n_iord); i++)
-            {
-                l_sim_iord[i] = (int) ((double *)(il_sim_iord + 4))[i];
-            }
-        }
-    }
-
-    /*32 : sim.labels */
-    il_sim_lab = (int *) (listentry(il_sim, 32));
-    m_lab = il_sim_lab[1];
-    n_lab = il_sim_lab[2];
-    il_sim_labptr = &il_sim_lab[4];  /*get address-1 of first pointer in labels*/
-    l_sim_lab = (int *) (il_sim_lab + m_lab + 5); /*get address of first string in labels*/
-
-    /*33 : sim.modptr */
-    il_sim_modptr = (int *) (listentry(il_sim, 33));
-    m_modptr = il_sim_modptr[1];
-    n_modptr = il_sim_modptr[2];
-    if ((l_sim_modptr = (int *) MALLOC((m_modptr * n_modptr) * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(l_sim_iord);
-        FREE(l_sim_funtyp);
-        FREE(l_sim_subscr);
-        FREE(l_sim_ndcblk);
-        FREE(l_sim_nblk);
-        FREE(l_sim_ztyp);
-        FREE(l_sim_nb);
-        FREE(l_sim_critev);
-        FREE(l_sim_zord);
-        FREE(l_sim_oord);
-        FREE(l_sim_cord);
-        FREE(l_sim_ordclk);
-        FREE(l_sim_execlk);
-        FREE(l_sim_ordptr);
-        FREE(l_sim_clkptr);
-        FREE(l_sim_opptr);
-        FREE(l_sim_ipptr);
-        FREE(l_sim_ipar);
-        FREE(l_sim_rpptr);
-        FREE(l_sim_outlnk);
-        FREE(l_sim_inplnk);
-        FREE(l_sim_outptr);
-        FREE(l_sim_inpptr);
-        FREE(l_sim_zcptr);
-        FREE(l_sim_ozptr);
-        FREE(l_sim_zptr);
-        FREE(l_sim_xptr);
-        FREE(l_state_evtspt);
-        FREE(l_pointi);
-        return 0;
-    }
-    else
-    {
-        for (i = 0; i < (m_modptr * n_modptr); i++)
-        {
-            l_sim_modptr[i] = (int) ((double *)(il_sim_modptr + 4))[i];
-        }
-    }
-
-    /*34 : sim.uids */
-    il_sim_uid = (int *) (listentry(il_sim, 34));
-    m_uid = il_sim_uid[1];
-    n_uid = il_sim_uid[2];
-    il_sim_uidptr = &il_sim_uid[4];  /*get address-1 of first pointer in uids*/
-    l_sim_uid = (int *) (il_sim_uid + m_uid + 5); /*get address of first string in uids*/
-
-    /*************
-    * str (rhs 5)
-    *************/
-    il_str = (int *) GetData(5);
-    m5 = il_str[1];
-    n5 = il_str[2];
-    l_str = (int *) (il_str + 6);
-    CheckDims(5, m5, n5, m5, 1);
-
-    sz_str = il_str[5] - 1; /*store the length of str*/
-    C2F(cha1).buf[0] = ' ';
-    C2F(cvstr)(&sz_str, &l_str[0], &C2F(cha1).buf[0], (j = 1, &j), sz_str); /*codetoascii*/
-    C2F(cha1).buf[sz_str] = '\0';
-    if (strcmp(C2F(cha1).buf, "start") == 0)
-    {
-        flag = 1;
-    }
-    else if (strcmp(C2F(cha1).buf, "run") == 0)
-    {
-        flag = 2;
-    }
-    else if (strcmp(C2F(cha1).buf, "finish") == 0)
-    {
-        flag = 3;
-    }
-    else if (strcmp(C2F(cha1).buf, "linear") == 0)
-    {
-        flag = 4;
-    }
-    else if (strcmp(C2F(cha1).buf, "Kinsol") == 0)
-    {
-        flag = 5;
-    }
-    else
-    {
-        Scierror(44, "%s : Fifth argument is incorrect.\n", fname);
-        freeparam;
-        C2F(iop).err = 5;
-        return 0;
-    }
-
-    /*************
-    * tol (rhs 6)
-    *************/
-    il_tol = (int *) GetData(6);
-    l_tol = (double *) (il_tol + 4);
-    m6 = il_tol[1];
-    n6 = il_tol[2];
-    m6 = m6 * n6;
-    if (m6 < 4) /*Check if tol has a minimun of four elements*/
-    {
-        Scierror(89, _("%s : Sixth argument must have at least four elements.\n"), fname);
-        freeparam;
-        C2F(iop).err = 6;
-        return 0;
-    }
-    else if (m6 > 7) /*Check if tol has a maximum of seven elements*/
-    {
-        Scierror(89, _("%s : Sixth argument must have a maximum of seven elements.\n"), fname);
-        freeparam;
-        C2F(iop).err = 6;
-        return 0;
-    }
-
-    /******************
-    * set simpar array
-    ******************/
-    if (m6 == 4)
-    {
-        for (i = 0; i < 4; i++)
-        {
-            simpar[i] = l_tol[i];
-        }
-        simpar[4] = 0;
-        simpar[5] = 0;
-        simpar[6] = 0;
-    }
-    else if (m6 == 5)
-    {
-        for (i = 0; i < 5; i++)
-        {
-            simpar[i] = l_tol[i];
-        }
-        simpar[5] = 0;
-        simpar[6] = 0;
-    }
-    else if (m6 == 6)
-    {
-        for (i = 0; i < 6; i++)
-        {
-            simpar[i] = l_tol[i];
-        }
-        simpar[6] = 0;
-    }
-    else for (i = 0; i < 7; i++)
-        {
-            simpar[i] = l_tol[i];
-        }
-    solver = (int)simpar[5]; /*set solver variable*/
-
-    /******************************
-    * cross variable size checking
-    ******************************/
-    err_check = 0;
-    if (m1e6 != m1e7)
-    {
-        err_check = 1;    /*tevts vs evtspt*/
-    }
-    else if (m_xptr != m_zptr)
-    {
-        err_check = 2;    /*xptr vs zptr*/
-    }
-    else if (m_xptr != m_ozptr)
-    {
-        err_check = 3;    /*xptr vs ozptr*/
-    }
-    else if (m_xptr != m_zcptr)
-    {
-        err_check = 4;    /*xptr vs zcptr*/
-    }
-    else if (m_xptr != m_inpptr)
-    {
-        err_check = 5;    /*xptr vs inpptr*/
-    }
-    else if (m_xptr != m_outptr)
-    {
-        err_check = 6;    /*xptr vs outptr*/
-    }
-    else if (m_xptr != m_rpptr)
-    {
-        err_check = 7;    /*xptr vs rpptr*/
-    }
-    else if (m_xptr != m_ipptr)
-    {
-        err_check = 8;    /*xptr vs ipptr*/
-    }
-    else if (m_xptr != m_opptr)
-    {
-        err_check = 8;    /*xptr vs opptr*/
-    }
-    else if (m_xptr != m_clkptr)
-    {
-        err_check = 10;    /*xptr vs clkptr*/
-    }
-    else if ((n_ordclk != 2) & (m_ordclk != 0))
-    {
-        err_check = 11;    /*sim.ordclk*/
-    }
-    else if ((n_cord != 2) & (m_cord != 0))
-    {
-        err_check = 12;    /*sim.cord*/
-    }
-    else if ((n_oord != 2) & (m_oord != 0))
-    {
-        err_check = 13;    /*sim.oord*/
-    }
-    else if ((n_zord != 2) & (m_zord != 0))
-    {
-        err_check = 14;    /*sim.zord*/
-    }
-    else if ((n_iord != 2) & (m_iord != 0))
-    {
-        err_check = 15;    /*sim.iord*/
-    }
-    if (err_check != 0)
-    {
-        /* please write an error table here  */
-        Scierror(42, _("%s : error in cross variable size checking : %d\n"), \
-                 fname, err_check);
-        freeparam;
-        return 0;
-    }
-
-    /*******************************
-    * set function table for blocks
-    *******************************/
-    il4 = iadr(*Lstk(Top - Rhs + 4)); /*sim*/
-    l4 = sadr(il4 + m4 + 3);
-    il4e2 = iadr(l4 + *istk(il4 + 3) - 1);
-    l4e2 = sadr(il4e2 + nblk + 3);
-    lf = l4e2;  /*first element of the list sim.funs*/
-    /*define new variable lfunpt*/
-    if ((lfunpt = (int *) MALLOC(nblk * sizeof(int))) == NULL )
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        freeparam;
-        return 0;
-    }
-
-    /*for each block*/
-    for (i = 0; i < nblk; i++)
-    {
-        ilf = iadr(lf); /*should be removed later*/
-        subheader = (int *)(listentry(il_sim_fun, i + 1));
-        /*Block is defined by a scilab function*/
-        if ((subheader[0] == 11) | (subheader[0] == 13))
-        {
-            lfunpt[i] = -lf;
-        }
-        /*Block is defined by a function described by a characater strings*/
-        else if (subheader[0] == 10)
-        {
-            sz_str = subheader[5] - 1; /*store the length of function name*/
-            C2F(cha1).buf[0] = ' ';
-            C2F(cvstr)(&sz_str, &subheader[6], &C2F(cha1).buf[0], (j = 1, &j), sz_str); /*codetoascii*/
-            C2F(cha1).buf[sz_str] = '\0';
-            ifun = C2F(funnum)(C2F(cha1).buf); /*search associated function number of function name*/
-            /*Block is defined by a C or Fortran function*/
-            if (ifun > 0)
-            {
-                lfunpt[i] = ifun;
-            }
-            /*Block is defined by a predefined scilab function*/
-            else
-            {
-                C2F(namstr)(id, &subheader[6], &sz_str, (j = 0, &j));
-                C2F(com).fin = 0;
-                C2F(funs)(id);
-                if ((C2F(com).fun == -1) | (C2F(com).fun == -2))
-                {
-                    lfunpt[i] = -*Lstk(C2F(com).fin);
-                }
-                else
-                {
-                    C2F(curblk).kfun = i + 1;
-                    Scierror(888, _("%s : unknown block : %s\n"), fname, C2F(cha1).buf);
-                    FREE(lfunpt);
-                    freeparam;
-                    return 0;
-                }
-            }
-        }
-        else
-        {
-            C2F(iop).err = 4;
-            Scierror(44, _("%s : error\n"), fname);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        lf = lf + *istk(il4e2 + 3 + i) - *istk(il4e2 + i + 2);
-    }
-
-    /**********************
-    * set oz, ozsz, oztyp
-    **********************/
-    if (noz <= 0)
-    {
-        oz = NULL;
-        ozsz = NULL;
-        oztyp = NULL;
-    }
-    else
-    {
-        /*Allocation of oz*/
-        if ((oz = (void **) MALLOC((noz) * sizeof(void *))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of ozsz*/
-        if ((ozsz = (int *) MALLOC(2 * (noz) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(oz);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of oztyp*/
-        if ((oztyp = (int *) MALLOC((noz) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-
-        /*set vectors of oz*/
-        for (j = 0; j < noz; j++)
-        {
-            subheader = (int *)(listentry(il_state_oz, j + 1));
-
-            switch (subheader[0]) /*store type and address*/
-            {
-                /*matrix of double*/
-                case 1  :
-                    switch (subheader[3])
-                    {
-                        case 0  :
-                            oztyp[j] = SCSREAL_N; /*double real matrix*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSREAL_COP *)(subheader + 4);
-                            break;
-
-                        case 1  :
-                            oztyp[j] = SCSCOMPLEX_N; /*double complex matrix*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSCOMPLEX_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            oztyp[j] = SCSUNKNOW_N;
-                            ozsz[j] = il_state_oz[3 + j] - il_state_oz[2 + j];
-                            ozsz[j + noz] = 1;
-                            oz[j] = (SCSUNKNOW_COP *)subheader;
-                            break;
-                    }
-                    break;
-
-                /*matrix of integers*/
-                case 8  :
-                    switch (subheader[3])
-                    {
-                        case 1  :
-                            oztyp[j] = SCSINT8_N; /*int8*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 2  :
-                            oztyp[j] = SCSINT16_N; /*int16*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 4  :
-                            oztyp[j] = SCSINT32_N; /*int32*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSINT32_COP *)(subheader + 4);
-                            break;
-
-                        case 11 :
-                            oztyp[j] = SCSUINT8_N; /*uint8*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSUINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 12 :
-                            oztyp[j] = SCSUINT16_N; /*uint16*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSUINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 14 :
-                            oztyp[j] = SCSUINT32_N; /*uint32*/
-                            ozsz[j] = subheader[1];
-                            ozsz[j + noz] = subheader[2];
-                            oz[j] = (SCSUINT32_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            oztyp[j] = SCSUNKNOW_N;
-                            ozsz[j] = il_state_oz[3 + j] - il_state_oz[2 + j];
-                            ozsz[j + noz] = 1;
-                            oz[j] = (SCSUNKNOW_COP *)subheader;
-                            break;
-                    }
-                    break;
-
-                default :
-                    oztyp[j] = SCSUNKNOW_N;
-                    ozsz[j] = il_state_oz[3 + j] - il_state_oz[2 + j];
-                    ozsz[j + noz] = 1;
-                    oz[j] = (SCSUNKNOW_COP *)subheader;
-                    break;
-            }
-        }
-    }
-
-    /****************************
-    * set opar, oparsz, opartyp
-    ****************************/
-    if (nopar <= 0)
-    {
-        opar = NULL;
-        oparsz = NULL;
-        opartyp = NULL;
-    }
-    else
-    {
-        /*Allocation of opar*/
-        if ((opar = (void **) MALLOC((nopar) * sizeof(void *))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of oparsz*/
-        if ((oparsz = (int *) MALLOC(2 * (nopar) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(opar);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of opartyp*/
-        if ((opartyp = (int *) MALLOC((nopar) * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(opar);
-            FREE(oparsz);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-
-        /*set vectors of opar*/
-        for (j = 0; j < nopar; j++)
-        {
-            subheader = (int *)(listentry(il_sim_opar, j + 1));
-
-            switch (subheader[0]) /*store type and address*/
-            {
-                /*matrix of double*/
-                case 1  :
-                    switch (subheader[3])
-                    {
-                        case 0  :
-                            opartyp[j] = SCSREAL_N; /*double real matrix*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSREAL_COP *)(subheader + 4);
-                            break;
-
-                        case 1  :
-                            opartyp[j] = SCSCOMPLEX_N; /*double complex matrix*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSCOMPLEX_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            opartyp[j] = SCSUNKNOW_N;
-                            oparsz[j] = il_sim_opar[3 + j] - il_sim_opar[2 + j];
-                            oparsz[j + nopar] = 1;
-                            opar[j] = (SCSUNKNOW_COP *)subheader;
-                            break;
-                    }
-                    break;
-
-                /*matrix of integers*/
-                case 8  :
-                    switch (subheader[3])
-                    {
-                        case 1  :
-                            opartyp[j] = SCSINT8_N; /*int8*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 2  :
-                            opartyp[j] = SCSINT16_N; /*int16*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 4  :
-                            opartyp[j] = SCSINT32_N; /*int32*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSINT32_COP *)(subheader + 4);
-                            break;
-
-                        case 11 :
-                            opartyp[j] = SCSUINT8_N; /*uint8*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSUINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 12 :
-                            opartyp[j] = SCSUINT16_N; /*uint16*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSUINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 14 :
-                            opartyp[j] = SCSUINT32_N; /*uint32*/
-                            oparsz[j] = subheader[1];
-                            oparsz[j + nopar] = subheader[2];
-                            opar[j] = (SCSUINT32_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            opartyp[j] = SCSUNKNOW_N;
-                            oparsz[j] = il_sim_opar[3 + j] - il_sim_opar[2 + j];
-                            oparsz[j + nopar] = 1;
-                            opar[j] = (SCSUNKNOW_COP *)subheader;
-                            break;
-                    }
-                    break;
-
-                default :
-                    opartyp[j] = SCSUNKNOW_N;
-                    oparsz[j] = il_sim_opar[3 + j] - il_sim_opar[2 + j];
-                    oparsz[j + nopar] = 1;
-                    opar[j] = (SCSUNKNOW_COP *)subheader;
-                    break;
-            }
-        }
-    }
-
-    /*******************************
-    * set outtbptr,outtbsz,outtbtyp
-    *******************************/
-    if (nlnk == 0)
-    {
-        outtbptr = NULL;
-        outtbsz = NULL;
-        outtbtyp = NULL;
-        outtb_elem = NULL;
-        nelem = 0;
-    }
-    else
-    {
-        /*Allocation of outtbptr*/
-        if ((outtbptr = (void **) MALLOC(nlnk * sizeof(void *))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(opar);
-            FREE(oparsz);
-            FREE(opartyp);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of outtbsz*/
-        if ((outtbsz = (int *) MALLOC(nlnk * 2 * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(outtbptr);
-            FREE(opar);
-            FREE(oparsz);
-            FREE(opartyp);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-        /*Allocation of outtbtyp*/
-        if ((outtbtyp = (int *) MALLOC(nlnk * sizeof(int))) == NULL )
-        {
-            Scierror(999, _("%s: Memory allocation error.\n"), fname);
-            FREE(outtbsz);
-            FREE(outtbptr);
-            FREE(opar);
-            FREE(oparsz);
-            FREE(opartyp);
-            FREE(oz);
-            FREE(ozsz);
-            FREE(oztyp);
-            FREE(lfunpt);
-            freeparam;
-            return 0;
-        }
-
-        /*initalize nelem*/
-        nelem = 0;
-
-        /*set vectors of outtb*/
-        for (j = 0; j < nlnk; j++) /*for each link*/
-        {
-            subheader = (int *)(listentry(il_state_outtb, j + 1)); /*get header of outtbl(j+1)*/
-            outtbsz[j] = subheader[1]; /*store dimensions*/
-            outtbsz[j + nlnk] = subheader[2];
-
-            switch (subheader[0]) /*store type and address*/
-            {
-                /*matrix of double*/
-                case 1  :
-                    switch (subheader[3])
-                    {
-                        case 0  :
-                            outtbtyp[j] = SCSREAL_N; /*double real matrix*/
-                            outtbptr[j] = (SCSREAL_COP *)(subheader + 4);
-                            break;
-
-                        case 1  :
-                            outtbtyp[j] = SCSCOMPLEX_N; /*double complex matrix*/
-                            outtbptr[j] = (SCSCOMPLEX_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            Scierror(888, _("%s : error. Type %d of double scalar matrix not yet supported for outtb.\n"), \
-                                     fname, subheader[3]);
-                            FREE(outtbptr);
-                            FREE(outtbtyp);
-                            FREE(outtbsz);
-                            FREE(opar);
-                            FREE(oparsz);
-                            FREE(opartyp);
-                            FREE(oz);
-                            FREE(ozsz);
-                            FREE(oztyp);
-                            FREE(lfunpt);
-                            freeparam;
-                            FREE(outtb_elem);
-                            return 0;
-                            break;
-                    }
-                    break;
-
-                /*matrix of integers*/
-                case 8  :
-                    switch (subheader[3])
-                    {
-                        case 1  :
-                            outtbtyp[j] = SCSINT8_N; /*int8*/
-                            outtbptr[j] = (SCSINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 2  :
-                            outtbtyp[j] = SCSINT16_N; /*int16*/
-                            outtbptr[j] = (SCSINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 4  :
-                            outtbtyp[j] = SCSINT32_N; /*int32*/
-                            outtbptr[j] = (SCSINT32_COP *)(subheader + 4);
-                            break;
-
-                        case 11 :
-                            outtbtyp[j] = SCSUINT8_N; /*uint8*/
-                            outtbptr[j] = (SCSUINT8_COP *)(subheader + 4);
-                            break;
-
-                        case 12 :
-                            outtbtyp[j] = SCSUINT16_N; /*uint16*/
-                            outtbptr[j] = (SCSUINT16_COP *)(subheader + 4);
-                            break;
-
-                        case 14 :
-                            outtbtyp[j] = SCSUINT32_N; /*uint32*/
-                            outtbptr[j] = (SCSUINT32_COP *)(subheader + 4);
-                            break;
-
-                        default :
-                            Scierror(888, \
-                                     _("%s : error. Type %d of int scalar matrix not yet supported for outtb.\n"), \
-                                     fname, subheader[3]);
-                            FREE(outtbptr);
-                            FREE(outtbtyp);
-                            FREE(outtbsz);
-                            FREE(opar);
-                            FREE(oparsz);
-                            FREE(opartyp);
-                            FREE(oz);
-                            FREE(ozsz);
-                            FREE(oztyp);
-                            FREE(lfunpt);
-                            freeparam;
-                            FREE(outtb_elem);
-                            return 0;
-                            break;
-                    }
-                    break;
-
-                default :
-                    Scierror(888, _("%s : error. Type %d not yet supported for outtb.\n"), fname, subheader[0]);
-                    FREE(outtbptr);
-                    FREE(outtbtyp);
-                    FREE(outtbsz);
-                    FREE(opar);
-                    FREE(oparsz);
-                    FREE(opartyp);
-                    FREE(oz);
-                    FREE(ozsz);
-                    FREE(oztyp);
-                    FREE(lfunpt);
-                    freeparam;
-                    FREE(outtb_elem);
-                    return 0;
-                    break;
-            }
-
-            /* store lnk and pos in outtb_elem */
-            k = nelem;
-            nelem += outtbsz[j] * outtbsz[j + nlnk];
-            if ((outtb_elem = (outtb_el *) REALLOC(outtb_elem, nelem * sizeof(outtb_el))) == NULL)
-            {
-                Scierror(999, _("%s : No more free memory.\n"), fname);
-                FREE(outtbptr);
-                FREE(outtbtyp);
-                FREE(outtbsz);
-                FREE(opar);
-                FREE(oparsz);
-                FREE(opartyp);
-                FREE(oz);
-                FREE(ozsz);
-                FREE(oztyp);
-                FREE(lfunpt);
-                freeparam;
-                FREE(outtb_elem);
-                return 0;
-            }
-            for (i = 0; i < outtbsz[j]*outtbsz[j + nlnk]; i++)
-            {
-                outtb_elem[k + i].lnk = j;
-                outtb_elem[k + i].pos = i;
-            }
-        }
-    }
-
-    /********************************
-    * save intersci common
-    * see intersci_push in stack2.c
-    ********************************/
-    Nbvars = Rhs; /*because of the use of getdata*/
-    new = MALLOC(Rhs * sizeof(intersci_state));
-    if (new == NULL)
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(outtbptr);
-        FREE(outtbtyp);
-        FREE(outtbsz);
-        FREE(opar);
-        FREE(oparsz);
-        FREE(opartyp);
-        FREE(oz);
-        FREE(ozsz);
-        FREE(oztyp);
-        FREE(lfunpt);
-        FREE(outtb_elem);
-        freeparam;
-        return 0;
-    }
-    loc = MALLOC(sizeof(intersci_list));
-    if (loc == NULL)
-    {
-        Scierror(999, _("%s: Memory allocation error.\n"), fname);
-        FREE(outtbptr);
-        FREE(outtbtyp);
-        FREE(outtbsz);
-        FREE(opar);
-        FREE(oparsz);
-        FREE(opartyp);
-        FREE(oz);
-        FREE(ozsz);
-        FREE(oztyp);
-        FREE(lfunpt);
-        FREE(outtb_elem);
-        FREE(new);
-        freeparam;
-        return 0;
-    }
-    loc->state = new;
-    loc->nbvars = Nbvars;
-    for (i = 0; i < Rhs; i++)
-    {
-        loc->state[i].iwhere = C2F(intersci).iwhere[i];
-        loc->state[i].ntypes = C2F(intersci).ntypes[i];
-        loc->state[i].lad    = C2F(intersci).lad[i];
-        loc->state[i].lhsvar = C2F(intersci).lhsvar[i];
-    }
-
-    /************************
-    * call scicos simulator
-    ************************/
-    if (C2F(iop).ddt != 0)
-    {
-        C2F(dbcos).idb = 1;    /*debug mode if ddt=0*/
-    }
-    C2F(cosim).isrun = 1; /*set isrun=1 to say that we enter in the simulator*/
-
-    /* Calling sequence :
-    * int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
-    *                 void **work,int *zptr,int *modptr_in,
-    *                 void **oz,int *ozsz,int *oztyp,int *ozptr,
-    *                 int *iz,int *izptr,double *t0_in,
-    *                 double *tf_in,double *tevts_in,int *evtspt_in,
-    *                 int *nevts,int *pointi_in,void **outtbptr_in,
-    *                 int *outtbsz_in,int *outtbtyp_in,
-    *                 outtb_el *outtb_elem_in,int *nelem1,int *nlnk1,
-    *                 int *funptr,int *funtyp_in,int *inpptr_in,
-    *                 int *outptr_in, int *inplnk_in,int *outlnk_in,
-    *                 double *rpar,int *rpptr,int *ipar,int *ipptr,
-    *                 void **opar,int *oparsz,int *opartyp,int *opptr,
-    *                 int *clkptr_in,int *ordptr_in,int *nordptr1,
-    *                 int *ordclk_in,int *cord_in,int *ncord1,
-    *                 int *iord_in,int *niord1,int *oord_in,
-    *                 int *noord1,int *zord_in,int *nzord1,
-    *                 int *critev_in,int *nblk1,int *ztyp,
-    *                 int *zcptr_in,int *subscr,int *nsubs,
-    *                 double *simpar,int *flag__,int *ierr_out)
-    */
-
-    C2F(scicos)(l_state_x, l_sim_xptr, l_state_z,
-                l_state_iz, l_sim_zptr, l_sim_modptr,
-                oz, ozsz, oztyp, l_sim_ozptr,
-                l_sim_lab, il_sim_labptr, l_sim_uid, il_sim_uidptr, l_tcur,
-                l_tf, l_state_tevts, l_state_evtspt,
-                &m1e5, l_pointi, outtbptr,
-                outtbsz, outtbtyp,
-                outtb_elem, &nelem, &nlnk,
-                lfunpt, l_sim_funtyp, l_sim_inpptr,
-                l_sim_outptr, l_sim_inplnk, l_sim_outlnk,
-                l_sim_rpar, l_sim_rpptr, l_sim_ipar, l_sim_ipptr,
-                opar, oparsz, opartyp, l_sim_opptr,
-                l_sim_clkptr, l_sim_ordptr, &m_ordptr,
-                l_sim_ordclk, l_sim_cord, &m_cord,
-                l_sim_iord, &m_iord, l_sim_oord,
-                &m_oord, l_sim_zord, &m_zord,
-                l_sim_critev, &nblk, l_sim_ztyp,
-                l_sim_zcptr, l_sim_subscr, &m_subscr,
-                simpar, &flag, &ierr);
-
-    C2F(dbcos).idb = 0; /*return in normal mode*/
-    C2F(cosim).isrun = 0; /*return in normal mode*/
-
-    /******************************
-    * retrieve intersci common
-    * see intersci_pop in stack2.c
-    ******************************/
-    Nbvars = loc->nbvars;
-    for (i = 0; i < Rhs; i++)
-    {
-        C2F(intersci).iwhere[i] = loc->state[i].iwhere ;
-        C2F(intersci).ntypes[i] = loc->state[i].ntypes ;
-        C2F(intersci).lad[i]    = loc->state[i].lad    ;
-        C2F(intersci).lhsvar[i] = loc->state[i].lhsvar ;
-    }
-    FREE(loc->state);
-    FREE(loc);
-
-    /**********************
-    * Free allocated array
-    **********************/
-    FREE(outtbptr);
-    FREE(outtbtyp);
-    FREE(outtbsz);
-    FREE(opar);
-    FREE(oparsz);
-    FREE(opartyp);
-    FREE(oz);
-    FREE(ozsz);
-    FREE(oztyp);
-    FREE(lfunpt);
-    FREE(outtb_elem);
-
-    /*************************************
-    * switch to appropriate message error
-    *************************************/
-    if (ierr > 0)
-    {
-        switch (ierr)
-        {
-            case 1  :
-                error = _("scheduling problem");
-                C2F(curblk).kfun = 0;
-                break;
-
-            case 2  :
-                error = _("input to zero-crossing stuck on zero");
-                C2F(curblk).kfun = 0;
-                break;
-
-            case 3  :
-                error = _("event conflict");
-                C2F(curblk).kfun = 0;
-                break;
-
-            case 4  :
-                error = _("algebraic loop detected");
-                C2F(curblk).kfun = 0;
-                break;
-
-            case 5  :
-                error = _("cannot allocate memory");
-                C2F(curblk).kfun = 0;
-                break;
-
-            case 6  :
-                error = MALLOC(MAX_ERROR_LEN);
-                if (error != NULL)
-                {
-                    allocatedError = TRUE;
-                    snprintf(error, MAX_ERROR_LEN, _("the block %d has been called with input out of its domain"), C2F(curblk).kfun);
-                }
-                else
-                {
-                    error = _("cannot allocate memory");
-                }
-                break;
-
-            case 7  :
-                error = _("singularity in a block");
-                break;
-
-            case 8  :
-                error = _("block produces an internal error");
-                break;
-
-            case 10  :
-                error = coserr.buf;
-                break;
-
-            case 20  :
-                error = _("initial conditions not converging");
-                break;
-
-            case 21  :
-                error = MALLOC(MAX_ERROR_LEN);
-                if (error != NULL)
-                {
-                    allocatedError = TRUE;
-                    snprintf(error, MAX_ERROR_LEN, _("cannot allocate memory in block=%d"), C2F(curblk).kfun);
-                }
-                else
-                {
-                    error = _("cannot allocate memory");
-                }
-                break;
-
-            case 22  :
-                error = _("sliding mode condition, cannot integrate");
-                break;
-
-            case 23  :
-                error = _("Cannot find the initial mode, maybe there is a sliding mode condition");
-                break;
-            case 24  :
-                error = _("You have changed a parameter in your model, but the model has been compiled to use an XML file containing initial values and parameters. So you should either recompile your Scicos diagram or [re]launch the initialization interface to regenerate the XML file  with new parameters.");
-                break;
-
-            case 25  :
-                error = _("Undefined data type.");
-                break;
-            case 26  :
-                error = _("The number of parameter provided by Scicos blocks is different from what expected by the code generated by the Modelica compiler. You might have relaxed a parameter using FIXED property (i.e., fixed=false) in a Modelica model. This will be corrected in the next version");
-                break;
-            /*In this case, you need to turn off the parameter embedded code generation mode by setting Modelica_ParEmb=%f in the Scilab command window, and  recompile the Scicos diagram*/
-
-            default  :
-                if (ierr >= 1000)
-                {
-                    error = _("unknown or erroneous block");
-                }
-                else if (ierr >= 201 && ierr <= 416) /* Sundials error messages, stocked in coserr.buf */
-                {
-                    error = coserr.buf;
-                }
-                else if (ierr >= 100)
-                {
-                    istate = -(ierr - 100);
-                    error = MALLOC(MAX_ERROR_LEN);
-                    if (error != NULL)
-                    {
-                        allocatedError = TRUE;
-                        snprintf(error, MAX_ERROR_LEN, _("integration problem istate=%d"), istate);
-                    }
-                    else
-                    {
-                        error = _("cannot allocate memory");
-                    }
-                    C2F(curblk).kfun = 0;
-                }
-                else
-                {
-                    error = _("scicos unexpected error, please report...");
-                    C2F(curblk).kfun = 0;
-                }
-                break;
-        }
-        if (! (C2F(errgst).err1 > 0 || C2F(iop).err > 0))
-        {
-            Scierror(888, "%s\n", error);
-            if (allocatedError)
-            {
-                FREE(error);
-            }
-            /*C2F(curblk).kfun=0;*/
-            C2F(com).fun = 0; /*set common fun=0 (this disable bug in debug mode)*/
-            freeparam;
-            return 0;
-        }
-    }
-
-    if (C2F(iop).err > 0)
-    {
-        freeparam;
-        return 0;
-    }
-
-    /*C2F(curblk).kfun=0;*/
-    C2F(com).fun = 0;
-
-    /*********************
-    * return Lsh variable
-    *********************/
-    /*copy int parameters of state in double parameters*/
-    for (i = 0; i < (m1e7 * n1e7); i++)
-    {
-        ((double *)(il_state_evtspt + 4))[i] = (double) l_state_evtspt[i];
-    }
-    for (i = 0; i < (m1e8 * n1e8); i++)
-    {
-        ((double *)(il_pointi + 4))[i] = (double) l_pointi[i];
-    }
-    /*set lsh var*/
-    if (Lhs >= 1)
-    {
-        LhsVar(1) = 1;    /*return state in LhsVar(1)*/
-    }
-    if (Lhs == 2)
-    {
-        LhsVar(2) = 2;    /*return tcur in LhsVar(2)*/
-    }
-
-    /* end */
-    freeparam;
-
-    PutLhsVar();
-#endif
-    return 0;
-}
-/*--------------------------------------------------------------------------*/
-
diff --git a/scilab/modules/scicos/sci_gateway/cpp/sci_curblock.cpp b/scilab/modules/scicos/sci_gateway/cpp/sci_curblock.cpp
new file mode 100644 (file)
index 0000000..f68a010
--- /dev/null
@@ -0,0 +1,53 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2015 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+#include <string>
+
+#include "gw_scicos.hxx"
+
+#include "types.hxx"
+#include "double.hxx"
+#include "function.hxx"
+
+extern "C"
+{
+#include "scicos-def.h"
+
+#include "localization.h"
+#include "Scierror.h"
+}
+
+/*--------------------------------------------------------------------------*/
+// Variable defined in scicos.c
+extern CURBLK_struct C2F(curblk);
+/*--------------------------------------------------------------------------*/
+
+const std::string funname = "curblock";
+
+types::Function::ReturnValue sci_curblock(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    if (in.size() != 0)
+    {
+        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), funname.c_str(), 0);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount != 1)
+    {
+        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), funname.c_str(), 1);
+        return types::Function::Error;
+    }
+
+    types::Double* kfun = new types::Double(C2F(curblk).kfun);
+    out.push_back(kfun);
+    return types::Function::OK;
+}
diff --git a/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp b/scilab/modules/scicos/sci_gateway/cpp/sci_scicosim.cpp
new file mode 100644 (file)
index 0000000..3c4c32b
--- /dev/null
@@ -0,0 +1,2181 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+#include <string>
+#include <cstdio>
+#include <cwchar>
+#include <cstring>
+
+#include "gw_scicos.hxx"
+
+#include "internal.hxx"
+#include "types.hxx"
+#include "context.hxx"
+#include "double.hxx"
+#include "function.hxx"
+#include "macro.hxx"
+#include "list.hxx"
+#include "tlist.hxx"
+#include "string.hxx"
+#include "int.hxx"
+
+#include "il_state.hxx"
+#include "il_sim.hxx"
+
+extern "C"
+{
+#include "import.h"
+#include "sci_malloc.h"
+#include "scicos-def.h"
+#include "scicos.h"
+
+#include "localization.h"
+#include "Scierror.h"
+}
+
+#ifdef _MSC_VER
+#define snprintf _snprintf
+#endif
+
+/*--------------------------------------------------------------------------*/
+/* intsicosimc scicosim interface routine.
+*
+* [state,t] = scicosim(state,tcur,tf,sim,str,tol)
+*
+* rhs 1 state : Tlist
+*        - 1  : state(1)     : !xcs  x  z  oz iz  tevts  evtspt  pointi  outtb  !
+*        - 2  : state.x      : column vector of real
+*        - 3  : state.z      : column vector of real
+*        - 4  : state.oz     : list of scilab object
+*        - 5  : state.iz     : column vector of real (empty object with flag "finish")
+*        - 6  : state.tevts  : column vector of real
+*        - 7  : state.evtspt : column vector of real
+*        - 8  : state.pointi : real scalar
+*        - 9  : state.outtb  : list of scilab object
+* rhs 2 tcur  : real scalar
+* rhs 3 tf    : real scalar
+* rhs 4 sim   : Tlist
+*        - 1  : sim(1) : !scs    funs    xptr    zptr    ozptr   zcptr   inpptr
+*                         outptr inplnk  outlnk  rpar    rpptr   ipar    ipptr
+*                         opar   opptr   clkptr  ordptr  execlk  ordclk  cord
+*                         oord   zord    critev  nb      ztyp    nblk    ndcblk
+*                         subscr funtyp  iord    labels  modptr  uids !
+*        - 2  : sim.funs   : list of strings and/or scilab function
+*        - 3  : sim.xptr   : column vector of real
+*        - 4  : sim.zptr   : column vector of real
+*        - 5  : sim.ozptr  : column vector of real
+*        - 6  : sim.zcptr  : column vector of real
+*        - 7  : sim.inpptr : column vector of real
+*        - 8  : sim.outptr : column vector of real
+*        - 9  : sim.inplnk : column vector of real
+*        - 10 : sim.outlnk : column vector of real
+*        - 11 : sim.rpar   : column vector of real
+*        - 12 : sim.rpptr  : column vector of real
+*        - 13 : sim.ipar   : column vector of real
+*        - 14 : sim.ipptr  : column vector of real
+*        - 15 : sim.opar   : list of scilab object
+*        - 16 : sim.opptr  : column vector of real
+*        - 17 : sim.clkptr : column vector of real
+*        - 18 : sim.ordptr : column vector of real
+*        - 19 : sim.execlk : matrix of real
+*        - 20 : sim.ordclk : matrix of real
+*        - 21 : sim.cord   : matrix of real
+*        - 22 : sim.oord   : matrix of real
+*        - 23 : sim.zord   : column vector ? of real
+*        - 24 : sim.critev : column vector of real
+*        - 25 : sim.nb     : real scalar
+*        - 26 : sim.ztyp   : column vector of real
+*        - 27 : sim.nblk   : real scalar
+*        - 28 : sim.ndcblk : real scalar
+*        - 29 : sim.subscr : column vector of real
+*        - 30 : sim.funtyp : column vector of real
+*        - 31 : sim.iord   : column vector of real
+*        - 32 : sim.labels : column vector of strings
+*        - 33 : sim.modptr : column vector of real
+*        - 34 : sim.uids : column vector of strings
+*
+* rhs 5 str   : string flag : 'start','run','finish','linear'
+* rhs 6 tol   : real vector of size (7,1) minimum (4,1)
+*               [atol rtol ttol [deltat realtimescale solver hmax]]'
+*
+* 16/03/06, A.Layec : Rewritten from original fortran
+*                     source code intsscicos in intcos.f.
+*
+* 29/03/06, Alan    : Improvement in accordance to c_pass2
+*                     (int32 parameters).
+*
+* 31/05/06, Alan    : Add global variable int *il_state_save
+*                     and int *il_sim_save in intcscicos.h to store
+*                     stack address of list %cpr.state and %cpr.sim
+*                     (to use with get/setscicosvars).
+*
+* 14/06/06, Alan    : Save common intersci before calling scicos
+*                     (to disable scilab crash with scifunc.f).
+*
+* 13/11/06, Alan    : Get back to double parameters for sim and state
+*                     (for better compatibility with scilab-4.x families).
+*                     Remove il_sim_save global variable.
+*
+* 15/12/06, Alan    : Warnings compilation removed.
+*                     This can crash scilab/scicos.
+*                     Please report.
+*
+* xx/02/07, Alan    : Add opar/odstate : scilab lists of arbitrary object
+*                     parameters/states.
+*
+* 08/12/14, Paul    : Rewrite to C++.
+*
+*/
+/*--------------------------------------------------------------------------*/
+
+const std::string funname = "scicosim";
+
+/*--------------------------------------------------------------------------*/
+COSIM_struct C2F(cosim); // Declaration of cosim -valable partout-
+/*--------------------------------------------------------------------------*/
+extern COSERR_struct coserr;    // Declaration of coserr -defined in scicos-
+extern "C"
+{
+    extern int C2F(funnum)(char *fname);
+}
+/*--------------------------------------------------------------------------*/
+// Variable defined in scicos.c
+extern CURBLK_struct C2F(curblk);
+/*--------------------------------------------------------------------------*/
+
+types::Function::ReturnValue sci_scicosim(types::typed_list &in, int _iRetCount, types::typed_list &out)
+{
+    /************************************
+    * Variables and constants definition
+    ************************************/
+    double simpar[7];
+
+    BOOL allocatedError = FALSE;
+    const int MAX_ERROR_LEN = 512;
+
+    if (in.size() != 6)
+    {
+        Scierror(77, _("%s: Wrong number of input argument(s): %d expected.\n"), funname.data(), 6);
+        return types::Function::Error;
+    }
+
+    if (_iRetCount > 2)
+    {
+        Scierror(78, _("%s: Wrong number of output argument(s): %d to %d expected.\n"), funname.data(), 1, 2);
+        return types::Function::Error;
+    }
+
+    /****************
+    * state (rhs 1)
+    ****************/
+    if (in[0]->isTList() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A tlist expected.\n"), funname.data(), 1);
+        return types::Function::Error;
+    }
+    types::TList* il_state_input = in[0]->getAs<types::TList>();
+    types::TList* il_state = new types::TList();
+
+    if (il_state_input->getSize() < 9)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : %d elements expected.\n"), funname.data(), 1, 9);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+
+    // Make a copy of 'il_state' in a global variabe
+    set_il_state(il_state_input);
+
+    types::String* header_state = il_state_input->get(0)->getAs<types::String>();
+    il_state->append(header_state->clone());
+
+    /*2 : state.x      */
+    if (il_state_input->get(1)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 2, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_state_x_input = il_state_input->get(1)->getAs<types::Double>();
+    il_state->append(il_state_x_input->clone());
+    types::Double* il_state_x = il_state->get(1)->getAs<types::Double>();
+    double* l_state_x = il_state_x->get();
+
+    /*3 : state.z      */
+    if (il_state_input->get(2)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 3, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_state_z_input = il_state_input->get(2)->getAs<types::Double>();
+    il_state->append(il_state_z_input->clone());
+    types::Double* il_state_z = il_state->get(2)->getAs<types::Double>();
+    double* l_state_z = il_state_z->get();
+
+    /*4 : state.oz     */
+    types::List* il_state_oz_input = il_state_input->get(3)->getAs<types::List>();
+    types::List* il_state_oz = new types::List();
+    for (int i = 0; i < il_state_oz_input->getSize(); ++i)
+    {
+        types::InternalType* l_state_oz_input = il_state_oz_input->get(i);
+        il_state_oz->append(l_state_oz_input->clone());
+    }
+    il_state->append(il_state_oz);
+    int noz = il_state_oz->getSize(); // 'nlnk' is the dimension of the list 'state.oz'
+
+    /*5 : state.iz     */
+    if (il_state_input->get(4)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 5, 1);
+        return types::Function::Error;
+    }
+    types::Double* il_state_iz_input = il_state_input->get(4)->getAs<types::Double>();
+    il_state->append(il_state_iz_input->clone());
+    types::Double* il_state_iz = il_state->get(4)->getAs<types::Double>();
+    void** l_state_iz = (void**) il_state_iz->get();
+    int m1e5 = il_state_iz->getRows();
+
+    /*6 : state.tevts  */
+    if (il_state_input->get(5)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 6, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_state_tevts_input = il_state_input->get(5)->getAs<types::Double>();
+    il_state->append(il_state_tevts_input->clone());
+    types::Double* il_state_tevts = il_state->get(5)->getAs<types::Double>();
+    double* l_state_tevts = il_state_tevts->get();
+    int m1e6 = il_state_tevts->getRows();
+
+    /*7 : state.evtspt */
+    if (il_state_input->get(6)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 7, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_state_evtspt_input = il_state_input->get(6)->getAs<types::Double>();
+    il_state->append(il_state_evtspt_input->clone());
+    types::Double* il_state_evtspt = il_state->get(6)->getAs<types::Double>();
+    il_state_evtspt->convertToInteger();
+    int* l_state_evtspt = (int*) il_state_evtspt->get();
+    int m1e7 = il_state_evtspt->getRows();
+
+    /*8 : state.pointi */
+    if (il_state_input->get(7)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 8, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_pointi_input = il_state_input->get(7)->getAs<types::Double>();
+    il_state->append(il_pointi_input->clone());
+    types::Double* il_pointi = il_state->get(7)->getAs<types::Double>();
+    il_pointi->convertToInteger();
+    int* l_pointi = (int*) il_pointi->get();
+
+    /*9 : state.outtb  */
+    if (il_state_input->get(8)->isList() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A list expected.\n"), funname.data(), 9, 1);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::List* il_state_outtb_input = il_state_input->get(8)->getAs<types::List>();
+    types::List* il_state_outtb = new types::List();
+    for (int i = 0; i < il_state_outtb_input->getSize(); ++i)
+    {
+        types::InternalType* l_state_outtb_input = il_state_outtb_input->get(i);
+        il_state_outtb->append(l_state_outtb_input->clone());
+    }
+    il_state->append(il_state_outtb);
+    int nlnk = il_state_outtb->getSize(); // 'nlnk' is the dimension of the list 'state.outtb'
+
+    /***************
+    * tcur (rhs 2)
+    ***************/
+    if (in[1]->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A matrix expected.\n"), funname.data(), 2);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_tcur_input = in[1]->getAs<types::Double>();
+    types::Double* il_tcur = il_tcur_input->clone()->getAs<types::Double>();
+    if (il_tcur->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : A scalar expected.\n"), funname.data(), 2);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        return types::Function::Error;
+    }
+    double* l_tcur = il_tcur->get();
+
+    /*************
+    * tf (rhs 3)
+    *************/
+    if (in[2]->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A matrix expected.\n"), funname.data(), 3);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_tf = in[2]->getAs<types::Double>();
+    if (il_tf->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : A scalar expected.\n"), funname.data(), 3);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        return types::Function::Error;
+    }
+    double* l_tf = il_tf->get();
+
+    /*************
+    * sim (rhs 4)
+    *************/
+    if (in[3]->isTList() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A tlist expected.\n"), funname.data(), 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        return types::Function::Error;
+    }
+    types::TList* il_sim_input = in[3]->getAs<types::TList>();
+    types::TList* il_sim = new types::TList();
+
+    // Make a copy of 'il_sim' in a global variabe
+    set_il_sim(il_sim_input);
+
+    if (il_sim_input->getSize() < 34)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : %d elements expected.\n"), funname.data(), 4, 34);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+
+    types::String* header_sim = il_sim_input->get(0)->getAs<types::String>();
+    il_sim->append(header_sim->clone());
+
+    /*2  : sim.funs*/
+    if (il_sim_input->get(1)->isList() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A list expected.\n"), funname.data(), 2, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::List* il_sim_fun_input = il_sim_input->get(1)->getAs<types::List>();
+    types::List* il_sim_fun = new types::List();
+    for (int i = 0; i < il_sim_fun_input->getSize(); ++i)
+    {
+        types::InternalType* l_sim_fun_input = il_sim_fun_input->get(i);
+        il_sim_fun->append(l_sim_fun_input->clone());
+    }
+    il_sim->append(il_sim_fun);
+    int nblk = il_sim_fun->getSize(); // 'nblk' is the dimension of the list 'sim.funs'
+
+    /*3  : sim.xptr   */
+    if (il_sim_input->get(2)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 3, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_xptr_input = il_sim_input->get(2)->getAs<types::Double>();
+    il_sim->append(il_sim_xptr_input->clone());
+    types::Double* il_sim_xptr = il_sim->get(2)->getAs<types::Double>();
+    il_sim_xptr->convertToInteger();
+    int* l_sim_xptr = (int*) il_sim_xptr->get();
+    int m_xptr = il_sim_xptr->getRows();
+
+    /*4  : sim.zptr   */
+    if (il_sim_input->get(3)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 4, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_zptr_input = il_sim_input->get(3)->getAs<types::Double>();
+    il_sim->append(il_sim_zptr_input->clone());
+    types::Double* il_sim_zptr = il_sim->get(3)->getAs<types::Double>();
+    il_sim_zptr->convertToInteger();
+    int* l_sim_zptr = (int*) il_sim_zptr->get();
+    int m_zptr = il_sim_zptr->getRows();
+
+    /*5  : sim.ozptr   */
+    if (il_sim_input->get(4)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 5, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ozptr_input = il_sim_input->get(4)->getAs<types::Double>();
+    il_sim->append(il_sim_ozptr_input->clone());
+    types::Double* il_sim_ozptr = il_sim->get(4)->getAs<types::Double>();
+    il_sim_ozptr->convertToInteger();
+    int* l_sim_ozptr = (int*) il_sim_ozptr->get();
+    int m_ozptr = il_sim_ozptr->getRows();
+
+    /*6  : sim.zcptr  */
+    if (il_sim_input->get(5)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 6, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_zcptr_input = il_sim_input->get(5)->getAs<types::Double>();
+    il_sim->append(il_sim_zcptr_input->clone());
+    types::Double* il_sim_zcptr = il_sim->get(5)->getAs<types::Double>();
+    il_sim_zcptr->convertToInteger();
+    int* l_sim_zcptr = (int*) il_sim_zcptr->get();
+    int m_zcptr = il_sim_zcptr->getRows();
+
+    /*7  : sim.inpptr */
+    if (il_sim_input->get(6)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 7, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_inpptr_input = il_sim_input->get(6)->getAs<types::Double>();
+    il_sim->append(il_sim_inpptr_input->clone());
+    types::Double* il_sim_inpptr = il_sim->get(6)->getAs<types::Double>();
+    il_sim_inpptr->convertToInteger();
+    int* l_sim_inpptr = (int*) il_sim_inpptr->get();
+    int m_inpptr = il_sim_inpptr->getRows();
+
+    /*8  : sim.outptr */
+    if (il_sim_input->get(7)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 8, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_outpptr_input = il_sim_input->get(7)->getAs<types::Double>();
+    il_sim->append(il_sim_outpptr_input->clone());
+    types::Double* il_sim_outptr = il_sim->get(7)->getAs<types::Double>();
+    il_sim_outptr->convertToInteger();
+    int* l_sim_outptr = (int*) il_sim_outptr->get();
+    int m_outptr = il_sim_outptr->getRows();
+
+    /*9  : sim.inplnk */
+    if (il_sim_input->get(8)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 9, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_inplnk_input = il_sim_input->get(8)->getAs<types::Double>();
+    il_sim->append(il_sim_inplnk_input->clone());
+    types::Double* il_sim_inplnk = il_sim->get(8)->getAs<types::Double>();
+    il_sim_inplnk->convertToInteger();
+    int* l_sim_inplnk = (int*) il_sim_inplnk->get();
+
+    /*10  : sim.outlnk */
+    if (il_sim_input->get(9)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 10, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_outlnk_input = il_sim_input->get(9)->getAs<types::Double>();
+    il_sim->append(il_sim_outlnk_input->clone());
+    types::Double* il_sim_outlnk = il_sim->get(9)->getAs<types::Double>();
+    il_sim_outlnk->convertToInteger();
+    int* l_sim_outlnk = (int*) il_sim_outlnk->get();
+
+    /*11 : sim.rpar   */
+    if (il_sim_input->get(10)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 11, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_rpar_input = il_sim_input->get(10)->getAs<types::Double>();
+    il_sim->append(il_sim_rpar_input->clone());
+    types::Double* il_sim_rpar = il_sim->get(10)->getAs<types::Double>();
+    double* l_sim_rpar = il_sim_rpar->get();
+
+    /*12 : sim.rpptr  */
+    if (il_sim_input->get(11)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 12, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_rpptr_input = il_sim_input->get(11)->getAs<types::Double>();
+    il_sim->append(il_sim_rpptr_input->clone());
+    types::Double* il_sim_rpptr = il_sim->get(11)->getAs<types::Double>();
+    il_sim_rpptr->convertToInteger();
+    int* l_sim_rpptr = (int*) il_sim_rpptr->get();
+    int m_rpptr = il_sim_rpptr->getRows();
+
+    /*13 : sim.ipar   */
+    if (il_sim_input->get(12)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 13, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ipar_input = il_sim_input->get(12)->getAs<types::Double>();
+    il_sim->append(il_sim_ipar_input->clone());
+    types::Double* il_sim_ipar = il_sim->get(12)->getAs<types::Double>();
+    il_sim_ipar->convertToInteger();
+    int* l_sim_ipar = (int*) il_sim_ipar->get();
+
+    /*14 : sim.ipptr  */
+    if (il_sim_input->get(13)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 14, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ipptr_input = il_sim_input->get(13)->getAs<types::Double>();
+    il_sim->append(il_sim_ipptr_input->clone());
+    types::Double* il_sim_ipptr = il_sim->get(13)->getAs<types::Double>();
+    il_sim_ipptr->convertToInteger();
+    int* l_sim_ipptr = (int*) il_sim_ipptr->get();
+    int m_ipptr = il_sim_ipptr->getRows();
+
+    /*15 : sim.opar   */
+    if (il_sim_input->get(14)->isList() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A list expected.\n"), funname.data(), 15, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::List* il_sim_opar_input = il_sim_input->get(14)->getAs<types::List>();
+    types::List* il_sim_opar = new types::List();
+    for (int i = 0; i < il_sim_opar_input->getSize(); ++i)
+    {
+        types::InternalType* l_sim_opar_input = il_sim_opar_input->get(i);
+        il_sim_opar->append(l_sim_opar_input->clone());
+    }
+    il_sim->append(il_sim_opar);
+    int nopar = il_sim_opar->getSize(); // 'nopar' is the dimension of the list 'sim.opar'
+
+    /*16 : sim.opptr  */
+    if (il_sim_input->get(15)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 16, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_opptr_input = il_sim_input->get(15)->getAs<types::Double>();
+    il_sim->append(il_sim_opptr_input->clone());
+    types::Double* il_sim_opptr = il_sim->get(15)->getAs<types::Double>();
+    il_sim_opptr->convertToInteger();
+    int* l_sim_opptr = (int*) il_sim_opptr->get();
+    int m_opptr = il_sim_opptr->getRows();
+
+    /*17 : sim.clkptr */
+    if (il_sim_input->get(16)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 17, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_clkptr_input = il_sim_input->get(16)->getAs<types::Double>();
+    il_sim->append(il_sim_clkptr_input->clone());
+    types::Double* il_sim_clkptr = il_sim->get(16)->getAs<types::Double>();
+    il_sim_clkptr->convertToInteger();
+    int* l_sim_clkptr = (int*) il_sim_clkptr->get();
+    int m_clkptr = il_sim_clkptr->getRows();
+
+    /*18 : sim.ordptr */
+    if (il_sim_input->get(17)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 18, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ordptr_input = il_sim_input->get(17)->getAs<types::Double>();
+    il_sim->append(il_sim_ordptr_input->clone());
+    types::Double* il_sim_ordptr = il_sim->get(17)->getAs<types::Double>();
+    il_sim_ordptr->convertToInteger();
+    int* l_sim_ordptr = (int*) il_sim_ordptr->get();
+    int m_ordptr = il_sim_ordptr->getRows();
+
+    /*19 : sim.execlk */
+    if (il_sim_input->get(18)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 19, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_execlk_input = il_sim_input->get(18)->getAs<types::Double>();
+    il_sim->append(il_sim_execlk_input->clone());
+
+    /*20 : sim.ordclk */
+    if (il_sim_input->get(19)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 20, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ordclk_input = il_sim_input->get(19)->getAs<types::Double>();
+    il_sim->append(il_sim_ordclk_input->clone());
+    types::Double* il_sim_ordclk = il_sim->get(19)->getAs<types::Double>();
+    il_sim_ordclk->convertToInteger();
+    int* l_sim_ordclk = (int*) il_sim_ordclk->get();
+    int m_ordclk = il_sim_ordclk->getRows();
+    int n_ordclk = il_sim_ordclk->getCols();
+
+    /*21 : sim.cord   */
+    if (il_sim_input->get(20)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 21, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_cord_input = il_sim_input->get(20)->getAs<types::Double>();
+    il_sim->append(il_sim_cord_input->clone());
+    types::Double* il_sim_cord = il_sim->get(20)->getAs<types::Double>();
+    il_sim_cord->convertToInteger();
+    int* l_sim_cord = (int*) il_sim_cord->get();
+    int m_cord = il_sim_cord->getRows();
+    int n_cord = il_sim_cord->getCols();
+
+    /*22 : sim.oord   */
+    if (il_sim_input->get(21)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 22, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_oord_input = il_sim_input->get(21)->getAs<types::Double>();
+    il_sim->append(il_sim_oord_input->clone());
+    types::Double* il_sim_oord = il_sim->get(21)->getAs<types::Double>();
+    il_sim_oord->convertToInteger();
+    int* l_sim_oord = (int*) il_sim_oord->get();
+    int m_oord = il_sim_oord->getRows();
+    int n_oord = il_sim_oord->getCols();
+
+    /*23 : sim.zord   */
+    if (il_sim_input->get(22)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 23, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_zord_input = il_sim_input->get(22)->getAs<types::Double>();
+    il_sim->append(il_sim_zord_input->clone());
+    types::Double* il_sim_zord = il_sim->get(22)->getAs<types::Double>();
+    il_sim_zord->convertToInteger();
+    int* l_sim_zord = (int*) il_sim_zord->get();
+    int m_zord = il_sim_zord->getRows();
+    int n_zord = il_sim_zord->getCols();
+
+    /*24 : sim.critev */
+    if (il_sim_input->get(23)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 24, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_critev_input = il_sim_input->get(23)->getAs<types::Double>();
+    il_sim->append(il_sim_critev_input->clone());
+    types::Double* il_sim_critev = il_sim->get(23)->getAs<types::Double>();
+    il_sim_critev->convertToInteger();
+    int* l_sim_critev = (int*) il_sim_critev->get();
+
+    /*25 : sim.nb     */
+    if (il_sim_input->get(24)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 25, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_nb_input = il_sim_input->get(24)->getAs<types::Double>();
+    il_sim->append(il_sim_nb_input->clone());
+    types::Double* il_sim_nb = il_sim->get(24)->getAs<types::Double>();
+    double* l_sim_nb = il_sim_nb->get();
+
+    if (static_cast<int>(l_sim_nb[0]) != nblk) // Value of 'nb' must be equal to 'nblk'
+    {
+        Scierror(42, _("%s : Incompatible sim.nb RHS parameter.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+
+    /*26 : sim.ztyp   */
+    if (il_sim_input->get(25)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 26, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ztyp_input = il_sim_input->get(25)->getAs<types::Double>();
+    il_sim->append(il_sim_ztyp_input->clone());
+    types::Double* il_sim_ztyp = il_sim->get(25)->getAs<types::Double>();
+    il_sim_ztyp->convertToInteger();
+    int* l_sim_ztyp = (int*) il_sim_ztyp->get();
+
+    /*27 : sim.nblk   */
+    if (il_sim_input->get(26)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 27, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_nblk_input = il_sim_input->get(26)->getAs<types::Double>();
+    il_sim->append(il_sim_nblk_input->clone());
+
+    /*28 : sim.ndcblk */
+    if (il_sim_input->get(27)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 28, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_ndcblk_input = il_sim_input->get(27)->getAs<types::Double>();
+    il_sim->append(il_sim_ndcblk_input->clone());
+
+    /*29 : sim.subscr */
+    if (il_sim_input->get(28)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 29, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_subscr_input = il_sim_input->get(28)->getAs<types::Double>();
+    il_sim->append(il_sim_subscr_input->clone());
+    types::Double* il_sim_subscr = il_sim->get(28)->getAs<types::Double>();
+    il_sim_subscr->convertToInteger();
+    int* l_sim_subscr = (int*) il_sim_subscr->get();
+    int m_subscr = il_sim_subscr->getRows();
+
+    /*30 : sim.funtyp */
+    if (il_sim_input->get(29)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 30, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_funtyp_input = il_sim_input->get(29)->getAs<types::Double>();
+    il_sim->append(il_sim_funtyp_input->clone());
+    types::Double* il_sim_funtyp = il_sim->get(29)->getAs<types::Double>();
+    il_sim_funtyp->convertToInteger();
+    int* l_sim_funtyp = (int*) il_sim_funtyp->get();
+
+    /*31 : sim.iord   */
+    if (il_sim_input->get(30)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 31, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::Double* il_sim_iord_input = il_sim_input->get(30)->getAs<types::Double>();
+    il_sim->append(il_sim_iord_input->clone());
+    types::Double* il_sim_iord = il_sim->get(30)->getAs<types::Double>();
+    il_sim_iord->convertToInteger();
+    int* l_sim_iord = (int*) il_sim_iord->get();
+    int m_iord = il_sim_iord->getRows();
+    int n_iord = il_sim_iord->getCols();
+
+    /*32 : sim.labels */
+    if (il_sim_input->get(31)->isString() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A string matrix expected.\n"), funname.data(), 32, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    types::String* il_sim_lab_input = il_sim_input->get(31)->getAs<types::String>();
+    il_sim->append(il_sim_lab_input->clone());
+    types::String* il_sim_lab = il_sim->get(31)->getAs<types::String>();
+    int* il_sim_labptr;
+    if ((il_sim_labptr = new (std::nothrow) int[il_sim_lab->getSize()]) == nullptr)
+    {
+        Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        return types::Function::Error;
+    }
+    char** l_sim_lab;
+    if ((l_sim_lab = new (std::nothrow) char*[il_sim_lab->getSize()]) == nullptr)
+    {
+        Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        return types::Function::Error;
+    }
+    for (int i = 0; i < il_sim_lab->getSize(); ++i)
+    {
+        l_sim_lab[i] = wide_string_to_UTF8(il_sim_lab->get(i));
+        il_sim_labptr[i] = strlen(l_sim_lab[i]);
+    }
+
+    /*33 : sim.modptr */
+    if (il_sim_input->get(32)->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A matrix expected.\n"), funname.data(), 33, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        return types::Function::Error;
+    }
+    types::Double* il_sim_modptr_input = il_sim_input->get(32)->getAs<types::Double>();
+    il_sim->append(il_sim_modptr_input->clone());
+    types::Double* il_sim_modptr = il_sim->get(32)->getAs<types::Double>();
+    il_sim_modptr->convertToInteger();
+    int* l_sim_modptr = (int*) il_sim_modptr->get();
+
+    /*34 : sim.uids */
+    if (il_sim_input->get(33)->isString() == false)
+    {
+        Scierror(999, _("%s: Wrong type for element #%d of argument #%d : A string matrix expected.\n"), funname.data(), 34, 4);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        return types::Function::Error;
+    }
+    types::String* il_sim_uid_input = il_sim_input->get(33)->getAs<types::String>();
+    il_sim->append(il_sim_uid_input->clone());
+    types::String* il_sim_uid = il_sim->get(33)->getAs<types::String>();
+    int* il_sim_uidptr;
+    if ((il_sim_uidptr = new (std::nothrow) int[il_sim_uid->getSize()]) == nullptr)
+    {
+        Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        return types::Function::Error;
+    }
+    char** l_sim_uid;
+    if ((l_sim_uid = new (std::nothrow) char*[il_sim_uid->getSize()]) == nullptr)
+    {
+        Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        return types::Function::Error;
+    }
+    for (int i = 0; i < il_sim_uid->getSize(); ++i)
+    {
+        l_sim_uid[i] = wide_string_to_UTF8(il_sim_uid->get(i));
+        il_sim_uidptr[i] = strlen(l_sim_uid[i]);
+    }
+
+    /*************
+    * str (rhs 5)
+    *************/
+    if (in[4]->isString() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A matrix expected.\n"), funname.data(), 5);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+    types::String* il_str = in[4]->getAs<types::String>();
+    if (il_str->isScalar() == false)
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : A scalar expected.\n"), funname.data(), 5);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+
+    const std::wstring start  (L"start");
+    const std::wstring run    (L"run");
+    const std::wstring finish (L"finish");
+    const std::wstring linear (L"linear");
+    const std::wstring Kinsol (L"Kinsol");
+    int flag;
+    if (il_str->get(0) == start)
+    {
+        flag = 1;
+    }
+    else if (il_str->get(0) == run)
+    {
+        flag = 2;
+    }
+    else if (il_str->get(0) == finish)
+    {
+        flag = 3;
+    }
+    else if (il_str->get(0) == linear)
+    {
+        flag = 4;
+    }
+    else if (il_str->get(0) == Kinsol)
+    {
+        flag = 5;
+    }
+    else
+    {
+        Scierror(44, _("%s: Wrong value for input argument #%d : ""%s"", ""%s"" ""%s"" ""%s"" or ""%s"" expected.\n"), funname.data(), 5,
+                 "start", "run", "finish", "linear", "Kinsol");
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+
+    /*************
+    * tol (rhs 6)
+    *************/
+    if (in[5]->isDouble() == false)
+    {
+        Scierror(999, _("%s: Wrong type for input argument #%d : A matrix expected.\n"), funname.data(), 6);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+    types::Double* il_tol = in[5]->getAs<types::Double>();
+    int m6 = il_tol->getSize();
+    if (m6 < 4 || m6 > 7) // Check if 'tol' has 4 to 7 elements
+    {
+        Scierror(999, _("%s: Wrong size for input argument #%d : %d to %d elements expected.\n"), funname.data(), 6, 4, 7);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+
+    /******************
+    * Set 'simpar' array
+    ******************/
+    for (int i = 0; i < m6; ++i)
+    {
+        simpar[i] = il_tol->get(i);
+    }
+    for (int i = m6; i < 7; ++i)
+    {
+        simpar[i] = 0;
+    }
+    int solver = static_cast<int>(simpar[5]); // Set 'solver' variable
+
+    /******************************
+    * Cross variable size checking
+    ******************************/
+    int err_check = 0;
+    if (m1e6 != m1e7)
+    {
+        err_check = 1;    // tevts vs evtspt
+    }
+    else if (m_xptr != m_zptr)
+    {
+        err_check = 2;    // xptr vs zptr
+    }
+    else if (m_xptr != m_ozptr)
+    {
+        err_check = 3;    // xptr vs ozptr
+    }
+    else if (m_xptr != m_zcptr)
+    {
+        err_check = 4;    // xptr vs zcptr
+    }
+    else if (m_xptr != m_inpptr)
+    {
+        err_check = 5;    // xptr vs inpptr
+    }
+    else if (m_xptr != m_outptr)
+    {
+        err_check = 6;    // xptr vs outptr
+    }
+    else if (m_xptr != m_rpptr)
+    {
+        err_check = 7;    // xptr vs rpptr
+    }
+    else if (m_xptr != m_ipptr)
+    {
+        err_check = 8;    // xptr vs ipptr
+    }
+    else if (m_xptr != m_opptr)
+    {
+        err_check = 8;    // xptr vs opptr
+    }
+    else if (m_xptr != m_clkptr)
+    {
+        err_check = 10;    // xptr vs clkptr
+    }
+    else if ((n_ordclk != 2) & (m_ordclk != 0))
+    {
+        err_check = 11;    // sim.ordclk
+    }
+    else if ((n_cord != 2) & (m_cord != 0))
+    {
+        err_check = 12;    // sim.cord
+    }
+    else if ((n_oord != 2) & (m_oord != 0))
+    {
+        err_check = 13;    // sim.oord
+    }
+    else if ((n_zord != 2) & (m_zord != 0))
+    {
+        err_check = 14;    // sim.zord
+    }
+    else if ((n_iord != 2) & (m_iord != 0))
+    {
+        err_check = 15;    // sim.iord
+    }
+    if (err_check != 0)
+    {
+        // Please write an error table here
+        Scierror(42, _("%s : error in cross variable size checking : %d\n"), funname.data(), err_check);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        return types::Function::Error;
+    }
+
+    /*******************************
+    * Set function table for blocks
+    *******************************/
+    // Define new variable 'lfunpt'
+    int* lfunpt;
+    if ((lfunpt = new (std::nothrow) int[nblk]) == nullptr)
+    {
+        Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        return types::Function::Error;
+    }
+
+    // For each block
+    for (int i = 0; i < nblk; ++i) // For each block
+    {
+        int subtype = il_sim_fun->get(i)->getType();
+        // Block is defined by a Scilab function
+        if (subtype == types::InternalType::ScilabMacro)
+        {
+            //types::Macro* macro = il_sim_fun->get(i)->getAs<types::Macro>();
+            //lfunpt[i] = macro;
+        }
+        // Block is defined by a function described by a string
+        else if (subtype == types::InternalType::ScilabString)
+        {
+            types::String* funStr = il_sim_fun->get(i)->getAs<types::String>();
+            if (funStr->isScalar() == false)
+            {
+                Scierror(999, _("%s: Wrong size for element #%d of input argument #%d : A scalar expected.\n"), funname.data(), i + 1, 4);
+                il_state->DecreaseRef();
+                il_state->killMe();
+                il_tcur->DecreaseRef();
+                il_tcur->killMe();
+                il_sim->DecreaseRef();
+                il_sim->killMe();
+                delete[] il_sim_labptr;
+                delete[] l_sim_lab;
+                delete[] il_sim_uidptr;
+                delete[] l_sim_uid;
+                delete[] lfunpt;
+                return types::Function::Error;
+            }
+            char* c_str = wide_string_to_UTF8(funStr->get(0));
+            int ifun = C2F(funnum)(c_str); // Search associated function number of function name
+            FREE(c_str);
+            // Block is defined by a C or Fortran function
+            if (ifun > 0)
+            {
+                lfunpt[i] = ifun;
+            }
+            // Block is defined by a predefined scilab function
+            else
+            {
+                //~ C2F(namstr)(id, &subheader[6], &sz_str, (j = 0, &j));
+                //~ C2F(com).fin = 0;
+                //~ C2F(funs)(id);
+                //~ if ((C2F(com).fun == -1) | (C2F(com).fun == -2))
+                //~ {
+                //~ lfunpt[i] = -*Lstk(C2F(com).fin);
+                //~ }
+                //~ else
+                //~ {
+                //~ C2F(curblk).kfun = i + 1;
+                //~ Scierror(888, _("%s : unknown block : %s\n"), funname.data(), C2F(cha1).buf);
+                //~ il_state->DecreaseRef();
+                //~ il_state->killMe();
+                //~ il_tcur->DecreaseRef();
+                //~ il_tcur->killMe();
+                //~ il_sim->DecreaseRef();
+                //~ il_sim->killMe();
+                //~ delete[] il_sim_labptr;
+                //~ delete[] l_sim_lab;
+                //~ delete[] il_sim_uidptr;
+                //~ delete[] l_sim_uid;
+                //~ delete[] lfunpt;
+                //~ return types::Function::Error;
+                //~ }
+            }
+        }
+        else
+        {
+            Scierror(999, _("%s: Wrong type for element #%d of input argument #%d : A string or macro expected.\n"), funname.data(), i + 1, 4);
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            return types::Function::Error;
+        }
+    }
+
+    /**********************
+    * Set oz, ozsz, oztyp
+    **********************/
+    void** oz = nullptr;
+    int* ozsz = nullptr;
+    int* oztyp = nullptr;
+    if (noz > 0)
+    {
+        // Allocation of 'oz'
+        if ((oz = new (std::nothrow) void*[noz]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            return types::Function::Error;
+        }
+        // Allocation of 'ozsz'
+        if ((ozsz = new (std::nothrow) int[2 * noz]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            return types::Function::Error;
+        }
+        // Allocation of 'oztyp'
+        if ((oztyp = new (std::nothrow) int[noz]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            return types::Function::Error;
+        }
+
+        // Set vectors of 'oz'
+        for (int j = 0; j < noz; ++j)
+        {
+            int subtype = il_state_oz->get(j)->getType();
+
+            switch (subtype) // Store type and address
+            {
+                case types::InternalType::ScilabDouble :
+                {
+                    types::Double* ozDouble = il_state_oz->get(j)->getAs<types::Double>();
+                    if (ozDouble->isComplex() == false)
+                    {
+                        oztyp[j] = SCSREAL_N; // Double real matrix
+                        oz[j] = (SCSREAL_COP *) ozDouble->get();
+                    }
+                    else
+                    {
+                        oztyp[j] = SCSCOMPLEX_N; // Double complex matrix
+                        oz[j] = (SCSCOMPLEX_COP *) ozDouble->get();
+                    }
+                    ozsz[j] = ozDouble->getRows();
+                    ozsz[j + noz] = ozDouble->getCols();
+                    break;
+                }
+                case types::InternalType::ScilabInt8 :
+                {
+                    types::Int8* ozInt8 = il_state_oz->get(j)->getAs<types::Int8>();
+                    oztyp[j] = SCSINT8_N; // int8
+                    ozsz[j] = ozInt8->getRows();
+                    ozsz[j + noz] = ozInt8->getCols();
+                    oz[j] = (SCSINT8_COP *) ozInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt16 :
+                {
+                    types::Int16* ozInt16 = il_state_oz->get(j)->getAs<types::Int16>();
+                    oztyp[j] = SCSINT16_N; // int16
+                    ozsz[j] = ozInt16->getRows();
+                    ozsz[j + noz] = ozInt16->getCols();
+                    oz[j] = (SCSINT16_COP *) ozInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt32 :
+                {
+                    types::Int32* ozInt32 = il_state_oz->get(j)->getAs<types::Int32>();
+                    oztyp[j] = SCSINT32_N; // int32
+                    ozsz[j] = ozInt32->getRows();
+                    ozsz[j + noz] = ozInt32->getCols();
+                    oz[j] = (SCSINT32_COP *) ozInt32->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt8 :
+                {
+                    types::UInt8* ozUInt8 = il_state_oz->get(j)->getAs<types::UInt8>();
+                    oztyp[j] = SCSUINT8_N; // uint8
+                    ozsz[j] = ozUInt8->getRows();
+                    ozsz[j + noz] = ozUInt8->getCols();
+                    oz[j] = (SCSUINT8_COP *) ozUInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt16 :
+                {
+                    types::UInt16* ozUInt16 = il_state_oz->get(j)->getAs<types::UInt16>();
+                    oztyp[j] = SCSUINT16_N; // uint16
+                    ozsz[j] = ozUInt16->getRows();
+                    ozsz[j + noz] = ozUInt16->getCols();
+                    oz[j] = (SCSUINT16_COP *) ozUInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt32 :
+                {
+                    types::UInt32* ozUInt32 = il_state_oz->get(j)->getAs<types::UInt32>();
+                    oztyp[j] = SCSUINT32_N; // uint32
+                    ozsz[j] = ozUInt32->getRows();
+                    ozsz[j + noz] = ozUInt32->getCols();
+                    oz[j] = (SCSUINT32_COP *) ozUInt32->get();
+                    break;
+                }
+                default :
+                {
+                    Scierror(999, _("%s: Wrong type for element #%d of element #%d of argument #%d : A matrix expected.\n"), funname.data(), j + 1, 4, 1);
+                    il_state->DecreaseRef();
+                    il_state->killMe();
+                    il_tcur->DecreaseRef();
+                    il_tcur->killMe();
+                    il_sim->DecreaseRef();
+                    il_sim->killMe();
+                    delete[] il_sim_labptr;
+                    delete[] l_sim_lab;
+                    delete[] il_sim_uidptr;
+                    delete[] l_sim_uid;
+                    delete[] lfunpt;
+                    delete[] oz;
+                    delete[] ozsz;
+                    delete[] oztyp;
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+
+    /****************************
+    * Set opar, oparsz, opartyp
+    ****************************/
+    void** opar = nullptr;
+    int* oparsz = nullptr;
+    int* opartyp = nullptr;
+    if (nopar > 0)
+    {
+        // Allocation of 'opar'
+        if ((opar = new (std::nothrow) void*[nopar]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            return types::Function::Error;
+        }
+        // Allocation of 'oparsz'
+        if ((oparsz = new (std::nothrow) int[2 * nopar]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            delete[] opar;
+            return types::Function::Error;
+        }
+        // Allocation of 'opartyp'
+        if ((opartyp = new (std::nothrow) int[nopar]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            delete[] opar;
+            delete[] oparsz;
+            return types::Function::Error;
+        }
+
+        // Set vectors of 'opar'
+        for (int j = 0; j < nopar; ++j)
+        {
+            int subtype = il_sim_opar->get(j)->getType();
+
+            switch (subtype) // Store type and address
+            {
+                case types::InternalType::ScilabDouble :
+                {
+                    types::Double* oparDouble = il_sim_opar->get(j)->getAs<types::Double>();
+                    if (oparDouble->isComplex() == false)
+                    {
+                        opartyp[j] = SCSREAL_N; // Double real matrix
+                        opar[j] = (SCSREAL_COP *) oparDouble->get();
+                    }
+                    else
+                    {
+                        opartyp[j] = SCSCOMPLEX_N; // Double complex matrix
+                        opar[j] = (SCSCOMPLEX_COP *) oparDouble->get();
+                    }
+                    oparsz[j] = oparDouble->getRows();
+                    oparsz[j + nopar] = oparDouble->getCols();
+                    break;
+                }
+                case types::InternalType::ScilabInt8 :
+                {
+                    types::Int8* oparInt8 = il_sim_opar->get(j)->getAs<types::Int8>();
+                    opartyp[j] = SCSINT8_N; // int8
+                    oparsz[j] = oparInt8->getRows();
+                    oparsz[j + nopar] = oparInt8->getCols();
+                    opar[j] = (SCSINT8_COP *) oparInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt16 :
+                {
+                    types::Int16* oparInt16 = il_sim_opar->get(j)->getAs<types::Int16>();
+                    opartyp[j] = SCSINT16_N; // int16
+                    oparsz[j] = oparInt16->getRows();
+                    oparsz[j + nopar] = oparInt16->getCols();
+                    opar[j] = (SCSINT16_COP *) oparInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt32 :
+                {
+                    types::Int32* oparInt32 = il_sim_opar->get(j)->getAs<types::Int32>();
+                    opartyp[j] = SCSINT32_N; // int32
+                    oparsz[j] = oparInt32->getRows();
+                    oparsz[j + nopar] = oparInt32->getCols();
+                    opar[j] = (SCSINT32_COP *) oparInt32->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt8 :
+                {
+                    types::UInt8* oparUInt8 = il_sim_opar->get(j)->getAs<types::UInt8>();
+                    opartyp[j] = SCSUINT8_N; // uint8
+                    oparsz[j] = oparUInt8->getRows();
+                    oparsz[j + nopar] = oparUInt8->getCols();
+                    opar[j] = (SCSUINT8_COP *) oparUInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt16 :
+                {
+                    types::UInt16* oparUInt16 = il_sim_opar->get(j)->getAs<types::UInt16>();
+                    opartyp[j] = SCSUINT16_N; // uint16
+                    oparsz[j] = oparUInt16->getRows();
+                    oparsz[j + nopar] = oparUInt16->getCols();
+                    opar[j] = (SCSUINT16_COP *) oparUInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt32 :
+                {
+                    types::UInt32* oparUInt32 = il_sim_opar->get(j)->getAs<types::UInt32>();
+                    opartyp[j] = SCSUINT32_N; // uint32
+                    oparsz[j] = oparUInt32->getRows();
+                    oparsz[j + nopar] = oparUInt32->getCols();
+                    opar[j] = (SCSUINT32_COP *) oparUInt32->get();
+                    break;
+                }
+                default :
+                {
+                    Scierror(999, _("%s: Wrong type for element #%d of element #%d of argument #%d : A matrix expected.\n"), funname.data(), j + 1, 15, 4);
+                    il_state->DecreaseRef();
+                    il_state->killMe();
+                    il_tcur->DecreaseRef();
+                    il_tcur->killMe();
+                    il_sim->DecreaseRef();
+                    il_sim->killMe();
+                    delete[] il_sim_labptr;
+                    delete[] l_sim_lab;
+                    delete[] il_sim_uidptr;
+                    delete[] l_sim_uid;
+                    delete[] lfunpt;
+                    delete[] oz;
+                    delete[] ozsz;
+                    delete[] oztyp;
+                    delete[] opar;
+                    delete[] oparsz;
+                    delete[] opartyp;
+                    return types::Function::Error;
+                }
+            }
+        }
+    }
+
+    // Declaration of 'outtb_elem'
+    outtb_el* outtb_elem = nullptr;
+    int nelem = 0;
+
+    /*******************************
+    * Set outtbptr, outtbsz, outtbtyp
+    *******************************/
+    void** outtbptr = nullptr;
+    int* outtbsz = nullptr;
+    int* outtbtyp = nullptr;
+    if (nlnk > 0)
+    {
+        // Allocation of 'outtbptr'
+        if ((outtbptr = new (std::nothrow) void*[nlnk]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            delete[] opar;
+            delete[] oparsz;
+            delete[] opartyp;
+            return types::Function::Error;
+        }
+        // Allocation of 'outtbptrsz'
+        if ((outtbsz = new (std::nothrow) int[2 * nlnk]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            delete[] opar;
+            delete[] oparsz;
+            delete[] opartyp;
+            delete[] outtbptr;
+            return types::Function::Error;
+        }
+        // Allocation of 'outtbtyp'
+        if ((outtbtyp = new (std::nothrow) int[nlnk]) == nullptr)
+        {
+            Scierror(999, _("%s: Memory allocation error.\n"), funname.data());
+            il_state->DecreaseRef();
+            il_state->killMe();
+            il_tcur->DecreaseRef();
+            il_tcur->killMe();
+            il_sim->DecreaseRef();
+            il_sim->killMe();
+            delete[] il_sim_labptr;
+            delete[] l_sim_lab;
+            delete[] il_sim_uidptr;
+            delete[] l_sim_uid;
+            delete[] lfunpt;
+            delete[] oz;
+            delete[] ozsz;
+            delete[] oztyp;
+            delete[] opar;
+            delete[] oparsz;
+            delete[] opartyp;
+            delete[] outtbptr;
+            delete[] outtbsz;
+            return types::Function::Error;
+        }
+
+        // Set vectors of 'outtbptr'
+        for (int j = 0; j < nlnk; ++j)
+        {
+            int subtype = il_state_outtb->get(j)->getType();
+
+            switch (subtype) // Store type and address
+            {
+                case types::InternalType::ScilabDouble :
+                {
+                    types::Double* outtbDouble = il_state_outtb->get(j)->getAs<types::Double>();
+                    if (outtbDouble->isComplex() == false)
+                    {
+                        outtbtyp[j] = SCSREAL_N; // Double real matrix
+                        outtbptr[j] = (SCSREAL_COP *) outtbDouble->get();
+                    }
+                    else
+                    {
+                        outtbtyp[j] = SCSCOMPLEX_N; // Double complex matrix
+                        outtbptr[j] = (SCSCOMPLEX_COP *) outtbDouble->get();
+                    }
+                    outtbsz[j] = outtbDouble->getRows();
+                    outtbsz[j + nlnk] = outtbDouble->getCols();
+                    break;
+                }
+                case types::InternalType::ScilabInt8 :
+                {
+                    types::Int8* outtbInt8 = il_state_outtb->get(j)->getAs<types::Int8>();
+                    outtbtyp[j] = SCSINT8_N; // int8
+                    outtbsz[j] = outtbInt8->getRows();
+                    outtbsz[j + nlnk] = outtbInt8->getCols();
+                    outtbptr[j] = (SCSINT8_COP *) outtbInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt16 :
+                {
+                    types::Int16* outtbInt16 = il_state_outtb->get(j)->getAs<types::Int16>();
+                    outtbtyp[j] = SCSINT16_N; // int16
+                    outtbsz[j] = outtbInt16->getRows();
+                    outtbsz[j + nlnk] = outtbInt16->getCols();
+                    outtbptr[j] = (SCSINT16_COP *) outtbInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabInt32 :
+                {
+                    types::Int32* outtbInt32 = il_state_outtb->get(j)->getAs<types::Int32>();
+                    outtbtyp[j] = SCSINT32_N; // int32
+                    outtbsz[j] = outtbInt32->getRows();
+                    outtbsz[j + nlnk] = outtbInt32->getCols();
+                    outtbptr[j] = (SCSINT32_COP *) outtbInt32->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt8 :
+                {
+                    types::UInt8* outtbUInt8 = il_state_outtb->get(j)->getAs<types::UInt8>();
+                    outtbtyp[j] = SCSUINT8_N; // uint8
+                    outtbsz[j] = outtbUInt8->getRows();
+                    outtbsz[j + nlnk] = outtbUInt8->getCols();
+                    outtbptr[j] = (SCSUINT8_COP *) outtbUInt8->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt16 :
+                {
+                    types::UInt16* outtbUInt16 = il_state_outtb->get(j)->getAs<types::UInt16>();
+                    outtbtyp[j] = SCSUINT16_N; // uint16
+                    outtbsz[j] = outtbUInt16->getRows();
+                    outtbsz[j + nlnk] = outtbUInt16->getCols();
+                    outtbptr[j] = (SCSUINT16_COP *) outtbUInt16->get();
+                    break;
+                }
+                case types::InternalType::ScilabUInt32 :
+                {
+                    types::UInt32* outtbUInt32 = il_state_outtb->get(j)->getAs<types::UInt32>();
+                    outtbtyp[j] = SCSUINT32_N; // uint32
+                    outtbsz[j] = outtbUInt32->getRows();
+                    outtbsz[j + nlnk] = outtbUInt32->getCols();
+                    outtbptr[j] = (SCSUINT32_COP *) outtbUInt32->get();
+                    break;
+                }
+                default :
+                {
+                    Scierror(999, _("%s: Wrong type for element #%d of element #%d of argument #%d : A matrix expected.\n"), funname.data(), j + 1, 9, 1);
+                    il_state->DecreaseRef();
+                    il_state->killMe();
+                    il_tcur->DecreaseRef();
+                    il_tcur->killMe();
+                    il_sim->DecreaseRef();
+                    il_sim->killMe();
+                    delete[] il_sim_labptr;
+                    delete[] l_sim_lab;
+                    delete[] il_sim_uidptr;
+                    delete[] l_sim_uid;
+                    delete[] lfunpt;
+                    delete[] outtbptr;
+                    delete[] outtbtyp;
+                    delete[] outtbsz;
+                    delete[] opar;
+                    delete[] oparsz;
+                    delete[] opartyp;
+                    delete[] oz;
+                    delete[] ozsz;
+                    delete[] oztyp;
+                    FREE(outtb_elem);
+                    return types::Function::Error;
+                }
+            }
+
+            // Store 'lnk' and 'pos' in 'outtb_elem'
+            int k = nelem;
+            nelem += outtbsz[j] * outtbsz[j + nlnk];
+            if ((outtb_elem = (outtb_el *) REALLOC(outtb_elem, nelem * sizeof(outtb_el))) == nullptr)
+            {
+                Scierror(999, _("%s : No more free memory.\n"), funname.data());
+                il_state->DecreaseRef();
+                il_state->killMe();
+                il_tcur->DecreaseRef();
+                il_tcur->killMe();
+                il_sim->DecreaseRef();
+                il_sim->killMe();
+                delete[] il_sim_labptr;
+                delete[] l_sim_lab;
+                delete[] il_sim_uidptr;
+                delete[] l_sim_uid;
+                delete[] lfunpt;
+                delete[] outtbptr;
+                delete[] outtbtyp;
+                delete[] outtbsz;
+                delete[] opar;
+                delete[] oparsz;
+                delete[] opartyp;
+                delete[] oz;
+                delete[] ozsz;
+                delete[] oztyp;
+                FREE(outtb_elem);
+                return types::Function::Error;
+            }
+            for (int i = 0; i < outtbsz[j]*outtbsz[j + nlnk]; ++i)
+            {
+                outtb_elem[k + i].lnk = j;
+                outtb_elem[k + i].pos = i;
+            }
+        }
+    }
+
+    /************************
+    * Call scicos simulator
+    ************************/
+    /* Calling sequence :
+    * int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
+    *                 void **work,int *zptr,int *modptr_in,
+    *                 void **oz,int *ozsz,int *oztyp,int *ozptr,
+    *                 char **iz,int *izptr,double *t0_in,
+    *                 double *tf_in,double *tevts_in,int *evtspt_in,
+    *                 int *nevts,int *pointi_in,void **outtbptr_in,
+    *                 int *outtbsz_in,int *outtbtyp_in,
+    *                 outtb_el *outtb_elem_in,int *nelem1,int *nlnk1,
+    *                 int *funptr,int *funtyp_in,int *inpptr_in,
+    *                 int *outptr_in, int *inplnk_in,int *outlnk_in,
+    *                 double *rpar,int *rpptr,int *ipar,int *ipptr,
+    *                 void **opar,int *oparsz,int *opartyp,int *opptr,
+    *                 int *clkptr_in,int *ordptr_in,int *nordptr1,
+    *                 int *ordclk_in,int *cord_in,int *ncord1,
+    *                 int *iord_in,int *niord1,int *oord_in,
+    *                 int *noord1,int *zord_in,int *nzord1,
+    *                 int *critev_in,int *nblk1,int *ztyp,
+    *                 int *zcptr_in,int *subscr,int *nsubs,
+    *                 double *simpar,int *flag__,int *ierr_out)
+    */
+
+    int ierr = 0;
+    C2F(scicos)(l_state_x, l_sim_xptr, l_state_z,
+                l_state_iz, l_sim_zptr, l_sim_modptr,
+                oz, ozsz, oztyp, l_sim_ozptr,
+                l_sim_lab, il_sim_labptr, l_sim_uid, il_sim_uidptr, l_tcur,
+                l_tf, l_state_tevts, l_state_evtspt,
+                &m1e5, l_pointi, outtbptr,
+                outtbsz, outtbtyp,
+                outtb_elem, &nelem, &nlnk,
+                lfunpt, l_sim_funtyp, l_sim_inpptr,
+                l_sim_outptr, l_sim_inplnk, l_sim_outlnk,
+                l_sim_rpar, l_sim_rpptr, l_sim_ipar, l_sim_ipptr,
+                opar, oparsz, opartyp, l_sim_opptr,
+                l_sim_clkptr, l_sim_ordptr, &m_ordptr,
+                l_sim_ordclk, l_sim_cord, &m_cord,
+                l_sim_iord, &m_iord, l_sim_oord,
+                &m_oord, l_sim_zord, &m_zord,
+                l_sim_critev, &nblk, l_sim_ztyp,
+                l_sim_zcptr, l_sim_subscr, &m_subscr,
+                simpar, &flag, &ierr);
+
+    /**********************
+    * Free allocated arrays
+    **********************/
+    delete[] outtbptr;
+    delete[] outtbtyp;
+    delete[] outtbsz;
+    delete[] opar;
+    delete[] oparsz;
+    delete[] opartyp;
+    delete[] oz;
+    delete[] ozsz;
+    delete[] oztyp;
+    delete[] lfunpt;
+    FREE(outtb_elem);
+
+    /*************************************
+    * Switch to appropriate message error
+    *************************************/
+    if (ierr > 0)
+    {
+        char* error;
+        switch (ierr)
+        {
+            case 1  :
+                error = _("scheduling problem");
+                C2F(curblk).kfun = 0;
+                break;
+
+            case 2  :
+                error = _("input to zero-crossing stuck on zero");
+                C2F(curblk).kfun = 0;
+                break;
+
+            case 3  :
+                error = _("event conflict");
+                C2F(curblk).kfun = 0;
+                break;
+
+            case 4  :
+                error = _("algebraic loop detected");
+                C2F(curblk).kfun = 0;
+                break;
+
+            case 5  :
+                error = _("cannot allocate memory");
+                C2F(curblk).kfun = 0;
+                break;
+
+            case 6  :
+                if ((error = new (std::nothrow) char[MAX_ERROR_LEN]) == nullptr)
+                {
+                    allocatedError = TRUE;
+                    snprintf(error, MAX_ERROR_LEN, _("the block %d has been called with input out of its domain"), C2F(curblk).kfun);
+                }
+                else
+                {
+                    error = _("cannot allocate memory");
+                }
+                break;
+
+            case 7  :
+                error = _("singularity in a block");
+                break;
+
+            case 8  :
+                error = _("block produces an internal error");
+                break;
+
+            case 10  :
+                error = coserr.buf;
+                break;
+
+            case 20  :
+                error = _("initial conditions not converging");
+                break;
+
+            case 21  :
+                if ((error = new (std::nothrow) char[MAX_ERROR_LEN]) == nullptr)
+                {
+                    allocatedError = TRUE;
+                    snprintf(error, MAX_ERROR_LEN, _("cannot allocate memory in block=%d"), C2F(curblk).kfun);
+                }
+                else
+                {
+                    error = _("cannot allocate memory");
+                }
+                break;
+
+            case 22  :
+                error = _("sliding mode condition, cannot integrate");
+                break;
+
+            case 23  :
+                error = _("Cannot find the initial mode, maybe there is a sliding mode condition");
+                break;
+            case 24  :
+                error = _("You have changed a parameter in your model, but the model has been compiled to use an XML file containing initial values and parameters. So you should either recompile your Scicos diagram or [re]launch the initialization interface to regenerate the XML file  with new parameters.");
+                break;
+
+            case 25  :
+                error = _("Undefined data type.");
+                break;
+            case 26  :
+                error = _("The number of parameter provided by Scicos blocks is different from what expected by the code generated by the Modelica compiler. You might have relaxed a parameter using FIXED property (i.e., fixed=false) in a Modelica model. This will be corrected in the next version");
+                break;
+                // In this case, you need to turn off the parameter embedded code generation mode by setting 'Modelica_ParEmb=%f' in the Scilab command window, and recompile the Scicos diagram
+
+            default  :
+                if (ierr >= 1000)
+                {
+                    error = _("unknown or erroneous block");
+                }
+                else if (ierr >= 201 && ierr <= 416) // Sundials error messages, stored in coserr.buf
+                {
+                    error = coserr.buf;
+                }
+                else if (ierr >= 100)
+                {
+                    int istate = -(ierr - 100);
+                    if ((error = new (std::nothrow) char[MAX_ERROR_LEN]) == nullptr)
+                    {
+                        allocatedError = TRUE;
+                        snprintf(error, MAX_ERROR_LEN, _("integration problem istate=%d"), istate);
+                    }
+                    else
+                    {
+                        error = _("cannot allocate memory");
+                    }
+                    C2F(curblk).kfun = 0;
+                }
+                else
+                {
+                    error = _("scicos unexpected error, please report...");
+                    C2F(curblk).kfun = 0;
+                }
+                break;
+        }
+
+        Scierror(888, "%s\n", error);
+        il_state->DecreaseRef();
+        il_state->killMe();
+        il_tcur->DecreaseRef();
+        il_tcur->killMe();
+        il_sim->DecreaseRef();
+        il_sim->killMe();
+        delete[] il_sim_labptr;
+        delete[] l_sim_lab;
+        delete[] il_sim_uidptr;
+        delete[] l_sim_uid;
+        if (allocatedError)
+        {
+            delete[] error;
+        }
+        return types::Function::Error;
+    }
+
+    /*********************
+    * Return Lhs variables
+    *********************/
+    // Convert integer parameters of 'il_state' into double parameters
+    il_state_evtspt->convertFromInteger();
+    il_pointi->convertFromInteger();
+
+    out.push_back(il_state);
+    out.push_back(il_tcur);
+
+    // End
+    il_sim->DecreaseRef();
+    il_sim->killMe();
+    delete[] il_sim_labptr;
+    delete[] l_sim_lab;
+    delete[] il_sim_uidptr;
+    delete[] l_sim_uid;
+    return types::Function::OK;
+}
diff --git a/scilab/modules/scicos/sci_gateway/fortran/sci_f_curblock.f b/scilab/modules/scicos/sci_gateway/fortran/sci_f_curblock.f
deleted file mode 100644 (file)
index 721e282..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-c     Scicos
-c     
-c     Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
-c     
-c     This program is free software; you can redistribute it and/or modify
-c     it under the terms of the GNU General Public License as published by
-c     the Free Software Foundation; either version 2 of the License, or
-c     (at your option) any later version.
-c     
-c     This program is distributed in the hope that it will be useful,
-c     but WITHOUT ANY WARRANTY; without even the implied warranty of
-c     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-c     GNU General Public License for more details.
-c     
-c     You should have received a copy of the GNU General Public License
-c     along with this program; if not, write to the Free Software
-c     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-c     
-c     See the file ./license.txt
-c 
-      subroutine intcurblk(fname)
-c
-c
-      include 'stack.h'
-      integer kfun
-Cc (DLL Intel Fortran)     
-cDEC$ IF DEFINED (FORDLL)
-cDEC$ ATTRIBUTES DLLIMPORT:: /curblk/
-cDEC$ ENDIF  
-      common /curblk/ kfun
-      integer iadr, sadr
-      character*(*) fname
-      
-      iadr(l)=l+l-1
-      sadr(l)=(l/2)+1
-
-      top=top+1
-      il=iadr(lstk(top))
-      istk(il)=1
-      istk(il+1)=1
-      istk(il+2)=1
-      istk(il+3)=0
-      l=sadr(il+4)
-      stk(l)=kfun
-      lstk(top+1)=l+1
-      return
-      end
-      
\ No newline at end of file
index f993b40..4cd725b 100644 (file)
     <gateway type="0" name="sci_tree2" function="sci_tree2"/>
     <gateway type="0" name="sci_tree3" function="sci_tree3"/>
     <gateway type="0" name="sci_tree4" function="sci_tree4"/>
-    <gateway type="0" name="sci_curblock" function="curblock"/>
     <gateway type="0" name="sci_scicos_time" function="scicos_time"/>
     <gateway type="0" name="sci_diffobjs" function="diffobjs"/>
     <gateway type="0" name="sci_pointer_xproperty" function="pointer_xproperty"/>
     <gateway type="0" name="sci_phase_simulation" function="phase_simulation"/>
     <gateway type="0" name="sci_set_xproperty" function="set_xproperty"/>
     <gateway type="0" name="sci_set_blockerror" function="set_blockerror"/>
-    <gateway type="0" name="sci_scicosim" function="scicosim"/>
     <gateway type="0" name="sci_getscicosvars" function="getscicosvars"/>
     <gateway type="0" name="sci_curblockc" function="curblockc"/>
     <gateway type="0" name="sci_end_scicosim" function="end_scicosim"/>
     <gateway type="1" name="sci_ctree2" function="ctree2"/>
     <gateway type="1" name="sci_ctree3" function="ctree3"/>
     <gateway type="1" name="sci_ctree4" function="ctree4"/>
+    <gateway type="1" name="sci_curblock" function="curblock"/>
     <gateway type="1" name="sci_duplicate" function="duplicate"/>
     <gateway type="1" name="sci_scicos_log" function="scicos_log"/>
     <gateway type="1" name="sci_scicos_new" function="scicos_new"/>
     <gateway type="1" name="sci_scicos_setfield" function="scicos_setfield"/>
+    <gateway type="1" name="sci_scicosim" function="scicosim"/>
     <gateway type="1" name="sci_validvar" function="validvar"/>
     <gateway type="1" name="sci_var2vec" function="var2vec"/>
     <gateway type="1" name="sci_vec2var" function="vec2var"/>
index 472a92d..babc9e4 100644 (file)
@@ -269,14 +269,11 @@ lib /DEF:"$(ProjectDir)../differential_equations_f_Import.def" /SUBSYSTEM:WINDOW
     <ClCompile Include="..\extractblklist.c" />
     <ClCompile Include="..\ezxml.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\gw_scicos.c" />
-    <ClCompile Include="..\il_sim.c" />
-    <ClCompile Include="..\il_state.c" />
     <ClCompile Include="..\import.c" />
     <ClCompile Include="..\MlistGetFieldNumber.c" />
     <ClCompile Include="..\lsodar.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_callblk.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_coserror.c" />
-    <ClCompile Include="..\..\..\sci_gateway\c\sci_curblock.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_curblockc.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_data2sig.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_diffobjs.c" />
@@ -293,7 +290,6 @@ lib /DEF:"$(ProjectDir)../differential_equations_f_Import.def" /SUBSYSTEM:WINDOW
     <ClCompile Include="..\..\..\sci_gateway\c\sci_scicos_debug.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_scicos_debug_count.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_scicos_time.c" />
-    <ClCompile Include="..\..\..\sci_gateway\c\sci_scicosim.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_sctree.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_set_blockerror.c" />
     <ClCompile Include="..\..\..\sci_gateway\c\sci_set_xproperty.c" />
@@ -384,4 +380,4 @@ lib /DEF:"$(ProjectDir)../differential_equations_f_Import.def" /SUBSYSTEM:WINDOW
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index b76f2c9..ee59895 100644 (file)
     <ClCompile Include="..\..\..\sci_gateway\c\gw_scicos.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\il_sim.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="..\il_state.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\import.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -65,9 +59,6 @@
     <ClCompile Include="..\..\..\sci_gateway\c\sci_coserror.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\sci_gateway\c\sci_curblock.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\sci_gateway\c\sci_curblockc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\..\sci_gateway\c\sci_scicos_time.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\sci_gateway\c\sci_scicosim.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\sci_gateway\c\sci_sctree.c">
       <Filter>Source Files</Filter>
     </ClCompile>
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
diff --git a/scilab/modules/scicos/src/c/il_sim.c b/scilab/modules/scicos/src/c/il_sim.c
deleted file mode 100644 (file)
index 47b6256..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*  Scicos
-*
-*  Copyright (C) DIGITEO - 2009 - Allan CORNET
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* See the file ./license.txt
-*/
-/*--------------------------------------------------------------------------*/
-#include "il_sim.h"
-#include "sci_malloc.h"
-/*--------------------------------------------------------------------------*/
-static int *il_sim_save = NULL;
-/*--------------------------------------------------------------------------*/
-int *get_il_sim(void)
-{
-    return il_sim_save;
-}
-/*--------------------------------------------------------------------------*/
-int *set_il_sim(int *_sim)
-{
-    il_sim_save = _sim;
-    return il_sim_save;
-}
-/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/scicos/src/c/il_state.c b/scilab/modules/scicos/src/c/il_state.c
deleted file mode 100644 (file)
index 8843293..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*  Scicos
-*
-*  Copyright (C) DIGITEO - 2009 - Allan CORNET
-*
-* This program is free software; you can redistribute it and/or modify
-* it under the terms of the GNU General Public License as published by
-* the Free Software Foundation; either version 2 of the License, or
-* (at your option) any later version.
-*
-* This program is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-* GNU General Public License for more details.
-*
-* You should have received a copy of the GNU General Public License
-* along with this program; if not, write to the Free Software
-* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-*
-* See the file ./license.txt
-*/
-/*--------------------------------------------------------------------------*/
-#include "il_state.h"
-#include "sci_malloc.h"
-/*--------------------------------------------------------------------------*/
-static int *il_state_save = NULL;
-/*--------------------------------------------------------------------------*/
-int *get_il_state(void)
-{
-    return il_state_save;
-}
-/*--------------------------------------------------------------------------*/
-int *set_il_state(int *_state)
-{
-    il_state_save = _state;
-    return il_state_save;
-}
-/*--------------------------------------------------------------------------*/
\ No newline at end of file
index 6d05167..d151d41 100644 (file)
@@ -46,9 +46,9 @@ ScicosImport scicos_imp =
     (int *) NULL,      /* mod        */
     (int *) NULL,      /* nmod       */
     (int *) NULL,      /* modptr **  */
-    (int *) NULL,      /* iz         */
+    (char **) NULL,      /* iz         */
     (int *) NULL,      /* izptr      */
-    (int *) NULL,      /* uid        */
+    (char **) NULL,      /* uid        */
     (int *) NULL,      /* uidptr     */
     (int *) NULL,      /* inpptr **  */
     (int *) NULL,      /* inplnk **  */
@@ -121,7 +121,7 @@ void makescicosimport(double *x, int *nx,
                       int *noz, void **oz, int *ozsz, int *oztyp, int *ozptr,
                       double *g, int *ng,
                       int *mod, int *nmod, int *modptr,
-                      int *iz, int *izptr, int *uid, int *uidptr, int *inpptr, int *inplnk,
+                      char **iz, int *izptr, char **uid, int *uidptr, int *inpptr, int *inplnk,
                       int *outptr, int *outlnk, void **outtbptr, int *outtbsz, int *outtbtyp,
                       outtb_el *outtb_elem, int *nelem,
                       int *nlnk, double *rpar, int *rpptr, int *ipar, int *ipptr,
@@ -245,9 +245,9 @@ void C2F(clearscicosimport)()
     scicos_imp.mod = (int *) NULL;
     scicos_imp.nmod = (int *) NULL;
     scicos_imp.modptr = (int *) NULL;
-    scicos_imp.iz = (int *) NULL;
+    scicos_imp.iz = (char **) NULL;
     scicos_imp.izptr = (int *) NULL;
-    scicos_imp.uid = (int *) NULL;
+    scicos_imp.uid = (char **) NULL;
     scicos_imp.uidptr = (int *) NULL;
 
     scicos_imp.inpptr = (int *) NULL;
@@ -479,7 +479,7 @@ int getscicosvarsfromimport(char *what, void **v, int *nv, int *mv)
         /* iz - label integer code of blocks array */
         *nv = (int)(scicos_imp.izptr[nblk] - scicos_imp.izptr[0]);
         *mv = 1;
-        *v  = (int *) (scicos_imp.iz);
+        *v  = (char **) (scicos_imp.iz);
     }
     else if (strcmp(what, "izptr") == 0)
     {
@@ -493,7 +493,7 @@ int getscicosvarsfromimport(char *what, void **v, int *nv, int *mv)
         /* uid */
         *nv = (int)(scicos_imp.uidptr[nblk] - scicos_imp.uidptr[0]);
         *mv = 1;
-        *v  = (int *) (scicos_imp.uid);
+        *v  = (char **) (scicos_imp.uid);
     }
     else if (strcmp(what, "uidptr") == 0)
     {
@@ -889,7 +889,7 @@ void C2F(getlabel)(int *kfun, char *label, int *n)
     }
     if (*n > 0 )
     {
-        F2C(cvstr)(n, &(scicos_imp.iz[scicos_imp.izptr[k - 1] - 1]), label, &job, *n);
+        strcpy(label, scicos_imp.iz[k]);
     }
 }
 
@@ -898,10 +898,8 @@ void C2F(getblockbylabel)(int *kfun, char **label, int *n)
 {
     int k, i, i0, nblk, n1;
     int job = 0;
-    int lab[40];
 
     nblk = scicos_imp.nblk[0];
-    F2C(cvstr)(n, lab, *label, &job, *n);
 
     *kfun = 0;
     for (k = 0; k < nblk; k++)
@@ -911,7 +909,7 @@ void C2F(getblockbylabel)(int *kfun, char **label, int *n)
         {
             i0 = scicos_imp.izptr[k - 1] - 1;
             i = 0;
-            while ((lab[i] == scicos_imp.iz[i0 + i]) & (i < n1))
+            while ((label[i] == scicos_imp.iz[i0 + i]) & (i < n1))
             {
                 i++;
             }
@@ -928,12 +926,16 @@ void C2F(getblockbylabel)(int *kfun, char **label, int *n)
 int C2F(getsciblockbylabel)(int*kfun, int label[], int *n)
 {
     int k, i, i0, nblk, n1;
+    int job = 1;
+    char* lab[100];
     if (scicos_imp.x == (double *)NULL)
     {
         return (2); /* undefined import table scicos is not running */
     }
     nblk = scicos_imp.nblk[0];
 
+    F2C(cvstr)(n, lab, *label, &job, *n);
+
     *kfun = 0;
     for (k = 0; k < nblk; k++)
     {
@@ -942,7 +944,7 @@ int C2F(getsciblockbylabel)(int*kfun, int label[], int *n)
         {
             i0 = scicos_imp.izptr[k - 1] - 1;
             i = 0;
-            while ((label[i] == scicos_imp.iz[i0 + i]) & (i < n1))
+            while ((lab[i] == scicos_imp.iz[i0 + i]) & (i < n1))
             {
                 i++;
             }
@@ -956,7 +958,7 @@ int C2F(getsciblockbylabel)(int*kfun, int label[], int *n)
     return 0;
 }
 /*--------------------------------------------------------------------------*/
-int C2F(getscilabel)(int *kfun, int label[], int *n)
+int C2F(getscilabel)(int *kfun, char *label[], int *n)
 {
     int k, i;
     int *u, *y;
@@ -966,10 +968,11 @@ int C2F(getscilabel)(int *kfun, int label[], int *n)
         return (2); /* undefined import table scicos is not running */
     }
     k = *kfun;
+
     *n = (int)(scicos_imp.izptr[k] - scicos_imp.izptr[k - 1]);
     if (*n > 0 )
     {
-        u = (int *) & (scicos_imp.iz[scicos_imp.izptr[k - 1] - 1]);
+        u = (char **) & (scicos_imp.iz[scicos_imp.izptr[k - 1] - 1]);
         y = label;
         for (i = 0; i < *n; i++)
         {
index 0f4cb4d..d7c99a2 100644 (file)
@@ -70,7 +70,6 @@
 #include "syncexec.h"
 #include "realtime.h"
 #include "sci_malloc.h"
-#include "cvstr.h"
 #include "ezxml.h"
 #include "xscion.h"
 
@@ -287,7 +286,7 @@ int simblkKinsol(N_Vector yy, N_Vector resval, void *rdata);
 int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
                 void **work, int *zptr, int *modptr_in,
                 void **oz, int *ozsz, int *oztyp, int *ozptr,
-                int *iz, int *izptr, int* uid, int* uidptr, double *t0_in,
+                char **iz, int *izptr, char **uid, int *uidptr, double *t0_in,
                 double *tf_in, double *tevts_in, int *evtspt_in,
                 int *nevts, int *pointi_in, void **outtbptr_in,
                 int *outtbsz_in, int *outtbtyp_in,
@@ -752,7 +751,7 @@ int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
         }
 
         /* 11 : block label (label) */
-        i1 = izptr[kf + 2] - izptr[kf + 1];
+        i1 = izptr[kf];
         if ((Blocks[kf].label = MALLOC(sizeof(char) * (i1 + 1))) == NULL)
         {
             FREE_blocks();
@@ -760,10 +759,10 @@ int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
             return 0;
         }
         Blocks[kf].label[i1] = '\0';
-        C2F(cvstr)(&i1, &(iz[izptr[kf + 1] - 1]), Blocks[kf].label, &job, i1);
+        strcpy(Blocks[kf].label, iz[kf]);
 
         /* block uid (uid) */
-        i1 = uidptr[kf + 1] - uidptr[kf];
+        i1 = uidptr[kf];
         if ((Blocks[kf].uid = MALLOC(sizeof(char) * (i1 + 1))) == NULL)
         {
             FREE_blocks();
@@ -771,7 +770,7 @@ int C2F(scicos)(double *x_in, int *xptr_in, double *z__,
             return 0;
         }
         Blocks[kf].uid[i1] = '\0';
-        C2F(cvstr)(&i1, &(uid[uidptr[kf] - 1]), Blocks[kf].uid, &job, i1);
+        strcpy(Blocks[kf].uid, uid[kf]);
 
         /* 12 : block array of crossed surfaces (jroot) */
         Blocks[kf].jroot = NULL;
@@ -1026,41 +1025,49 @@ static void cosini(double *told)
             case SCSREAL_N    :
                 szouttbd += outtbsz[ii] * outtbsz[ii + nlnk]; /*double real matrix*/
                 outtbd = (SCSREAL_COP *) REALLOC (outtbd, szouttbd * sizeof(SCSREAL_COP));
+                memset(outtbd, 0, szouttbd * sizeof(SCSREAL_COP));
                 break;
 
             case SCSCOMPLEX_N :
                 szouttbd += 2 * outtbsz[ii] * outtbsz[ii + nlnk]; /*double complex matrix*/
                 outtbd = (SCSCOMPLEX_COP *) REALLOC (outtbd, szouttbd * sizeof(SCSCOMPLEX_COP));
+                memset(outtbd, 0, szouttbd * sizeof(SCSCOMPLEX_COP));
                 break;
 
             case SCSINT8_N    :
                 szouttbc += outtbsz[ii] * outtbsz[ii + nlnk]; /*int8*/
                 outtbc = (SCSINT8_COP *) REALLOC (outtbc, szouttbc * sizeof(SCSINT8_COP));
+                memset(outtbc, 0, szouttbc * sizeof(SCSINT8_COP));
                 break;
 
             case SCSINT16_N   :
                 szouttbs += outtbsz[ii] * outtbsz[ii + nlnk]; /*int16*/
                 outtbs = (SCSINT16_COP *) REALLOC (outtbs, szouttbs * sizeof(SCSINT16_COP));
+                memset(outtbs, 0, szouttbs * sizeof(SCSINT16_COP));
                 break;
 
             case SCSINT32_N   :
                 szouttbl += outtbsz[ii] * outtbsz[ii + nlnk]; /*int32*/
                 outtbl = (SCSINT32_COP *) REALLOC (outtbl, szouttbl * sizeof(SCSINT32_COP));
+                memset(outtbl, 0, szouttbl * sizeof(SCSINT32_COP));
                 break;
 
             case SCSUINT8_N   :
                 szouttbuc += outtbsz[ii] * outtbsz[ii + nlnk]; /*uint8*/
                 outtbuc = (SCSUINT8_COP *) REALLOC (outtbuc, szouttbuc * sizeof(SCSUINT8_COP));
+                memset(outtbuc, 0, szouttbuc * sizeof(SCSUINT8_COP));
                 break;
 
             case SCSUINT16_N  :
                 szouttbus += outtbsz[ii] * outtbsz[ii + nlnk]; /*uint16*/
                 outtbus = (SCSUINT16_COP *) REALLOC (outtbus, szouttbus * sizeof(SCSUINT16_COP));
+                memset(outtbus, 0, szouttbus * sizeof(SCSUINT16_COP));
                 break;
 
             case SCSUINT32_N  :
                 szouttbul += outtbsz[ii] * outtbsz[ii + nlnk]; /*uint32*/
                 outtbul = (SCSUINT32_COP *) REALLOC (outtbul, szouttbul * sizeof(SCSUINT32_COP));
+                memset(outtbul, 0, szouttbul * sizeof(SCSUINT32_COP));
                 break;
 
             default  : /* Add a message here */
index 9fbc7ed..9e13fc3 100644 (file)
@@ -255,6 +255,8 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile Include="..\..\sci_gateway\cpp\sci_ctree3.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_ctree4.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_duplicate.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_curblock.cpp" />
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_scicosim.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_scicos_log.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_scicos_new.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_scicos_setfield.cpp" />
@@ -262,6 +264,8 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile Include="..\..\sci_gateway\cpp\sci_var2vec.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_vec2var.cpp" />
     <ClCompile Include="..\cpp\Controller.cpp" />
+    <ClCompile Include="..\cpp\il_sim.cpp" />
+    <ClCompile Include="..\cpp\il_state.cpp" />
     <ClCompile Include="..\cpp\LoggerView.cpp" />
     <ClCompile Include="..\cpp\Model.cpp" />
     <ClCompile Include="..\cpp\Model_getObjectProperties.cpp" />
@@ -284,15 +288,12 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile Include="extractblklist.c" />
     <ClCompile Include="ezxml.c" />
     <ClCompile Include="..\..\sci_gateway\c\gw_scicos.c" />
-    <ClCompile Include="il_sim.c" />
-    <ClCompile Include="il_state.c" />
     <ClCompile Include="import.c" />
     <ClCompile Include="MlistGetFieldNumber.c" />
     <ClCompile Include="lsodar.c" />
     <ClCompile Include="ddaskr.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_callblk.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_coserror.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_curblock.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_curblockc.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_data2sig.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_diffobjs.c" />
@@ -310,7 +311,6 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClCompile Include="..\..\sci_gateway\c\sci_scicos_debug.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_scicos_debug_count.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_scicos_time.c" />
-    <ClCompile Include="..\..\sci_gateway\c\sci_scicosim.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_sctree.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_set_blockerror.c" />
     <ClCompile Include="..\..\sci_gateway\c\sci_set_xproperty.c" />
@@ -330,6 +330,8 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
     <ClInclude Include="..\..\includes\Model.hxx" />
     <ClInclude Include="..\..\includes\model\BaseObject.hxx" />
     <ClInclude Include="..\..\includes\View.hxx" />
+    <ClInclude Include="..\cpp\il_sim.hxx" />
+    <ClInclude Include="..\cpp\il_state.hxx" />
     <ClInclude Include="..\cpp\LoggerView.hxx" />
     <ClInclude Include="..\cpp\model\Annotation.hxx" />
     <ClInclude Include="..\cpp\model\Block.hxx" />
@@ -438,4 +440,4 @@ lib /DEF:"$(ProjectDir)differential_equations_f_Import.def" /SUBSYSTEM:WINDOWS /
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 74a8add..1e2d481 100644 (file)
     <ClCompile Include="..\..\sci_gateway\c\gw_scicos.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="il_sim.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
-    <ClCompile Include="il_state.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="import.c">
       <Filter>Source Files</Filter>
     </ClCompile>
@@ -83,9 +77,6 @@
     <ClCompile Include="..\..\sci_gateway\c\sci_coserror.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_curblock.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_curblockc.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_scicos_time.c">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\c\sci_scicosim.c">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\c\sci_sctree.c">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_duplicate.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_curblock.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\..\sci_gateway\cpp\sci_scicosim.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\il_sim.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
+    <ClCompile Include="..\cpp\il_state.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_var2vec.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
     <ClInclude Include="..\cpp\model\Port.hxx">
       <Filter>Header Files\MVC\model</Filter>
     </ClInclude>
+    <ClInclude Include="..\cpp\il_sim.hxx">
+      <Filter>Header Files\MVC\model</Filter>
+    </ClInclude>
+    <ClInclude Include="..\cpp\il_state.hxx">
+      <Filter>Header Files\MVC\model</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="Dynamic_link_Import.def">
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 41f2128..3302799 100644 (file)
@@ -18,7 +18,7 @@ void makescicosimport(double *x, int *nx,
                       int *noz, void **oz, int *ozsz, int *oztyp, int *ozptr,
                       double *g, int *ng,
                       int *mod, int *nmod, int *modptr,
-                      int *iz, int *izptr, int *uid, int *uidptr, int *inpptr, int *inplnk,
+                      char **iz, int *izptr, char **uid, int *uidptr, int *inpptr, int *inplnk,
                       int *outptr, int *outlnk, void **outtbptr, int *outtbsz, int *outtbtyp,
                       outtb_el *outtb_elem, int *nelem,
                       int *nlnk, double *rpar, int *rpptr, int *ipar, int *ipptr,
diff --git a/scilab/modules/scicos/src/cpp/il_sim.cpp b/scilab/modules/scicos/src/cpp/il_sim.cpp
new file mode 100644 (file)
index 0000000..0a4fcfa
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "il_sim.hxx"
+
+#include "types.hxx"
+#include "internal.hxx"
+
+/*--------------------------------------------------------------------------*/
+static types::InternalType* il_sim_save = nullptr;
+/*--------------------------------------------------------------------------*/
+types::InternalType* get_il_sim(void)
+{
+    return il_sim_save;
+}
+/*--------------------------------------------------------------------------*/
+types::InternalType* set_il_sim(types::InternalType* _sim)
+{
+    il_sim_save = _sim;
+    return il_sim_save;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/scicos/src/cpp/il_sim.hxx b/scilab/modules/scicos/src/cpp/il_sim.hxx
new file mode 100644 (file)
index 0000000..5f65940
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+#ifndef __IL_SIM_HXX__
+#define __IL_SIM_HXX__
+
+#include "types.hxx"
+#include "internal.hxx"
+
+/**
+* get il_sim
+*/
+types::InternalType* get_il_sim(void);
+
+/**
+* set il_sim
+*/
+types::InternalType* set_il_sim(types::InternalType* _sim);
+
+#endif /* __IL_SIM_HXX__ */
diff --git a/scilab/modules/scicos/src/cpp/il_state.cpp b/scilab/modules/scicos/src/cpp/il_state.cpp
new file mode 100644 (file)
index 0000000..c0c9892
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include "il_state.hxx"
+
+#include "types.hxx"
+#include "internal.hxx"
+
+/*--------------------------------------------------------------------------*/
+static types::InternalType* il_state_save = nullptr;
+/*--------------------------------------------------------------------------*/
+types::InternalType* get_il_state(void)
+{
+    return il_state_save;
+}
+/*--------------------------------------------------------------------------*/
+types::InternalType* set_il_state(types::InternalType* _state)
+{
+    il_state_save = _state;
+    return il_state_save;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/scicos/src/cpp/il_state.hxx b/scilab/modules/scicos/src/cpp/il_state.hxx
new file mode 100644 (file)
index 0000000..ea088da
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2014 - Scilab Enterprises - Paul Bignier
+ *
+ *  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.1-en.txt
+ *
+ */
+
+#ifndef __IL_STATE_HXX__
+#define __IL_STATE_HXX__
+
+#include "types.hxx"
+#include "internal.hxx"
+
+/**
+* get il_state
+*/
+types::InternalType* get_il_state(void);
+
+/**
+* set il_state
+*/
+types::InternalType* set_il_state(types::InternalType* _state);
+
+#endif /* __IL_STATE_HXX__ */
index b69f0cf..9ad9318 100644 (file)
@@ -61,7 +61,6 @@
                <File RelativePath=".\ftree4.f"/>
                <File RelativePath=".\list2vars.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\sci_f_ctree.f"/>
-               <File RelativePath="..\..\sci_gateway\fortran\sci_f_curblock.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\sci_f_debug_count.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\sci_f_getblocklabel.f"/>
                <File RelativePath="..\..\sci_gateway\fortran\sci_f_scicos_debug.f"/>
index e83760d..f92b48d 100644 (file)
@@ -257,7 +257,6 @@ cd ..
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="..\..\sci_gateway\fortran\sci_f_ctree.c" />
-    <ClCompile Include="..\..\sci_gateway\fortran\sci_f_curblock.c" />
     <ClCompile Include="..\..\sci_gateway\fortran\sci_f_debug_count.c" />
     <ClCompile Include="..\..\sci_gateway\fortran\sci_f_getblocklabel.c" />
     <ClCompile Include="..\..\sci_gateway\fortran\sci_f_scicos_debug.c" />
@@ -282,7 +281,6 @@ cd ..
   </ItemGroup>
   <ItemGroup>
     <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_ctree.f" />
-    <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_curblock.f" />
     <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_debug_count.f" />
     <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_getblocklabel.f" />
     <f2c_rule Include="..\..\sci_gateway\fortran\sci_f_scicos_debug.f" />