cosmetic, rename functions 46/10346/2
Antoine ELIAS [Tue, 29 Jan 2013 15:16:40 +0000 (16:16 +0100)]
Change-Id: I9a16ca3b6db0f727dcb5c6dd580756d927e39fef

31 files changed:
scilab/modules/ast/includes/run_AssignExp.hxx
scilab/modules/boolean/src/cpp/boolean_gw.cpp
scilab/modules/console/sci_gateway/cpp/console_gw.cpp
scilab/modules/core/src/cpp/core_gw.cpp
scilab/modules/dynamic_link/sci_gateway/cpp/dynamic_link_gw.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/elem_func_gw.cpp
scilab/modules/elementary_functions/sci_gateway/cpp/sci_gsort.cpp
scilab/modules/fileio/sci_gateway/cpp/fileio_gw.cpp
scilab/modules/functions/sci_gateway/cpp/sci_functionlist.cpp
scilab/modules/functions/sci_gateway/cpp/sci_whereis.cpp
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp
scilab/modules/graphics/sci_gateway/cpp/graphics_gw.cpp
scilab/modules/gui/sci_gateway/cpp/gui_gw.cpp
scilab/modules/history_manager/sci_gateway/cpp/history_manager_gw.cpp
scilab/modules/integer/sci_gateway/cpp/integer_gw.cpp
scilab/modules/io/src/cpp/io_gw.cpp
scilab/modules/jvm/sci_gateway/cpp/jvm_gw.cpp
scilab/modules/linear_algebra/sci_gateway/cpp/linear_algebra_gw.cpp
scilab/modules/localization/sci_gateway/cpp/localization_gw.cpp
scilab/modules/mexlib/src/cpp/mexlib.cpp
scilab/modules/output_stream/sci_gateway/cpp/output_stream_gw.cpp
scilab/modules/polynomials/sci_gateway/cpp/polynomials_gw.cpp
scilab/modules/string/sci_gateway/cpp/string_gw.cpp
scilab/modules/symbol/includes/context.hxx
scilab/modules/symbol/includes/stack.hxx
scilab/modules/symbol/src/cpp/context.cpp
scilab/modules/time/sci_gateway/cpp/time_gw.cpp
scilab/modules/types/sci_gateway/cpp/sci_inspectorGetFunctionList.cpp
scilab/modules/types/sci_gateway/cpp/types_gw.cpp
scilab/modules/types/src/cpp/macrofile.cpp
scilab/modules/windows_tools/src/cpp/windows_tools_gw.cpp

index d4a3dab..9d96970 100644 (file)
@@ -60,7 +60,7 @@ void visitprivate(const AssignExp  &e)
             if (pReturn)
             {
                 //ReturnExp so, put the value in the previous scope
-                symbol::Context::getInstance()->put_in_previous_scope(pVar->name_get(), *pIT);
+                symbol::Context::getInstance()->putInPreviousScope(pVar->name_get(), *pIT);
                 ((AssignExp*)&e)->break_set();
             }
             else
index 3e4cece..f830c51 100644 (file)
 #define MODULE_NAME L"boolean"
 extern "C"
 {
-       #include "gw_boolean.h"
+#include "gw_boolean.h"
 }
 
 using namespace types;
 
 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));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"bool2s", &sci_bool2s, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"find", &sci_find, MODULE_NAME));
-       return 1;
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"or", &sci_or, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"and", &sci_and, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"bool2s", &sci_bool2s, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"find", &sci_find, MODULE_NAME));
+    return 1;
 }
 
index 92970cc..e483a95 100644 (file)
 
 extern "C"
 {
-    #include "gw_console.h"
+#include "gw_console.h"
 }
 
 #define MODULE_NAME L"console"
 
 int ConsoleModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"clc", &sci_clc, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tohome", &sci_tohome, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"lines", &sci_lines, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"prompt", &sci_prompt, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"iswaitingforinput",   &sci_iswaitingforinput, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"clc", &sci_clc, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"tohome", &sci_tohome, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lines", &sci_lines, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"prompt", &sci_prompt, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"iswaitingforinput",   &sci_iswaitingforinput, MODULE_NAME));
     return true;
 }
\ No newline at end of file
index 73ce571..8452c87 100644 (file)
@@ -23,34 +23,34 @@ using namespace types;
 
 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));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getdebuginfo", &sci_getdebuginfo, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getversion", &sci_getversion, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"clear", &sci_clear, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"banner", &sci_banner, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"quit", &sci_quit, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"exit", &sci_exit, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"exists", &sci_exists, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isdef", &sci_isdef, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"argn", &sci_argn, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"global", &sci_global, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"clearglobal", &sci_clearglobal, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isglobal", &sci_isglobal, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getos", &sci_getos, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getscilabmode", &sci_getscilabmode, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"with_module", &sci_with_module, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"lasterror", &sci_lasterror, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"warning", &sci_warning, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getmd5", &sci_getmd5, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"error", &sci_error, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pause", &sci_pause, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"resume", &sci_resume, MODULE_NAME));
-    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));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"sciargs", &sci_sciargs, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"format", &sci_format, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"ieee", &sci_ieee, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"type", &sci_type, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getmodules", &sci_getmodules, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getdebuginfo", &sci_getdebuginfo, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getversion", &sci_getversion, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"clear", &sci_clear, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"banner", &sci_banner, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"quit", &sci_quit, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"exit", &sci_exit, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"exists", &sci_exists, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"isdef", &sci_isdef, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"argn", &sci_argn, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"global", &sci_global, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"clearglobal", &sci_clearglobal, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"isglobal", &sci_isglobal, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getos", &sci_getos, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getscilabmode", &sci_getscilabmode, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"with_module", &sci_with_module, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"lasterror", &sci_lasterror, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"warning", &sci_warning, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getmd5", &sci_getmd5, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"error", &sci_error, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"pause", &sci_pause, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"resume", &sci_resume, MODULE_NAME));
+    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));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"sciargs", &sci_sciargs, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"format", &sci_format, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"ieee", &sci_ieee, MODULE_NAME));
     return 1;
 }
index 689cff6..d2494d9 100644 (file)
 
 extern "C"
 {
-   #include "gw_dynamic_link.h"
+#include "gw_dynamic_link.h"
 }
 
 int DynamicLinkModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getdynlibext", &sci_getdynlibext, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"link", &sci_link, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ulink", &sci_ulink, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"c_link", &sci_c_link, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ilib_verbose", &sci_ilib_verbose, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"addinter", &sci_addinter, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getdynlibext", &sci_getdynlibext, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"link", &sci_link, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ulink", &sci_ulink, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"c_link", &sci_c_link, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ilib_verbose", &sci_ilib_verbose, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"addinter", &sci_addinter, MODULE_NAME));
     return 1;
 }
index 6651453..8ca5025 100644 (file)
@@ -22,54 +22,54 @@ extern "C"
 
 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));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"asin", &sci_asin, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"atan", &sci_atan, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ceil", &sci_ceil, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"clean", &sci_clean, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"conj", &sci_conj, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"cos", &sci_cos, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"cumprod", &sci_cumprod, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"cumsum", &sci_cumsum, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"diag", &sci_diag, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"dsearch", &sci_dsearch, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"exp", &sci_exp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"expm", &sci_expm, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"eye", &sci_eye, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"floor", &sci_floor, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"frexp", &sci_frexp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"gsort", &sci_gsort, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"imag", &sci_imag, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"imult", &sci_imult, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"int", &sci_int, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"isreal", &sci_isreal, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"isequal", &sci_isequal, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"kron", &sci_kron, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"log", &sci_log, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"log1p", &sci_log1p, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"matrix", &sci_matrix, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"max", &sci_max, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"min", &sci_min, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"nearfloat", &sci_nearfloat, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"number_properties", &sci_number_properties, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ones", &sci_ones, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"prod", &sci_prod, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rand", &sci_rand, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"real", &sci_real, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"round", &sci_round, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sign", &sci_sign, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sin", &sci_sin, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"size", &sci_size, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sqrt", &sci_sqrt, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sum", &sci_sum, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tan", &sci_tan, MODULE_NAME));
-    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"triu", &sci_triu, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"zeros", &sci_zeros, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rat", &sci_rat, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"base2dec", &sci_base2dec, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"dec2base", &sci_dec2base, MODULE_NAME));
+    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));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"asin", &sci_asin, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"atan", &sci_atan, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ceil", &sci_ceil, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"clean", &sci_clean, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"conj", &sci_conj, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"cos", &sci_cos, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"cumprod", &sci_cumprod, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"cumsum", &sci_cumsum, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"diag", &sci_diag, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"dsearch", &sci_dsearch, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"exp", &sci_exp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"expm", &sci_expm, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"eye", &sci_eye, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"floor", &sci_floor, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"frexp", &sci_frexp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"gsort", &sci_gsort, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"imag", &sci_imag, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"imult", &sci_imult, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"int", &sci_int, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"isreal", &sci_isreal, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"isequal", &sci_isequal, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"kron", &sci_kron, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"log", &sci_log, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"log1p", &sci_log1p, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"matrix", &sci_matrix, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"max", &sci_max, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"min", &sci_min, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"nearfloat", &sci_nearfloat, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"number_properties", &sci_number_properties, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ones", &sci_ones, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"prod", &sci_prod, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"rand", &sci_rand, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"real", &sci_real, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"round", &sci_round, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sign", &sci_sign, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sin", &sci_sin, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"size", &sci_size, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sqrt", &sci_sqrt, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sum", &sci_sum, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"tan", &sci_tan, MODULE_NAME));
+    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"triu", &sci_triu, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"zeros", &sci_zeros, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"rat", &sci_rat, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"base2dec", &sci_base2dec, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"dec2base", &sci_dec2base, MODULE_NAME));
     return 1;
 }
