* Bug #9444 fixed - jvm: remove with_embedded_jre
[scilab.git] / scilab / modules / jvm / sci_gateway / c / gw_jvm.c
1 /*
2  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3  * Copyright (C) INRIA - Allan CORNET
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.1-en.txt
10  *
11  */
12
13 /*--------------------------------------------------------------------------*/
14 #include <string.h>
15 #include "gw_jvm.h"
16 #include "api_scilab.h"
17 #include "MALLOC.h"
18 #include "scilabmode.h"
19 #include "Scierror.h"
20 #include "callFunctionFromGateway.h"
21 #include "localization.h"
22 /*--------------------------------------------------------------------------*/
23 static gw_generic_table  Tab[] =
24 {
25     {sci_system_setproperty, "system_setproperty"},
26     {sci_system_getproperty, "system_getproperty"},
27     {sci_javaclasspath, "javaclasspath"},
28     {sci_javalibrarypath, "javalibrarypath"}
29 };
30 /*--------------------------------------------------------------------------*/
31 int gw_jvm(void)
32 {
33     Rhs = Max(0, Rhs);
34
35     if (pvApiCtx == NULL)
36     {
37         pvApiCtx = (StrCtx*)MALLOC(sizeof(StrCtx));
38     }
39
40     pvApiCtx->pstName = (char*)Tab[Fin - 1].name;
41     if ( (getScilabMode() != SCILAB_NWNI) )
42     {
43         callFunctionFromGateway(Tab, SIZE_CURRENT_GENERIC_TABLE(Tab));
44     }
45     else
46     {
47         Scierror(999, _("JVM interface disabled in -nogui or -nwni modes.\n"));
48     }
49
50     return 0;
51 }
52 /*--------------------------------------------------------------------------*/