Added Scilab function runVMKit to be used to change how the AST is visited.
[scilab.git] / scilab / modules / core / sci_gateway / cpp / core_gw.cpp
1 /*
2 *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 *  Copyright (C) 2008-2008 - DIGITEO - Antoine ELIAS
4 *
5 *  This file must be used under the terms of the CeCILL.
6 *  This source file is licensed as described in the file COPYING, which
7 *  you should have received as part of this distribution.  The terms
8 *  are also available at
9 *  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 *
11 */
12
13 #include "core_gw.hxx"
14 #include "context.hxx"
15
16 #define MODULE_NAME L"core"
17 extern "C"
18 {
19 #include "gw_core.h"
20 }
21
22 using namespace types;
23
24 int CoreModule::Load()
25 {
26     symbol::Context::getInstance()->addFunction(Function::createFunction(L"type", &sci_type, MODULE_NAME));
27     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getmodules", &sci_getmodules, MODULE_NAME));
28     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getdebuginfo", &sci_getdebuginfo, MODULE_NAME));
29     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getversion", &sci_getversion, MODULE_NAME));
30     symbol::Context::getInstance()->addFunction(Function::createFunction(L"clear", &sci_clear, MODULE_NAME));
31     symbol::Context::getInstance()->addFunction(Function::createFunction(L"banner", &sci_banner, MODULE_NAME));
32     symbol::Context::getInstance()->addFunction(Function::createFunction(L"quit", &sci_quit, MODULE_NAME));
33     symbol::Context::getInstance()->addFunction(Function::createFunction(L"exit", &sci_exit, MODULE_NAME));
34     symbol::Context::getInstance()->addFunction(Function::createFunction(L"exists", &sci_exists, MODULE_NAME));
35     symbol::Context::getInstance()->addFunction(Function::createFunction(L"isdef", &sci_isdef, MODULE_NAME));
36     symbol::Context::getInstance()->addFunction(Function::createFunction(L"argn", &sci_argn, MODULE_NAME));
37     symbol::Context::getInstance()->addFunction(Function::createFunction(L"global", &sci_global, MODULE_NAME));
38     symbol::Context::getInstance()->addFunction(Function::createFunction(L"clearglobal", &sci_clearglobal, MODULE_NAME));
39     symbol::Context::getInstance()->addFunction(Function::createFunction(L"isglobal", &sci_isglobal, MODULE_NAME));
40     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getos", &sci_getos, MODULE_NAME));
41     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getscilabmode", &sci_getscilabmode, MODULE_NAME));
42     symbol::Context::getInstance()->addFunction(Function::createFunction(L"with_module", &sci_with_module, MODULE_NAME));
43     symbol::Context::getInstance()->addFunction(Function::createFunction(L"lasterror", &sci_lasterror, MODULE_NAME));
44     symbol::Context::getInstance()->addFunction(Function::createFunction(L"warning", &sci_warning, MODULE_NAME));
45     symbol::Context::getInstance()->addFunction(Function::createFunction(L"getmd5", &sci_getmd5, MODULE_NAME));
46     symbol::Context::getInstance()->addFunction(Function::createFunction(L"error", &sci_error, MODULE_NAME));
47     symbol::Context::getInstance()->addFunction(Function::createFunction(L"pause", &sci_pause, MODULE_NAME));
48     symbol::Context::getInstance()->addFunction(Function::createFunction(L"abort", &sci_abort, MODULE_NAME));
49     symbol::Context::getInstance()->addFunction(Function::createFunction(L"who", &sci_who, MODULE_NAME));
50     symbol::Context::getInstance()->addFunction(Function::createFunction(L"stacksize", &sci_stacksize, MODULE_NAME));
51     symbol::Context::getInstance()->addFunction(Function::createFunction(L"sciargs", &sci_sciargs, MODULE_NAME));
52     symbol::Context::getInstance()->addFunction(Function::createFunction(L"format", &sci_format, MODULE_NAME));
53     symbol::Context::getInstance()->addFunction(Function::createFunction(L"ieee", &sci_ieee, MODULE_NAME));
54     symbol::Context::getInstance()->addFunction(Function::createFunction(L"typename", &sci_typename, MODULE_NAME));
55     symbol::Context::getInstance()->addFunction(Function::createFunction(L"funcprot", &sci_funcprot, MODULE_NAME));
56     symbol::Context::getInstance()->addFunction(Function::createFunction(L"runVMKit", &sci_runVMKit, MODULE_NAME));
57     return 1;
58 }