change Module::Load function prototype to 'C' format 29/4329/1
Antoine ELIAS [Mon, 27 Jun 2011 09:54:34 +0000 (11:54 +0200)]
Change-Id: Idd1c87bcea498152c7f36a87b65277cba8b09fc9

53 files changed:
scilab/modules/action_binding/includes/action_binding_gw.hxx
scilab/modules/action_binding/sci_gateway/cpp/action_binding_gw.cpp
scilab/modules/action_binding/src/noaction_binding/noaction_binding.cpp
scilab/modules/boolean/includes/boolean_gw.hxx
scilab/modules/boolean/src/cpp/boolean_gw.cpp
scilab/modules/core/includes/core_gw.hxx
scilab/modules/core/src/cpp/core_gw.cpp
scilab/modules/elementary_functions/includes/elem_func_gw.hxx
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
scilab/modules/fileio/includes/fileio_gw.hxx
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.cpp
scilab/modules/functions/includes/functions_gw.hxx
scilab/modules/functions/sci_gateway/cpp/functions_gw.cpp
scilab/modules/functions_manager/includes/funcmanager.hxx
scilab/modules/gui/includes/gui_gw.hxx
scilab/modules/gui/sci_gateway/cpp/gui_gw.cpp
scilab/modules/gui/src/nogui/nogui_gw.cpp
scilab/modules/hdf5/includes/hdf5_gw.hxx
scilab/modules/hdf5/sci_gateway/cpp/hdf5_gw.cpp
scilab/modules/helptools/includes/helptools_gw.hxx
scilab/modules/helptools/sci_gateway/cpp/helptools_gw.cpp
scilab/modules/helptools/sci_gateway/nogui/nogui.cpp
scilab/modules/integer/includes/integer_gw.hxx
scilab/modules/integer/sci_gateway/cpp/integer_gw.cpp
scilab/modules/io/includes/io_gw.hxx
scilab/modules/io/src/cpp/io_gw.cpp
scilab/modules/jvm/includes/jvm_gw.hxx
scilab/modules/jvm/sci_gateway/cpp/jvm_gw.cpp
scilab/modules/jvm/src/nojvm/nojvm_gw.cpp
scilab/modules/localization/includes/localization_gw.hxx
scilab/modules/localization/sci_gateway/cpp/localization_gw.cpp
scilab/modules/matio/includes/matio_gw.hxx
scilab/modules/matio/sci_gateway/cpp/matio_gw.cpp
scilab/modules/output_stream/includes/output_stream_gw.hxx
scilab/modules/output_stream/sci_gateway/cpp/output_stream_gw.cpp
scilab/modules/scinotes/includes/scinotes_gw.hxx
scilab/modules/scinotes/sci_gateway/cpp/scinotes_gw.cpp
scilab/modules/scinotes/src/noscinotes/noscinotes_gw.cpp
scilab/modules/string/includes/string_gw.hxx
scilab/modules/string/sci_gateway/cpp/string_gw.cpp
scilab/modules/symbol/includes/addGatewayInContext.h [new file with mode: 0644]
scilab/modules/symbol/includes/context.hxx
scilab/modules/symbol/src/cpp/context.cpp
scilab/modules/symbol/symbol.vcxproj
scilab/modules/symbol/symbol.vcxproj.filters
scilab/modules/time/includes/time_gw.hxx
scilab/modules/time/sci_gateway/cpp/time_gw.cpp
scilab/modules/types/includes/c_gateway_prototype.h
scilab/modules/types/includes/function.hxx
scilab/modules/types/includes/types_gw.hxx
scilab/modules/types/sci_gateway/cpp/types_gw.cpp
scilab/modules/windows_tools/includes/windows_tools_gw.hxx
scilab/modules/windows_tools/src/cpp/windows_tools_gw.cpp

index 7434df6..f7808df 100644 (file)
@@ -25,7 +25,7 @@ private :
     ~ActionBindingModule() {};
 
 public :
-       ACTION_BINDING_GW_IMPEXP static bool Load();
+       ACTION_BINDING_GW_IMPEXP static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_notify);
index 93d9d18..30d6485 100644 (file)
@@ -22,8 +22,8 @@ extern "C"
 
 #define MODULE_NAME L"action_binding"
 
