Preferences: connect Java Heap allocation 98/7598/6
Calixte DENIZET [Tue, 19 Jun 2012 15:17:25 +0000 (17:17 +0200)]
Introduce a lib for preferences access from scilab-cli

Change-Id: Ic1a4891fa5b35c555586d6cd7cb0e3d691c10680

25 files changed:
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/console/etc/XConfiguration-general.xml
scilab/modules/console/etc/XConfiguration-general.xsl
scilab/modules/core/Makefile.am
scilab/modules/core/Makefile.in
scilab/modules/core/includes/machine.h.in
scilab/modules/core/src/c/core.vcxproj
scilab/modules/core/src/c/sciquit.c
scilab/modules/jvm/Makefile.am
scilab/modules/jvm/Makefile.in
scilab/modules/jvm/libjvm.vcxproj
scilab/modules/jvm/preferences_Import.def [new file with mode: 0644]
scilab/modules/jvm/src/c/getJvmOptions.c
scilab/modules/jvm/xml/jvm-options.dtd
scilab/modules/preferences/Makefile.am
scilab/modules/preferences/Makefile.in
scilab/modules/preferences/includes/getScilabPreference.h [new file with mode: 0644]
scilab/modules/preferences/src/c/DllmainPreferences.c
scilab/modules/preferences/src/c/core_Import.def
scilab/modules/preferences/src/c/getScilabPreference.c [new file with mode: 0644]
scilab/modules/preferences/src/c/preferences.vcxproj
scilab/modules/preferences/src/c/preferences.vcxproj.filters
scilab/modules/preferences/src/jni/ScilabPreferences.cpp
scilab/modules/preferences/src/jni/ScilabPreferences.hxx

index 977733f..07c1944 100644 (file)
@@ -122,7 +122,7 @@ $(top_builddir)/libs/doublylinkedlist/libscidoublylinkedlist.la  \
 $(top_builddir)/libs/libst/libscilibst.la
 
 
-GUI_LIBS =     $(top_builddir)/modules/gui/libscigui.la \
+GUI_LIBS = $(top_builddir)/modules/gui/libscigui.la \
        $(top_builddir)/modules/renderer/libscirenderer.la \
        $(top_builddir)/modules/graphics/libscigraphics.la \
        $(top_builddir)/modules/graphic_export/libscigraphic_export.la \
@@ -134,7 +134,8 @@ GUI_LIBS =  $(top_builddir)/modules/gui/libscigui.la \
        $(top_builddir)/modules/ui_data/libsciui_data.la \
        $(top_builddir)/modules/history_browser/libscihistory_browser.la \
        $(top_builddir)/modules/commons/libscicommons.la \
-       $(top_builddir)/modules/tclsci/libscitclsci.la
+       $(top_builddir)/modules/tclsci/libscitclsci.la \
+       $(top_builddir)/modules/preferences/libscipreferences.la
 
 GUI_LIBS += $(top_builddir)/modules/hdf5/libscihdf5-forceload.la
 # HDF5 is here because it needs the JVM (see bug #5481)
@@ -184,10 +185,11 @@ ENGINE_LIBS =     $(top_builddir)/modules/fileio/libscifileio.la \
        $(top_builddir)/modules/string/libscistring.la \
        $(top_builddir)/modules/hdf5/libscihdf5.la \
        $(top_builddir)/modules/fftw/libscifftw.la \
-    $(top_builddir)/modules/statistics/libscistatistics.la \
-    $(top_builddir)/modules/dynamic_link/libscidynamic_link.la \
+       $(top_builddir)/modules/statistics/libscistatistics.la \
+       $(top_builddir)/modules/dynamic_link/libscidynamic_link.la \
        $(top_builddir)/libs/dynamiclibrary/libscidynamiclibrary.la \
-       $(top_builddir)/modules/xml/libscixml.la
+       $(top_builddir)/modules/xml/libscixml.la \
+       $(top_builddir)/modules/preferences/libscipreferences-cli.la
 
 # These libraries are loaded dynamically from Scilab.
 ENGINE_LIBS_DYNAMIC_LOAD = \
@@ -205,8 +207,7 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
        $(top_builddir)/modules/helptools/libscihelptools.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la \
-       $(top_builddir)/modules/preferences/libscipreferences.la
+       $(top_builddir)/modules/parallel/libsciparallel.la
 
 
 # Core modules
index 989a2b2..18ae5b5 100644 (file)
@@ -488,6 +488,7 @@ GUI_LIBS = $(top_builddir)/modules/gui/libscigui.la \
        $(top_builddir)/modules/history_browser/libscihistory_browser.la \
        $(top_builddir)/modules/commons/libscicommons.la \
        $(top_builddir)/modules/tclsci/libscitclsci.la \
+       $(top_builddir)/modules/preferences/libscipreferences.la \
        $(top_builddir)/modules/hdf5/libscihdf5-forceload.la
 # HDF5 is here because it needs the JVM (see bug #5481)
 NO_GUI_LIBS = $(top_builddir)/modules/gui/libscigui-disable.la \
@@ -533,10 +534,11 @@ ENGINE_LIBS = $(top_builddir)/modules/fileio/libscifileio.la \
        $(top_builddir)/modules/string/libscistring.la \
        $(top_builddir)/modules/hdf5/libscihdf5.la \
        $(top_builddir)/modules/fftw/libscifftw.la \
-    $(top_builddir)/modules/statistics/libscistatistics.la \
-    $(top_builddir)/modules/dynamic_link/libscidynamic_link.la \
+       $(top_builddir)/modules/statistics/libscistatistics.la \
+       $(top_builddir)/modules/dynamic_link/libscidynamic_link.la \
        $(top_builddir)/libs/dynamiclibrary/libscidynamiclibrary.la \
-       $(top_builddir)/modules/xml/libscixml.la
+       $(top_builddir)/modules/xml/libscixml.la \
+       $(top_builddir)/modules/preferences/libscipreferences-cli.la
 
 
 # These libraries are loaded dynamically from Scilab.
@@ -555,8 +557,7 @@ ENGINE_LIBS_DYNAMIC_LOAD = \
        $(top_builddir)/modules/umfpack/libsciumfpack.la \
        $(top_builddir)/modules/matio/libscimatio.la \
        $(top_builddir)/modules/helptools/libscihelptools.la \
-       $(top_builddir)/modules/parallel/libsciparallel.la \
-       $(top_builddir)/modules/preferences/libscipreferences.la
+       $(top_builddir)/modules/parallel/libsciparallel.la
 
 
 # Core modules
index 94ec0f9..0d8a5cc 100644 (file)
@@ -2,7 +2,7 @@
 <general title="General">
   <body>
     <environment floating-point-exception="Produces a warning" printing-format="long" width="10"/>
-    <java-heap-memory heap-size="128"/>
+    <java-heap-memory heap-size="256"/>
   </body>
   <confirmation-dialogs title="Confirmation dialogs"> 
     <body>
index 92c0081..3ca51f8 100644 (file)
@@ -61,7 +61,7 @@
       <Grid>\r
         <Label text="Select the memory (in MB) available in Java: " gridx="1" gridy="1" anchor="baseline" weightx="0"/>\r
         <Panel gridx="2" gridy="1" weightx="1"/>\r
-        <NumericalSpinner min-value = "128"\r
+        <NumericalSpinner min-value = "0"\r
                           increment = "128"\r
                           length = "6"\r
                           listener = "ActionListener"\r
@@ -71,6 +71,8 @@
             <xsl:call-template name="context"/>\r
           </actionPerformed>\r
         </NumericalSpinner>\r
+        <Label text="(modify this option requires to restart Scilab)" font-face="bold" gridx="1" gridy="2" anchor="west" weightx="0"/>\r
+       <Panel gridx="2" gridy="2" weightx="1" fill="both"/>    \r
       </Grid>\r
     </Title>\r
 \r
index 1446b7c..c69d344 100644 (file)
@@ -291,6 +291,7 @@ libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ \
        -I$(top_srcdir)/modules/fileio/includes/ \
        -I$(top_srcdir)/modules/console/includes/ \
        -I$(top_srcdir)/modules/history_manager/includes/ \
+       -I$(top_srcdir)/modules/preferences/includes/ \
        $(XML_FLAGS) \
     $(AM_CPPFLAGS)
 
index 9a986f9..d7ddf3f 100644 (file)
@@ -797,7 +797,8 @@ libscicore_la_CPPFLAGS = -I$(srcdir)/includes/ -I$(srcdir)/src/c/ \
        -I$(top_srcdir)/modules/string/includes/ \
        -I$(top_srcdir)/modules/fileio/includes/ \
        -I$(top_srcdir)/modules/console/includes/ \