index 3328c32..40d8a33 100644 (file)
@@ -110,7 +110,7 @@ types::Function::ReturnValue sci_gsort(types::typed_list &in, int _iRetCount, ty
     {
         types::Double* pDblIn = in[0]->getAs<types::Double>();
         // doc says : "With complex numbers, gsort can be overloaded"
-        if (pDblIn->isComplex() && symbol::Context::getInstance()->get_fun(symbol::Symbol(L"%_gsort")))
+        if (pDblIn->isComplex() && symbol::Context::getInstance()->getFunction(symbol::Symbol(L"%_gsort")))
         {
             if (_iRetCount == 2)
             {
index d38b704..dfb3454 100644 (file)
 
 extern "C"
 {
-       #include "gw_fileio.h"
+#include "gw_fileio.h"
 }
 
 using namespace types;
 
 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));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pwd", &sci_pwd, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mopen", &sci_mopen, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mclose", &sci_mclose, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mput", &sci_mput, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mget", &sci_mget, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mputl", &sci_mputl, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mgetl", &sci_mgetl, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pathconvert", &sci_pathconvert, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isdir", &sci_isdir, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"filesep", &sci_filesep, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileparts", &sci_fileparts, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"findfiles", &sci_findfiles, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"basename", &sci_basename, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"isfile", &sci_isfile, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileinfo", &sci_fileinfo, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"deletefile", &sci_deletefile, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getshortpathname", &sci_getshortpathname, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getlongpathname", &sci_getlongpathname, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fileext", &sci_fileext, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"createdir", &sci_createdir, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fullpath", &sci_fullpath, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"copyfile", &sci_copyfile, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"removedir", &sci_removedir, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"meof", &sci_meof, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mputstr", &sci_mputstr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mgetstr", &sci_mgetstr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mseek", &sci_mseek, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mtell", &sci_mtell, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"newest", &sci_newest, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"merror", &sci_merror, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mclearerr", &sci_mclearerr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"get_absolute_file_path", &sci_get_absolute_file_path, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getrelativefilename", &sci_getrelativefilename, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"pathsep", &sci_pathsep, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mfprintf", &sci_mfprintf, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"mscanf", &sci_mscanf, MODULE_NAME));
-    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));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"cd", &sci_chdir, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"chdir", &sci_chdir, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"pwd", &sci_pwd, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mopen", &sci_mopen, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mclose", &sci_mclose, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mput", &sci_mput, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mget", &sci_mget, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mputl", &sci_mputl, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mgetl", &sci_mgetl, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"pathconvert", &sci_pathconvert, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"isdir", &sci_isdir, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"filesep", &sci_filesep, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"fileparts", &sci_fileparts, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"findfiles", &sci_findfiles, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"basename", &sci_basename, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"isfile", &sci_isfile, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"fileinfo", &sci_fileinfo, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"deletefile", &sci_deletefile, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getshortpathname", &sci_getshortpathname, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getlongpathname", &sci_getlongpathname, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"fileext", &sci_fileext, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"createdir", &sci_createdir, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"fullpath", &sci_fullpath, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"copyfile", &sci_copyfile, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"removedir", &sci_removedir, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"meof", &sci_meof, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mputstr", &sci_mputstr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mgetstr", &sci_mgetstr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mseek", &sci_mseek, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mtell", &sci_mtell, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"newest", &sci_newest, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"merror", &sci_merror, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mclearerr", &sci_mclearerr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"get_absolute_file_path", &sci_get_absolute_file_path, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getrelativefilename", &sci_getrelativefilename, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"pathsep", &sci_pathsep, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mfprintf", &sci_mfprintf, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"mscanf", &sci_mscanf, MODULE_NAME));
+    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 1;
 }
index fb5660b..e508927 100644 (file)
@@ -20,50 +20,50 @@ using namespace types;
 /*--------------------------------------------------------------------------*/
 Function::ReturnValue sci_funclist(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-       symbol::Context* pContext = symbol::Context::getInstance();
+    symbol::Context* pContext = symbol::Context::getInstance();
 
-       wchar_t* pstLibName = NULL;
-       if(in.size() > 1)
-       {
-               return Function::Error;
-       }
+    wchar_t* pstLibName = NULL;
+    if (in.size() > 1)
+    {
+        return Function::Error;
+    }
 
-       if(in.size() == 1)
-       {
-               InternalType* pIT = in[0];
+    if (in.size() == 1)
+    {
+        InternalType* pIT = in[0];
 
-               if(pIT->isString() == false)
-               {
-                       return Function::Error;
-               }
+        if (pIT->isString() == false)
+        {
+            return Function::Error;
+        }
 
-               String *pS = pIT->getAs<types::String>();
+        String *pS = pIT->getAs<types::String>();
 
-               if(pS->getSize() != 1)
-               {
-                       return Function::Error;
-               }
+        if (pS->getSize() != 1)
+        {
+            return Function::Error;
+        }
 
-               pstLibName = pS->get(0);
-       }
-       else
-       {
-               pstLibName = L"";
-       }
+        pstLibName = pS->get(0);
+    }
+    else
+    {
+        pstLibName = L"";
+    }
 
-       wstring libName(pstLibName);
-       std::list<symbol::Symbol> FuncList = pContext->get_funlist(libName);
+    wstring libName(pstLibName);
+    std::list<symbol::Symbol> FuncList = pContext->getFunctionList(libName, false);
 
-       String *pS = new String((int)FuncList.size(), 1);
+    String *pS = new String((int)FuncList.size(), 1);
 
-       std::list<symbol::Symbol>::iterator it;
-       int i = 0;
-       for(it = FuncList.begin() ; it != FuncList.end() ; it++)
-       {
-               pS->set(i++, 0, it->name_get().c_str());
-       }
+    std::list<symbol::Symbol>::iterator it;
+    int i = 0;
+    for (it = FuncList.begin() ; it != FuncList.end() ; it++)
+    {
+        pS->set(i++, 0, it->name_get().c_str());
+    }
 
-       out.push_back(pS);
-       return Function::OK;
+    out.push_back(pS);
+    return Function::OK;
 }
 /*--------------------------------------------------------------------------*/
index 8b7d546..43f828f 100644 (file)
@@ -26,59 +26,59 @@ using namespace types;
 
 Function::ReturnValue sci_whereis(types::typed_list &in, int _iRetCount, types::typed_list &out)
 {
-       InternalType *pIT = NULL;
-       wstring stModule;
+    InternalType *pIT = NULL;
+    wstring stModule;
 
-       /* Check the number of input argument */
-       if(in.size() != 1)
-       {
+    /* Check the number of input argument */
+    if (in.size() != 1)
+    {
         Scierror(999, _("%s: Wrong number of input argument(s): %d expected.\n"), "whereis", 1);
-               return Function::Error;
-       }
+        return Function::Error;
+    }
 
-       /* Check the number of output argument */
-       if(_iRetCount != 1)
-       {
+    /* Check the number of output argument */
+    if (_iRetCount != 1)
+    {
         Scierror(999, _("%s: Wrong number of output argument(s): %d expected.\n"), "whereis", 1);
-               return Function::Error;
-       }
+        return Function::Error;
+    }
 
-       if(in[0]->isString())
-       {
-               types::String* pS = in[0]->getAs<types::String>();
+    if (in[0]->isString())
+    {
+        types::String* pS = in[0]->getAs<types::String>();
 
-               if(pS->getSize() != 1)
-               {
+        if (pS->getSize() != 1)
+        {
             Scierror(999, _("%s: Wrong type for input argument #%d: A String expected.\n"), "whereis", 1);
-                       return Function::Error;
-               }
+            return Function::Error;
+        }
 
-               ;
-               pIT = symbol::Context::getInstance()->get_fun(symbol::Symbol(pS->get(0)));
-               if(pIT == NULL)
-               {
+        ;
+        pIT = symbol::Context::getInstance()->getFunction(symbol::Symbol(pS->get(0)));
+        if (pIT == NULL)
+        {
             out.push_back(types::Double::Empty());
-                       return Function::OK;
-               }
-       }
-       else
-       {
-               pIT = in[0];
-       }
+            return Function::OK;
+        }
+    }
+    else
+    {
+        pIT = in[0];
+    }
 
-       switch(pIT->getType())
-       {
-       case InternalType::RealFunction :
-       case InternalType::RealMacro :
-       case InternalType::RealMacroFile :
-               stModule = pIT->getAs<Callable>()->getModule();
-               break;
-       default :
-               out.push_back(types::Double::Empty());
-        return Function::OK;
+    switch (pIT->getType())
+    {
+        case InternalType::RealFunction :
+        case InternalType::RealMacro :
+        case InternalType::RealMacroFile :
+            stModule = pIT->getAs<Callable>()->getModule();
+            break;
+        default :
+            out.push_back(types::Double::Empty());
+            return Function::OK;
     }
 
-       out.push_back(new types::String(stModule.c_str()));
-       return Function::OK;
+    out.push_back(new types::String(stModule.c_str()));
+    return Function::OK;
 }
 /*--------------------------------------------------------------------------*/
index e7c55a4..45d178a 100644 (file)
@@ -122,7 +122,7 @@ int ScinotesModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, &ScinotesModule::LoadDeps, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, &ScinotesModule::LoadDeps, wstModuleName));
     }
 
     return 1;
@@ -143,7 +143,7 @@ int FunctionsModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -163,7 +163,7 @@ int StatisticsModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -183,7 +183,7 @@ int SignalProcessingModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -212,7 +212,7 @@ int HelptoolsModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, &HelptoolsModule::LoadDeps, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, &HelptoolsModule::LoadDeps, wstModuleName));
     }
 
     return 1;