-bool ActionBindingModule::Load()
+int ActionBindingModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"notify", &sci_notify, MODULE_NAME));
-    return true;
+    return 1;
 }
index 54390ee..6972fc3 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "action_binding_gw.hxx"
 
-bool ActionBindingModule::Load()
+int ActionBindingModule::Load()
 {
        return true;
 }
index bb3c454..0a64f59 100644 (file)
@@ -21,7 +21,7 @@ private :
        BooleanModule(){};
        ~BooleanModule(){};
 public :
-       BOOLEAN_GW_IMPEXP static bool Load();
+       BOOLEAN_GW_IMPEXP static int Load();
 };
 
 #endif /* __BOOLEAN_GW_HXX__ */
index 8e1ccbd..34f4e93 100644 (file)
@@ -22,10 +22,10 @@ extern "C"
 
 using namespace types;
 
-bool BooleanModule::Load()
+int BooleanModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"or", &sci_or, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"and", &sci_and, MODULE_NAME));
-       return true;
+       return 1;
 }
 
index 1716a60..b14897c 100644 (file)
@@ -23,7 +23,7 @@ private :
     CoreModule(){};
     ~CoreModule(){};
 public :
-    CORE_GW_IMPEXP static bool Load();
+    CORE_GW_IMPEXP static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_getmodules);
index c31a6ba..84cebb8 100644 (file)
@@ -21,7 +21,7 @@ extern "C"
 
 using namespace types;
 
-bool CoreModule::Load()
+int CoreModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"type", &sci_type, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getmodules", &sci_getmodules, MODULE_NAME));
@@ -49,6 +49,5 @@ bool CoreModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"abort", &sci_abort, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"who", &sci_who, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"stacksize", &sci_stacksize, MODULE_NAME));
-    return true;
+    return 1;
 }
-
index 0d05c6b..48d8d9f 100644 (file)
@@ -32,7 +32,7 @@ private :
        ElemFuncModule(){};
        ~ElemFuncModule(){};
 public :
-       EXTERN_EF_GW static bool Load();
+       EXTERN_EF_GW static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_isequal);
index fff3d0b..e336c9d 100644 (file)
@@ -20,7 +20,7 @@ extern "C"
        #include "gw_elementary_functions.h"
 }
 
-bool ElemFuncModule::Load()
+int ElemFuncModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"abs", &sci_abs, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"acos", &sci_acos, MODULE_NAME));
@@ -67,7 +67,5 @@ bool ElemFuncModule::Load()
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"testmatrix", &sci_testmatrix, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tril", &sci_tril, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"zeros", &sci_zeros, MODULE_NAME));
-
-       return true;
+       return 1;
 }
-
index 86bfba4..a1167fd 100644 (file)
@@ -32,7 +32,7 @@ private :
     ~FileioModule() {};
 
 public :
-       EXTERN_FILEIO_GW static bool Load();
+       EXTERN_FILEIO_GW static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_mopen);
index 5748429..d38b704 100644 (file)
@@ -23,7 +23,7 @@ extern "C"
 
 using namespace types;
 
-bool FileioModule::Load()
+int FileioModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"cd", &sci_chdir, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"chdir", &sci_chdir, MODULE_NAME));
@@ -66,6 +66,5 @@ bool FileioModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mfscanf", &sci_mfscanf, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"msscanf", &sci_msscanf, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getdrives", &sci_getdrives, MODULE_NAME));
-    return true;
+    return 1;
 }
-
index e55eb70..fc86a75 100644 (file)
@@ -23,7 +23,7 @@ private :
        FunctionsModule(){};
        ~FunctionsModule(){};
 public :
-       FUNCTIONS_GW_IMPEXP static bool Load();
+       FUNCTIONS_GW_IMPEXP static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_exec);
index e95bda6..5f3242a 100644 (file)
@@ -22,7 +22,7 @@ extern "C"
 
 using namespace types;
 
-bool FunctionsModule::Load()
+int FunctionsModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"exec", &sci_exec, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"execstr", &sci_execstr, MODULE_NAME));
@@ -31,6 +31,5 @@ bool FunctionsModule::Load()
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getCurrentThreadId", &sci_getCurrentThreadId, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mode", &sci_mode, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getThreads", &sci_getThreads, MODULE_NAME));
-       return true;
+       return 1;
 }