-       -I$(top_srcdir)/modules/history_manager/includes/ $(XML_FLAGS) \
+       -I$(top_srcdir)/modules/history_manager/includes/ \
+       -I$(top_srcdir)/modules/preferences/includes/ $(XML_FLAGS) \
        $(AM_CPPFLAGS) $(am__append_3)
 @MAINTAINER_MODE_TRUE@pkglib_LTLIBRARIES = libscicore.la
 @MAINTAINER_MODE_FALSE@noinst_LTLIBRARIES = libscicore-algo.la libscicore.la
index 997a645..c08feab 100644 (file)
 /* Define to 1 if the X Window System is missing or not being used. */
 #undef X_DISPLAY_MISSING
 
+/* Enable large inode numbers on Mac OS X 10.5.  */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
 /* Number of bits in a file offset, on hosts where this is settable. */
 #undef _FILE_OFFSET_BITS
 
index 7802d63..033f30a 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -112,7 +112,7 @@ cd ..
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;_DEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -146,7 +146,7 @@ cd ..
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -187,7 +187,7 @@ cd ..
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>.;../../includes;../../../../libs/dynamiclibrary/includes;../../../../libs/GetWindowsVersion;../../../../libs/doublylinkedlist/includes;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../../libs/libxml2;../../../../libs/libxml2/libxml;../../../mexlib/includes;../../../gui/src/c/wsci;../../../api_scilab/includes;../../../string/includes;../../../functions/includes;../../../dynamic_link/includes;../../../action_binding/includes;../../../output_stream/includes;../../../fileio/includes;../../../elementary_functions/includes;../../../tclsci/includes;../../../localization/includes;../../../tclsci/includes/tcltk;../../../windows_tools/includes;../../../windows_tools/src/c/scilab_windows;../../../intersci/includes;../../../call_scilab/includes;../../../call_scilab/src/c;../../../graphics/includes;../../../io/includes;../../../console/includes;../../../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;NDEBUG;_WINDOWS;_USRDLL;CORE_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -563,6 +563,9 @@ cd ..
     <ProjectReference Include="..\..\..\polynomials\src\c\polynomials.vcxproj">
       <Project>{620d8fa7-3704-438e-bb1e-391c84401a2e}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\preferences\src\c\preferences.vcxproj">
+      <Project>{7b893e9f-d032-44de-9b71-197a29c4989b}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\..\..\sparse\src\c\sparse.vcxproj">
       <Project>{51240b08-5e4e-439b-b745-c870d5b513bf}</Project>
     </ProjectReference>
index d207ca2..6df3228 100644 (file)
@@ -1,11 +1,11 @@
 /*
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006 - INRIA - Allan CORNET
- * 
+ *
  * 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    
+ * are also available at
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
@@ -22,6 +22,7 @@
 #include "dynamic_tclsci.h"
 #include "../../../gui/includes/TerminateGui.h"
 #include "../../../jvm/includes/TerminateJVM.h"
+#include "getScilabPreference.h"
 #ifdef _MSC_VER
 #include "../../../windows_tools/includes/TerminateWindows_tools.h"
 #include "../../../windows_tools/includes/MutexClosingScilab.h"
@@ -37,6 +38,7 @@ int ExitScilab(void)
 {
     scilabMode CurrentScilabMode;
 
+    clearScilabPreferences();
     TerminateCorePart1();
 
     CurrentScilabMode = getScilabMode();
@@ -69,7 +71,7 @@ void sciquit(void)
 #ifdef _MSC_VER
     /* bug 3672 */
     /* Create a Mutex (closing scilab)
-     * used by files association 
+     * used by files association
      */
     createMutexClosingScilab();
 #endif
@@ -86,7 +88,7 @@ void sciquit(void)
 
 #ifdef _MSC_VER
     /* close mutex (closing scilab)
-     * used by files association 
+     * used by files association
      */
     terminateMutexClosingScilab();
 #endif
index 8219a67..63708b8 100644 (file)
@@ -37,6 +37,7 @@ libscijvm_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
                        -I$(top_srcdir)/modules/api_scilab/includes/ \
                        -I$(top_srcdir)/modules/call_scilab/includes/ \
                        -I$(top_srcdir)/modules/fileio/includes/ \
+                       -I$(top_srcdir)/modules/preferences/includes/ \
                        $(AM_CPPFLAGS)
 
 pkglib_LTLIBRARIES = libscijvm-disable.la
@@ -54,7 +55,7 @@ if IS_MACOSX
 libscijvm_la_LDFLAGS += -framework JavaVM
 endif
 
-libscijvm_la_LIBADD =  libscijvm-algo.la
+libscijvm_la_LIBADD = libscijvm-algo.la
 
 #### jvm : gateway declaration ####
 libscijvm_la_sci_gatewaydir = $(mydatadir)/sci_gateway
@@ -107,6 +108,7 @@ libscijvm_disable_la_CPPFLAGS = -I$(srcdir)/includes/ \
                        -I$(top_srcdir)/modules/localization/includes/ \
                        -I$(top_srcdir)/modules/api_scilab/includes/ \
                        -I$(top_srcdir)/modules/output_stream/includes/ \
+                       -I$(top_srcdir)/modules/preferences/src/c \
                        $(AM_CPPFLAGS)
 
 libscijvm_algo_la_SOURCES = $(JVM_C_SOURCES)
index 8b8caa0..ac07c7d 100644 (file)
@@ -464,6 +464,7 @@ libscijvm_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
                        -I$(top_srcdir)/modules/api_scilab/includes/ \
                        -I$(top_srcdir)/modules/call_scilab/includes/ \
                        -I$(top_srcdir)/modules/fileio/includes/ \
+                       -I$(top_srcdir)/modules/preferences/includes/ \
                        $(AM_CPPFLAGS)
 
 pkglib_LTLIBRARIES = libscijvm-disable.la $(am__append_1)
@@ -523,6 +524,7 @@ libscijvm_disable_la_CPPFLAGS = -I$(srcdir)/includes/ \
                        -I$(top_srcdir)/modules/localization/includes/ \
                        -I$(top_srcdir)/modules/api_scilab/includes/ \
                        -I$(top_srcdir)/modules/output_stream/includes/ \
+                       -I$(top_srcdir)/modules/preferences/src/c \
                        $(AM_CPPFLAGS)
 
 libscijvm_algo_la_SOURCES = $(JVM_C_SOURCES)
index 56ab0da..8271ec8 100644 (file)
@@ -76,7 +76,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
 lib /DEF:"$(ProjectDir)Scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)scilab_windows.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)String_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)string.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)call_scilab.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)preferences.lib" 1&gt;NUL 2&gt;NUL
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>preferences.lib;core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>libjvm_export.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -109,7 +110,7 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;_DEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <WarningLevel>Level3</WarningLevel>
@@ -120,10 +121,11 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
 lib /DEF:"$(ProjectDir)Scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)scilab_windows.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)String_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)string.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)call_scilab.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)preferences.lib" 1&gt;NUL 2&gt;NUL
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>preferences.lib;core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>libjvm_export.def</ModuleDefinitionFile>
       <GenerateDebugInformation>true</GenerateDebugInformation>
@@ -140,7 +142,7 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -154,10 +156,11 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
 lib /DEF:"$(ProjectDir)Scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)scilab_windows.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)String_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)string.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)call_scilab.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)preferences.lib" 1&gt;NUL 2&gt;NUL
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>preferences.lib;core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>libjvm_export.def</ModuleDefinitionFile>
       <GenerateDebugInformation>false</GenerateDebugInformation>
@@ -179,7 +182,7 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
     <ClCompile>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../windows_tools/includes;../string/includes;../core/includes;../fileio/includes;../../java/jdk/include;../../java/jdk/include/win32;../../libs/GetWindowsVersion;includes;src/c;../output_stream/includes;../localization/includes;../call_scilab/includes;../../libs/MALLOC/includes;../../libs/libxml2;../../libs/libxml2/libxml;../../libs/dynamiclibrary/includes;../../libs/intl;../api_scilab/includes;../preferences/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>FORDLL;NDEBUG;_WINDOWS;_USRDLL;LIBJVM_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
@@ -193,10 +196,11 @@ lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Pla
 lib /DEF:"$(ProjectDir)Scilab_windows_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)scilab_windows.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)String_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)string.lib" 1&gt;NUL 2&gt;NUL
 lib /DEF:"$(ProjectDir)Call_scilab_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)call_scilab.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)preferences_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)preferences.lib" 1&gt;NUL 2&gt;NUL
 </Command>
     </PreLinkEvent>
     <Link>
-      <AdditionalDependencies>core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>preferences.lib;core.lib;scilab_windows.lib;string.lib;call_scilab.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile>
       <ModuleDefinitionFile>libjvm_export.def</ModuleDefinitionFile>
       <GenerateDebugInformation>false</GenerateDebugInformation>
