Draft of JIMS based on external object
[scilab.git] / scilab / modules / external_objects_java / sci_gateway / c / gw_external_objects_java.c
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
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 "gw_external_objects_java.h"
14 #include "api_scilab.h"
15 #include "callFunctionFromGateway.h"
16 #include "MALLOC.h"
17 /*--------------------------------------------------------------------------*/
18 /*  interface function */
19 /*--------------------------------------------------------------------------*/
20 static gw_generic_table Tab[] =
21 {
22     {sci_jimport, "jimport"},
23     {sci_jgetclassname, "jgetclassname"},
24     {sci_jwrap, "jwrap"},
25     {sci_jgetmethods, "jgetmethods"},
26     {sci_jgetfields, "jgetfields"},
27     {sci_jgetfield, "jgetfield"},
28     {sci_jcompile, "jcompile"},
29     {sci_jnewInstance, "jnewInstance"},
30     {sci_jremove, "jremove"},
31     {sci_jexists, "jexists"},
32     {sci_junwrap, "junwrap"},
33     {sci_junwraprem, "junwraprem"},
34     {sci_jenableTrace, "jenableTrace"},
35     {sci_jdisableTrace, "jdisableTrace"},
36     {sci_jdeff, "jdeff"},
37     {sci_jvoid, "jvoid"},
38     {sci_jarray, "jarray"},
39     {sci_jcast, "jcast"},
40     {sci_jallowClassReloading, "jallowClassReloading"}
41 };
42
43 /*--------------------------------------------------------------------------*/
44 int gw_external_objects_java(void)
45 {
46     Rhs = Max(0, Rhs);
47
48     if (pvApiCtx == NULL)
49     {
50         pvApiCtx = (StrCtx *) MALLOC(sizeof(StrCtx));
51     }
52
53     pvApiCtx->pstName = (char *)Tab[Fin - 1].name;
54     callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
55     return 0;
56 }
57
58 /*--------------------------------------------------------------------------*/