-
index fcf1ac0..d989861 100644 (file)
@@ -40,7 +40,7 @@ using namespace std;
 #define END_EXT     L".end"
 
 //Gateway function pointer
-typedef bool (*GW_MOD)(void); 
+typedef int (*GW_MOD)(void); 
 
 class EXTERN_FUNC_MAN FuncManager
 {
index 2aa4f0d..f328ad4 100644 (file)
@@ -31,7 +31,7 @@ private :
        GuiModule(){};
        ~GuiModule(){};
 public :
-       EXTERN_GUI_GW static bool Load();
+       EXTERN_GUI_GW static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_helpbrowser);
index 440017d..dcc5cba 100644 (file)
@@ -22,9 +22,9 @@ extern "C"
 
 using namespace types;
 
-bool GuiModule::Load()
+int GuiModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"about", &sci_about, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"helpbrowser", &sci_helpbrowser, MODULE_NAME));
-    return true;
+    return 1;
 }
index 3364f1b..d7c3566 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "gui_gw.hxx"
 
-bool GuiModule::Load()
+int GuiModule::Load()
 {
        /* Do Nothing */
     return true;
index 7ebc082..d2faa10 100644 (file)
@@ -26,7 +26,7 @@ private :
     ~Hdf5Module() {};
 
 public :
-       HDF5_SCILAB_IMPEXP static bool Load();
+       HDF5_SCILAB_IMPEXP static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_export_to_hdf5);
index ce7acba..6c41c0c 100644 (file)
@@ -22,9 +22,9 @@ extern "C"
 
 using namespace types;
 
-bool Hdf5Module::Load()
+int Hdf5Module::Load()
 {
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"export_to_hdf5", &sci_export_to_hdf5, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"import_from_hdf5", &sci_import_from_hdf5, MODULE_NAME));
-    return true;
+    return 1;
 }
index fc75533..c27adcb 100644 (file)
@@ -31,7 +31,7 @@ private :
     static void LoadDeps(void);
 
 public :
-    HELPTOOLS_IMPEXP static bool Load();
+    HELPTOOLS_IMPEXP static int Load();
 };
 
 #endif /* !__HELPTOOLS_GW_HXX__ */
index d4fc60c..44c3967 100644 (file)
@@ -35,9 +35,9 @@ void HelptoolsModule::LoadDeps(void)
     }
 }
 
-bool HelptoolsModule::Load()
+int HelptoolsModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"buildDoc", &sci_buildDoc, &HelptoolsModule::LoadDeps, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"buildDocv2", &sci_buildDocv2, &HelptoolsModule::LoadDeps, MODULE_NAME));
-    return true;
+    return 1;
 }
index de42f9b..448cf7f 100644 (file)
@@ -32,7 +32,7 @@ int sci_buildDoc(char *fname, unsigned long l)
 }
 /*--------------------------------------------------------------------------*/
 
-bool HelptoolsModule::Load()
+int HelptoolsModule::Load()
 {
     /* Do Nothing */
     return true;
index b9974aa..90335ee 100644 (file)
@@ -23,7 +23,7 @@ private :
        IntegerModule(){};
        ~IntegerModule(){};
 public :
-       INTEGER_GW_IMPEXP static bool Load();
+       INTEGER_GW_IMPEXP static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_inttype);
index 7c579c5..fcc6ba9 100644 (file)
@@ -22,7 +22,7 @@ extern "C"
 
 using namespace types;
 
-bool IntegerModule::Load()
+int IntegerModule::Load()
 {
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"int8", &sci_int8, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint8", &sci_uint8, MODULE_NAME));
@@ -34,6 +34,5 @@ bool IntegerModule::Load()
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint64", &sci_uint64, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"inttype", &sci_inttype, MODULE_NAME));
        symbol::Context::getInstance()->AddFunction(Function::createFunction(L"double", &sci_double, MODULE_NAME));
-       return true;
+       return 1;
 }
-
index ccebfb9..24a788c 100644 (file)
@@ -26,7 +26,7 @@ private :
        IoModule(){};
        ~IoModule(){};
 public :