diff --git a/scilab/modules/jvm/preferences_Import.def b/scilab/modules/jvm/preferences_Import.def
new file mode 100644 (file)
index 0000000..c98bb34
--- /dev/null
@@ -0,0 +1,5 @@
+LIBRARY    preferences.dll
+
+
+EXPORTS
+getScilabPreferences
index 59f600d..d47ec1d 100644 (file)
@@ -28,6 +28,9 @@
 #include "getos.h"
 #include "getshortpathname.h"
 #include "BOOL.h"
+#include "getScilabPreference.h"
+
+static char * getJavaHeapSize();
 /*--------------------------------------------------------------------------*/
 JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_JavaVMOption)
 {
@@ -45,6 +48,7 @@ JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_
             xmlXPathContextPtr xpathCtxt = NULL;
             xmlXPathObjectPtr xpathObj = NULL;
             char *jvm_option_string = NULL;
+            char * heapSize = getJavaHeapSize();
 
             int indice = 0;
             {
@@ -76,7 +80,8 @@ JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_
             if (xpathObj && xpathObj->nodesetval->nodeMax)
             {
                 /* the Xpath has been understood and there are node */
-                int    i;
+                int i;
+                char heapSizeUsed = 0;
                 for (i = 0; i < xpathObj->nodesetval->nodeNr; i++)
                 {
 
@@ -89,7 +94,15 @@ JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_
                         {
                             /* we found the tag name */
                             const char *str = (const char*)attrib->children->content;
-                            jvm_option_string = strdup(str);
+                            if (strstr(str, "-Xmx") == str && heapSize)
+                            {
+                                jvm_option_string = heapSize;
+                                heapSizeUsed = 1;
+                            }
+                            else
+                            {
+                                jvm_option_string = strdup(str);
+                            }
                         }
                         attrib = attrib->next;
                     }
@@ -113,7 +126,11 @@ JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_
                     }
 
                     if (jvm_option_string) FREE(jvm_option_string);
+                }
 
+                if (!heapSizeUsed)
+                {
+                    FREE(heapSize);
                 }
             }
 
@@ -162,3 +179,21 @@ JavaVMOption * getJvmOptions(char *SCI_PATH, char *filename_xml_conf, int *size_
     return NULL;
 }
 /*--------------------------------------------------------------------------*/
+char * getJavaHeapSize()
+{
+    const char * value = getScilabPreferences()->heapSize;
+    char * rvalue = NULL;
+    int ivalue;
+
+    if (value)
+    {
+        ivalue = (int)atof(value);
+        if (ivalue > 0)
+        {
+            rvalue = (char *)MALLOC(24 * sizeof(char));
+            sprintf(rvalue, "-Xmx%dm", ivalue);
+        }
+    }
+
+    return rvalue;
+}
index 480a766..1601df1 100644 (file)
@@ -4,7 +4,7 @@
 CATEGORY       CDATA   "Scilab jvm_options"
 VERSION_SCI    CDATA   "5.3"
 VERSION_DOC    CDATA   "1.0"
-AUTHOR         CDATA   "Allan CORNET DIGITEO 2010"
+AUTHOR         CDATA   "Allan CORNET DIGITEO 2010">
 
 <!ELEMENT option EMPTY >
 <!ATTLIST option value CDATA #REQUIRED >
index 73f7c69..c82f0b5 100644 (file)
@@ -46,9 +46,7 @@ libscipreferences_la_src_xslt_xwizard_DATA = \
 
 PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
 
-PREFERENCES_C_SOURCES =
-
-PREFERENCES_CXX_SOURCES =
+PREFERENCES_C_SOURCES = src/c/getScilabPreference.c
 
 GATEWAY_C_SOURCES = sci_gateway/c/gw_preferences.c
 
@@ -60,8 +58,9 @@ libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
     -I$(srcdir)/src/cpp/ \
     -I$(srcdir)/src/c/ \
     -I$(srcdir)/src/jni/ \
+    $(XML_FLAGS) \
     -I$(top_srcdir)/libs/MALLOC/includes/ \
-    -I$(top_srcdir)/modules/commons/src/jni \
+    -I$(top_srcdir)/modules/commons/src/jni/ \
     -I$(top_srcdir)/modules/jvm/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes/ \
@@ -69,18 +68,21 @@ libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     -I$(top_srcdir)/modules/core/includes/ \
     -I$(top_srcdir)/modules/functions/includes/ \
+    -I$(top_srcdir)/modules/string/includes/ \
     $(AM_CPPFLAGS)
 
 # Without the preferences module 
-libscipreferences_disable_la_CPPFLAGS = -I$(srcdir)/includes/ \
+libscipreferences_cli_la_CPPFLAGS = -I$(srcdir)/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/output_stream/includes \
        $(AM_CPPFLAGS)
 
-PREFERENCES_DISABLE_C_SOURCES = src/nopreferences/nopreferences.c
-libscipreferences_disable_la_SOURCES = $(PREFERENCES_DISABLE_C_SOURCES)
+PREFERENCES_CLI_C_SOURCES = src/nopreferences/nopreferences.c
+libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_C_SOURCES)
+
+libscipreferences_la_LDFLAGS = $(X_LIBS) $(X_EXTRA_LIBS) $(XML_LIBS) $(AM_LDFLAGS)
 
-pkglib_LTLIBRARIES = libscipreferences-disable.la
+pkglib_LTLIBRARIES = libscipreferences-cli.la
 
 if GUI
     pkglib_LTLIBRARIES += libscipreferences.la 
@@ -88,8 +90,8 @@ if GUI
 endif
 
 
-libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES) $(PREFERENCES_JNI_SOURCES) $(PREFERENCES_CXX_SOURCES)
-libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES) 
+libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)  $(PREFERENCES_JNI_SOURCES)
 libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
 libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
 
@@ -109,10 +111,8 @@ if SWIG
 BUILT_SOURCES+=swig
 endif
 
-libscipreferences_la_LIBADD = libscipreferences-algo.la \
-    $(top_builddir)/libs/MALLOC/libscimalloc.la \
-    $(top_builddir)/modules/jvm/libscijvm.la \
-    $(top_builddir)/modules/output_stream/libscioutput_stream.la
+libscipreferences_cli_la_LIBADD = libscipreferences-algo.la
+libscipreferences_la_LIBADD = libscipreferences-algo.la
 
 
 #### preferences : gateway declaration ####
index 40aad0b..fa03a44 100644 (file)
@@ -127,27 +127,31 @@ am__installdirs = "$(DESTDIR)$(pkglibdir)" \
        "$(DESTDIR)$(libscipreferences_la_src_xslt_xwizarddir)"
 LTLIBRARIES = $(noinst_LTLIBRARIES) $(pkglib_LTLIBRARIES)
 libscipreferences_algo_la_LIBADD =
-am__objects_1 =
-am__objects_2 = libscipreferences_algo_la-ScilabPreferences.lo
-am_libscipreferences_algo_la_OBJECTS = $(am__objects_1) \
-       $(am__objects_2) $(am__objects_1)
+am__objects_1 = libscipreferences_algo_la-getScilabPreference.lo
+am_libscipreferences_algo_la_OBJECTS = $(am__objects_1)
 libscipreferences_algo_la_OBJECTS =  \
        $(am_libscipreferences_algo_la_OBJECTS)