@@ -232,7 +232,7 @@ int MatioModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -250,7 +250,7 @@ int Hdf5Module::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -270,7 +270,7 @@ int ActionBindingModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -290,7 +290,7 @@ int DifferentialEquationsModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -308,7 +308,7 @@ int SpreadsheetModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -328,7 +328,7 @@ int InterpolationModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -348,7 +348,7 @@ int SoundModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -366,7 +366,7 @@ int RandlibModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -384,7 +384,7 @@ int CacsdModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -402,7 +402,7 @@ int UmfpackModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -420,7 +420,7 @@ int OptimizationModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -438,7 +438,7 @@ int SpecialFunctionModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
@@ -456,7 +456,7 @@ int GraphicExportModule::Load()
 
     for (int i = 0 ; i < (int)vect.size() ; i++)
     {
-        symbol::Context::getInstance()->AddFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
+        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
     }
 
     return 1;
index b88e6be..90c0522 100644 (file)
@@ -39,70 +39,70 @@ void GraphicsModule::LoadDeps(void)
 
 int GraphicsModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"champ", &sci_champ, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"champ1", &sci_champ1, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fec", &sci_fec, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"geom3d", &sci_geom3d, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"grayplot", &sci_grayplot, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"Matplot", &sci_matplot, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"Matplot1", &sci_matplot1, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"contour2di", &sci_contour2di, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"param3d", &sci_param3d, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"param3d1", &sci_param3d1, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xstringb", &sci_xstringb, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d", &sci_plot2d, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d1", &sci_plot2d1_1, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d2", &sci_plot2d1_2, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d3", &sci_plot2d1_3, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot2d4", &sci_plot2d1_4, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot3d", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"plot3d1", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"winsid", &sci_winsid, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarcs", &sci_xarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xarrows", &sci_xarrows, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawaxis", &sci_drawaxis, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xchange", &sci_xchange, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xclick", &sci_xclick, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xdel", &sci_xdel, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfarcs", &sci_xfarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfpoly", &sci_xfpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfpolys", &sci_xfpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xfrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xget", &sci_xget, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgetmouse", &sci_xgetmouse, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgrid", &sci_xgrid, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xlfont", &sci_xlfont, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xpoly", &sci_xpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xpolys", &sci_xpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xrects", &sci_xrects, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xsegs", &sci_xsegs, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"show_window", &sci_show_window, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xset", &sci_xset, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xstring", &sci_xstring, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xtitle", &sci_xtitle, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xgraduate", &sci_xgraduate, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xname", &sci_xname, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"zoom_rect", &sci_zoom_rect, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"unzoom", &sci_unzoom, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"stringbox", &sci_stringbox, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"move", &sci_move, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"glue", &sci_glue, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"unglue", &sci_unglue, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawnow", &sci_drawnow, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"drawlater", &sci_drawlater, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"copy", &sci_copy, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"delete", &sci_delete, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"get", &sci_get, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"set", &sci_set, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"newaxes", &sci_newaxes, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"relocate_handle", &sci_relocate_handle, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"swap_handles", &sci_swap_handles, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rubberbox", &sci_rubberbox, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rotate_axes", &sci_rotate_axes, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"is_handle_valid", &sci_is_handle_valid, &GraphicsModule::LoadDeps, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"captions", &sci_Legend, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"champ", &sci_champ, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"champ1", &sci_champ1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"fec", &sci_fec, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"geom3d", &sci_geom3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"grayplot", &sci_grayplot, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"Matplot", &sci_matplot, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"Matplot1", &sci_matplot1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"contour2di", &sci_contour2di, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"param3d", &sci_param3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"param3d1", &sci_param3d1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xstringb", &sci_xstringb, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot2d", &sci_plot2d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot2d1", &sci_plot2d1_1, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot2d2", &sci_plot2d1_2, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot2d3", &sci_plot2d1_3, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot2d4", &sci_plot2d1_4, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot3d", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"plot3d1", &sci_plot3d, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"winsid", &sci_winsid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xarcs", &sci_xarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xarrows", &sci_xarrows, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"drawaxis", &sci_drawaxis, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xchange", &sci_xchange, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xclick", &sci_xclick, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xdel", &sci_xdel, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xfarc", &sci_xarc, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xfarcs", &sci_xfarcs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xfpoly", &sci_xfpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xfpolys", &sci_xfpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xfrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xget", &sci_xget, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xgetmouse", &sci_xgetmouse, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xgrid", &sci_xgrid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xlfont", &sci_xlfont, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xpoly", &sci_xpoly, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xpolys", &sci_xpolys, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xrect", &sci_xrect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xrects", &sci_xrects, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xsegs", &sci_xsegs, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"show_window", &sci_show_window, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xset", &sci_xset, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xstring", &sci_xstring, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xtitle", &sci_xtitle, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xgraduate", &sci_xgraduate, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xname", &sci_xname, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"zoom_rect", &sci_zoom_rect, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"unzoom", &sci_unzoom, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"stringbox", &sci_stringbox, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"move", &sci_move, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"glue", &sci_glue, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"unglue", &sci_unglue, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"drawnow", &sci_drawnow, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"drawlater", &sci_drawlater, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"copy", &sci_copy, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"delete", &sci_delete, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"get", &sci_get, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"set", &sci_set, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"newaxes", &sci_newaxes, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"relocate_handle", &sci_relocate_handle, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"swap_handles", &sci_swap_handles, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"rubberbox", &sci_rubberbox, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"rotate_axes", &sci_rotate_axes, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"is_handle_valid", &sci_is_handle_valid, &GraphicsModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"captions", &sci_Legend, &GraphicsModule::LoadDeps, MODULE_NAME));
     return 1;
 }
index d6e51fa..068ac44 100644 (file)
@@ -17,7 +17,7 @@
 #define MODULE_NAME L"gui"
 extern "C"
 {
-       #include "gw_gui.h"
+#include "gw_gui.h"
 #include "loadOnUseClassPath.h"
 }
 
@@ -35,42 +35,42 @@ void GuiModule::LoadDeps(void)
 }
 int GuiModule::Load()
 {
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_dialog", &sci_x_dialog, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_choose", &sci_x_choose, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_mdialog", &sci_x_mdialog, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"xchoicesi", &sci_x_choice, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"delmenu", &sci_delmenu, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"setmenu", &sci_setmenu, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"unsetmenu", &sci_unsetmenu, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"raise_window", &sci_raise_window, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getlookandfeel", &sci_getlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getinstalledlookandfeels", &sci_getinstalledlookandfeels, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"setlookandfeel", &sci_setlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"ClipBoard", &sci_ClipBoard, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"toolbar", &sci_toolbar, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetdir", &sci_uigetdir, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uicontrol", &sci_uicontrol, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uimenu", &sci_uimenu, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uipopup", &sci_mpopup, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"x_choose_modeless", &sci_x_choose_modeless, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uicontextmenu", &sci_uicontextmenu, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiwait", &sci_uiwait, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"messagebox", &sci_messagebox, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"waitbar", &sci_waitbar, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"progressionbar", &sci_progressionbar, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"helpbrowser", &sci_helpbrowser, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetfont", &sci_uigetfont, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetcolor", &sci_uigetcolor, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"getcallbackobject", &sci_getcallbackobject, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"printfigure", &sci_printfigure, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"exportUI", &sci_exportUI, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"printsetupbox", &sci_printsetupbox, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"toprint", &sci_toprint, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uigetfile", &sci_uigetfile, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"usecanvas", &sci_usecanvas, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiDisplayTree", &sci_displaytree, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uiputfile", &sci_uiputfile, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"about", &sci_about, &GuiModule::LoadDeps, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"fire_closing_finished", &sci_fire_closing_finished, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"x_dialog", &sci_x_dialog, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"x_choose", &sci_x_choose, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"x_mdialog", &sci_x_mdialog, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"xchoicesi", &sci_x_choice, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"delmenu", &sci_delmenu, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"setmenu", &sci_setmenu, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"unsetmenu", &sci_unsetmenu, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"raise_window", &sci_raise_window, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getlookandfeel", &sci_getlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getinstalledlookandfeels", &sci_getinstalledlookandfeels, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"setlookandfeel", &sci_setlookandfeel, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"ClipBoard", &sci_ClipBoard, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"toolbar", &sci_toolbar, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uigetdir", &sci_uigetdir, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uicontrol", &sci_uicontrol, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uimenu", &sci_uimenu, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uipopup", &sci_mpopup, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"x_choose_modeless", &sci_x_choose_modeless, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uicontextmenu", &sci_uicontextmenu, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uiwait", &sci_uiwait, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"messagebox", &sci_messagebox, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"waitbar", &sci_waitbar, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"progressionbar", &sci_progressionbar, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"helpbrowser", &sci_helpbrowser, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uigetfont", &sci_uigetfont, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uigetcolor", &sci_uigetcolor, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"getcallbackobject", &sci_getcallbackobject, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"printfigure", &sci_printfigure, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"exportUI", &sci_exportUI, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"printsetupbox", &sci_printsetupbox, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"toprint", &sci_toprint, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uigetfile", &sci_uigetfile, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"usecanvas", &sci_usecanvas, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uiDisplayTree", &sci_displaytree, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uiputfile", &sci_uiputfile, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"about", &sci_about, &GuiModule::LoadDeps, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"fire_closing_finished", &sci_fire_closing_finished, &GuiModule::LoadDeps, MODULE_NAME));
     return 1;
 }
index f16efb7..23aed0a 100644 (file)
 
 int HistoryManagerModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"loadhistory", &sci_loadhistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"addhistory",   &sci_addhistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"displayhistory",   &sci_displayhistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"gethistoryfile",   &sci_gethistoryfile, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"gethistory", &sci_gethistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"historymanager",   &sci_historymanager, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"historysize",   &sci_historysize, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"removelinehistory",   &sci_removelinehistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"resethistory", &sci_resethistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"saveafterncommands",   &sci_saveafterncommands, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"saveconsecutivecommands",   &sci_saveconsecutivecommands, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"savehistory", &sci_savehistory, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sethistoryfile",   &sci_sethistoryfile, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"loadhistory", &sci_loadhistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"addhistory",   &sci_addhistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"displayhistory",   &sci_displayhistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"gethistoryfile",   &sci_gethistoryfile, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"gethistory", &sci_gethistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"historymanager",   &sci_historymanager, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"historysize",   &sci_historysize, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"removelinehistory",   &sci_removelinehistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"resethistory", &sci_resethistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"saveafterncommands",   &sci_saveafterncommands, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"saveconsecutivecommands",   &sci_saveconsecutivecommands, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"savehistory", &sci_savehistory, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sethistoryfile",   &sci_sethistoryfile, MODULE_NAME));
 
     return true;
 }