-       IO_GW_IMPEXP static bool Load();
+       IO_GW_IMPEXP static int Load();
 };
 
 #endif /* __IO_GW_HXX__ */
index 8ac356a..8e3349f 100644 (file)
@@ -21,7 +21,7 @@ extern "C"
 
 using namespace types;
 
-bool IoModule::Load()
+int IoModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"load", &sci_load, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"genlib", &sci_genlib, MODULE_NAME));
@@ -30,6 +30,5 @@ bool IoModule::Load()
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"unix", &sci_unix, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getenv", &sci_getenv, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(Function::createFunction(L"setenv", &sci_setenv, MODULE_NAME));
-    return true;
+    return 1;
 }
-
index 088b447..992f829 100644 (file)
@@ -27,7 +27,7 @@ private :
   ~JvmModule() {};
 
 public :
-  JVM_GW_IMPEXP static bool Load();
+  JVM_GW_IMPEXP static int Load();
 };
 CPP_GATEWAY_PROTOTYPE(sci_system_getproperty);
 
index 8bdddfa..9f46bc6 100644 (file)
@@ -22,9 +22,9 @@ extern "C"
 
 #define MODULE_NAME L"jvm"
 
-bool JvmModule::Load()
+int JvmModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"system_getproperty", &sci_system_getproperty, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"javaclasspath", &sci_javaclasspath, MODULE_NAME));
-    return true;
+    return 1;
 }
index c58eedf..34cce66 100644 (file)
@@ -13,7 +13,7 @@
 #include "jvm_gw.hxx"
 
 
-bool JvmModule::Load()
+int JvmModule::Load()
 {
     /* Do Nothing */
     return true;
index b0dad41..fefaa42 100644 (file)
@@ -28,7 +28,7 @@ private :
   ~LocalizationModule() {};
 
 public :
-  LOCALIZATION_GW_IMPEXP static bool Load();
+  LOCALIZATION_GW_IMPEXP static int Load();
 };
 CPP_GATEWAY_PROTOTYPE(sci_gettext);
 CPP_GATEWAY_PROTOTYPE(sci_setdefaultlanguage);
index f95b64b..52223b2 100644 (file)
@@ -23,7 +23,7 @@ extern "C"
 
 #define MODULE_NAME L"localization"
 
-bool LocalizationModule::Load()
+int LocalizationModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"gettext", &sci_gettext, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"_", &sci_gettext, MODULE_NAME));
@@ -31,5 +31,5 @@ bool LocalizationModule::Load()
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getdefaultlanguage", &sci_getdefaultlanguage, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"setlanguage", &sci_setlanguage, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getlanguage", &sci_getlanguage, MODULE_NAME));
-    return true;
+    return 1;
 }
index f521a0c..927909c 100644 (file)
@@ -33,7 +33,7 @@ private :
   MatioModule(){};
   ~MatioModule(){};
 public :
-  EXTERN_MATIO_GW static bool Load();
+  EXTERN_MATIO_GW static int Load();
 };
 
 types::Function::ReturnValue sci_matfile_open(types::typed_list &in, int* _piRetCount, types::typed_list &out);
index 7edea26..95573a3 100644 (file)
@@ -20,7 +20,7 @@ extern "C"
 
 using namespace types;
 
-bool MatioModule::Load()
+int MatioModule::Load()
 {
   symbol::Context::getInstance()->AddFunction(Function::createFunction(L"matfile_open", &sci_matfile_open, MODULE_NAME));
   symbol::Context::getInstance()->AddFunction(Function::createFunction(L"matfile_close", &sci_matfile_close, MODULE_NAME));
@@ -28,6 +28,5 @@ bool MatioModule::Load()
   symbol::Context::getInstance()->AddFunction(Function::createFunction(L"matfile_varreadnext", &sci_matfile_varreadnext, MODULE_NAME));
   symbol::Context::getInstance()->AddFunction(Function::createFunction(L"matfile_varwrite", &sci_matfile_varwrite, MODULE_NAME));
   
-  return true;
+  return 1;
 }
-
index 65cf13b..1968a1f 100644 (file)
@@ -27,7 +27,7 @@ private :
   ~OutputStreamModule() {};
 
 public :