+libscipreferences_algo_la_LINK = $(LIBTOOL) --tag=CC \
+       $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=link $(CCLD) \
+       $(libscipreferences_algo_la_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 @GUI_TRUE@am_libscipreferences_algo_la_rpath =
-libscipreferences_disable_la_LIBADD =
-am__objects_3 = libscipreferences_disable_la-nopreferences.lo
-am_libscipreferences_disable_la_OBJECTS = $(am__objects_3)
-libscipreferences_disable_la_OBJECTS =  \
-       $(am_libscipreferences_disable_la_OBJECTS)
-libscipreferences_la_DEPENDENCIES = libscipreferences-algo.la \
-       $(top_builddir)/libs/MALLOC/libscimalloc.la \
-       $(top_builddir)/modules/jvm/libscijvm.la \
-       $(top_builddir)/modules/output_stream/libscioutput_stream.la
-am__objects_4 = libscipreferences_la-gw_preferences.lo
-am__objects_5 = libscipreferences_la-sci_addModulePreferences.lo \
+libscipreferences_cli_la_DEPENDENCIES = libscipreferences-algo.la
+am__objects_2 = libscipreferences_cli_la-nopreferences.lo
+am_libscipreferences_cli_la_OBJECTS = $(am__objects_2)
+libscipreferences_cli_la_OBJECTS =  \
+       $(am_libscipreferences_cli_la_OBJECTS)
+libscipreferences_la_DEPENDENCIES = libscipreferences-algo.la
+am__objects_3 = libscipreferences_la-gw_preferences.lo
+am__objects_4 = libscipreferences_la-sci_addModulePreferences.lo \
        libscipreferences_la-sci_removeModulePreferences.lo
-am_libscipreferences_la_OBJECTS = $(am__objects_4) $(am__objects_5)
+am__objects_5 = libscipreferences_la-ScilabPreferences.lo
+am_libscipreferences_la_OBJECTS = $(am__objects_3) $(am__objects_4) \
+       $(am__objects_5)
 libscipreferences_la_OBJECTS = $(am_libscipreferences_la_OBJECTS)
+libscipreferences_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+       $(CXXFLAGS) $(libscipreferences_la_LDFLAGS) $(LDFLAGS) -o $@
 @GUI_TRUE@am_libscipreferences_la_rpath = -rpath $(pkglibdir)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
 depcomp = $(SHELL) $(top_srcdir)/config/depcomp
@@ -172,10 +176,10 @@ CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
 SOURCES = $(libscipreferences_algo_la_SOURCES) \
-       $(libscipreferences_disable_la_SOURCES) \
+       $(libscipreferences_cli_la_SOURCES) \
        $(libscipreferences_la_SOURCES)
 DIST_SOURCES = $(libscipreferences_algo_la_SOURCES) \
-       $(libscipreferences_disable_la_SOURCES) \
+       $(libscipreferences_cli_la_SOURCES) \
        $(libscipreferences_la_SOURCES)
 DATA = $(libscipreferences_la_etc_DATA) \
        $(libscipreferences_la_root_DATA) \
@@ -475,8 +479,7 @@ libscipreferences_la_src_xslt_xwizard_DATA = \
        src/xslt/XWizard/XWizard-xcos.xsl
 
 PREFERENCES_JNI_SOURCES = src/jni/ScilabPreferences.cpp
-PREFERENCES_C_SOURCES = 
-PREFERENCES_CXX_SOURCES = 
+PREFERENCES_C_SOURCES = src/c/getScilabPreference.c
 GATEWAY_C_SOURCES = sci_gateway/c/gw_preferences.c
 GATEWAY_CXX_SOURCES = sci_gateway/cpp/sci_addModulePreferences.cpp \
                       sci_gateway/cpp/sci_removeModulePreferences.cpp
@@ -486,8 +489,9 @@ libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
     -I$(srcdir)/src/cpp/ \
     -I$(srcdir)/src/c/ \
     -I$(srcdir)/src/jni/ \
+    $(XML_FLAGS) \
     -I$(top_srcdir)/libs/MALLOC/includes/ \
-    -I$(top_srcdir)/modules/commons/src/jni \
+    -I$(top_srcdir)/modules/commons/src/jni/ \
     -I$(top_srcdir)/modules/jvm/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
     -I$(top_srcdir)/modules/output_stream/includes/ \
@@ -495,21 +499,23 @@ libscipreferences_la_CPPFLAGS = $(JAVA_JNI_INCLUDE) \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     -I$(top_srcdir)/modules/core/includes/ \
     -I$(top_srcdir)/modules/functions/includes/ \
+    -I$(top_srcdir)/modules/string/includes/ \
     $(AM_CPPFLAGS)
 
 
 # Without the preferences module 
-libscipreferences_disable_la_CPPFLAGS = -I$(srcdir)/includes/ \
+libscipreferences_cli_la_CPPFLAGS = -I$(srcdir)/includes/ \
        -I$(top_srcdir)/modules/localization/includes/ \
        -I$(top_srcdir)/modules/output_stream/includes \
        $(AM_CPPFLAGS)
 
-PREFERENCES_DISABLE_C_SOURCES = src/nopreferences/nopreferences.c
-libscipreferences_disable_la_SOURCES = $(PREFERENCES_DISABLE_C_SOURCES)
-pkglib_LTLIBRARIES = libscipreferences-disable.la $(am__append_1)
+PREFERENCES_CLI_C_SOURCES = src/nopreferences/nopreferences.c
+libscipreferences_cli_la_SOURCES = $(PREFERENCES_CLI_C_SOURCES)
+libscipreferences_la_LDFLAGS = $(X_LIBS) $(X_EXTRA_LIBS) $(XML_LIBS) $(AM_LDFLAGS)
+pkglib_LTLIBRARIES = libscipreferences-cli.la $(am__append_1)
 @GUI_TRUE@noinst_LTLIBRARIES = libscipreferences-algo.la 
-libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES) $(PREFERENCES_JNI_SOURCES) $(PREFERENCES_CXX_SOURCES)
-libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES) 
+libscipreferences_algo_la_SOURCES = $(PREFERENCES_C_SOURCES)
+libscipreferences_la_SOURCES = $(GATEWAY_C_SOURCES) $(GATEWAY_CXX_SOURCES)  $(PREFERENCES_JNI_SOURCES)
 libscipreferences_algo_la_CFLAGS = $(libscipreferences_la_CFLAGS)
 libscipreferences_algo_la_CPPFLAGS = $(libscipreferences_la_CPPFLAGS)
 
@@ -519,11 +525,8 @@ INCLUDE_FLAGS = $(libscipreferences_la_CPPFLAGS)
 GIWS_WRAPPERS = src/jni/ScilabPreferences.giws.xml
 SWIG_WRAPPERS = 
 BUILT_SOURCES = $(am__append_2) $(am__append_3)
-libscipreferences_la_LIBADD = libscipreferences-algo.la \
-    $(top_builddir)/libs/MALLOC/libscimalloc.la \
-    $(top_builddir)/modules/jvm/libscijvm.la \
-    $(top_builddir)/modules/output_stream/libscioutput_stream.la
-
+libscipreferences_cli_la_LIBADD = libscipreferences-algo.la
+libscipreferences_la_LIBADD = libscipreferences-algo.la
 
 #### preferences : gateway declaration ####
 libscipreferences_la_sci_gatewaydir = $(mydatadir)/sci_gateway
@@ -679,11 +682,11 @@ clean-pkglibLTLIBRARIES:
          rm -f "$${dir}/so_locations"; \
        done
 libscipreferences-algo.la: $(libscipreferences_algo_la_OBJECTS) $(libscipreferences_algo_la_DEPENDENCIES) $(EXTRA_libscipreferences_algo_la_DEPENDENCIES) 
-       $(CXXLINK) $(am_libscipreferences_algo_la_rpath) $(libscipreferences_algo_la_OBJECTS) $(libscipreferences_algo_la_LIBADD) $(LIBS)
-libscipreferences-disable.la: $(libscipreferences_disable_la_OBJECTS) $(libscipreferences_disable_la_DEPENDENCIES) $(EXTRA_libscipreferences_disable_la_DEPENDENCIES) 
-       $(LINK) -rpath $(pkglibdir) $(libscipreferences_disable_la_OBJECTS) $(libscipreferences_disable_la_LIBADD) $(LIBS)
+       $(libscipreferences_algo_la_LINK) $(am_libscipreferences_algo_la_rpath) $(libscipreferences_algo_la_OBJECTS) $(libscipreferences_algo_la_LIBADD) $(LIBS)
+libscipreferences-cli.la: $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_DEPENDENCIES) $(EXTRA_libscipreferences_cli_la_DEPENDENCIES) 
+       $(LINK) -rpath $(pkglibdir) $(libscipreferences_cli_la_OBJECTS) $(libscipreferences_cli_la_LIBADD) $(LIBS)
 libscipreferences.la: $(libscipreferences_la_OBJECTS) $(libscipreferences_la_DEPENDENCIES) $(EXTRA_libscipreferences_la_DEPENDENCIES) 
-       $(CXXLINK) $(am_libscipreferences_la_rpath) $(libscipreferences_la_OBJECTS) $(libscipreferences_la_LIBADD) $(LIBS)
+       $(libscipreferences_la_LINK) $(am_libscipreferences_la_rpath) $(libscipreferences_la_OBJECTS) $(libscipreferences_la_LIBADD) $(LIBS)
 
 mostlyclean-compile:
        -rm -f *.$(OBJEXT)
@@ -691,8 +694,9 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_disable_la-nopreferences.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_algo_la-getScilabPreference.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_cli_la-nopreferences.Plo@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-ScilabPreferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-gw_preferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscipreferences_la-sci_removeModulePreferences.Plo@am__quote@
@@ -718,12 +722,19 @@ distclean-compile:
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
 