index 47c1568..eddd757 100644 (file)
 
 extern "C"
 {
-       #include "gw_integer.h"
+#include "gw_integer.h"
 }
 
 using namespace types;
 
 int IntegerModule::Load()
 {
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"int8", &sci_integer8, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint8", &sci_uinteger8, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"int16", &sci_integer16, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint16", &sci_uinteger16, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"int32", &sci_integer32, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint32", &sci_uinteger32, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"int64", &sci_integer64, MODULE_NAME));
-       symbol::Context::getInstance()->AddFunction(Function::createFunction(L"uint64", &sci_uinteger64, 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 1;
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"int8", &sci_integer8, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uint8", &sci_uinteger8, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"int16", &sci_integer16, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uint16", &sci_uinteger16, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"int32", &sci_integer32, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uint32", &sci_uinteger32, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"int64", &sci_integer64, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"uint64", &sci_uinteger64, 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 1;
 }
index 8e3349f..78c0162 100644 (file)
@@ -23,12 +23,12 @@ using namespace types;
 
 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));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"file", &sci_file, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(Function::createFunction(L"host", &sci_host, MODULE_NAME));
-    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));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"load", &sci_load, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"genlib", &sci_genlib, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"file", &sci_file, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(Function::createFunction(L"host", &sci_host, MODULE_NAME));
+    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 1;
 }
index 9f46bc6..49f2020 100644 (file)
 
 extern "C"
 {
-    #include "gw_jvm.h"
+#include "gw_jvm.h"
 }
 
 #define MODULE_NAME L"jvm"
 
 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));
+    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 1;
 }
index cdb35c8..d86da58 100644 (file)
 #include "linear_algebra_gw.hxx"
 extern "C"
 {
-    #include "gw_linear_algebra.h"
+#include "gw_linear_algebra.h"
 }
 
 #define MODULE_NAME L"linear_algebra"
 
 int LinearAlgebraModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"chol", &sci_chol, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"bdiag", &sci_bdiag, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"svd", &sci_svd, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"rcond", &sci_rcond, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"qr", &sci_qr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"lu", &sci_lu, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"lsq", &sci_lsq, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inv", &sci_inv, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"hess", &sci_hess, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spec", &sci_spec, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"det", &sci_det, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"balanc", &sci_balanc, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"schur", &sci_schur, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"chol", &sci_chol, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"bdiag", &sci_bdiag, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"svd", &sci_svd, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"rcond", &sci_rcond, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"qr", &sci_qr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lu", &sci_lu, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"lsq", &sci_lsq, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inv", &sci_inv, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"hess", &sci_hess, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spec", &sci_spec, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"det", &sci_det, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"balanc", &sci_balanc, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"schur", &sci_schur, MODULE_NAME));
     return true;
 }
index 52223b2..2cd033c 100644 (file)
@@ -25,11 +25,11 @@ extern "C"
 
 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));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"setdefaultlanguage", &sci_setdefaultlanguage, MODULE_NAME));
-    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));
+    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));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"setdefaultlanguage", &sci_setdefaultlanguage, MODULE_NAME));
+    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 1;
 }
index f7faa4d..048a75a 100644 (file)
@@ -102,38 +102,38 @@ mxClassID mxGetClassID(const mxArray *ptr)
 
     switch (type)
     {
-    case types::InternalType::RealInt8:
-        return mxINT8_CLASS;
-    case types::InternalType::RealUInt8:
-        return mxUINT8_CLASS;
-    case types::InternalType::RealInt16:
-        return mxINT16_CLASS;
-    case types::InternalType::RealUInt16:
-        return mxUINT16_CLASS;
-    case types::InternalType::RealInt32:
-        return mxINT32_CLASS;
-    case types::InternalType::RealUInt32:
-        return mxUINT32_CLASS;
-    case types::InternalType::RealInt64:
-        return mxINT64_CLASS;
-    case types::InternalType::RealUInt64:
-        return mxUINT64_CLASS;
-    case types::InternalType::RealString:
-        return mxCHAR_CLASS;
-    case types::InternalType::RealDouble:
-        return mxDOUBLE_CLASS;
-    case types::InternalType::RealBool:
-        return mxLOGICAL_CLASS;
-    case types::InternalType::RealFloat:
-        return mxSINGLE_CLASS;
-    case types::InternalType::RealStruct:
-        return mxSTRUCT_CLASS;
-    case types::InternalType::RealCell:
-        return mxCELL_CLASS;
-    case types::InternalType::RealFunction:
-        return mxFUNCTION_CLASS;
-    default:
-        return mxUNKNOWN_CLASS;
+        case types::InternalType::RealInt8:
+            return mxINT8_CLASS;
+        case types::InternalType::RealUInt8:
+            return mxUINT8_CLASS;
+        case types::InternalType::RealInt16:
+            return mxINT16_CLASS;
+        case types::InternalType::RealUInt16:
+            return mxUINT16_CLASS;
+        case types::InternalType::RealInt32:
+            return mxINT32_CLASS;
+        case types::InternalType::RealUInt32:
+            return mxUINT32_CLASS;
+        case types::InternalType::RealInt64:
+            return mxINT64_CLASS;
+        case types::InternalType::RealUInt64:
+            return mxUINT64_CLASS;
+        case types::InternalType::RealString:
+            return mxCHAR_CLASS;
+        case types::InternalType::RealDouble:
+            return mxDOUBLE_CLASS;
+        case types::InternalType::RealBool:
+            return mxLOGICAL_CLASS;
+        case types::InternalType::RealFloat:
+            return mxSINGLE_CLASS;
+        case types::InternalType::RealStruct:
+            return mxSTRUCT_CLASS;
+        case types::InternalType::RealCell:
+            return mxCELL_CLASS;
+        case types::InternalType::RealFunction:
+            return mxFUNCTION_CLASS;
+        default:
+            return mxUNKNOWN_CLASS;
     }
 }
 
@@ -300,7 +300,8 @@ int mxGetNumberOfDimensions(const mxArray *ptr)
 
     types::GenericType *pGT = pIT->getAs<types::GenericType>();
     if (pGT == NULL)
