2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) INRIA - 2010 - Sylvestre Ledru
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
16 * Windows: swig -java -package org.scilab.modules.commons -outdir ../java/org/scilab/modules/commons/ ScilabCommons.i
17 * Other: Use the option --enable-build-swig to the configure
21 #include "sci_malloc.h"
23 #include "sci_tmpdir.h"
24 #include "createtempfilename.h"
25 #include "setgetlanguage.h"
26 #include "getversion.h"
27 #include "configvariable_interface.h"
28 #include "setformat.h"
31 /* JavaDoc for ScilabCommonsJNI class */
32 %pragma(java) jniclassclassmodifiers=%{
33 /* It is generated code. Disable checkstyle */
36 * Some commons values from Scilab engine to Java
37 * @author Sylvestre LEDRU
38 * @copyright DIGITEO 2010
42 /* Constructor for ScilabCommonsJNI class */
43 %pragma(java) jniclasscode="
47 protected ScilabCommonsJNI() {
48 throw new UnsupportedOperationException();
51 /* static load of library */
52 %pragma(java) jniclasscode=%{
55 System.loadLibrary("scicommons");
56 } catch (SecurityException e) {
57 System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
58 System.err.println(e.getLocalizedMessage());
60 } catch (UnsatisfiedLinkError e) {
61 System.err.println("The native library scicommons does not exist or cannot be found.");
62 if (System.getenv("CONTINUE_ON_JNI_ERROR") == null) {
63 System.err.println(e.getLocalizedMessage());
64 System.err.println("Current java.library.path is : "+System.getProperty("java.library.path"));
67 System.err.println("Continuing anyway because of CONTINUE_ON_JNI_ERROR");
73 %typemap(out, noblock=1) char * {if ($1)
75 $result = JCALL1(NewStringUTF, jenv, (const char *)$1);
79 /* JavaDoc for ScilabCommons class */
80 %pragma(java) moduleclassmodifiers="
82 * Some commons values from Scilab engine to Java
83 * @author Sylvestre LEDRU
84 * @copyright DIGITEO 2010
88 /* Constructor for ScilabCommons class */
89 %pragma(java) modulecode="
93 protected ScilabCommons() {
94 throw new UnsupportedOperationException();
98 %javamethodmodifiers getSCIHOME() "
100 * Get SCIHOME variable from Scilab
101 * @return SCIHOME value
108 %javamethodmodifiers getTMPDIR() "
110 * returns TMPDIR directory value
111 * @return TMPDIR value
114 char *getTMPDIR(void);
118 %javamethodmodifiers getScilabLanguage() "
120 * returns Scilab current language
124 char *getlanguage(void);
128 %javamethodmodifiers createTempFileName() "
130 * Create file with unique file name in TMPDIR
131 * TMPDIR/PREFIX[XXXXXXX]
132 * @param prefix the file prefix
133 * @param bShortFormat set 1 for a 8.5 filename, 0 otherwise
134 * @return a unique filename
137 char *createtempfilename(const char* prefix, int bShortFormat);
140 %javamethodmodifiers getScilabIeeeMode() "
142 * returns the Scilab ieee mode
149 %javamethodmodifiers setScilabIeeeMode(int) "
151 * Set the Scilab ieee mode
157 %javamethodmodifiers setformat(const char *, int) "
159 * Set the Scilab ieee mode
162 void setformat(const char * format, int width);
165 %javamethodmodifiers getformat() "
167 * returns the Scilab format (\"v\" or \"e\")
174 %javamethodmodifiers getformatwidth() "
176 * returns the Scilab format width
180 int getformatwidth();
183 %javamethodmodifiers getScilabVersionMajor() "
185 * returns the Scilab version major number
186 * @return version major
189 int getScilabVersionMajor();
192 %javamethodmodifiers getScilabVersionMinor() "
194 * returns the Scilab version minor number
195 * @return version minor
198 int getScilabVersionMinor();
201 %javamethodmodifiers getScilabVersionMaintenance() "
203 * returns the Scilab version maintenance number
204 * @return version maintenance
207 int getScilabVersionMaintenance();
210 %javamethodmodifiers getScilabVersionTimestamp() "
212 * returns the Scilab version timestamp number
213 * @return version timestamp
216 int getScilabVersionTimestamp();
219 %javamethodmodifiers getScilabVersionAsString() "
221 * returns the Scilab version as string
222 * @return version Scilab version as a string
225 char* getScilabVersionAsString();