-libscipreferences_disable_la-nopreferences.lo: src/nopreferences/nopreferences.c
-@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_disable_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscipreferences_disable_la-nopreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_disable_la-nopreferences.Tpo -c -o libscipreferences_disable_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
-@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscipreferences_disable_la-nopreferences.Tpo $(DEPDIR)/libscipreferences_disable_la-nopreferences.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/nopreferences/nopreferences.c' object='libscipreferences_disable_la-nopreferences.lo' libtool=yes @AMDEPBACKSLASH@
+libscipreferences_algo_la-getScilabPreference.lo: src/c/getScilabPreference.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_algo_la_CFLAGS) $(CFLAGS) -MT libscipreferences_algo_la-getScilabPreference.lo -MD -MP -MF $(DEPDIR)/libscipreferences_algo_la-getScilabPreference.Tpo -c -o libscipreferences_algo_la-getScilabPreference.lo `test -f 'src/c/getScilabPreference.c' || echo '$(srcdir)/'`src/c/getScilabPreference.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscipreferences_algo_la-getScilabPreference.Tpo $(DEPDIR)/libscipreferences_algo_la-getScilabPreference.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/c/getScilabPreference.c' object='libscipreferences_algo_la-getScilabPreference.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(libscipreferences_algo_la_CFLAGS) $(CFLAGS) -c -o libscipreferences_algo_la-getScilabPreference.lo `test -f 'src/c/getScilabPreference.c' || echo '$(srcdir)/'`src/c/getScilabPreference.c
+
+libscipreferences_cli_la-nopreferences.lo: src/nopreferences/nopreferences.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscipreferences_cli_la-nopreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo -c -o libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscipreferences_cli_la-nopreferences.Tpo $(DEPDIR)/libscipreferences_cli_la-nopreferences.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/nopreferences/nopreferences.c' object='libscipreferences_cli_la-nopreferences.lo' libtool=yes @AMDEPBACKSLASH@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_disable_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscipreferences_disable_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libscipreferences_cli_la-nopreferences.lo `test -f 'src/nopreferences/nopreferences.c' || echo '$(srcdir)/'`src/nopreferences/nopreferences.c
 
 libscipreferences_la-gw_preferences.lo: sci_gateway/c/gw_preferences.c
 @am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libscipreferences_la-gw_preferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-gw_preferences.Tpo -c -o libscipreferences_la-gw_preferences.lo `test -f 'sci_gateway/c/gw_preferences.c' || echo '$(srcdir)/'`sci_gateway/c/gw_preferences.c
@@ -753,13 +764,6 @@ libscipreferences_la-gw_preferences.lo: sci_gateway/c/gw_preferences.c
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<
 
-libscipreferences_algo_la-ScilabPreferences.lo: src/jni/ScilabPreferences.cpp
-@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_algo_la-ScilabPreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Tpo -c -o libscipreferences_algo_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
-@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Tpo $(DEPDIR)/libscipreferences_algo_la-ScilabPreferences.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/jni/ScilabPreferences.cpp' object='libscipreferences_algo_la-ScilabPreferences.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_algo_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_algo_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
-
 libscipreferences_la-sci_addModulePreferences.lo: sci_gateway/cpp/sci_addModulePreferences.cpp
 @am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_la-sci_addModulePreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Tpo -c -o libscipreferences_la-sci_addModulePreferences.lo `test -f 'sci_gateway/cpp/sci_addModulePreferences.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_addModulePreferences.cpp
 @am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Tpo $(DEPDIR)/libscipreferences_la-sci_addModulePreferences.Plo
@@ -774,6 +778,13 @@ libscipreferences_la-sci_removeModulePreferences.lo: sci_gateway/cpp/sci_removeM
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_la-sci_removeModulePreferences.lo `test -f 'sci_gateway/cpp/sci_removeModulePreferences.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_removeModulePreferences.cpp
 
+libscipreferences_la-ScilabPreferences.lo: src/jni/ScilabPreferences.cpp
+@am__fastdepCXX_TRUE@  $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT libscipreferences_la-ScilabPreferences.lo -MD -MP -MF $(DEPDIR)/libscipreferences_la-ScilabPreferences.Tpo -c -o libscipreferences_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
+@am__fastdepCXX_TRUE@  $(am__mv) $(DEPDIR)/libscipreferences_la-ScilabPreferences.Tpo $(DEPDIR)/libscipreferences_la-ScilabPreferences.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='src/jni/ScilabPreferences.cpp' object='libscipreferences_la-ScilabPreferences.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(LIBTOOL)  --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscipreferences_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o libscipreferences_la-ScilabPreferences.lo `test -f 'src/jni/ScilabPreferences.cpp' || echo '$(srcdir)/'`src/jni/ScilabPreferences.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
diff --git a/scilab/modules/preferences/includes/getScilabPreference.h b/scilab/modules/preferences/includes/getScilabPreference.h
new file mode 100644 (file)
index 0000000..5377bd0
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+ *
+ * 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
+ *
+ */
+
+#ifndef __GETSCILABPREFERENCES_H__
+#define __GETSCILABPREFERENCES_H__
+
+#include "dynlib_preferences_scilab.h"
+
+typedef struct
+{
+    const char * heapSize;
+    const char * columnsToDisplay;
+    const char * linesToDisplay;
+    const char * historySaveAfter;
+    const char * historyFile;
+    const char * historyLines;
+} ScilabPreferences;
+
+#define HEAPSIZE_XPATH (const xmlChar*)"//general/body/java-heap-memory/@heap-size"
+#define COLUMNSTODISPLAY_XPATH (const xmlChar*)"//console/body/display/@columns-to-display"
+#define LINESTODISPLAY_XPATH (const xmlChar*)"//console/body/display/@lines-to-display"
+#define HISTORYSAVEAFTER_XPATH (const xmlChar*)"//command-history/body/history-save/@after"
+#define HISTORYFILE_XPATH (const xmlChar*)"//command-history/body/history-settings/@history-file"
+#define HISTORYLINES_XPATH (const xmlChar*)"//command-history/body/history-settings/@history-lines"
+
+PREFERENCES_SCILAB_IMPEXP const ScilabPreferences * getScilabPreferences();
+PREFERENCES_SCILAB_IMPEXP void reloadScilabPreferences();
+PREFERENCES_SCILAB_IMPEXP void clearScilabPreferences();
+
+#endif // __GETSCILABPREFERENCES_H__
index caf1f15..6f2755b 100644 (file)
@@ -13,6 +13,7 @@
 #include <windows.h> 
 /*--------------------------------------------------------------------------*/ 
 #pragma comment(lib,"../../../../bin/libintl.lib")