-    {                           //InternalType but not GenericType, so mono dimension type.
+    {
+        //InternalType but not GenericType, so mono dimension type.
         return 1;
     }
 
@@ -317,16 +318,16 @@ int *mxGetDimensions(const mxArray *ptr)
 
     switch (pIT->getType())
     {
-    case types::InternalType::RealList:
-    case types::InternalType::RealMList:
-    case types::InternalType::RealTList:
+        case types::InternalType::RealList:
+        case types::InternalType::RealMList:
+        case types::InternalType::RealTList:
         {
             int *piDims = (int *) MALLOC(sizeof(int));
 
             piDims[0] = pIT->getAs<types::Container>()->getSize();
             return piDims;
         }
-    default:
+        default:
         {
             types::GenericType *pGT = pIT->getAs<types::GenericType>();
             if (pGT == NULL)
@@ -446,8 +447,8 @@ bool mxIsChar(const mxArray *ptr)
 bool mxIsNumeric(const mxArray *ptr)
 {
     return mxIsDouble(ptr) || mxIsSingle(ptr) ||
-        mxIsInt8(ptr) || mxIsUint8(ptr) ||
-        mxIsInt16(ptr) || mxIsUint16(ptr) || mxIsInt32(ptr) || mxIsUint32(ptr) || mxIsInt64(ptr) || mxIsUint64(ptr);
+           mxIsInt8(ptr) || mxIsUint8(ptr) ||
+           mxIsInt16(ptr) || mxIsUint16(ptr) || mxIsInt32(ptr) || mxIsUint32(ptr) || mxIsInt64(ptr) || mxIsUint64(ptr);
 }
 
 bool mxIsDouble(const mxArray *ptr)
@@ -464,7 +465,8 @@ bool mxIsEmpty(const mxArray *ptr)
 {
     types::InternalType * pIT = (types::InternalType *) ptr;
     if (pIT == NULL)
-    {                           //true or false, whatever ;)
+    {
+        //true or false, whatever ;)
         return true;
     }
 
@@ -473,12 +475,12 @@ bool mxIsEmpty(const mxArray *ptr)
         case types::InternalType::RealDouble:
         {
             types::Double *pD = pIT->getAs<types::Double>();
-           return pD->getSize() == 0;
+            return pD->getSize() == 0;
         }
         case types::InternalType::RealCell:
         {
             types::Cell *pC = pIT->getAs<types::Cell>();
-         return pC->getSize() == 0;
+            return pC->getSize() == 0;
         }
         case types::InternalType::RealContainer:
         case types::InternalType::RealList:
@@ -489,7 +491,8 @@ bool mxIsEmpty(const mxArray *ptr)
             return pC->getSize() == 0;
         }
         default:
-        {                       //other type can not be empty
+        {
+            //other type can not be empty
             return false;
         }
     }
@@ -509,7 +512,7 @@ bool mxIsSparse(const mxArray *ptr)
 
 bool mxIsLogical(const mxArray *ptr)
 {
-    return mxGetClassID(ptr)==mxLOGICAL_CLASS;
+    return mxGetClassID(ptr) == mxLOGICAL_CLASS;
 }
 
 void mxSetLogical(mxArray *ptr)
@@ -916,35 +919,35 @@ mxArray *mxCreateNumericArray(int ndim, const int *dims, mxClassID CLASS, mxComp
 
     switch (CLASS)
     {
-    case mxDOUBLE_CLASS:
-        ptr = new types::Double(ndim, (int *) dims, complexFlag == mxCOMPLEX);
-        break;
-    case mxINT8_CLASS:
-        ptr = new types::Int8(ndim, (int *) dims);
-        break;
-    case mxUINT8_CLASS:
-        ptr = new types::UInt8(ndim, (int *) dims);
-        break;
-    case mxINT16_CLASS:
-        ptr = new types::Int16(ndim, (int *) dims);
-        break;
-    case mxUINT16_CLASS:
-        ptr = new types::UInt16(ndim, (int *) dims);
-        break;
-    case mxINT32_CLASS:
-        ptr = new types::Int32(ndim, (int *) dims);
-        break;
-    case mxUINT32_CLASS:
-        ptr = new types::UInt32(ndim, (int *) dims);
-        break;
-    case mxINT64_CLASS:
-        ptr = new types::Int64(ndim, (int *) dims);
-        break;
-    case mxUINT64_CLASS:
-        ptr = new types::UInt64(ndim, (int *) dims);
-        break;
-    default:
-        ptr = NULL;
+        case mxDOUBLE_CLASS:
+            ptr = new types::Double(ndim, (int *) dims, complexFlag == mxCOMPLEX);
+            break;
+        case mxINT8_CLASS:
+            ptr = new types::Int8(ndim, (int *) dims);
+            break;
+        case mxUINT8_CLASS:
+            ptr = new types::UInt8(ndim, (int *) dims);
+            break;
+        case mxINT16_CLASS:
+            ptr = new types::Int16(ndim, (int *) dims);
+            break;
+        case mxUINT16_CLASS:
+            ptr = new types::UInt16(ndim, (int *) dims);
+            break;
+        case mxINT32_CLASS:
+            ptr = new types::Int32(ndim, (int *) dims);
+            break;
+        case mxUINT32_CLASS:
+            ptr = new types::UInt32(ndim, (int *) dims);
+            break;
+        case mxINT64_CLASS:
+            ptr = new types::Int64(ndim, (int *) dims);
+            break;
+        case mxUINT64_CLASS:
+            ptr = new types::UInt64(ndim, (int *) dims);
+            break;
+        default:
+            ptr = NULL;
     }
     return (mxArray *) ptr;
 }
@@ -1130,7 +1133,7 @@ int mxGetString(const mxArray *ptr, char *str, int strl)
         wchar_t *to_copy = pa->get(k);
         char *dest = wide_string_to_UTF8(to_copy);
         int length = (int)strlen(dest);
-        memcpy(str+index, dest, free_space);
+        memcpy(str + index, dest, free_space);
         index += Min(length, free_space);
         free_space -= length;
         FREE(dest);
@@ -1163,7 +1166,7 @@ char *mxArrayToString(const mxArray *ptr)
     {
         char *dest = wide_string_to_UTF8(wstrings[k]);
         int dest_length = strlen(dest);
-        memcpy(str+index, dest, dest_length);
+        memcpy(str + index, dest, dest_length);
         index += dest_length;
     }
     str[index] = '\0';
@@ -1357,7 +1360,7 @@ int mexCallSCILAB(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs, const char
 
     types::InternalType *value = context->get(*symbol);
     types::Function *func = value->getAs<types::Function>();
-    if(func == NULL)
+    if (func == NULL)
     {
         return 1;
     }
@@ -1365,14 +1368,14 @@ int mexCallSCILAB(int nlhs, mxArray **plhs, int nrhs, mxArray **prhs, const char
     types::typed_list in;
     types::typed_list out;
     types::optional_list opt;
-    for(int i = 0; i < nrhs; i++)
+    for (int i = 0; i < nrhs; i++)
     {
         in.push_back((types::InternalType*)prhs[i]);
     }
 
     func->call(in, opt, nlhs, out, NULL);
 
-    for(int i = 0; i < nlhs; i++)
+    for (int i = 0; i < nlhs; i++)
     {
         plhs[i] = (mxArray *) (out[i]);
     }
@@ -1390,7 +1393,7 @@ int mxCalcSingleSubscript(const mxArray *ptr, int nsubs, const int *subs)
     int index = 0;
     int iMult = 1;
     int *dims = mxGetDimensions(ptr);
-    for(int i = 0; i < nsubs; i++)
+    for (int i = 0; i < nsubs; i++)
     {
         index += subs[i] * iMult;
         iMult *= dims[i];
@@ -1492,7 +1495,7 @@ int mexEvalString(const char *name)
     bool bMute = true;
     Parser parser;
     parser.parse(to_wide_string(name));
-    if(parser.getExitStatus() !=  Parser::Succeded)
+    if (parser.getExitStatus() !=  Parser::Succeded)
     {
         //mexPrintf(wide_string_to_UTF8(parser.getErrorMessage()));
         return 1;
@@ -1500,7 +1503,7 @@ int mexEvalString(const char *name)
 
     Exp *pExp = parser.getTree();
 
-    if(pExp == NULL)
+    if (pExp == NULL)
     {
         //mexPrintf("pExp is NULL");
         return 1;
@@ -1508,14 +1511,14 @@ int mexEvalString(const char *name)
 
     //save current prompt mode
     int oldVal = ConfigVariable::getPromptMode();
-    if(bMute)
+    if (bMute)
     {
         ConfigVariable::setPromptMode(-1);
     }
     std::list<Exp *>::iterator j;
     std::list<Exp *>LExp = ((SeqExp*)pExp)->exps_get();
 
-    for(j = LExp.begin() ; j != LExp.end() ; j++)
+    for (j = LExp.begin() ; j != LExp.end() ; j++)
     {
         try
         {
@@ -1524,7 +1527,7 @@ int mexEvalString(const char *name)
             (*j)->accept(execMe);
 
             //to manage call without ()
-            if(execMe.result_get() != NULL && execMe.result_get()->getAs<Callable>())
+            if (execMe.result_get() != NULL && execMe.result_get()->getAs<Callable>())
             {
                 Callable *pCall = execMe.result_get()->getAs<Callable>();
                 types::typed_list out;
@@ -1534,34 +1537,34 @@ int mexEvalString(const char *name)
                 {
                     ExecVisitor execCall;
                     Function::ReturnValue Ret = pCall->call(in, opt, 1, out, &execCall);
-                    if(Ret == Callable::OK)
+                    if (Ret == Callable::OK)
                     {
-                        if(out.size() == 0)
+                        if (out.size() == 0)
                         {
                             execMe.result_set(NULL);
                         }
-                        else if(out.size() == 1)
+                        else if (out.size() == 1)
                         {
                             out[0]->DecreaseRef();
                             execMe.result_set(out[0]);
                         }
                         else
                         {
-                            for(int i = 0 ; i < static_cast<int>(out.size()) ; i++)
+                            for (int i = 0 ; i < static_cast<int>(out.size()) ; i++)
                             {
                                 out[i]->DecreaseRef();
                                 execMe.result_set(i, out[i]);
                             }
                         }
                     }
-                    else if(Ret == Callable::Error)
+                    else if (Ret == Callable::Error)
                     {
-                        if(ConfigVariable::getLastErrorFunction() == L"")
+                        if (ConfigVariable::getLastErrorFunction() == L"")
                         {
                             ConfigVariable::setLastErrorFunction(pCall->getName());
                         }
 
-                        if(pCall->isMacro() || pCall->isMacroFile())
+                        if (pCall->isMacro() || pCall->isMacroFile())
                         {
                             wchar_t szError[bsiz];
                             os_swprintf(szError, bsiz, _W("at line % 5d of function %ls called by :\n"), (*j)->location_get().first_line, pCall->getName().c_str());
@@ -1573,18 +1576,18 @@ int mexEvalString(const char *name)
                         }
                     }
                 }
-                catch(ScilabMessage sm)
+                catch (ScilabMessage sm)
                 {
                     wostringstream os;
                     PrintVisitor printMe(os);
                     (*j)->accept(printMe);
                     os << std::endl << std::endl;
-                    if(ConfigVariable::getLastErrorFunction() == L"")
+                    if (ConfigVariable::getLastErrorFunction() == L"")
                     {
                         ConfigVariable::setLastErrorFunction(pCall->getName());
                     }
 
-                    if(pCall->isMacro() || pCall->isMacroFile())
+                    if (pCall->isMacro() || pCall->isMacroFile())
                     {
                         wstring szAllError;
                         wchar_t szError[bsiz];
@@ -1603,10 +1606,10 @@ int mexEvalString(const char *name)
             }
 
             //update ans variable.
-            if(execMe.result_get() != NULL && execMe.result_get()->isDeletable())
+            if (execMe.result_get() != NULL && execMe.result_get()->isDeletable())
             {
                 symbol::Context::getInstance()->put(symbol::Symbol(L"ans"), *execMe.result_get());
-                if((*j)->is_verbose() && bErrCatch == false)
+                if ((*j)->is_verbose() && bErrCatch == false)
                 {
                     std::wostringstream ostr;
                     ostr << L"ans = " << std::endl;
@@ -1617,20 +1620,21 @@ int mexEvalString(const char *name)
                 }
             }
         }
-        catch(ScilabMessage sm)
+        catch (ScilabMessage sm)
         {
-            if(bErrCatch  == false && bMute == false)
+            if (bErrCatch  == false && bMute == false)
             {
                 scilabErrorW(sm.GetErrorMessage().c_str());
 
                 CallExp* pCall = dynamic_cast<CallExp*>(*j);
-                if(pCall != NULL)
-                {//to print call expression only of it is a macro
+                if (pCall != NULL)
+                {
+                    //to print call expression only of it is a macro
                     ExecVisitor execFunc;
                     pCall->name_get().accept(execFunc);
 
-                    if(execFunc.result_get() != NULL &&
-                        (execFunc.result_get()->isMacro() || execFunc.result_get()->isMacroFile()))
+                    if (execFunc.result_get() != NULL &&
+                            (execFunc.result_get()->isMacro() || execFunc.result_get()->isMacroFile()))
                     {
                         wostringstream os;
 
@@ -1644,7 +1648,7 @@ int mexEvalString(const char *name)
                         os_swprintf(szError, bsiz, _W("at line % 5d of exec file called by :\n"), (*j)->location_get().first_line);
                         os << szError;
 
-                        if(ConfigVariable::getLastErrorFunction() == L"")
+                        if (ConfigVariable::getLastErrorFunction() == L"")
                         {
                             ConfigVariable::setLastErrorFunction(execFunc.result_get()->getAs<Callable>()->getName());
                         }
@@ -1662,9 +1666,9 @@ int mexEvalString(const char *name)
                 break;
             }
         }
-        catch(ScilabError se)
+        catch (ScilabError se)
         {
-            if(ConfigVariable::getLastErrorMessage() == L"")
+            if (ConfigVariable::getLastErrorMessage() == L"")
             {
                 ConfigVariable::setLastErrorMessage(se.GetErrorMessage());
                 ConfigVariable::setLastErrorNumber(se.GetErrorNumber());
@@ -1674,7 +1678,7 @@ int mexEvalString(const char *name)
 
             //store message
             iErr = ConfigVariable::getLastErrorNumber();
-            if(bErrCatch == false)
+            if (bErrCatch == false)
             {
                 //in case of error, change mode to 2 ( prompt )
                 ConfigVariable::setPromptMode(2);
@@ -1738,7 +1742,7 @@ int mexPutVariable(const char *workspace, const char *varname, const mxArray *pm
     wchar_t *dest = to_wide_string(varname);
     if (strcmp(workspace, "base") == 0)
     {
-        context->put_in_previous_scope(*(new symbol::Symbol(dest)), *(types::InternalType *) pm);
+        context->putInPreviousScope(*(new symbol::Symbol(dest)), *(types::InternalType *) pm);
     }
     else if (strcmp(workspace, "caller") == 0)
     {
@@ -1906,8 +1910,9 @@ int mxSetDimensions(mxArray *array_ptr, const int *dims, int ndim)
     {
         ((types::Double *) array_ptr)->resize((int *) dims, ndim);
     }
-     else if (mxIsFunction(array_ptr)) {
-         //((types::Function *) array_ptr)->resize((int *) dims, ndim);
+    else if (mxIsFunction(array_ptr))
+    {
+        //((types::Function *) array_ptr)->resize((int *) dims, ndim);
     }
     // else if (mxIsSparse(array_ptr)) {
     //     TODO: we don't have Sparse classes yet
index 7d5e6e4..418da7f 100644 (file)
 
 extern "C"
 {
-    #include "gw_output_stream.h"
+#include "gw_output_stream.h"
 }
 
 #define MODULE_NAME L"output_stream"
 
 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"sprintf", &sci_msprintf, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"printf", &sci_mprintf, 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));
+    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"sprintf", &sci_msprintf, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"printf", &sci_mprintf, 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 1;
 }
index 5c4c492..9206d46 100644 (file)
 
 int PolynomialsModule::Load()
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"poly", &sci_poly, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"varn", &sci_varn, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"roots", &sci_roots, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"coeff", &sci_coeff, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"degree", &sci_degree, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"pppdiv", &sci_pppdiv, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"simp_mode", &sci_simpMode, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"simp", &sci_simp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sfact", &sci_sfact, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"bezout", &sci_bezout, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"poly", &sci_poly, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"varn", &sci_varn, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"roots", &sci_roots, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"coeff", &sci_coeff, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"degree", &sci_degree, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"pppdiv", &sci_pppdiv, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"simp_mode", &sci_simpMode, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"simp", &sci_simp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sfact", &sci_sfact, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"bezout", &sci_bezout, MODULE_NAME));
     return 1;
 }
 
index ca6f341..065dcea 100644 (file)
 
 extern "C"
 {
-    #include "gw_string.h"
+#include "gw_string.h"
 }
 
 #define MODULE_NAME L"string"
 
 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));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"regexp", &sci_regexp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"part", &sci_part, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"length", &sci_length, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strindex", &sci_strindex, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strsubst", &sci_strsubst, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strsplit", &sci_strsplit, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"ascii", &sci_ascii, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strcat", &sci_strcat, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"string", &sci_string, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"convstr", &sci_convstr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strncpy", &sci_strncpy, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strrchr", &sci_strrchr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strchr", &sci_strchr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strstr", &sci_strstr, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strrev", &sci_strrev, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strtod", &sci_strtod, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tokens", &sci_tokens, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"strcmp", &sci_strcmp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"isletter", &sci_isletter, MODULE_NAME));
-    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));
+    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));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"regexp", &sci_regexp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"part", &sci_part, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"length", &sci_length, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strindex", &sci_strindex, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strsubst", &sci_strsubst, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strsplit", &sci_strsplit, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"ascii", &sci_ascii, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strcat", &sci_strcat, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"string", &sci_string, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"convstr", &sci_convstr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strncpy", &sci_strncpy, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strrchr", &sci_strrchr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strchr", &sci_strchr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strstr", &sci_strstr, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strrev", &sci_strrev, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strtod", &sci_strtod, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"tokens", &sci_tokens, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"strcmp", &sci_strcmp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"isletter", &sci_isletter, MODULE_NAME));
+    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 1;
 }
index 9d184e4..81f6ba3 100644 (file)
@@ -60,11 +60,10 @@ public :
 
     /** If key was associated to some Entry_T in the open scopes, return the
      ** most recent insertion. Otherwise return the empty pointer. */
-    types::InternalType*       get_fun(const symbol::Symbol& key) const;
+    types::InternalType*       getFunction(const symbol::Symbol& key) const;
 
     /*return function list in the module _stModuleName*/
-    std::list<symbol::Symbol>& get_funlist(const std::wstring& _stModuleName);
-
+    std::list<symbol::Symbol>& getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd = true);
 
     /* global functions */
 
@@ -98,12 +97,12 @@ public :
     /*add symbol and value in the stack*/
     bool put(const symbol::Symbol& key, types::InternalType &type);
     /*add symbol and value in the previous scope*/
-    bool put_in_previous_scope(const symbol::Symbol& key, types::InternalType &type);
+    bool putInPreviousScope(const symbol::Symbol& key, types::InternalType &type);
 
     /* remove symbol/value association */
     bool remove(const symbol::Symbol& key);
 
-    bool AddFunction(types::Function *_info);
+    bool addFunction(types::Function *_info);
     bool AddMacro(types::Macro *_info);
     bool AddMacroFile(types::MacroFile *_info);
     void print(std::wostream& ostr) const
index 4531d0f..6f2a4ae 100644 (file)
 namespace symbol
 {
 
-    /*-----------------------------------------------------------------------.
-    | This implements stacks for storing definitions of variables and        |
-    | functions as a stack of dictionnaries.  Each time a scope is opened, a |
-    | new dictionnary is added on the top of the stack; the dictionary is    |
-    | removed when the scope is closed.  Lookup of symbols is donne in the   |
-    | last added dictionnary first (LIFO).                                   |
-    `-----------------------------------------------------------------------*/
-    class EXTERN_SYMBOL Stack : public Table
+/*-----------------------------------------------------------------------.
+| This implements stacks for storing definitions of variables and        |
+| functions as a stack of dictionnaries.  Each time a scope is opened, a |
+| new dictionnary is added on the top of the stack; the dictionary is    |
+| removed when the scope is closed.  Lookup of symbols is donne in the   |
+| last added dictionnary first (LIFO).                                   |
+`-----------------------------------------------------------------------*/
+class EXTERN_SYMBOL Stack : public Table
+{
+public:
+    /** Open a new scope */
+    void scope_begin()
     {
-    public:
-        /** Open a new scope */
-        void scope_begin()
-        {
-            this->l_scope.push_front(new Scope());
-        }
+        this->l_scope.push_front(new Scope());
+    }
+
+    /** Close the last scope, forgetting everything since the latest
+    ** scope_begin (). */
+    void scope_end()
+    {
+        Scope* scope = this->l_scope.front();
+        delete scope;
+        this->l_scope.pop_front();
+    }
 
-        /** Close the last scope, forgetting everything since the latest
-        **     scope_begin (). */
-        void scope_end()
+    void putInPreviousScope(const symbol::Symbol& key, types::InternalType &value)
+    {
+        if (l_scope.size() > 1)
         {
-            Scope* scope = this->l_scope.front();
-            delete scope;
-            this->l_scope.pop_front();
+            std::list<Scope*>::iterator i;
+            i = l_scope.begin();
+            i++;
+            (*i)->put(key, value);
         }
+    }
+
+    /** Associate value to key in the current scope. */
+    void put(const symbol::Symbol& key, types::InternalType &value)
+    {
+        (this->l_scope.front())->put(key, value);
+    }
 
-        void put_in_previous_scope(const symbol::Symbol& key, types::InternalType &value)
+    /** Remove Association between value and key in the current scope. */
+    void remove(const symbol::Symbol& key)
+    {
+        (this->l_scope.front())->remove(key);
+    }
+
+    /** If key was associated to some Entry_T in the open scopes, return the
+    ** most recent insertion. Otherwise return the empty pointer. */
+    types::InternalType* get(const symbol::Symbol& key) const
+    {
+        types::InternalType* result = NULL;
+
+        std::list<Scope*>::const_iterator it_list_scope = this->l_scope.begin();
+
+        for (; it_list_scope != this->l_scope.end(); it_list_scope++)
         {
-            if(l_scope.size() > 1)
+            result = (*it_list_scope)->get(key);
+            if (result)
             {
-                std::list<Scope*>::iterator i;
-                i = l_scope.begin();
-                i++;
-                (*i)->put(key, value);
+                return result;
             }
         }
+        return result;
+    }
 
-        /** Associate value to key in the current scope. */
-        void put(const symbol::Symbol& key, types::InternalType &value)
-        {
-            (this->l_scope.front())->put(key, value);
-        }
+    /** If key was associated to some Entry_T in the open scopes, return the
+    ** most recent insertion DESPITE the current/last one. Otherwise return the empty pointer. */
+    types::InternalType* getAllButCurrentLevel(const symbol::Symbol& key) const
+    {
+        types::InternalType* result = 0;
 
-        /** Remove Association between value and key in the current scope. */
-        void remove(const symbol::Symbol& key)
+        /*
+        ** If we are in the top level scope, also look within it
+        */
+        if (l_scope.size() == 1)
         {
-            (this->l_scope.front())->remove(key);
+            return l_scope.front()->get(key);
         }
 
-        /** If key was associated to some Entry_T in the open scopes, return the
-        ** most recent insertion. Otherwise return the empty pointer. */
-        types::InternalType* get(const symbol::Symbol& key) const
+        /*
+        ** else look in all previous scopes but not in the current one.
+        */
+        std::list<Scope*>::const_iterator it_list_scope = this->l_scope.begin();
+        ++it_list_scope;
+        for ( ; it_list_scope != this->l_scope.end(); ++it_list_scope)
         {
-            types::InternalType* result = NULL;
-
-            std::list<Scope*>::const_iterator it_list_scope = this->l_scope.begin();
-
-            for (; it_list_scope != this->l_scope.end(); it_list_scope++)
+            result = (*it_list_scope)->get(key);
+            if (result == 0)
             {
-                result = (*it_list_scope)->get(key);
-                if(result)
-                {
-                    return result;
-                }
+                continue ;
             }
             return result;
         }
+        return result;
+    }
 
-        /** If key was associated to some Entry_T in the open scopes, return the
-        ** most recent insertion DESPITE the current/last one. Otherwise return the empty pointer. */
-        types::InternalType* getAllButCurrentLevel(const symbol::Symbol& key) const
-        {
-            types::InternalType* result = 0;
+    /** If key was associated to some Entry_T in the last opened scope, return it.
+    ** Otherwise return the empty pointer. */
+    types::InternalType* getCurrentLevel(const symbol::Symbol& key) const
+    {
+        return l_scope.front()->get(key);
+    }
 
-            /*
-            ** If we are in the top level scope, also look within it
-            */
-            if (l_scope.size() == 1)
-            {
-                return l_scope.front()->get(key);
-            }
 
-            /*
-            ** else look in all previous scopes but not in the current one.
-            */
-            std::list<Scope*>::const_iterator it_list_scope = this->l_scope.begin();
-            ++it_list_scope;
-            for ( ; it_list_scope != this->l_scope.end(); ++it_list_scope)
-            {
-                result = (*it_list_scope)->get(key);
-                if (result == 0)
-                {
-                    continue ;
-                }
-                return result;
-            }
-            return result;
-        }
+    std::list<symbol::Symbol>& getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd)
+    {
+        //get hightest scope
+        std::list<Scope*>::iterator i;
 
-        /** If key was associated to some Entry_T in the last opened scope, return it.
-        ** Otherwise return the empty pointer. */
-        types::InternalType* getCurrentLevel(const symbol::Symbol& key) const
+        if (_bFromEnd)
         {
-            return l_scope.front()->get(key);
+            i = l_scope.end();
+            i--;
         }
-
-
-        std::list<symbol::Symbol>& get_funlist(const std::wstring& _stModuleName)
+        else
         {
-            //get hightest scope
-            std::list<Scope*>::iterator i = l_scope.end();
-            i--;
-            return (*i)->get_names(_stModuleName);
+            i = l_scope.begin();
         }
-    };
 
-    inline std::wostream& operator<< (std::wostream& ostr, const Stack &tbl)
-    {
-        tbl.print (ostr);
-        return ostr;
+        return (*i)->get_names(_stModuleName);
     }
+};
+
+inline std::wostream& operator<< (std::wostream& ostr, const Stack &tbl)
+{
+    tbl.print (ostr);
+    return ostr;
+}
 }
 
 
index 13578e6..cc6082a 100644 (file)
 
 void addGatewayInContext(wchar_t* _pwstName, OLDGW_FUNC _pFunc, wchar_t* _pwstModule)
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(_pwstName, _pFunc, _pwstModule));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(_pwstName, _pFunc, _pwstModule));
 }
 
 void addMexGatewayInContext(wchar_t* _pwstName, MEXGW_FUNC _pFunc, wchar_t* _pwstModule)
 {
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(_pwstName, _pFunc, _pwstModule));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(_pwstName, _pFunc, _pwstModule));
 }
 
 namespace symbol