-  OUTPUT_STREAM_IMPEXP_GW static bool Load();
+  OUTPUT_STREAM_IMPEXP_GW static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_disp);
index 2311d56..6fc8cc8 100644 (file)
@@ -21,11 +21,11 @@ extern "C"
 
 #define MODULE_NAME L"output_stream"
 
-bool OutputStreamModule::Load()
+int OutputStreamModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"disp", &sci_disp, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"msprintf", &sci_msprintf, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"mprintf", &sci_mprintf, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"diary", &sci_diary, MODULE_NAME));
-    return true;
+    return 1;
 }
index 75cabda..0d26a67 100644 (file)
@@ -29,7 +29,7 @@ private :
    ScinotesModule() {};
    ~ScinotesModule() {};
 public :
-   EXTERN_SCINOTES_GW static bool Load();
+   EXTERN_SCINOTES_GW static int Load();
 };
 
 #endif /* !__SCINOTES_GW_HXX__ */
index 24320a1..b643400 100644 (file)
@@ -21,8 +21,8 @@ extern "C"
 #include "gw_scinotes.h"
 }
 
-bool ScinotesModule::Load()
+int  ScinotesModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"editor", &sci_scinotes, MODULE_NAME));
-    return true;
+    return 1;
 }
index bfba334..3961f03 100644 (file)
@@ -13,7 +13,7 @@
 #include "scinotes_gw.hxx"
 
 
-bool ScinotesModule::Load()
+int ScinotesModule::Load()
 {
     /* Do Nothing */
     return true;
index 80df0b2..dfaaf02 100644 (file)
@@ -24,7 +24,7 @@ private :
    StringModule(){};
    ~StringModule(){};
 public :
-   EXTERN_STRING_GW static bool Load();
+   EXTERN_STRING_GW static int Load();
 };
 
 CPP_GATEWAY_PROTOTYPE(sci_grep);
index e609c3c..ca6f341 100644 (file)
@@ -21,7 +21,7 @@ extern "C"
 
 #define MODULE_NAME L"string"
 
-bool StringModule::Load()
+int StringModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"grep", &sci_grep, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"stripblanks", &sci_stripblanks, MODULE_NAME));
@@ -47,6 +47,5 @@ bool StringModule::Load()
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strcspn", &sci_strcspn, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strtok", &sci_strtok, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strspn", &sci_strspn, MODULE_NAME));
-
-    return true;
+    return 1;
 }
diff --git a/scilab/modules/symbol/includes/addGatewayInContext.h b/scilab/modules/symbol/includes/addGatewayInContext.h
new file mode 100644 (file)
index 0000000..461a066
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ *  Copyright (C) 2011 - DIGITEO - Antoine ELIAS
+ *
+ *  This file must be used under the terms of the CeCILL.
+ *  This source file is licensed as described in the file COPYING, which
+ *  you should have received as part of this distribution.  The terms
+ *  are also available at
+ *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#ifndef __ADDGATEWAYINCONTEXT_H__
+#define __ADDGATEWAYINCONTEXT_H__
+#include "export_symbol.h"
+#include "c_gateway_prototype.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+    EXTERN_SYMBOL void addGatewayInContext(wchar_t* _pwstName, OLDGW_FUNC _pFunc, wchar_t* _pwstModule);
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* !__ADDGATEWAYINCONTEXT_H__ */
\ No newline at end of file
index ef1eed1..a955e29 100644 (file)
@@ -23,6 +23,7 @@
 #include "function.hxx"
 #include "macro.hxx"
 #include "macrofile.hxx"