+#pragma comment(lib, "../../../../bin/libxml2.lib")
 /*--------------------------------------------------------------------------*/ 
 int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
 {
diff --git a/scilab/modules/preferences/src/c/getScilabPreference.c b/scilab/modules/preferences/src/c/getScilabPreference.c
new file mode 100644 (file)
index 0000000..51e4006
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+ *
+ * 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 <stdlib.h>
+#include <libxml/xpath.h>
+#include <libxml/xmlreader.h>
+#include "getScilabPreference.h"
+#include "GetXmlFileEncoding.h"
+#include "MALLOC.h"
+#include "FileExist.h"
+#include "stricmp.h"
+#ifdef _MSC_VER
+#include "strdup_windows.h"
+#endif
+#include "getshortpathname.h"
+#include "BOOL.h"
+#include "SCIHOME.h"
+
+#define XCONF "%s/XConfiguration.xml"
+
+/*--------------------------------------------------------------------------*/
+static unsigned char isInit = 0;
+static ScilabPreferences scilabPref;
+/*--------------------------------------------------------------------------*/
+static void getPrefs();
+static char * getAttribute(xmlDocPtr doc, xmlXPathContextPtr xpathCtxt, const char * xpath);
+static void initPrefs();
+/*--------------------------------------------------------------------------*/
+const ScilabPreferences * getScilabPreferences()
+{
+    getPrefs();
+    return &scilabPref;
+}
+/*--------------------------------------------------------------------------*/
+void initPrefs()
+{
+    scilabPref.heapSize = NULL;
+    scilabPref.columnsToDisplay = NULL;
+    scilabPref.linesToDisplay = NULL;
+    scilabPref.historySaveAfter = NULL;
+    scilabPref.historyFile = NULL;
+    scilabPref.historyLines = NULL;
+}
+/*--------------------------------------------------------------------------*/
+void reloadScilabPreferences()
+{
+    clearScilabPreferences();
+    getPrefs();
+}
+/*--------------------------------------------------------------------------*/
+void clearScilabPreferences()
+{
+    if (isInit == 1)
+    {
+        FREE(scilabPref.heapSize);
+        FREE(scilabPref.columnsToDisplay);
+        FREE(scilabPref.linesToDisplay);
+        FREE(scilabPref.historySaveAfter);
+        FREE(scilabPref.historyFile);
+        FREE(scilabPref.historyLines);
+        initPrefs();
+    }
+    isInit = 0;
+}
+/*--------------------------------------------------------------------------*/
+void getPrefs()
+{
+    xmlDocPtr doc = NULL;
+    xmlXPathContextPtr xpathCtxt = NULL;
+    char * SCIHOME = NULL;
+    char * path = NULL;
+    BOOL bConvert = FALSE;
+    char * shortfilename_xml_conf = NULL;
+
+    if (!isInit)
+    {
+        initPrefs();
+
+        SCIHOME = getSCIHOME();
+        path = (char *)MALLOC(strlen(SCIHOME) + strlen(XCONF));
+
+        sprintf(path, XCONF, SCIHOME);
+
+        if (FileExist(path))
+        {
+            shortfilename_xml_conf = getshortpathname(path, &bConvert);
+            if (shortfilename_xml_conf)
+            {
+                doc = xmlParseFile(shortfilename_xml_conf);
+                FREE(shortfilename_xml_conf);
+                shortfilename_xml_conf = NULL;
+            }
+            FREE(path);
+            path = NULL;
+        }
+
+        if (doc == NULL)
+        {
+            return;
+        }
+
+        if (stricmp(doc->encoding, "utf-8"))
+        {
+            return;
+        }
+
+        xpathCtxt = xmlXPathNewContext(doc);
+
+        if (xpathCtxt)
+        {
+            scilabPref.heapSize = strdup(getAttribute(doc, xpathCtxt, HEAPSIZE_XPATH));
+            scilabPref.columnsToDisplay = strdup(getAttribute(doc, xpathCtxt, COLUMNSTODISPLAY_XPATH));
+            scilabPref.linesToDisplay = strdup(getAttribute(doc, xpathCtxt, LINESTODISPLAY_XPATH));
+            scilabPref.historySaveAfter = strdup(getAttribute(doc, xpathCtxt, HISTORYSAVEAFTER_XPATH));
+            scilabPref.historyFile = strdup(getAttribute(doc, xpathCtxt, HISTORYFILE_XPATH));
+            scilabPref.historyLines = strdup(getAttribute(doc, xpathCtxt, HISTORYLINES_XPATH));
+
+            xmlXPathFreeContext(xpathCtxt);
+        }
+        xmlFreeDoc(doc);
+
+        isInit = 1;
+    }
+}
+/*--------------------------------------------------------------------------*/
+char * getAttribute(xmlDocPtr doc, xmlXPathContextPtr xpathCtxt, const char * xpath)
+{
+    char * value = NULL;
+    xmlXPathObjectPtr xpathObj = xmlXPathEval((const xmlChar*)xpath, xpathCtxt);
+    if (xpathObj && xpathObj->nodesetval->nodeMax)
+    {
+        value = (char *)((xmlAttrPtr)xpathObj->nodesetval->nodeTab[0])->children->content;
+    }
+
+    if (xpathObj) xmlXPathFreeObject(xpathObj);
+
+    return value;
+}
+/*--------------------------------------------------------------------------*/
index 620eb3c..49f255e 100644 (file)
@@ -77,7 +77,7 @@
     <ClCompile>
       <AdditionalOptions>%(AdditionalOptions)</AdditionalOptions>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../../libs/libxml2;../../../string/includes;../../../windows_tools/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
     </Midl>
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../../libs/libxml2;../../../string/includes;../../../windows_tools/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>Default</BasicRuntimeChecks>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../../libs/libxml2;../../../string/includes;../../../windows_tools/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
       <WholeProgramOptimization>false</WholeProgramOptimization>
-      <AdditionalIncludeDirectories>.;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../includes;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../cpp;../jni;../../../commons/src/jni;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+      <AdditionalIncludeDirectories>../../includes;.;../jni;../cpp;../../../../java/jdk/include;../../../../java/jdk/include/win32;../../../../libs/intl;../../../../libs/MALLOC/includes;../../../api_scilab/includes;../../../core/includes;../../../localization/includes;../../../jvm/includes;../../../fileio/includes;../../../output_stream/includes;../../../commons/src/jni;../../../../libs/libxml2;../../../string/includes;../../../windows_tools/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <PreprocessorDefinitions>_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;PREFERENCES_SCILAB_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <StringPooling>true</StringPooling>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
       <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
     </ProjectReference>
+    <ProjectReference Include="..\..\..\windows_tools\src\c\scilab_windows\scilab_windows.vcxproj">
+      <Project>{8028f371-6a94-4a26-8804-6e7f05f1d1aa}</Project>
+    </ProjectReference>
   </ItemGroup>
   <ItemGroup>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_addModulePreferences.cpp" />
     <ClCompile Include="..\..\sci_gateway\c\gw_preferences.c" />
     <ClCompile Include="..\jni\ScilabPreferences.cpp" />
     <ClCompile Include="DllmainPreferences.c" />
+    <ClCompile Include="getScilabPreference.c" />
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\includes\dynlib_preferences_scilab.h" />
+    <ClInclude Include="..\..\includes\getScilabPreference.h" />
     <ClInclude Include="..\..\includes\gw_preferences.h" />
     <ClInclude Include="..\jni\ScilabPreferences.hxx" />
   </ItemGroup>
index 10a9954..a3c2f3d 100644 (file)
@@ -51,6 +51,9 @@
     <ClCompile Include="..\..\sci_gateway\cpp\sci_removeModulePreferences.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="getScilabPreference.c">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\jni\ScilabPreferences.hxx">
@@ -62,5 +65,8 @@
     <ClInclude Include="..\..\includes\gw_preferences.h">
       <Filter>Header Files</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\includes\getScilabPreference.h">
+      <Filter>Header Files</Filter>
+    </ClInclude>
   </ItemGroup>
 </Project>
\ No newline at end of file
index 3491fd2..996cb4a 100644 (file)
@@ -1,31 +1,25 @@
 #include "ScilabPreferences.hxx"
-/* Generated by GIWS (version 2.0.0) with command:
-giws --disable-return-size-array --output-dir src/jni/ --throws-exception-on-error --description-file src/jni/ScilabPreferences.giws.xml 
+/* Generated by GIWS (version 2.0.1) with command:
+giws -e -r -f ScilabPreferences.giws.xml
 */
 /*
 
-Copyright 2007-2008 INRIA
-Copyright 2008-2011 DIGITEO
-Copyright 2011-2012 Scilab Enterprises
-
-Author : Sylvestre Ledru & others
-
 This is generated code.
 
 This software is a computer program whose purpose is to hide the complexity
 of accessing Java objects/methods from C++ code.
 
 This software is governed by the CeCILL-B license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
+abiding by the rules of distribution of free software.  You can  use,
 modify and/ or redistribute the software under the terms of the CeCILL-B
 license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
+"http://www.cecill.info".
 
 As a counterpart to the access to the source code and  rights to copy,
 modify and redistribute granted by the license, users are provided only
 with a limited warranty  and the software's author,  the holder of the
 economic rights,  and the successive licensors  have only  limited
-liability. 
+liability.
 
 In this respect, the user's attention is drawn to the risks associated
 with loading,  using,  modifying and/or developing or reproducing the
@@ -34,193 +28,216 @@ that may mean  that it is complicated to manipulate,  and  that  also
 therefore means  that it is reserved for developers  and  experienced
 professionals having in-depth computer knowledge. Users are therefore
 encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and,  more generally, to use and operate it in the
+same conditions as regards security.
 
 The fact that you are presently reading this means that you have had
 knowledge of the CeCILL-B license and that you accept its terms.
 */
 
-namespace org_scilab_modules_preferences {
+namespace org_scilab_modules_preferences
+{
+
+// Static declarations (if any)
 
-                // Static declarations (if any)
-                
 // Returns the current env
 
-JNIEnv * ScilabPreferences::getCurrentEnv() {
-JNIEnv * curEnv = NULL;
-jint res=this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
-if (res != JNI_OK) {
-throw GiwsException::JniException(getCurrentEnv());
-}
-return curEnv;
+JNIEnv * ScilabPreferences::getCurrentEnv()
+{
+    JNIEnv * curEnv = NULL;
+    jint res = this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+    if (res != JNI_OK)
+    {
+        throw GiwsException::JniException(getCurrentEnv());
+    }
+    return curEnv;
 }
 // Destructor
 
-ScilabPreferences::~ScilabPreferences() {
-JNIEnv * curEnv = NULL;
-this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+ScilabPreferences::~ScilabPreferences()
+{
+    JNIEnv * curEnv = NULL;
+    this->jvm->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
 
-curEnv->DeleteGlobalRef(this->instance);
-curEnv->DeleteGlobalRef(this->instanceClass);
+    curEnv->DeleteGlobalRef(this->instance);
+    curEnv->DeleteGlobalRef(this->instanceClass);
 }
 // Constructors
-ScilabPreferences::ScilabPreferences(JavaVM * jvm_) {
-jmethodID constructObject = NULL ;
-jobject localInstance ;
-jclass localClass ;
+ScilabPreferences::ScilabPreferences(JavaVM * jvm_)
+{
+    jmethodID constructObject = NULL ;
+    jobject localInstance ;
+    jclass localClass ;
 
-const std::string construct="<init>";
-const std::string param="()V";
-jvm=jvm_;
+    const std::string construct = "<init>";
+    const std::string param = "()V";
+    jvm = jvm_;
 
-JNIEnv * curEnv = getCurrentEnv();
+    JNIEnv * curEnv = getCurrentEnv();
 
-localClass = curEnv->FindClass( this->className().c_str() ) ;
-if (localClass == NULL) {
-  throw GiwsException::JniClassNotFoundException(curEnv, this->className());
-}
+    localClass = curEnv->FindClass( this->className().c_str() ) ;
+    if (localClass == NULL)
+    {
+        throw GiwsException::JniClassNotFoundException(curEnv, this->className());
+    }
 
-this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+    this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
 
-/* localClass is not needed anymore */
-curEnv->DeleteLocalRef(localClass);
+    /* localClass is not needed anymore */
+    curEnv->DeleteLocalRef(localClass);
 
-if (this->instanceClass == NULL) {
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-}
+    if (this->instanceClass == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
 
 
-constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
-if(constructObject == NULL){
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-}
+    constructObject = curEnv->GetMethodID( this->instanceClass, construct.c_str() , param.c_str() ) ;
+    if (constructObject == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
 
-localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
-if(localInstance == NULL){
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-}
-this->instance = curEnv->NewGlobalRef(localInstance) ;
-if(this->instance == NULL){
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-}
-/* localInstance not needed anymore */
-curEnv->DeleteLocalRef(localInstance);
+    localInstance = curEnv->NewObject( this->instanceClass, constructObject ) ;
+    if (localInstance == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
 
-                /* Methods ID set to NULL */
-voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID=NULL;
-voidremoveToolboxInfosjstringjava_lang_StringID=NULL;
+    this->instance = curEnv->NewGlobalRef(localInstance) ;
+    if (this->instance == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
+    /* localInstance not needed anymore */
+    curEnv->DeleteLocalRef(localInstance);
+
+    /* Methods ID set to NULL */
+    voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID = NULL;
+    voidremoveToolboxInfosjstringjava_lang_StringID = NULL;
 
 
 }
 
-ScilabPreferences::ScilabPreferences(JavaVM * jvm_, jobject JObj) {
-        jvm=jvm_;
+ScilabPreferences::ScilabPreferences(JavaVM * jvm_, jobject JObj)
+{
+    jvm = jvm_;
 
-        JNIEnv * curEnv = getCurrentEnv();
+    JNIEnv * curEnv = getCurrentEnv();
 
-jclass localClass = curEnv->GetObjectClass(JObj);
-        this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
-        curEnv->DeleteLocalRef(localClass);
+    jclass localClass = curEnv->GetObjectClass(JObj);
+    this->instanceClass = static_cast<jclass>(curEnv->NewGlobalRef(localClass));
+    curEnv->DeleteLocalRef(localClass);
 
-        if (this->instanceClass == NULL) {
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-        }
+    if (this->instanceClass == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
 
-        this->instance = curEnv->NewGlobalRef(JObj) ;
-        if(this->instance == NULL){
-throw GiwsException::JniObjectCreationException(curEnv, this->className());
-        }
-        /* Methods ID set to NULL */
-        voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID=NULL;
-voidremoveToolboxInfosjstringjava_lang_StringID=NULL;
+    this->instance = curEnv->NewGlobalRef(JObj) ;
+    if (this->instance == NULL)
+    {
+        throw GiwsException::JniObjectCreationException(curEnv, this->className());
+    }
+    /* Methods ID set to NULL */
+    voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID = NULL;
+    voidremoveToolboxInfosjstringjava_lang_StringID = NULL;
 
 
 }
 
 // Generic methods
 
-void ScilabPreferences::synchronize() {
-if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK) {
-throw GiwsException::JniMonitorException(getCurrentEnv(), "ScilabPreferences");
-}
+void ScilabPreferences::synchronize()
+{
+    if (getCurrentEnv()->MonitorEnter(instance) != JNI_OK)
+    {
+        throw GiwsException::JniMonitorException(getCurrentEnv(), "ScilabPreferences");
+    }
 }
 
-void ScilabPreferences::endSynchronize() {
-if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK) {
-throw GiwsException::JniMonitorException(getCurrentEnv(), "ScilabPreferences");
-}
+void ScilabPreferences::endSynchronize()
+{
+    if ( getCurrentEnv()->MonitorExit(instance) != JNI_OK)
+    {
+        throw GiwsException::JniMonitorException(getCurrentEnv(), "ScilabPreferences");
+    }
 }
 // Method(s)
 
-void ScilabPreferences::addToolboxInfos (JavaVM * jvm_, char const* name, char const* path, char const* prefFile){
-
-JNIEnv * curEnv = NULL;
-jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
-jclass cls = curEnv->FindClass( className().c_str() );
-
-jmethodID voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID = curEnv->GetStaticMethodID(cls, "addToolboxInfos", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V" ) ;
-if (voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID == NULL) {
-throw GiwsException::JniMethodNotFoundException(curEnv, "addToolboxInfos");
-}
-
-jstring name_ = curEnv->NewStringUTF( name );
-if (name != NULL && name_ == NULL)
+void ScilabPreferences::addToolboxInfos (JavaVM * jvm_, char const* name, char const* path, char const* prefFile)
 {
-throw GiwsException::JniBadAllocException(curEnv);
-}
 
+    JNIEnv * curEnv = NULL;
+    jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+    jclass cls = curEnv->FindClass( className().c_str() );
 
-jstring path_ = curEnv->NewStringUTF( path );
-if (path != NULL && path_ == NULL)
-{
-throw GiwsException::JniBadAllocException(curEnv);
-}
+    jmethodID voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID = curEnv->GetStaticMethodID(cls, "addToolboxInfos", "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V" ) ;
+    if (voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID == NULL)
+    {
+        throw GiwsException::JniMethodNotFoundException(curEnv, "addToolboxInfos");
+    }
 
+    jstring name_ = curEnv->NewStringUTF( name );
+    if (name != NULL && name_ == NULL)
+    {
+        throw GiwsException::JniBadAllocException(curEnv);
+    }
 
-jstring prefFile_ = curEnv->NewStringUTF( prefFile );
-if (prefFile != NULL && prefFile_ == NULL)
-{
-throw GiwsException::JniBadAllocException(curEnv);
-}
 
+    jstring path_ = curEnv->NewStringUTF( path );
+    if (path != NULL && path_ == NULL)
+    {
+        throw GiwsException::JniBadAllocException(curEnv);
+    }
 
-                         curEnv->CallStaticVoidMethod(cls, voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID ,name_, path_, prefFile_);
-                        curEnv->DeleteLocalRef(name_);
-curEnv->DeleteLocalRef(path_);
-curEnv->DeleteLocalRef(prefFile_);
-curEnv->DeleteLocalRef(cls);
-if (curEnv->ExceptionCheck()) {
-throw GiwsException::JniCallMethodException(curEnv);
-}
-}
 
-void ScilabPreferences::removeToolboxInfos (JavaVM * jvm_, char const* path){
+    jstring prefFile_ = curEnv->NewStringUTF( prefFile );
+    if (prefFile != NULL && prefFile_ == NULL)
+    {
+        throw GiwsException::JniBadAllocException(curEnv);
+    }
 
-JNIEnv * curEnv = NULL;
-jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
-jclass cls = curEnv->FindClass( className().c_str() );
 
-jmethodID voidremoveToolboxInfosjstringjava_lang_StringID = curEnv->GetStaticMethodID(cls, "removeToolboxInfos", "(Ljava/lang/String;)V" ) ;
-if (voidremoveToolboxInfosjstringjava_lang_StringID == NULL) {
-throw GiwsException::JniMethodNotFoundException(curEnv, "removeToolboxInfos");
+    curEnv->CallStaticVoidMethod(cls, voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID , name_, path_, prefFile_);
+    curEnv->DeleteLocalRef(name_);
+    curEnv->DeleteLocalRef(path_);
+    curEnv->DeleteLocalRef(prefFile_);
+    curEnv->DeleteLocalRef(cls);
+    if (curEnv->ExceptionCheck())
+    {
+        throw GiwsException::JniCallMethodException(curEnv);
+    }
 }
 
-jstring path_ = curEnv->NewStringUTF( path );
-if (path != NULL && path_ == NULL)
+void ScilabPreferences::removeToolboxInfos (JavaVM * jvm_, char const* path)
 {
-throw GiwsException::JniBadAllocException(curEnv);
-}
 
-
-                         curEnv->CallStaticVoidMethod(cls, voidremoveToolboxInfosjstringjava_lang_StringID ,path_);
-                        curEnv->DeleteLocalRef(path_);
-curEnv->DeleteLocalRef(cls);
-if (curEnv->ExceptionCheck()) {
-throw GiwsException::JniCallMethodException(curEnv);
-}
+    JNIEnv * curEnv = NULL;
+    jvm_->AttachCurrentThread(reinterpret_cast<void **>(&curEnv), NULL);
+    jclass cls = curEnv->FindClass( className().c_str() );
+
+    jmethodID voidremoveToolboxInfosjstringjava_lang_StringID = curEnv->GetStaticMethodID(cls, "removeToolboxInfos", "(Ljava/lang/String;)V" ) ;
+    if (voidremoveToolboxInfosjstringjava_lang_StringID == NULL)
+    {
+        throw GiwsException::JniMethodNotFoundException(curEnv, "removeToolboxInfos");
+    }
+
+    jstring path_ = curEnv->NewStringUTF( path );
+    if (path != NULL && path_ == NULL)
+    {
+        throw GiwsException::JniBadAllocException(curEnv);
+    }
+
+
+    curEnv->CallStaticVoidMethod(cls, voidremoveToolboxInfosjstringjava_lang_StringID , path_);
+    curEnv->DeleteLocalRef(path_);
+    curEnv->DeleteLocalRef(cls);
+    if (curEnv->ExceptionCheck())
+    {
+        throw GiwsException::JniCallMethodException(curEnv);
+    }
 }
 
 }
index b44a376..42f9a3b 100644 (file)
@@ -1,30 +1,24 @@
-/* Generated by GIWS (version 2.0.0) with command:
-giws --disable-return-size-array --output-dir src/jni/ --throws-exception-on-error --description-file src/jni/ScilabPreferences.giws.xml 
+/* Generated by GIWS (version 2.0.1) with command:
+giws -e -r -f ScilabPreferences.giws.xml
 */
 /*
 
-Copyright 2007-2008 INRIA
-Copyright 2008-2011 DIGITEO
-Copyright 2011-2012 Scilab Enterprises
-
-Author : Sylvestre Ledru & others
-
 This is generated code.
 
 This software is a computer program whose purpose is to hide the complexity
 of accessing Java objects/methods from C++ code.
 
 This software is governed by the CeCILL-B license under French law and
-abiding by the rules of distribution of free software.  You can  use, 
+abiding by the rules of distribution of free software.  You can  use,
 modify and/ or redistribute the software under the terms of the CeCILL-B
 license as circulated by CEA, CNRS and INRIA at the following URL
-"http://www.cecill.info". 
+"http://www.cecill.info".
 
 As a counterpart to the access to the source code and  rights to copy,
 modify and redistribute granted by the license, users are provided only
 with a limited warranty  and the software's author,  the holder of the
 economic rights,  and the successive licensors  have only  limited
-liability. 
+liability.
 
 In this respect, the user's attention is drawn to the risks associated
 with loading,  using,  modifying and/or developing or reproducing the
@@ -33,9 +27,9 @@ that may mean  that it is complicated to manipulate,  and  that  also
 therefore means  that it is reserved for developers  and  experienced
 professionals having in-depth computer knowledge. Users are therefore
 encouraged to load and test the software's suitability as regards their
-requirements in conditions enabling the security of their systems and/or 
-data to be ensured and,  more generally, to use and operate it in the 
-same conditions as regards security. 
+requirements in conditions enabling the security of their systems and/or
+data to be ensured and,  more generally, to use and operate it in the
+same conditions as regards security.
 
 The fact that you are presently reading this means that you have had
 knowledge of the CeCILL-B license and that you accept its terms.
@@ -52,11 +46,11 @@ knowledge of the CeCILL-B license and that you accept its terms.
 
 #include "GiwsException.hxx"
 
-        #if !defined(byte) | !defined(_MSC_VER) /* Defined anyway with Visual */
-                typedef signed char byte;
-        #else
-                #pragma message("Byte has been redefined elsewhere. Some problems can happen")
-        #endif
+#if !defined(byte) | !defined(_MSC_VER) /* Defined anyway with Visual */
+typedef signed char byte;
+#else
+#pragma message("Byte has been redefined elsewhere. Some problems can happen")
+#endif
 
 
 #ifndef GIWSEXPORT
@@ -75,89 +69,91 @@ knowledge of the CeCILL-B license and that you accept its terms.
 # endif
 #endif
 
-namespace org_scilab_modules_preferences {
-class GIWSEXPORT ScilabPreferences {
+namespace org_scilab_modules_preferences
+{
+class GIWSEXPORT ScilabPreferences
+{
 
 private:
-JavaVM * jvm;
+    JavaVM * jvm;
 
 protected:
-jmethodID voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID; // cache method id
-jmethodID voidremoveToolboxInfosjstringjava_lang_StringID; // cache method id
-
+    jmethodID voidaddToolboxInfosjstringjava_lang_Stringjstringjava_lang_Stringjstringjava_lang_StringID; // cache method id
+    jmethodID voidremoveToolboxInfosjstringjava_lang_StringID; // cache method id
 
 
-jobject instance;
-jclass instanceClass; // cache class
 
-                       
-// Caching (if any)
+    jobject instance;
+    jclass instanceClass; // cache class
 
 
-/**
-* Get the environment matching to the current thread.
-*/
-virtual JNIEnv * getCurrentEnv();
+    // Caching (if any)
 
-public:
-// Constructor
-/**
-* Create a wrapping of the object from a JNIEnv.
-* It will call the default constructor
-* @param JEnv_ the Java Env
-*/
-ScilabPreferences(JavaVM * jvm_);
 
-/**
-* Create a wrapping of an already existing object from a JNIEnv.
-* The object must have already been instantiated
-* @param JEnv_ the Java Env
-* @param JObj the object
-*/
-ScilabPreferences(JavaVM * jvm_, jobject JObj);
+    /**
+    * Get the environment matching to the current thread.
+    */
+    virtual JNIEnv * getCurrentEnv();
 
-
-/** 
-* This is a fake constructor to avoid the constructor
-* chaining when dealing with extended giws classes 
-*/
+public:
+    // Constructor
+    /**
+    * Create a wrapping of the object from a JNIEnv.
+    * It will call the default constructor
+    * @param JEnv_ the Java Env
+    */
+    ScilabPreferences(JavaVM * jvm_);
+
+    /**
+    * Create a wrapping of an already existing object from a JNIEnv.
+    * The object must have already been instantiated
+    * @param JEnv_ the Java Env
+    * @param JObj the object
+    */
+    ScilabPreferences(JavaVM * jvm_, jobject JObj);
+
+
+    /**
+    * This is a fake constructor to avoid the constructor
+    * chaining when dealing with extended giws classes
+    */
 #ifdef FAKEGIWSDATATYPE
-ScilabPreferences(fakeGiwsDataType::fakeGiwsDataType /* unused */) {}
+    ScilabPreferences(fakeGiwsDataType::fakeGiwsDataType /* unused */) {}
 #endif
 
-// Destructor
-~ScilabPreferences();
+    // Destructor
+    ~ScilabPreferences();
 
-// Generic method
-// Synchronization methods
-/**
-* Enter monitor associated with the object.
-* Equivalent of creating a "synchronized(obj)" scope in Java.
-*/
-void synchronize();
+    // Generic method
+    // Synchronization methods
+    /**
+    * Enter monitor associated with the object.
+    * Equivalent of creating a "synchronized(obj)" scope in Java.
+    */
+    void synchronize();
 
-/**
-* Exit monitor associated with the object.
-* Equivalent of ending a "synchronized(obj)" scope.
-*/
-void endSynchronize();
+    /**
+    * Exit monitor associated with the object.
+    * Equivalent of ending a "synchronized(obj)" scope.
+    */
+    void endSynchronize();
+
+    // Methods
+    static void addToolboxInfos(JavaVM * jvm_, char const* name, char const* path, char const* prefFile);
+
+    static void removeToolboxInfos(JavaVM * jvm_, char const* path);
 
-// Methods
-static void addToolboxInfos(JavaVM * jvm_, char const* name, char const* path, char const* prefFile);
 
-static void removeToolboxInfos(JavaVM * jvm_, char const* path);
+    /**
+    * Get class name to use for static methods
+    * @return class name to use for static methods
+    */
 
+    static const std::string className()
+    {
+        return "org/scilab/modules/preferences/ScilabPreferences";
+    }
 
-                        /**
-                        * Get class name to use for static methods
-                        * @return class name to use for static methods
-                        */
-                        
-                static const std::string className()
-                {
-                return "org/scilab/modules/preferences/ScilabPreferences";
-                }
-                
 };