@@ -82,14 +82,14 @@ types::InternalType* Context::getAllButCurrentLevel(const symbol::Symbol& key) c
     return EnvVarTable.getAllButCurrentLevel(key);
 }
 
-types::InternalType* Context::get_fun(const symbol::Symbol& key) const
+types::InternalType* Context::getFunction(const symbol::Symbol& key) const
 {
     return EnvVarTable.get(key);
 }
 
-std::list<symbol::Symbol>& Context::get_funlist(const std::wstring& _stModuleName)
+std::list<symbol::Symbol>& Context::getFunctionList(const std::wstring& _stModuleName, bool _bFromEnd)
 {
-    return EnvVarTable.get_funlist(_stModuleName);
+    return EnvVarTable.getFunctionList(_stModuleName, _bFromEnd);
 }
 
 bool Context::put(const symbol::Symbol& key, types::InternalType &type)
@@ -125,13 +125,13 @@ bool Context::remove(const symbol::Symbol& key)
     return true;
 }
 
-bool Context::put_in_previous_scope(const symbol::Symbol& key, types::InternalType &type)
+bool Context::putInPreviousScope(const symbol::Symbol& key, types::InternalType &type)
 {
-    EnvVarTable.put_in_previous_scope(key, type);
+    EnvVarTable.putInPreviousScope(key, type);
     return true;
 }
 