+#include "export_symbol.h"
 
 namespace symbol
 {
index c49e545..e3ed2e3 100644 (file)
 #include "function.hxx"
 #include "macro.hxx"
 #include "macrofile.hxx"
+#include "addGatewayInContext.h"
+
+void addGatewayInContext(wchar_t* _pwstName , OLDGW_FUNC _pFunc, wchar_t* _pwstModule)
+{
+    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(_pwstName, _pFunc, _pwstModule));
+}
 
 namespace symbol
 {
index ab9fd8c..be53de4 100644 (file)
     <ClCompile Include="src\cpp\table.cpp" />
   </ItemGroup>
   <ItemGroup>
+    <ClInclude Include="includes\addGatewayInContext.h" />
     <ClInclude Include="includes\context.hxx" />
     <ClInclude Include="includes\export_symbol.h" />
     <ClInclude Include="includes\heap.hxx" />
index 0a9eb8c..9d0689b 100644 (file)
@@ -47,6 +47,9 @@
     <ClInclude Include="includes\table.hxx">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="includes\addGatewayInContext.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <Library Include="..\..\bin\blasplus.lib" />
index 408e0f6..060c2b6 100644 (file)
@@ -32,7 +32,7 @@ private :
    TimeModule() {};
    ~TimeModule() {};
 public :
-   EXTERN_TIME_GW static bool Load();
+   EXTERN_TIME_GW static int Load();
 };
 
 types::Function::ReturnValue sci_tic(types::typed_list &in, int _iRetCount, types::typed_list &out);
index fabb98c..d0c31b4 100644 (file)
@@ -18,7 +18,7 @@ extern "C"
    #include "gw_time.h"
 }
 
-bool TimeModule::Load()
+int TimeModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getdate", &sci_getdate, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"Calendar", &sci_calendar, MODULE_NAME));
@@ -29,5 +29,5 @@ bool TimeModule::Load()
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"realtime", &sci_realtime, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tic", &sci_tic, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"toc", &sci_toc, MODULE_NAME));
-    return true;
+    return 1;
 }
index 9569db7..8db511f 100644 (file)
@@ -13,5 +13,6 @@
 #define __C_GATEWAY_PROTOTYPE_H__
 
 #define C_GATEWAY_PROTOTYPE(__gateway__) int __gateway__(char* fname, int* _piKey)
+typedef int (*OLDGW_FUNC)(char *fname, int* _piKey);
 
 #endif /* !__C_GATEWAY_PROTOTYPE_H__ */
index 0e33f48..5b44c0d 100644 (file)
 #include "callable.hxx"
 #include "dynlib_types.h"
 
+extern "C"
+{
+#include "c_gateway_prototype.h"
+}
+
 #define MAX_OUTPUT_VARIABLE            64
 
 namespace types
@@ -33,7 +38,6 @@ namespace types
     public :
         typedef void (*LOAD_DEPS)(void);
         typedef ReturnValue (*GW_FUNC)(typed_list &in, int _iRetCount, typed_list &out);
-        typedef int (*OLDGW_FUNC)(char *fname, int* _piKey);
 
                                 Function() : Callable() {};
                                 Function(std::wstring _szName, GW_FUNC _pFunc, LOAD_DEPS _pLoadDeps, std::wstring _szModule);
index fcac435..c61b410 100644 (file)
@@ -25,7 +25,7 @@ private :
   ~TypesModule() {};
 
 public :
-  TYPES_GW_IMPEXP static bool Load();
+  TYPES_GW_IMPEXP static int Load();
 };
 CPP_GATEWAY_PROTOTYPE(sci_list);
 CPP_GATEWAY_PROTOTYPE(sci_struct);
index 9a84650..50cedef 100644 (file)
@@ -14,7 +14,7 @@
 #include "context.hxx"
 
 #define MODULE_NAME L"types"
-bool TypesModule::Load()
+int TypesModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"list", &sci_list, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"struct", &sci_struct, MODULE_NAME));
@@ -30,5 +30,5 @@ bool TypesModule::Load()
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getfield", &sci_getfield, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fieldnames", &sci_fieldnames, MODULE_NAME));
 
-    return true;
+    return 1;
 }
index bdebb80..c9da0b4 100644 (file)
@@ -27,7 +27,7 @@ private :
   ~WindowsToolsModule() {};
 
 public :
-  WINDOWS_TOOLS_IMPEXP static bool Load();
+  WINDOWS_TOOLS_IMPEXP static int Load();
 };
 
 
index 4934a13..ba89ddb 100644 (file)
@@ -18,10 +18,10 @@ extern "C"
 }
 
 #define MODULE_NAME L"windows_tools"
-bool WindowsToolsModule::Load()
+int WindowsToolsModule::Load()
 {
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"win64", &sci_win64, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"winqueryreg", &sci_winqueryreg, MODULE_NAME));
     symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"dos", &sci_dos, MODULE_NAME));
-    return true;
+    return 1;
 }