-bool Context::AddFunction(types::Function *_info)
+bool Context::addFunction(types::Function *_info)
 {
     EnvVarTable.put(symbol::Symbol(_info->getName()), *_info);
     return true;
index d0c31b4..5b28962 100644 (file)
@@ -1,13 +1,13 @@
 /*
  *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  *  Copyright (C) 2010-2010 - DIGITEO - Bruno JOFRET
- * 
+ *
  *  This file must be used under the terms of the CeCILL.
  *  This source file is licensed as described in the file COPYING, which
  *  you should have received as part of this distribution.  The terms
  *  are also available at
  *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
- * 
+ *
  */
 
 #include "time_gw.hxx"
 #define MODULE_NAME L"time"
 extern "C"
 {
-   #include "gw_time.h"
+#include "gw_time.h"
 }
 
 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));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"timer", &sci_timer, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sleep", &sci_sleep, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"xpause", &sci_xpause, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"realtimeinit", &sci_realtimeinit, MODULE_NAME));
-    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));
+    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));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"timer", &sci_timer, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sleep", &sci_sleep, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"xpause", &sci_xpause, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"realtimeinit", &sci_realtimeinit, MODULE_NAME));
+    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 1;
 }
index f2495a1..7af1244 100644 (file)
@@ -26,7 +26,7 @@ using namespace types;
 
 Function::ReturnValue sci_inspectorGetFunctionList(typed_list &in, int _iRetCount, typed_list &out)
 {
-    if(in.size() != 0)
+    if (in.size() != 0)
     {
         Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), "inspectorGetFunctionList", 0);
         return Function::Error;
@@ -34,12 +34,12 @@ Function::ReturnValue sci_inspectorGetFunctionList(typed_list &in, int _iRetCoun
 
     symbol::Context* pC = symbol::Context::getInstance();
 
-    std::list<symbol::Symbol> FuncName = pC->get_funlist(L"");
+    std::list<symbol::Symbol> FuncName = pC->getFunctionList(L"");
 
     String* pOut = new String(FuncName.size(), 4);
 
     std::list<symbol::Symbol>::iterator it = FuncName.begin();
-    for(int i = 0; it != FuncName.end() ; it++,i++)
+    for (int i = 0; it != FuncName.end() ; it++, i++)
     {
         Callable* pCall = pC->get(*it)->getAs<Callable>();
         //Function name
@@ -47,7 +47,7 @@ Function::ReturnValue sci_inspectorGetFunctionList(typed_list &in, int _iRetCoun
         pOut->set(i, 1, pCall->getModule().c_str());
         pOut->set(i, 2, pCall->getTypeStr().c_str());
 
-        if(pCall->isMacroFile())
+        if (pCall->isMacroFile())
         {
             pOut->set(i, 3, pCall->getAs<MacroFile>()->getMacro() == NULL ? L"false" : L"true");
         }
index af61874..10a0ea3 100644 (file)
 #define MODULE_NAME L"types"
 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));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"null", &sci_null, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"insert", &sci_insert, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"cell", &sci_cell, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"makecell", &sci_makecell, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"usertype", &sci_usertype, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"typeof", &sci_typeof, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"tlist", &sci_tlist, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"mlist", &sci_mlist, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"isfield", &sci_isfield, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"getfield", &sci_getfield, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"fieldnames", &sci_fieldnames, MODULE_NAME));
+    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));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"null", &sci_null, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"insert", &sci_insert, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"cell", &sci_cell, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"makecell", &sci_makecell, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"usertype", &sci_usertype, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"typeof", &sci_typeof, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"tlist", &sci_tlist, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"mlist", &sci_mlist, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"isfield", &sci_isfield, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"getfield", &sci_getfield, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"fieldnames", &sci_fieldnames, MODULE_NAME));
 
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"adj2sp", &sci_adj2sp, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"nnz", &sci_nnz, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sp2adj", &sci_sp2adj, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"sparse", &sci_sparse, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spcompack", &sci_spcompack, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spget", &sci_spget, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spzeros", &sci_spzeros, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"spones", &sci_spones, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"full", &sci_full, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"adj2sp", &sci_adj2sp, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"nnz", &sci_nnz, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sp2adj", &sci_sp2adj, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"sparse", &sci_sparse, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spcompack", &sci_spcompack, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spget", &sci_spget, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spzeros", &sci_spzeros, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"spones", &sci_spones, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"full", &sci_full, MODULE_NAME));
 
 #ifndef NDEBUG
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorGetItemCount", &sci_inspectorGetItemCount, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorShowItem", &sci_inspectorShowItem, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorShowUnreferencedItem", &sci_inspectorShowUnreferencedItem, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorGetItem", &sci_inspectorGetItem, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorGetUnreferencedItem", &sci_inspectorGetUnreferencedItem, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorDeleteUnreferencedItems", &sci_inspectorDeleteUnreferencedItems, MODULE_NAME));
-    symbol::Context::getInstance()->AddFunction(types::Function::createFunction(L"inspectorGetFunctionList", &sci_inspectorGetFunctionList, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorGetItemCount", &sci_inspectorGetItemCount, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorShowItem", &sci_inspectorShowItem, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorShowUnreferencedItem", &sci_inspectorShowUnreferencedItem, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorGetItem", &sci_inspectorGetItem, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorGetUnreferencedItem", &sci_inspectorGetUnreferencedItem, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorDeleteUnreferencedItems", &sci_inspectorDeleteUnreferencedItems, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"inspectorGetFunctionList", &sci_inspectorGetFunctionList, MODULE_NAME));
 #endif
     return 1;
 }
index 629a77b..79be634 100644 (file)
@@ -2,13 +2,13 @@
 *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 *  Copyright (C) 2009-2010 - DIGITEO - Bruno JOFRET
 *  Copyright (C) 2009-2009 - 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
-* 
+*
 */
 
 #include <sstream>
 using namespace ast;
 namespace types
 {
-    MacroFile::MacroFile(wstring _stName, wstring _stPath, wstring _stModule) : Callable(), m_stPath(_stPath), m_pMacro(NULL)
-    {
-        setName(_stName);
-        setModule(_stModule);
-    }
+MacroFile::MacroFile(wstring _stName, wstring _stPath, wstring _stModule) : Callable(), m_stPath(_stPath), m_pMacro(NULL)
+{
+    setName(_stName);
+    setModule(_stModule);
+}
 
-    MacroFile::~MacroFile()
+MacroFile::~MacroFile()
+{
+    if (m_pMacro)
     {
-        if(m_pMacro)
-        {
-            delete m_pMacro;
-        }
+        delete m_pMacro;
     }
+}
 
-    InternalType* MacroFile::clone()
-    {
-        IncreaseRef();
-        return this;
-    }
+InternalType* MacroFile::clone()
+{
+    IncreaseRef();
+    return this;
+}
 
-    void MacroFile::whoAmI()
-    {
-        std::cout << "types::MacroFile";
-    }
+void MacroFile::whoAmI()
+{
+    std::cout << "types::MacroFile";
+}
 
-    InternalType::RealType MacroFile::getType(void)
-    { 
-        return RealMacroFile; 
-    }
+InternalType::RealType MacroFile::getType(void)
+{
+    return RealMacroFile;
+}
+
+bool MacroFile::toString(std::wostringstream& ostr)
+{
+    ostr << L"FIXME : Implement MacroFile::toString" << std::endl;
+    return true;
+}
+
+Callable::ReturnValue MacroFile::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+{
+    ReturnValue RetVal = Callable::OK;
 
-    bool MacroFile::toString(std::wostringstream& ostr)
+    parse();
+    if (m_pMacro)
     {
-        ostr << L"FIXME : Implement MacroFile::toString" << std::endl;
-        return true;
+        ReturnValue Val =  m_pMacro->call(in, opt, _iRetCount, out, execFunc);
+        return Val;
     }
-
-    Callable::ReturnValue MacroFile::call(typed_list &in, optional_list &opt, int _iRetCount, typed_list &out, ast::ConstVisitor* execFunc)
+    else
     {
-        ReturnValue RetVal = Callable::OK;
-
-        parse();
-        if(m_pMacro)
-        {
-            ReturnValue Val =  m_pMacro->call(in, opt, _iRetCount, out, execFunc);
-            return Val;
-        }
-        else
-        {
-            return Callable::Error;
-        }
+        return Callable::Error;
     }
+}
 
-    bool MacroFile::parse(void)
-    {
+bool MacroFile::parse(void)
+{
 
-        if(m_pMacro == NULL)
-        {//load file, only for the first call
-            Parser parser;
-            parser.parseFile(m_stPath, L"parse macro file");
-            if(parser.getExitStatus() !=  Parser::Succeded)
-            {
-                scilabWriteW(L"Unable to parse ");
-                scilabWriteW(m_stPath.c_str());
-                scilabWriteW(L"\n\n");
-                scilabWriteW(parser.getErrorMessage());
-                return false;
-            }
+    if (m_pMacro == NULL)
+    {
+        //load file, only for the first call
+        Parser parser;
+        parser.parseFile(m_stPath, L"parse macro file");
+        if (parser.getExitStatus() !=  Parser::Succeded)
+        {
+            scilabWriteW(L"Unable to parse ");
+            scilabWriteW(m_stPath.c_str());
+            scilabWriteW(L"\n\n");
+            scilabWriteW(parser.getErrorMessage());
+            return false;
+        }
 
-            //find FunctionDec
-            FunctionDec* pFD = NULL;
+        //find FunctionDec
+        FunctionDec* pFD = NULL;
 
-            std::list<Exp *>::iterator j;
-            std::list<Exp *>LExp = ((SeqExp*)parser.getTree())->exps_get();
+        std::list<Exp *>::iterator j;
+        std::list<Exp *>LExp = ((SeqExp*)parser.getTree())->exps_get();
 
-            for(j = LExp.begin() ; j != LExp.end() ; j++)
+        for (j = LExp.begin() ; j != LExp.end() ; j++)
+        {
+            pFD = dynamic_cast<FunctionDec*>(*j);
+            if (pFD) // &&     pFD->name_get() == m_stName
             {
-                pFD = dynamic_cast<FunctionDec*>(*j);
-                if(pFD) // &&  pFD->name_get() == m_stName
+                symbol::Context* pContext = symbol::Context::getInstance();
+                types::InternalType* pFunc = pContext->getFunction(pFD->name_get());
+                if (pFunc && pFunc->isMacroFile())
                 {
-                    symbol::Context* pContext = symbol::Context::getInstance();
-                    types::InternalType* pFunc = pContext->get_fun(pFD->name_get());
-                    if(pFunc && pFunc->isMacroFile())
+                    MacroFile* pMacro = pContext->getFunction(pFD->name_get())->getAs<MacroFile>();
+                    if (pMacro->m_pMacro == NULL)
                     {
-                        MacroFile* pMacro = pContext->get_fun(pFD->name_get())->getAs<MacroFile>();
-                        if(pMacro->m_pMacro == NULL)
+                        std::list<Var *>::const_iterator       i;
+
+                        //get input parameters list
+                        std::list<symbol::Symbol> *pVarList = new std::list<symbol::Symbol>();
+                        ArrayListVar *pListVar = (ArrayListVar *)&pFD->args_get();
+                        for (i = pListVar->vars_get().begin() ; i != pListVar->vars_get().end() ; i++)
                         {
-                            std::list<Var *>::const_iterator   i;
-
-                            //get input parameters list
-                            std::list<symbol::Symbol> *pVarList = new std::list<symbol::Symbol>();
-                            ArrayListVar *pListVar = (ArrayListVar *)&pFD->args_get();
-                            for(i = pListVar->vars_get().begin() ; i != pListVar->vars_get().end() ; i++)
-                            {
-                                pVarList->push_back(((SimpleVar*)(*i))->name_get());
-                            }
-
-                            //get output parameters list
-                            std::list<symbol::Symbol> *pRetList = new std::list<symbol::Symbol>();
-                            ArrayListVar *pListRet = (ArrayListVar *)&pFD->returns_get();
-                            for(i = pListRet->vars_get().begin() ; i != pListRet->vars_get().end() ; i++)
-                            {
-                                pRetList->push_back(((SimpleVar*)(*i))->name_get());
-                            }
-
-                            //types::Macro macro(VarList, RetList, (SeqExp&)e.body_get());
-                            //types::Macro *pMacro = new types::Macro(m_stName, *pVarList, *pRetList, (SeqExp&)e.body_get());
-
-                            pMacro->m_pMacro = new Macro(m_wstName, *pVarList, *pRetList, (SeqExp&)pFD->body_get(), m_wstModule);
+                            pVarList->push_back(((SimpleVar*)(*i))->name_get());
                         }
+
+                        //get output parameters list
+                        std::list<symbol::Symbol> *pRetList = new std::list<symbol::Symbol>();
+                        ArrayListVar *pListRet = (ArrayListVar *)&pFD->returns_get();
+                        for (i = pListRet->vars_get().begin() ; i != pListRet->vars_get().end() ; i++)
+                        {
+                            pRetList->push_back(((SimpleVar*)(*i))->name_get());
+                        }
+
+                        //types::Macro macro(VarList, RetList, (SeqExp&)e.body_get());
+                        //types::Macro *pMacro = new types::Macro(m_stName, *pVarList, *pRetList, (SeqExp&)e.body_get());
+
+                        pMacro->m_pMacro = new Macro(m_wstName, *pVarList, *pRetList, (SeqExp&)pFD->body_get(), m_wstModule);
                     }
                 }
             }
         }
-        return true;
     }
+    return true;
+}
 }
index ba89ddb..5f76b41 100644 (file)
@@ -20,8 +20,8 @@ extern "C"
 #define MODULE_NAME L"windows_tools"
 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));
+    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 1;
 }