diff options
author | Shashank | 2017-05-29 12:40:26 +0530 |
---|---|---|
committer | Shashank | 2017-05-29 12:40:26 +0530 |
commit | 0345245e860375a32c9a437c4a9d9cae807134e9 (patch) | |
tree | ad51ecbfa7bcd3cc5f09834f1bb8c08feaa526a4 /modules/javasci | |
download | scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.gz scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.tar.bz2 scilab_for_xcos_on_cloud-0345245e860375a32c9a437c4a9d9cae807134e9.zip |
CMSCOPE changed
Diffstat (limited to 'modules/javasci')
103 files changed, 14081 insertions, 0 deletions
diff --git a/modules/javasci/.libs/libjavasci2.la b/modules/javasci/.libs/libjavasci2.la new file mode 120000 index 000000000..5e505a138 --- /dev/null +++ b/modules/javasci/.libs/libjavasci2.la @@ -0,0 +1 @@ +../libjavasci2.la
\ No newline at end of file diff --git a/modules/javasci/.libs/libjavasci2.lai b/modules/javasci/.libs/libjavasci2.lai new file mode 100755 index 000000000..c410b8990 --- /dev/null +++ b/modules/javasci/.libs/libjavasci2.lai @@ -0,0 +1,41 @@ +# libjavasci2.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.2 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libjavasci2.so.5' + +# Names of this library. +library_names='libjavasci2.so.5.5.2 libjavasci2.so.5 libjavasci2.so' + +# The name of the static archive. +old_library='' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags=' -pthread' + +# Libraries that this one depends upon. +dependency_libs=' /usr/local/lib/scilab/libscilab.la -L/home/shashank/scilab-master_5.5.2/usr/lib -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server /usr/local/lib/scilab/libscigui.la /usr/local/lib/scilab/libscirenderer.la /usr/local/lib/scilab/libscigraphics.la /usr/local/lib/scilab/libscigraphic_export.la /usr/local/lib/scilab/libsciconsole.la /usr/local/lib/scilab/libsciaction_binding.la /usr/local/lib/scilab/libscigraphic_objects.la /usr/local/lib/scilab/libsciscinotes.la /usr/local/lib/scilab/libsciui_data.la /usr/local/lib/scilab/libscihistory_browser.la /usr/local/lib/scilab/libscitclsci.la -ltk8.5 -ltcl8.5 /usr/local/lib/scilab/libscipreferences.la /usr/local/lib/scilab/libsciexternal_objects_java.la /usr/local/lib/scilab/libscihelptools.la /usr/local/lib/scilab/libscitypes.la /usr/local/lib/scilab/libscicommons.la /usr/local/lib/scilab/libscijvm.la -ljava -lverify -ljvm /usr/local/lib/scilab/libscilab-cli.la -lcurl -lssl -lcrypto -lrt /usr/local/lib/scilab/libscifunctions.la /usr/local/lib/scilab/libscicall_scilab.la /usr/local/lib/scilab/libscilocalization.la /usr/local/lib/scilab/libscispecial_functions.la /usr/local/lib/scilab/libscicompletion.la /usr/local/lib/scilab/libscihistory_manager.la -lpcreposix -lpcre /usr/local/lib/scilab/libscihdf5.la -lhdf5 -lhdf5_hl -lfftw3 /usr/local/lib/scilab/libscistatistics.la /usr/local/lib/scilab/libscixml.la -lxml2 -lz /usr/local/lib/scilab/libsciexternal_objects.la /usr/local/lib/scilab/libscipreferences-cli.la /usr/local/lib/scilab/libscigui-disable.la /usr/local/lib/scilab/libscigraphics-disable.la /usr/local/lib/scilab/libscigraphic_export-disable.la /usr/local/lib/scilab/libsciconsole-minimal.la /usr/local/lib/scilab/libsciaction_binding-disable.la /usr/local/lib/scilab/libscijvm-disable.la /usr/local/lib/scilab/libscixcos-disable.la /usr/local/lib/scilab/libscigraphic_objects-disable.la /usr/local/lib/scilab/libsciscinotes-disable.la /usr/local/lib/scilab/libsciui_data-disable.la /usr/local/lib/scilab/libscihistory_browser-disable.la /usr/local/lib/scilab/libscicommons-disable.la -llapack -lblas -lpthread -ldl -lcurses -lm' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libjavasci2. +current=10 +age=5 +revision=2 + +# Is this an already installed library? +installed=yes + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib/scilab' diff --git a/modules/javasci/.libs/libjavasci2.so b/modules/javasci/.libs/libjavasci2.so new file mode 120000 index 000000000..ed0f588ad --- /dev/null +++ b/modules/javasci/.libs/libjavasci2.so @@ -0,0 +1 @@ +libjavasci2.so.5.5.2
\ No newline at end of file diff --git a/modules/javasci/.libs/libjavasci2.so.5 b/modules/javasci/.libs/libjavasci2.so.5 new file mode 120000 index 000000000..ed0f588ad --- /dev/null +++ b/modules/javasci/.libs/libjavasci2.so.5 @@ -0,0 +1 @@ +libjavasci2.so.5.5.2
\ No newline at end of file diff --git a/modules/javasci/.libs/libjavasci2.so.5.5.2 b/modules/javasci/.libs/libjavasci2.so.5.5.2 Binary files differnew file mode 100755 index 000000000..b2f0f653e --- /dev/null +++ b/modules/javasci/.libs/libjavasci2.so.5.5.2 diff --git a/modules/javasci/Core_f_Import.def b/modules/javasci/Core_f_Import.def new file mode 100755 index 000000000..3538bcbbb --- /dev/null +++ b/modules/javasci/Core_f_Import.def @@ -0,0 +1,8 @@ + LIBRARY core_f.dll + + +EXPORTS +; +;core_f +; +inisci_ diff --git a/modules/javasci/Javasci.vcxproj b/modules/javasci/Javasci.vcxproj new file mode 100755 index 000000000..15d8cfac0 --- /dev/null +++ b/modules/javasci/Javasci.vcxproj @@ -0,0 +1,240 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{0BD503EF-5CB6-4277-BAC4-8955C97F247D}</ProjectGuid> + <RootNamespace>Javasci</RootNamespace> + <Keyword>Win32Proj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <CharacterSet>MultiByte</CharacterSet> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir> + <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>includes;../core/includes;../api_scilab/includes;../output_stream/includes;../windows_tools/includes;../tclsci/includes;../tclsci/includes/tcltk/include;../../java/jdk/include/;../../java/jdk/include/win32;../../libs/intl;../call_scilab/includes;src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;_USRDLL;JAVA_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <ObjectFileName>$(Configuration)/</ObjectFileName> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)Javasci.pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <AdditionalDependencies>core_f.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + </PostBuildEvent> + <PreLinkEvent> + <Command>lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1>NUL 2>NUL</Command> + </PreLinkEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Midl> + <TargetEnvironment>X64</TargetEnvironment> + </Midl> + <ClCompile> + <Optimization>Disabled</Optimization> + <AdditionalIncludeDirectories>includes;../core/includes;../api_scilab/includes;../output_stream/includes;../windows_tools/includes;../tclsci/includes;../tclsci/includes/tcltk/include;../../java/jdk/include/;../../java/jdk/include/win32;../../libs/intl;../call_scilab/includes;src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>_DEBUG;_USRDLL;JAVA_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> + <ObjectFileName>$(Configuration)/</ObjectFileName> + <WarningLevel>Level3</WarningLevel> + </ClCompile> + <Link> + <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>true</GenerateDebugInformation> + <ProgramDatabaseFile>$(IntDir)Javasci.pdb</ProgramDatabaseFile> + <SubSystem>Windows</SubSystem> + <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary> + <TargetMachine>MachineX64</TargetMachine> + <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <AdditionalDependencies>core_f.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + </PostBuildEvent> + <PreLinkEvent> + <Command>lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1>NUL 2>NUL</Command> + </PreLinkEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <AdditionalIncludeDirectories>includes;../core/includes;../api_scilab/includes;../output_stream/includes;../windows_tools/includes;../tclsci/includes;../tclsci/includes/tcltk/include;../../java/jdk/include/;../../java/jdk/include/win32;../../libs/intl;../call_scilab/includes;src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;_USRDLL;JAVA_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <ObjectFileName>$(Configuration)/</ObjectFileName> + <WarningLevel>Level3</WarningLevel> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding> + </EnableCOMDATFolding> + <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary> + <TargetMachine>MachineX86</TargetMachine> + <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <AdditionalDependencies>core_f.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + </PostBuildEvent> + <PreLinkEvent> + <Command>lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1>NUL 2>NUL</Command> + </PreLinkEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Midl> + <TargetEnvironment>X64</TargetEnvironment> + </Midl> + <ClCompile> + <AdditionalIncludeDirectories>includes;../core/includes;../api_scilab/includes;../output_stream/includes;../windows_tools/includes;../tclsci/includes;../tclsci/includes/tcltk/include;../../java/jdk/include/;../../java/jdk/include/win32;../../libs/intl;../call_scilab/includes;src/c;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <PreprocessorDefinitions>NDEBUG;_USRDLL;JAVA_EXPORTS;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <ObjectFileName>$(Configuration)/</ObjectFileName> + <WarningLevel>Level3</WarningLevel> + <MultiProcessorCompilation>true</MultiProcessorCompilation> + </ClCompile> + <Link> + <OutputFile>$(SolutionDir)bin\$(ProjectName).dll</OutputFile> + <GenerateDebugInformation>false</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <OptimizeReferences>true</OptimizeReferences> + <EnableCOMDATFolding> + </EnableCOMDATFolding> + <ImportLibrary>$(SolutionDir)bin\$(ProjectName).lib</ImportLibrary> + <TargetMachine>MachineX64</TargetMachine> + <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck> + <RandomizedBaseAddress>false</RandomizedBaseAddress> + <AdditionalDependencies>core_f.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + <PostBuildEvent> + </PostBuildEvent> + <PreLinkEvent> + <Command>lib /DEF:"$(ProjectDir)core_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core_f.lib" 1>NUL 2>NUL</Command> + </PreLinkEvent> + </ItemDefinitionGroup> + <ItemGroup> + <ClCompile Include="src\jni\call_scilab_wrap.c" /> + <ClCompile Include="src\c\DllmainJavasci.c" /> + <ClCompile Include="src\c\javasci2_helper.c" /> + <ClCompile Include="src\jni\putLists.c" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="src\c\javasci2_helper.h" /> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="javasci.rc" /> + </ItemGroup> + <ItemGroup> + <None Include="Core_f_Import.def" /> + <None Include="javasci.iss" /> + <None Include="Makefile.am" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\api_scilab\api_scilab.vcxproj"> + <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\call_scilab\call_scilab.vcxproj"> + <Project>{6a6a6f76-ccc0-40c4-8aee-8a010f49a604}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\core\src\c\core.vcxproj"> + <Project>{c6e2bc17-34d8-46e4-85f3-6293cb21adcd}</Project> + </ProjectReference> + <ProjectReference Include="..\graphics\graphics.vcxproj"> + <Project>{8ccdd3c2-b025-4a12-a986-1aa28d7c0c33}</Project> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + <ProjectReference Include="..\graphic_objects\src\c\graphic_objects.vcxproj"> + <Project>{30f9ee41-587b-4618-8de7-698d3fba4985}</Project> + </ProjectReference> + <ProjectReference Include="..\output_stream\src\c\output_stream.vcxproj"> + <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> + <ReferenceOutputAssembly>false</ReferenceOutputAssembly> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/modules/javasci/Javasci.vcxproj.filters b/modules/javasci/Javasci.vcxproj.filters new file mode 100755 index 000000000..0ccccee70 --- /dev/null +++ b/modules/javasci/Javasci.vcxproj.filters @@ -0,0 +1,54 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions> + </Filter> + <Filter Include="localization"> + <UniqueIdentifier>{15ec80be-2eb1-4a30-b9ed-bbfb13daa61c}</UniqueIdentifier> + </Filter> + <Filter Include="Libraries Dependencies"> + <UniqueIdentifier>{a80262cb-66f7-4d15-8271-cbddc2c2816b}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="src\jni\call_scilab_wrap.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="src\c\DllmainJavasci.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="src\c\javasci2_helper.c"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="src\jni\putLists.c"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="src\c\javasci2_helper.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ResourceCompile Include="javasci.rc"> + <Filter>Resource Files</Filter> + </ResourceCompile> + </ItemGroup> + <ItemGroup> + <None Include="javasci.iss" /> + <None Include="Makefile.am" /> + <None Include="Core_f_Import.def"> + <Filter>Libraries Dependencies</Filter> + </None> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/modules/javasci/Makefile b/modules/javasci/Makefile new file mode 100755 index 000000000..0b7650b90 --- /dev/null +++ b/modules/javasci/Makefile @@ -0,0 +1,1300 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# modules/javasci/Makefile. Generated from Makefile.in by configure. + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + + +# +# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +# Copyright (C) INRIA - 2006 - Sylvestre Ledru +# Copyright (C) DIGITEO - 2009 - Pierre MARECHAL +# +# 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.1-en.txt +# + +# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr> +# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr> +# +# 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.1-en.txt +# + +########## +### Makefile included stuff +### Target, variable, suffixes which are supposed to be useful in every makefile.am +########## + + + +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/scilab +pkgincludedir = $(includedir)/scilab +pkglibdir = $(libdir)/scilab +pkglibexecdir = $(libexecdir)/scilab +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = x86_64-unknown-linux-gnu +host_triplet = x86_64-unknown-linux-gnu +#am__append_1 = swig +DIST_COMMON = $(top_srcdir)/Makefile.incl.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/config/mkinstalldirs \ + $(top_srcdir)/config/depcomp TODO +am__append_2 = java +subdir = modules/javasci +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/backtrace.m4 \ + $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/curl.m4 \ + $(top_srcdir)/m4/docbook.m4 $(top_srcdir)/m4/doxygen.m4 \ + $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \ + $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/hdf5.m4 \ + $(top_srcdir)/m4/intel_compiler.m4 \ + $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \ + $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \ + $(top_srcdir)/m4/mpi.m4 $(top_srcdir)/m4/ocaml.m4 \ + $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \ + $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \ + $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkglibdir)" \ + "$(DESTDIR)$(libjavasci2_la_etcdir)" \ + "$(DESTDIR)$(libjavasci2_la_rootdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +libjavasci2_la_DEPENDENCIES = $(top_builddir)/modules/api_scilab/libsciapi_scilab.la \ + $(top_builddir)/modules/libscilab.la +am__libjavasci2_la_SOURCES_DIST = src/jni/call_scilab_wrap.c \ + src/jni/putLists.c src/c/javasci2_helper.c +am__dirstamp = $(am__leading_dot)dirstamp +am__objects_1 = \ + src/jni/libjavasci2_la-call_scilab_wrap.lo \ + src/jni/libjavasci2_la-putLists.lo \ + src/c/libjavasci2_la-javasci2_helper.lo +am_libjavasci2_la_OBJECTS = $(am__objects_1) +libjavasci2_la_OBJECTS = $(am_libjavasci2_la_OBJECTS) +AM_V_lt = $(am__v_lt_$(V)) +am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY)) +am__v_lt_0 = --silent +am__v_lt_1 = +am_libjavasci2_la_rpath = -rpath $(pkglibdir) +AM_V_P = $(am__v_P_$(V)) +am__v_P_ = $(am__v_P_$(AM_DEFAULT_VERBOSITY)) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_$(V)) +am__v_GEN_ = $(am__v_GEN_$(AM_DEFAULT_VERBOSITY)) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_$(V)) +am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I. -I$(top_builddir)/modules/core/includes +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_$(V)) +am__v_CC_ = $(am__v_CC_$(AM_DEFAULT_VERBOSITY)) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_$(V)) +am__v_CCLD_ = $(am__v_CCLD_$(AM_DEFAULT_VERBOSITY)) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libjavasci2_la_SOURCES) +DIST_SOURCES = $(am__libjavasci2_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(libjavasci2_la_etc_DATA) $(libjavasci2_la_root_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing aclocal-1.14 +ALL_LINGUAS = en_US fr_FR zh_CN zh_TW ru_RU ca_ES de_DE es_ES pt_BR ja_JP it_IT uk_UA pl_PL cs_CZ +ALL_LINGUAS_DOC = en_US fr_FR pt_BR ja_JP ru_RU +AMTAR = $${TAR-tar} +AM_DEFAULT_VERBOSITY = 1 +ANT = /usr/bin/ant +ANTLR = /usr/share/java/antlr.jar +AR = ar +ARPACK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -larpack +ASM3 = /usr/share/java/asm3-3.3.2.jar +AUTOCONF = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing autoconf +AUTOHEADER = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing autoheader +AUTOMAKE = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing automake-1.14 +AVALON_FRAMEWORK = /home/shashank/scilab-master_5.5.2/thirdparty/avalon-framework.jar +AWK = mawk +BATIK = /home/shashank/scilab-master_5.5.2/thirdparty/batik-all-1.7.jar +BLAS_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lblas +CC = gcc +CCACHE = +CCDEPMODE = depmode=gcc3 +CFLAGS = -g -O2 +CHECKSTYLE = +COBERTURA = /usr/share/java/cobertura.jar +COMMONS_BEANUTILS = +COMMONS_IO = /home/shashank/scilab-master_5.5.2/thirdparty/commons-io.jar +COMMONS_LOGGING = /home/shashank/scilab-master_5.5.2/thirdparty/commons-logging.jar +CPP = gcc -E +CPPFLAGS = +CURL_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include +CURL_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/curl-config +CURL_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lcurl -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -lssl -lcrypto -lrt -lz +CURL_VERSION = libcurl 7.19.7 +CXX = g++ +CXXCPP = g++ -E +CXXDEPMODE = depmode=gcc3 +CXXFLAGS = -g -O2 +CYGPATH_W = echo +DEFS = -DHAVE_CONFIG_H +DEMOTOOLS_ENABLE = yes +DEPDIR = .deps +DLLTOOL = false +DOCBOOK_ROOT = /home/shashank/scilab-master_5.5.2/thirdparty/docbook/ +DOXYGEN_BIN = +DSYMUTIL = +DUMPBIN = +ECHO_C = +ECHO_N = -n +ECHO_T = +ECJ = /home/shashank/scilab-master_5.5.2/thirdparty/ecj.jar +EGREP = /bin/grep -E +EXEEXT = +F77 = gfortran +FFLAGS = -g -O2 +FFTW3_LIB = -L/home/shashank/scilab-master_5.5.2/usr/lib -lfftw3 +FFTW_ENABLE = yes +FGREP = /bin/grep -F +FLEXDOCK = /home/shashank/scilab-master_5.5.2/thirdparty/flexdock-1.2.4.jar +FLIBS = -L/usr/lib/gcc/x86_64-linux-gnu/5 -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu -L/usr/lib/gcc/x86_64-linux-gnu/5/../../../../lib -L/lib/x86_64-linux-gnu -L/lib/../lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/5/../../.. -lpthread -ldl -lcurses -lgfortran -lm -lquadmath +FOP = /home/shashank/scilab-master_5.5.2/thirdparty/fop.jar +FREEHEP_GRAPHICS2D = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphics2d.jar +FREEHEP_GRAPHICSIO = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphicsio.jar +FREEHEP_GRAPHICSIO_EMF = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-graphicsio-emf.jar +FREEHEP_IO = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-io.jar +FREEHEP_UTIL = /home/shashank/scilab-master_5.5.2/thirdparty/freehep-util.jar +GENHTML = +GETTEXT_MACRO_VERSION = 0.19 +GIWS_BIN = +GLUEGEN2_RT = /home/shashank/scilab-master_5.5.2/thirdparty/gluegen2-rt.jar +GMSGFMT = /usr/bin/msgfmt +GMSGFMT_015 = /usr/bin/msgfmt +GRAPHICS_ENABLE = yes +GREP = /bin/grep +GUI_ENABLE = yes +HDF5_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include +HDF5_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lhdf5 -lhdf5_hl +HELP_ENABLE = yes +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +INSTALL_PROGRAM = ${INSTALL} +INSTALL_SCRIPT = ${INSTALL} +INSTALL_STRIP_PROGRAM = $(install_sh) -c -s +INTLLIBS = +INTL_MACOSX_LIBS = +JAR = /usr/lib/jvm/java-8-openjdk-amd64/bin/jar +JAVA = /usr/lib/jvm/java-8-openjdk-amd64/bin/java +JAVAC = /usr/lib/jvm/java-8-openjdk-amd64/bin/javac +JAVAC_DEBUG = off +JAVADOC = /usr/lib/jvm/java-8-openjdk-amd64/bin/javadoc +JAVAH = /usr/lib/jvm/java-8-openjdk-amd64/bin/javah +JAVASCI_ENABLE = yes +JAVA_ENABLE = yes +JAVA_G = /usr/lib/jvm/java-8-openjdk-amd64/bin/java +JAVA_HOME = /usr/lib/jvm/java-8-openjdk-amd64 +JAVA_JNI_INCLUDE = -I/usr/lib/jvm/java-8-openjdk-amd64/include -I/usr/lib/jvm/java-8-openjdk-amd64/include/linux +JAVA_JNI_LIBS = -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 -ljava -lverify -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm +JDB = /usr/lib/jvm/java-8-openjdk-amd64/bin/jdb +JEUCLID_CORE = /home/shashank/scilab-master_5.5.2/thirdparty/jeuclid-core.jar +JGRAPHX = /home/shashank/scilab-master_5.5.2/thirdparty/jgraphx.jar +JHALL = /home/shashank/scilab-master_5.5.2/thirdparty/jhall.jar +JLATEXMATH = /home/shashank/scilab-master_5.5.2/thirdparty/jlatexmath-1.0.3.jar +JLATEXMATH_FOP = /home/shashank/scilab-master_5.5.2/thirdparty/jlatexmath-fop-1.0.3.jar +JOGL2 = /home/shashank/scilab-master_5.5.2/thirdparty/jogl2.jar +JROSETTA_API = /home/shashank/scilab-master_5.5.2/thirdparty/jrosetta-API.jar +JROSETTA_ENGINE = /home/shashank/scilab-master_5.5.2/thirdparty/jrosetta-engine.jar +JUNIT4 = /usr/share/java/junit4.jar +LAPACK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -llapack +LCOV = +LD = /usr/bin/ld -m elf_x86_64 +LDFLAGS = -Wl,--no-as-needed +LIBICONV = -liconv +LIBINTL = +LIBM = -lm +LIBOBJS = +LIBS = -lpthread -ldl -lcurses -lm +LIBTOOL = $(SHELL) $(top_builddir)/libtool +LIPO = +LN_S = ln -s +LOGGING_LEVEL = SEVERE +LOOKS = /home/shashank/scilab-master_5.5.2/thirdparty/looks-2.1.1.jar +LTLIBICONV = -liconv +LTLIBINTL = +LTLIBOBJS = +MAINT = # +MAKEINFO = ${SHELL} /home/shashank/scilab-master_5.5.2/config/missing makeinfo +MANIFEST_TOOL = : +MATIO_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include +MATIO_ENABLE = yes +MATIO_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lm -lz -lmatio -lhdf5 +MKDIR_P = /bin/mkdir -p +MPI_ENABLE = no +MSGCAT = /usr/bin/msgcat +MSGFMT = /usr/bin/msgfmt +MSGFMT_015 = /usr/bin/msgfmt +MSGMERGE = /usr/bin/msgmerge +NM = nm +NMEDIT = +OBJDUMP = objdump +OBJEXT = o +OCAMLC = ocamlc +OCAMLDEP = ocamldep +OCAMLLEX = ocamllex +OCAMLOPT = ocamlopt +OCAMLYACC = ocamlyacc +OPENMPI_CC = +OPENMPI_CFLAGS = +OPENMPI_CXX = +OPENMPI_CXXFLAGS = +OPENMPI_LIBS = +OPENMP_CFLAGS = -fopenmp +OPENMP_CXXFLAGS = -fopenmp +OPENMP_ENABLE = yes +OPENMP_LIBS = -lgomp -lstdc++ +OTOOL = +OTOOL64 = +PACKAGE = scilab +PACKAGE_BUGREPORT = http://bugzilla.scilab.org/ +PACKAGE_NAME = Scilab +PACKAGE_STRING = Scilab 5 +PACKAGE_TARNAME = scilab +PACKAGE_URL = +PACKAGE_VERSION = 5 +PATH_SEPARATOR = : +PCRE_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include +PCRE_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/pcre-config +PCRE_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lpcreposix -lpcre +PCRE_VERSION = 8.35 +PKG_CONFIG = /usr/bin/pkg-config +POSUB = po +POW_LIB = +PYTHON = +RANLIB = ranlib +RELOCATABLE = no +RT_LIB = -lrt +SAXON = /home/shashank/scilab-master_5.5.2/thirdparty/saxon9he.jar +SCILAB_BINARY_VERSION = 5.5.2 +SCILAB_LIBRARY_VERSION = 5:5:2 +SCILAB_VERSION_MAINTENANCE = 2 +SCILAB_VERSION_MAJOR = 5 +SCILAB_VERSION_MINOR = 5 +SCIRENDERER = ${modules.dir}/scirenderer/${build.jar.dir}/scirenderer.jar +SCIRENDERER_CP = $SCILAB/modules/scirenderer/jar/scirenderer.jar +SCI_CFLAGS = -D_LARGEFILE64_SOURCE -DNDEBUG -m64 -fno-stack-protector +SCI_CXXFLAGS = -DNDEBUG -fno-stack-protector +SCI_FFLAGS = -DNDEBUG -m64 -fPIC +SCI_LDFLAGS = +SED = /bin/sed +SET_MAKE = +SET_RELOCATABLE = +SHELL = /bin/bash +SKINLF = /home/shashank/scilab-master_5.5.2/thirdparty/skinlf.jar +SPLINT = no +STRIP = strip +SWIG_BIN = +SWIG_JAVA = +SWIG_RUNTIME_LIBS_DIR = +SWIG_SCILAB = +TCLTK_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -ltk8.5 -L/home/shashank/scilab-master_5.5.2/usr/lib -ltcl8.5 -ldl +TCL_INC_PATH = -I/home/shashank/scilab-master_5.5.2/usr/include +TK_INC_PATH = -I/home/shashank/scilab-master_5.5.2/usr/include +UMFPACK_CFLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include +UMFPACK_ENABLE = yes +UMFPACK_LIB = -L/home/shashank/scilab-master_5.5.2/usr/lib -lumfpack -lamd +USE_NLS = yes +VERSION = 5 +WITH_OCAML = +WITH_TKSCI = yes +XCOS_ENABLE = yes +XGETTEXT = /usr/bin/xgettext +XGETTEXT_015 = /usr/bin/xgettext +XGETTEXT_EXTRA_OPTIONS = +XMKMF = +XMLGRAPHICS_COMMONS = /home/shashank/scilab-master_5.5.2/thirdparty/xmlgraphics-commons-1.4.jar +XML_APIS_EXT = /home/shashank/scilab-master_5.5.2/thirdparty/xml-apis-ext.jar +XML_CONFIG = /home/shashank/scilab-master_5.5.2/usr/bin/xml2-config +XML_FLAGS = -I/home/shashank/scilab-master_5.5.2/usr/include/libxml2 +XML_LIBS = -L/home/shashank/scilab-master_5.5.2/usr/lib -lxml2 -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -lz -lm -ldl +XML_VERSION = 2.9.1 +X_CFLAGS = +X_EXTRA_LIBS = +X_LIBS = +X_PRE_LIBS = +abs_builddir = /home/shashank/scilab-master_5.5.2/modules/javasci +abs_srcdir = /home/shashank/scilab-master_5.5.2/modules/javasci +abs_top_builddir = /home/shashank/scilab-master_5.5.2 +abs_top_srcdir = /home/shashank/scilab-master_5.5.2 +ac_ct_AR = ar +ac_ct_CC = gcc +ac_ct_CXX = g++ +ac_ct_DUMPBIN = +ac_ct_F77 = gfortran +am__include = include +am__leading_dot = . +am__quote = +am__tar = $${TAR-tar} chof - "$$tardir" +am__untar = $${TAR-tar} xf - +bindir = ${exec_prefix}/bin +build = x86_64-unknown-linux-gnu +build_alias = +build_cpu = x86_64 +build_os = linux-gnu +build_vendor = unknown +builddir = . +cxx_present = yes +datadir = ${datarootdir} +datarootdir = ${prefix}/share +docdir = ${datarootdir}/doc/${PACKAGE_TARNAME} +dvidir = ${docdir} +exec_prefix = ${prefix} +host = x86_64-unknown-linux-gnu +host_alias = +host_cpu = x86_64 +host_os = linux-gnu +host_vendor = unknown +htmldir = ${docdir} +includedir = ${prefix}/include +infodir = ${datarootdir}/info +install_sh = ${SHELL} /home/shashank/scilab-master_5.5.2/config/install-sh +libdir = ${exec_prefix}/lib +libexecdir = ${exec_prefix}/libexec +localedir = ${datarootdir}/locale +localstatedir = ${prefix}/var +mandir = ${datarootdir}/man +mkdir_p = $(MKDIR_P) +oldincludedir = /usr/include +pdfdir = ${docdir} +prefix = /usr/local +program_transform_name = s,x,x, +psdir = ${docdir} +sbindir = ${exec_prefix}/sbin +sharedstatedir = ${prefix}/com +srcdir = . +sysconfdir = ${prefix}/etc +target_alias = +top_build_prefix = ../../ +top_builddir = ../.. +top_srcdir = ../.. + +#### Target ###### +modulename = javasci + +#### javasci : Conf files #### +libjavasci2_la_rootdir = $(mydatadir) +libjavasci2_la_root_DATA = license.txt + +#### javasci : init scripts #### +libjavasci2_la_etcdir = $(mydatadir)/etc +libjavasci2_la_etc_DATA = etc/javasci.quit etc/javasci.start + +### All the compilation process of java is deleguated to ant + +#### Javasci : sources #### +JAVASCI_V2_C_SOURCES = \ +src/jni/call_scilab_wrap.c \ +src/jni/putLists.c \ +src/c/javasci2_helper.c + +pkglib_LTLIBRARIES = libjavasci2.la +libjavasci2_la_SOURCES = $(JAVASCI_V2_C_SOURCES) + +# For the code check (splint) +CHECK_SRC = $(JAVASCI_C_SOURCES) +INCLUDE_FLAGS = $(libjavasci2_la_CPPFLAGS) +libjavasci2_la_CPPFLAGS = -I$(srcdir)/includes/ \ + -I$(srcdir)/src/c/ \ + $(JAVA_JNI_INCLUDE) \ + $(TCL_INC_PATH) \ + $(TK_INC_PATH) \ + -I$(top_srcdir)/modules/tclsci/includes/ \ + -I$(top_srcdir)/modules/call_scilab/includes/ \ + -I$(top_srcdir)/modules/api_scilab/includes/ \ + -I$(top_srcdir)/modules/fileio/includes/ \ + -I$(top_srcdir)/modules/localization/includes/ \ + -I$(top_srcdir)/modules/output_stream/includes/ \ + $(AM_CPPFLAGS) + +libjavasci2_la_LIBADD = \ + $(top_builddir)/modules/api_scilab/libsciapi_scilab.la \ + $(top_builddir)/modules/libscilab.la + +BUILT_SOURCES = $(am__append_1) + +#### SWIG Declaration #### +SWIG_WRAPPERS = src/jni/call_scilab.i +USEANT = 1 + +# Where all the Scilab stuff is installed (macros, help, ...) +mydatadir = $(pkgdatadir)/modules/$(modulename) + +# Set AM_* SCI detected settings +AM_CPPFLAGS = $(SCI_CPPFLAGS) +AM_CFLAGS = $(SCI_CFLAGS) +AM_CXXFLAGS = $(SCI_CXXFLAGS) +# append includes to AM_FFLAGS to manage fortran includes +AM_FFLAGS = $(SCI_FFLAGS) \ + -I$(top_srcdir)/modules/core/includes/ + +# Tag shared libraries with the Scilab version +AM_LDFLAGS = $(SCI_LDFLAGS) -version-number \ + $(SCILAB_LIBRARY_VERSION) + +# splint options +SPLINT_OPTIONS = -weak -booltype BOOL + +########################### JAVA ###################################### +#### We are delegating java compilation to ant... Thanks to that +#### the procedure will be the same with Microsoft Windows (C) +#### and Linux/Unix +####################################################################### +TARGETS_ALL = $(am__append_2) + +################ MACROS ###################### +# Rule to build a macro +# NOT USED AT THE MOMENT +SUFFIXES = .sci + +########### INSTALL DOCUMENTATION ################### + +# Install documentation files into the right target +# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because +# automake needs the html files to be present which is not the case when +# we are building Scilab + +# Where it should be installed +pkgdocdir = $(mydatadir) + +# What is the mask of the help source +DOCMASKXML = *.xml + +# What is the mask of the MathML sources +DOCMASKMML = *.mml + +########### INSTALL DATA ################### +# Install macros, help & demos +# Where it should be installed +pkgmacrosdir = $(mydatadir) +# Which directory we process +MACRODIRS = macros/ +# Mask of the Scilab sources macros +MACROMASK = *.sci +# Mask of the Scilab executable sources macros +MACROBUILDMASK = *.sce +# Mask of the Scilab compiled macros +MACROBINMASK = *.bin +# List of the standard directory for tests +TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java +# Where the demos should be installed +pkgdemosdir = $(mydatadir) +# List of the standard directory for demos +DEMOS_DIR = demos +# List of the standard directory for examples +EXAMPLES_DIR = examples +# Where to export JAVA archives (.jar) +JARDIR = jar/ +# JAR files mask +JARMASK = *.jar +# Chapter file +HELP_CHAPTERDIR = help/ +HELP_CHAPTERFILE = addchapter.sce +HELP_CHAPTERLANG = en_US fr_FR pt_BR +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .sci .bin .c .lo .o .obj +$(srcdir)/Makefile.in: # $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/javasci/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign modules/javasci/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/Makefile.incl.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: # $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): # $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +src/jni/$(am__dirstamp): + @$(MKDIR_P) src/jni + @: > src/jni/$(am__dirstamp) +src/jni/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/jni/$(DEPDIR) + @: > src/jni/$(DEPDIR)/$(am__dirstamp) +src/jni/libjavasci2_la-call_scilab_wrap.lo: src/jni/$(am__dirstamp) \ + src/jni/$(DEPDIR)/$(am__dirstamp) +src/jni/libjavasci2_la-putLists.lo: src/jni/$(am__dirstamp) \ + src/jni/$(DEPDIR)/$(am__dirstamp) +src/c/$(am__dirstamp): + @$(MKDIR_P) src/c + @: > src/c/$(am__dirstamp) +src/c/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/c/$(DEPDIR) + @: > src/c/$(DEPDIR)/$(am__dirstamp) +src/c/libjavasci2_la-javasci2_helper.lo: src/c/$(am__dirstamp) \ + src/c/$(DEPDIR)/$(am__dirstamp) + +libjavasci2.la: $(libjavasci2_la_OBJECTS) $(libjavasci2_la_DEPENDENCIES) $(EXTRA_libjavasci2_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libjavasci2_la_rpath) $(libjavasci2_la_OBJECTS) $(libjavasci2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f src/c/*.$(OBJEXT) + -rm -f src/c/*.lo + -rm -f src/jni/*.$(OBJEXT) + -rm -f src/jni/*.lo + +distclean-compile: + -rm -f *.tab.c + +include src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Plo +include src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Plo +include src/jni/$(DEPDIR)/libjavasci2_la-putLists.Plo + +.c.o: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ $< + +.c.obj: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ + $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ + $(am__mv) $$depbase.Tpo $$depbase.Po +# $(AM_V_CC)source='$<' object='$@' libtool=no \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: + $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ + $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ + $(am__mv) $$depbase.Tpo $$depbase.Plo +# $(AM_V_CC)source='$<' object='$@' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LTCOMPILE) -c -o $@ $< + +src/jni/libjavasci2_la-call_scilab_wrap.lo: src/jni/call_scilab_wrap.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/jni/libjavasci2_la-call_scilab_wrap.lo -MD -MP -MF src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Tpo -c -o src/jni/libjavasci2_la-call_scilab_wrap.lo `test -f 'src/jni/call_scilab_wrap.c' || echo '$(srcdir)/'`src/jni/call_scilab_wrap.c + $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Tpo src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Plo +# $(AM_V_CC)source='src/jni/call_scilab_wrap.c' object='src/jni/libjavasci2_la-call_scilab_wrap.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/jni/libjavasci2_la-call_scilab_wrap.lo `test -f 'src/jni/call_scilab_wrap.c' || echo '$(srcdir)/'`src/jni/call_scilab_wrap.c + +src/jni/libjavasci2_la-putLists.lo: src/jni/putLists.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/jni/libjavasci2_la-putLists.lo -MD -MP -MF src/jni/$(DEPDIR)/libjavasci2_la-putLists.Tpo -c -o src/jni/libjavasci2_la-putLists.lo `test -f 'src/jni/putLists.c' || echo '$(srcdir)/'`src/jni/putLists.c + $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libjavasci2_la-putLists.Tpo src/jni/$(DEPDIR)/libjavasci2_la-putLists.Plo +# $(AM_V_CC)source='src/jni/putLists.c' object='src/jni/libjavasci2_la-putLists.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/jni/libjavasci2_la-putLists.lo `test -f 'src/jni/putLists.c' || echo '$(srcdir)/'`src/jni/putLists.c + +src/c/libjavasci2_la-javasci2_helper.lo: src/c/javasci2_helper.c + $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libjavasci2_la-javasci2_helper.lo -MD -MP -MF src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Tpo -c -o src/c/libjavasci2_la-javasci2_helper.lo `test -f 'src/c/javasci2_helper.c' || echo '$(srcdir)/'`src/c/javasci2_helper.c + $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Tpo src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Plo +# $(AM_V_CC)source='src/c/javasci2_helper.c' object='src/c/libjavasci2_la-javasci2_helper.lo' libtool=yes \ +# DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) \ +# $(AM_V_CC_no)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libjavasci2_la-javasci2_helper.lo `test -f 'src/c/javasci2_helper.c' || echo '$(srcdir)/'`src/c/javasci2_helper.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf src/c/.libs src/c/_libs + -rm -rf src/jni/.libs src/jni/_libs +install-libjavasci2_la_etcDATA: $(libjavasci2_la_etc_DATA) + @$(NORMAL_INSTALL) + @list='$(libjavasci2_la_etc_DATA)'; test -n "$(libjavasci2_la_etcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libjavasci2_la_etcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libjavasci2_la_etcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libjavasci2_la_etcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(libjavasci2_la_etcdir)" || exit $$?; \ + done + +uninstall-libjavasci2_la_etcDATA: + @$(NORMAL_UNINSTALL) + @list='$(libjavasci2_la_etc_DATA)'; test -n "$(libjavasci2_la_etcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libjavasci2_la_etcdir)'; $(am__uninstall_files_from_dir) +install-libjavasci2_la_rootDATA: $(libjavasci2_la_root_DATA) + @$(NORMAL_INSTALL) + @list='$(libjavasci2_la_root_DATA)'; test -n "$(libjavasci2_la_rootdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libjavasci2_la_rootdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libjavasci2_la_rootdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libjavasci2_la_rootdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(libjavasci2_la_rootdir)" || exit $$?; \ + done + +uninstall-libjavasci2_la_rootDATA: + @$(NORMAL_UNINSTALL) + @list='$(libjavasci2_la_root_DATA)'; test -n "$(libjavasci2_la_rootdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libjavasci2_la_rootdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +#check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +#all-local: +all-am: Makefile $(LTLIBRARIES) $(DATA) all-local +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libjavasci2_la_etcdir)" "$(DESTDIR)$(libjavasci2_la_rootdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f src/c/$(DEPDIR)/$(am__dirstamp) + -rm -f src/c/$(am__dirstamp) + -rm -f src/jni/$(DEPDIR)/$(am__dirstamp) + -rm -f src/jni/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +#install-data-local: +#distclean-local: +#clean-local: +#install-html-local: +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf src/c/$(DEPDIR) src/jni/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-local distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-libjavasci2_la_etcDATA \ + install-libjavasci2_la_rootDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: install-html-local + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf src/c/$(DEPDIR) src/jni/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libjavasci2_la_etcDATA \ + uninstall-libjavasci2_la_rootDATA uninstall-pkglibLTLIBRARIES + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \ + check-local clean clean-generic clean-libtool clean-local \ + clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-local distclean-tags distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-html-local install-info install-info-am \ + install-libjavasci2_la_etcDATA install-libjavasci2_la_rootDATA \ + install-man install-pdf install-pdf-am \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libjavasci2_la_etcDATA \ + uninstall-libjavasci2_la_rootDATA uninstall-pkglibLTLIBRARIES + + +# This target enables tests for Scilab +check-local: $(top_builddir)/scilab-bin test + if test -d $(mydatadir)/tests; then \ + @COMMAND="try test_run('$(modulename)');catch exit(-1);end;exit(0)"; export LANG=C; $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"; \ + fi +check-code: + if test -f build.xml; then \ + $(ANT) checkstyle; \ + fi + if test -x "$(SPLINT)"; then \ + $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \ + fi +java: +# Some configurations needs to export JAVA_HOME in the current env + @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \ + if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ + if test -f build.xml -a $$USEANT -eq 1; then \ + $(ANT); \ + fi + +clean-java: +# Some configurations needs to export JAVA_HOME in the current env + @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \ + if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ + if test -f build.xml -a $$USEANT -eq 1; then \ + $(ANT) clean; \ + fi; + +# If the user request for the SWIG generation of the wrappers Java => C/C++ +# We call the target swig-build on the variable SWIG_WRAPPERS + +#swig: $(SWIG_WRAPPERS) +# @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \ +# SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \ +# if test -n "$(SWIG_WRAPPERS)"; then \ +# for file in $(SWIG_WRAPPERS) ; do \ +# echo "Swig process of $$file (Java) ..."; \ +# $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME -outdir $$SWIG_OUTDIR $$file; \ +# done; \ +# fi + +#swig-scilab: $(SWIG_SCILAB_WRAPPERS) +# @SWIG_OUTDIR=src/swig/; \ +# if test -n "$(SWIG_SCILAB_WRAPPERS)"; then \ +# for file in $(SWIG_SCILAB_WRAPPERS) ; do \ +# echo "Swig process of $$file (Scilab) ..."; \ +# $(SWIG_BIN) $(SWIG_SCILAB) -outdir $$SWIG_OUTDIR $$file; \ +# done; \ +# fi + +# If the user request for the SWIG generation of the wrappers Java => C/C++ +# We call the target swig-build on the variable SWIG_WRAPPERS + +#giws: $(GIWS_WRAPPERS) +# @GIWS_OUTPUTDIR=src/jni/; \ +# MANDATORY_OPTIONS="--throws-exception-on-error --description-file"; \ +# if test -n "$(GIWS_WRAPPERS)"; then \ +# for file in $(GIWS_WRAPPERS) ; do \ +# echo "GIWS process of $$file ..."; \ +# if test -z "$(GIWS_OPTIONS)"; then \ +# $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \ +# else \ +# echo "Custom GIWS call with '$$GIWS_OPTIONS'"; \ +# $(GIWS_BIN) $$GIWS_OPTIONS --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \ +# fi \ +# done; \ +# fi + +#giws-exception: +# @GIWS_OUTPUTDIR=src/jni/;\ +# echo "GIWS: Generation of exception class ..."; \ +# $(GIWS_BIN) --generate-exception-class --output-dir $$GIWS_OUTPUTDIR + +macros: + -@( if test ! -x $(top_builddir)/scilab-bin; then \ + echo "Error : Cannot build $< : Scilab has not been built"; \ + else \ + $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\ + fi) + +# Removes the macros +clean-macros: +# Removes macros (*.bin generated from .sci) + @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \ + echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \ + rm -f $(builddir)/$$dir/$(MACROBINMASK); \ + done + +test: +# More tests could be added here + @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ + if test -f build.xml -a $$USEANT -eq 1; then \ + $(ANT) test; \ + fi + +all-local: $(TARGETS_ALL) + +.sci.bin: + -@( if test ! -x $(top_builddir)/scilab-bin; then \ + echo "Error : Cannot build $< : Scilab has not been build"; \ + else \ + echo "Creating $@"; \ + $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \ + fi ) + +install-html-local: + +install-data-local-local: +# Mainly for javasci + @if test -d $(srcdir)/javadoc; then \ + cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \ + fi +# If the user wants the help sources to be installed + @echo "-------- Install of XML sources of help files --------"; \ + for lang in $(ALL_LINGUAS); do \ + if test -d $(srcdir)/help/$$lang; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \ + if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \ + for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \ + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \ + $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \ + done ; \ + fi; \ + fi; \ + done; \ + @echo "-------- Install of MathML sources --------"; \ + if test -d $(srcdir)/help/mml/; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \ + if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \ + for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \ + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \ + $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \ + done ; \ + fi; \ + fi +install-data-local: +# Install the tests + @echo "-------- Install tests (if any) --------"; \ + for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \ + if test -d $(srcdir)/$$dir/; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \ + for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \ + if test -d "$(srcdir)/$$dir/$$file"; then \ + echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \ + $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \ + $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \ + fi \ + done; \ + fi; \ + done +# Install the help chapter + @echo "-------- Install the help chapter (if any) --------"; \ + for lang in $(HELP_CHAPTERLANG); do \ + HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \ + if test -f $$HELPFILE; then \ + echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \ + echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \ + $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \ + fi; \ + done +# Install the demos & examples + @echo "-------- Install demos & examples (if any) --------"; \ + for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \ + if test -d $(srcdir)/$$dir/; then \ + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \ + for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \ + if test -d "$(srcdir)/$$dir/$$file"; then \ + echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \ + $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \ + else \ + echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \ + $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \ + fi \ + done; \ + fi; \ + done +# Install the macros + @echo "-------- Install macros (if any) --------"; \ + for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \ + $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \ + if test -d $(srcdir)/$$dir/; then \ + FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\ + if test -n "$(MACROSSPECIALEXT)"; then \ + specialExtDir=""; \ + for specialExt in $(MACROSSPECIALEXT); do \ + specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \ + done; \ + FILELIST="$$FILELIST $$specialExtDir"; \ + fi; \ + for file in `ls -1 $$FILELIST 2>/dev/null`; do \ + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \ + $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \ + done; \ + fi; \ + done +# Install java files (.jar) + @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \ + echo "-------- Install jar files --------"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \ + for file in $(srcdir)/$(JARDIR)$(JARMASK); do\ + echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \ + $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \ + done ; \ + fi + +########### CLEAN ################### +# Clean help (generated automatically by Scilab) +# It used to clean the macro (clean-macros) but this was causing +# make clean && make to fail Scilab startup +clean-local: clean-java +#clean-local: + +distclean-local: + rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_* + +.PHONY: macros java swig giws + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/modules/javasci/Makefile.am b/modules/javasci/Makefile.am new file mode 100755 index 000000000..7a1babcc6 --- /dev/null +++ b/modules/javasci/Makefile.am @@ -0,0 +1,74 @@ +# +# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +# Copyright (C) INRIA - 2006 - Sylvestre Ledru +# Copyright (C) DIGITEO - 2009 - Pierre MARECHAL +# +# 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.1-en.txt +# + +#### Target ###### +modulename=javasci + +#### javasci : Conf files #### +libjavasci2_la_rootdir = $(mydatadir) +libjavasci2_la_root_DATA = license.txt + +#### javasci : init scripts #### +libjavasci2_la_etcdir = $(mydatadir)/etc +libjavasci2_la_etc_DATA = etc/javasci.quit etc/javasci.start + + +if JAVASCI +### All the compilation process of java is deleguated to ant + + +#### Javasci : sources #### +JAVASCI_V2_C_SOURCES = \ +src/jni/call_scilab_wrap.c \ +src/jni/putLists.c \ +src/c/javasci2_helper.c + +pkglib_LTLIBRARIES = libjavasci2.la + + +libjavasci2_la_SOURCES = $(JAVASCI_V2_C_SOURCES) + +# For the code check (splint) +CHECK_SRC= $(JAVASCI_C_SOURCES) +INCLUDE_FLAGS = $(libjavasci2_la_CPPFLAGS) + +libjavasci2_la_CPPFLAGS = -I$(srcdir)/includes/ \ + -I$(srcdir)/src/c/ \ + $(JAVA_JNI_INCLUDE) \ + $(TCL_INC_PATH) \ + $(TK_INC_PATH) \ + -I$(top_srcdir)/modules/tclsci/includes/ \ + -I$(top_srcdir)/modules/call_scilab/includes/ \ + -I$(top_srcdir)/modules/api_scilab/includes/ \ + -I$(top_srcdir)/modules/fileio/includes/ \ + -I$(top_srcdir)/modules/localization/includes/ \ + -I$(top_srcdir)/modules/output_stream/includes/ \ + $(AM_CPPFLAGS) + +libjavasci2_la_LIBADD = \ + $(top_builddir)/modules/api_scilab/libsciapi_scilab.la \ + $(top_builddir)/modules/libscilab.la + +BUILT_SOURCES= +if SWIG +BUILT_SOURCES+=swig +endif + +#### SWIG Declaration #### +SWIG_WRAPPERS = src/jni/call_scilab.i + +USEANT=1 + +include $(top_srcdir)/Makefile.incl.am + +endif + diff --git a/modules/javasci/Makefile.in b/modules/javasci/Makefile.in new file mode 100755 index 000000000..d1e1df567 --- /dev/null +++ b/modules/javasci/Makefile.in @@ -0,0 +1,1300 @@ +# Makefile.in generated by automake 1.14.1 from Makefile.am. +# @configure_input@ + +# Copyright (C) 1994-2013 Free Software Foundation, Inc. + +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +@SET_MAKE@ + +# +# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +# Copyright (C) INRIA - 2006 - Sylvestre Ledru +# Copyright (C) DIGITEO - 2009 - Pierre MARECHAL +# +# 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.1-en.txt +# + +# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +# Copyright (C) 2006-2008 - INRIA - Sylvestre LEDRU <sylvestre.ledru@inria.fr> +# Copyright (C) 2008 - INRIA - Pierre MARECHAL <pierre.marechal@inria.fr> +# +# 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.1-en.txt +# + +########## +### Makefile included stuff +### Target, variable, suffixes which are supposed to be useful in every makefile.am +########## + + +VPATH = @srcdir@ +am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)' +am__make_running_with_option = \ + case $${target_option-} in \ + ?) ;; \ + *) echo "am__make_running_with_option: internal error: invalid" \ + "target option '$${target_option-}' specified" >&2; \ + exit 1;; \ + esac; \ + has_opt=no; \ + sane_makeflags=$$MAKEFLAGS; \ + if $(am__is_gnu_make); then \ + sane_makeflags=$$MFLAGS; \ + else \ + case $$MAKEFLAGS in \ + *\\[\ \ ]*) \ + bs=\\; \ + sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ + | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ + esac; \ + fi; \ + skip_next=no; \ + strip_trailopt () \ + { \ + flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ + }; \ + for flg in $$sane_makeflags; do \ + test $$skip_next = yes && { skip_next=no; continue; }; \ + case $$flg in \ + *=*|--*) continue;; \ + -*I) strip_trailopt 'I'; skip_next=yes;; \ + -*I?*) strip_trailopt 'I';; \ + -*O) strip_trailopt 'O'; skip_next=yes;; \ + -*O?*) strip_trailopt 'O';; \ + -*l) strip_trailopt 'l'; skip_next=yes;; \ + -*l?*) strip_trailopt 'l';; \ + -[dEDm]) skip_next=yes;; \ + -[JT]) skip_next=yes;; \ + esac; \ + case $$flg in \ + *$$target_option*) has_opt=yes; break;; \ + esac; \ + done; \ + test $$has_opt = yes +am__make_dryrun = (target_option=n; $(am__make_running_with_option)) +am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) +pkgdatadir = $(datadir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkglibexecdir = $(libexecdir)/@PACKAGE@ +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_HEADER = $(INSTALL_DATA) +transform = $(program_transform_name) +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +build_triplet = @build@ +host_triplet = @host@ +@JAVASCI_TRUE@@SWIG_TRUE@am__append_1 = swig +DIST_COMMON = $(top_srcdir)/Makefile.incl.am $(srcdir)/Makefile.in \ + $(srcdir)/Makefile.am $(top_srcdir)/config/mkinstalldirs \ + $(top_srcdir)/config/depcomp TODO +@JAVASCI_TRUE@@NEED_JAVA_TRUE@am__append_2 = java +subdir = modules/javasci +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +am__aclocal_m4_deps = $(top_srcdir)/m4/backtrace.m4 \ + $(top_srcdir)/m4/compiler.m4 $(top_srcdir)/m4/curl.m4 \ + $(top_srcdir)/m4/docbook.m4 $(top_srcdir)/m4/doxygen.m4 \ + $(top_srcdir)/m4/fftw.m4 $(top_srcdir)/m4/fortran.m4 \ + $(top_srcdir)/m4/giws.m4 $(top_srcdir)/m4/hdf5.m4 \ + $(top_srcdir)/m4/intel_compiler.m4 \ + $(top_srcdir)/m4/java-thirdparty.m4 $(top_srcdir)/m4/java.m4 \ + $(top_srcdir)/m4/largefile.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/libsmath.m4 $(top_srcdir)/m4/libtool.m4 \ + $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/ltoptions.m4 \ + $(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \ + $(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/macosx.m4 \ + $(top_srcdir)/m4/mpi.m4 $(top_srcdir)/m4/ocaml.m4 \ + $(top_srcdir)/m4/pcre.m4 $(top_srcdir)/m4/pkg.m4 \ + $(top_srcdir)/m4/relocatable.m4 $(top_srcdir)/m4/swig.m4 \ + $(top_srcdir)/m4/symlinks.m4 $(top_srcdir)/m4/tcltk.m4 \ + $(top_srcdir)/m4/umfpack.m4 $(top_srcdir)/configure.ac +am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ + $(ACLOCAL_M4) +mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/modules/core/includes/machine.h +CONFIG_CLEAN_FILES = +CONFIG_CLEAN_VPATH_FILES = +am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; +am__vpath_adj = case $$p in \ + $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ + *) f=$$p;; \ + esac; +am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; +am__install_max = 40 +am__nobase_strip_setup = \ + srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` +am__nobase_strip = \ + for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" +am__nobase_list = $(am__nobase_strip_setup); \ + for p in $$list; do echo "$$p $$p"; done | \ + sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ + $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ + if (++n[$$2] == $(am__install_max)) \ + { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ + END { for (dir in files) print dir, files[dir] }' +am__base_list = \ + sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ + sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' +am__uninstall_files_from_dir = { \ + test -z "$$files" \ + || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ + || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ + $(am__cd) "$$dir" && rm -f $$files; }; \ + } +am__installdirs = "$(DESTDIR)$(pkglibdir)" \ + "$(DESTDIR)$(libjavasci2_la_etcdir)" \ + "$(DESTDIR)$(libjavasci2_la_rootdir)" +LTLIBRARIES = $(pkglib_LTLIBRARIES) +@JAVASCI_TRUE@libjavasci2_la_DEPENDENCIES = $(top_builddir)/modules/api_scilab/libsciapi_scilab.la \ +@JAVASCI_TRUE@ $(top_builddir)/modules/libscilab.la +am__libjavasci2_la_SOURCES_DIST = src/jni/call_scilab_wrap.c \ + src/jni/putLists.c src/c/javasci2_helper.c +am__dirstamp = $(am__leading_dot)dirstamp +@JAVASCI_TRUE@am__objects_1 = \ +@JAVASCI_TRUE@ src/jni/libjavasci2_la-call_scilab_wrap.lo \ +@JAVASCI_TRUE@ src/jni/libjavasci2_la-putLists.lo \ +@JAVASCI_TRUE@ src/c/libjavasci2_la-javasci2_helper.lo +@JAVASCI_TRUE@am_libjavasci2_la_OBJECTS = $(am__objects_1) +libjavasci2_la_OBJECTS = $(am_libjavasci2_la_OBJECTS) +AM_V_lt = $(am__v_lt_@AM_V@) +am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) +am__v_lt_0 = --silent +am__v_lt_1 = +@JAVASCI_TRUE@am_libjavasci2_la_rpath = -rpath $(pkglibdir) +AM_V_P = $(am__v_P_@AM_V@) +am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) +am__v_P_0 = false +am__v_P_1 = : +AM_V_GEN = $(am__v_GEN_@AM_V@) +am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) +am__v_GEN_0 = @echo " GEN " $@; +am__v_GEN_1 = +AM_V_at = $(am__v_at_@AM_V@) +am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) +am__v_at_0 = @ +am__v_at_1 = +DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes +depcomp = $(SHELL) $(top_srcdir)/config/depcomp +am__depfiles_maybe = depfiles +am__mv = mv -f +COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ + $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CFLAGS) $(CFLAGS) +AM_V_CC = $(am__v_CC_@AM_V@) +am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) +am__v_CC_0 = @echo " CC " $@; +am__v_CC_1 = +CCLD = $(CC) +LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ + $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +AM_V_CCLD = $(am__v_CCLD_@AM_V@) +am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) +am__v_CCLD_0 = @echo " CCLD " $@; +am__v_CCLD_1 = +SOURCES = $(libjavasci2_la_SOURCES) +DIST_SOURCES = $(am__libjavasci2_la_SOURCES_DIST) +am__can_run_installinfo = \ + case $$AM_UPDATE_INFO_DIR in \ + n|no|NO) false;; \ + *) (install-info --version) >/dev/null 2>&1;; \ + esac +DATA = $(libjavasci2_la_etc_DATA) $(libjavasci2_la_root_DATA) +am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) +# Read a list of newline-separated strings from the standard input, +# and print each of them once, without duplicates. Input order is +# *not* preserved. +am__uniquify_input = $(AWK) '\ + BEGIN { nonempty = 0; } \ + { items[$$0] = 1; nonempty = 1; } \ + END { if (nonempty) { for (i in items) print i; }; } \ +' +# Make sure the list of sources is unique. This is necessary because, +# e.g., the same source file might be shared among _SOURCES variables +# for different programs/libraries. +am__define_uniq_tagged_files = \ + list='$(am__tagged_files)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | $(am__uniquify_input)` +ETAGS = etags +CTAGS = ctags +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) +ACLOCAL = @ACLOCAL@ +ALL_LINGUAS = @ALL_LINGUAS@ +ALL_LINGUAS_DOC = @ALL_LINGUAS_DOC@ +AMTAR = @AMTAR@ +AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ +ANT = @ANT@ +ANTLR = @ANTLR@ +AR = @AR@ +ARPACK_LIBS = @ARPACK_LIBS@ +ASM3 = @ASM3@ +AUTOCONF = @AUTOCONF@ +AUTOHEADER = @AUTOHEADER@ +AUTOMAKE = @AUTOMAKE@ +AVALON_FRAMEWORK = @AVALON_FRAMEWORK@ +AWK = @AWK@ +BATIK = @BATIK@ +BLAS_LIBS = @BLAS_LIBS@ +CC = @CC@ +CCACHE = @CCACHE@ +CCDEPMODE = @CCDEPMODE@ +CFLAGS = @CFLAGS@ +CHECKSTYLE = @CHECKSTYLE@ +COBERTURA = @COBERTURA@ +COMMONS_BEANUTILS = @COMMONS_BEANUTILS@ +COMMONS_IO = @COMMONS_IO@ +COMMONS_LOGGING = @COMMONS_LOGGING@ +CPP = @CPP@ +CPPFLAGS = @CPPFLAGS@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CURL_LIBS = @CURL_LIBS@ +CURL_VERSION = @CURL_VERSION@ +CXX = @CXX@ +CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ +CXXFLAGS = @CXXFLAGS@ +CYGPATH_W = @CYGPATH_W@ +DEFS = @DEFS@ +DEMOTOOLS_ENABLE = @DEMOTOOLS_ENABLE@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +DOCBOOK_ROOT = @DOCBOOK_ROOT@ +DOXYGEN_BIN = @DOXYGEN_BIN@ +DSYMUTIL = @DSYMUTIL@ +DUMPBIN = @DUMPBIN@ +ECHO_C = @ECHO_C@ +ECHO_N = @ECHO_N@ +ECHO_T = @ECHO_T@ +ECJ = @ECJ@ +EGREP = @EGREP@ +EXEEXT = @EXEEXT@ +F77 = @F77@ +FFLAGS = @FFLAGS@ +FFTW3_LIB = @FFTW3_LIB@ +FFTW_ENABLE = @FFTW_ENABLE@ +FGREP = @FGREP@ +FLEXDOCK = @FLEXDOCK@ +FLIBS = @FLIBS@ +FOP = @FOP@ +FREEHEP_GRAPHICS2D = @FREEHEP_GRAPHICS2D@ +FREEHEP_GRAPHICSIO = @FREEHEP_GRAPHICSIO@ +FREEHEP_GRAPHICSIO_EMF = @FREEHEP_GRAPHICSIO_EMF@ +FREEHEP_IO = @FREEHEP_IO@ +FREEHEP_UTIL = @FREEHEP_UTIL@ +GENHTML = @GENHTML@ +GETTEXT_MACRO_VERSION = @GETTEXT_MACRO_VERSION@ +GIWS_BIN = @GIWS_BIN@ +GLUEGEN2_RT = @GLUEGEN2_RT@ +GMSGFMT = @GMSGFMT@ +GMSGFMT_015 = @GMSGFMT_015@ +GRAPHICS_ENABLE = @GRAPHICS_ENABLE@ +GREP = @GREP@ +GUI_ENABLE = @GUI_ENABLE@ +HDF5_CFLAGS = @HDF5_CFLAGS@ +HDF5_LIBS = @HDF5_LIBS@ +HELP_ENABLE = @HELP_ENABLE@ +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +INTLLIBS = @INTLLIBS@ +INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@ +JAR = @JAR@ +JAVA = @JAVA@ +JAVAC = @JAVAC@ +JAVAC_DEBUG = @JAVAC_DEBUG@ +JAVADOC = @JAVADOC@ +JAVAH = @JAVAH@ +JAVASCI_ENABLE = @JAVASCI_ENABLE@ +JAVA_ENABLE = @JAVA_ENABLE@ +JAVA_G = @JAVA_G@ +JAVA_HOME = @JAVA_HOME@ +JAVA_JNI_INCLUDE = @JAVA_JNI_INCLUDE@ +JAVA_JNI_LIBS = @JAVA_JNI_LIBS@ +JDB = @JDB@ +JEUCLID_CORE = @JEUCLID_CORE@ +JGRAPHX = @JGRAPHX@ +JHALL = @JHALL@ +JLATEXMATH = @JLATEXMATH@ +JLATEXMATH_FOP = @JLATEXMATH_FOP@ +JOGL2 = @JOGL2@ +JROSETTA_API = @JROSETTA_API@ +JROSETTA_ENGINE = @JROSETTA_ENGINE@ +JUNIT4 = @JUNIT4@ +LAPACK_LIBS = @LAPACK_LIBS@ +LCOV = @LCOV@ +LD = @LD@ +LDFLAGS = @LDFLAGS@ +LIBICONV = @LIBICONV@ +LIBINTL = @LIBINTL@ +LIBM = @LIBM@ +LIBOBJS = @LIBOBJS@ +LIBS = @LIBS@ +LIBTOOL = @LIBTOOL@ +LIPO = @LIPO@ +LN_S = @LN_S@ +LOGGING_LEVEL = @LOGGING_LEVEL@ +LOOKS = @LOOKS@ +LTLIBICONV = @LTLIBICONV@ +LTLIBINTL = @LTLIBINTL@ +LTLIBOBJS = @LTLIBOBJS@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +MANIFEST_TOOL = @MANIFEST_TOOL@ +MATIO_CFLAGS = @MATIO_CFLAGS@ +MATIO_ENABLE = @MATIO_ENABLE@ +MATIO_LIBS = @MATIO_LIBS@ +MKDIR_P = @MKDIR_P@ +MPI_ENABLE = @MPI_ENABLE@ +MSGCAT = @MSGCAT@ +MSGFMT = @MSGFMT@ +MSGFMT_015 = @MSGFMT_015@ +MSGMERGE = @MSGMERGE@ +NM = @NM@ +NMEDIT = @NMEDIT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +OCAMLC = @OCAMLC@ +OCAMLDEP = @OCAMLDEP@ +OCAMLLEX = @OCAMLLEX@ +OCAMLOPT = @OCAMLOPT@ +OCAMLYACC = @OCAMLYACC@ +OPENMPI_CC = @OPENMPI_CC@ +OPENMPI_CFLAGS = @OPENMPI_CFLAGS@ +OPENMPI_CXX = @OPENMPI_CXX@ +OPENMPI_CXXFLAGS = @OPENMPI_CXXFLAGS@ +OPENMPI_LIBS = @OPENMPI_LIBS@ +OPENMP_CFLAGS = @OPENMP_CFLAGS@ +OPENMP_CXXFLAGS = @OPENMP_CXXFLAGS@ +OPENMP_ENABLE = @OPENMP_ENABLE@ +OPENMP_LIBS = @OPENMP_LIBS@ +OTOOL = @OTOOL@ +OTOOL64 = @OTOOL64@ +PACKAGE = @PACKAGE@ +PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +PACKAGE_NAME = @PACKAGE_NAME@ +PACKAGE_STRING = @PACKAGE_STRING@ +PACKAGE_TARNAME = @PACKAGE_TARNAME@ +PACKAGE_URL = @PACKAGE_URL@ +PACKAGE_VERSION = @PACKAGE_VERSION@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +PCRE_CFLAGS = @PCRE_CFLAGS@ +PCRE_CONFIG = @PCRE_CONFIG@ +PCRE_LIBS = @PCRE_LIBS@ +PCRE_VERSION = @PCRE_VERSION@ +PKG_CONFIG = @PKG_CONFIG@ +POSUB = @POSUB@ +POW_LIB = @POW_LIB@ +PYTHON = @PYTHON@ +RANLIB = @RANLIB@ +RELOCATABLE = @RELOCATABLE@ +RT_LIB = @RT_LIB@ +SAXON = @SAXON@ +SCILAB_BINARY_VERSION = @SCILAB_BINARY_VERSION@ +SCILAB_LIBRARY_VERSION = @SCILAB_LIBRARY_VERSION@ +SCILAB_VERSION_MAINTENANCE = @SCILAB_VERSION_MAINTENANCE@ +SCILAB_VERSION_MAJOR = @SCILAB_VERSION_MAJOR@ +SCILAB_VERSION_MINOR = @SCILAB_VERSION_MINOR@ +SCIRENDERER = @SCIRENDERER@ +SCIRENDERER_CP = @SCIRENDERER_CP@ +SCI_CFLAGS = @SCI_CFLAGS@ +SCI_CXXFLAGS = @SCI_CXXFLAGS@ +SCI_FFLAGS = @SCI_FFLAGS@ +SCI_LDFLAGS = @SCI_LDFLAGS@ +SED = @SED@ +SET_MAKE = @SET_MAKE@ +SET_RELOCATABLE = @SET_RELOCATABLE@ +SHELL = @SHELL@ +SKINLF = @SKINLF@ +SPLINT = @SPLINT@ +STRIP = @STRIP@ +SWIG_BIN = @SWIG_BIN@ +SWIG_JAVA = @SWIG_JAVA@ +SWIG_RUNTIME_LIBS_DIR = @SWIG_RUNTIME_LIBS_DIR@ +SWIG_SCILAB = @SWIG_SCILAB@ +TCLTK_LIBS = @TCLTK_LIBS@ +TCL_INC_PATH = @TCL_INC_PATH@ +TK_INC_PATH = @TK_INC_PATH@ +UMFPACK_CFLAGS = @UMFPACK_CFLAGS@ +UMFPACK_ENABLE = @UMFPACK_ENABLE@ +UMFPACK_LIB = @UMFPACK_LIB@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +WITH_OCAML = @WITH_OCAML@ +WITH_TKSCI = @WITH_TKSCI@ +XCOS_ENABLE = @XCOS_ENABLE@ +XGETTEXT = @XGETTEXT@ +XGETTEXT_015 = @XGETTEXT_015@ +XGETTEXT_EXTRA_OPTIONS = @XGETTEXT_EXTRA_OPTIONS@ +XMKMF = @XMKMF@ +XMLGRAPHICS_COMMONS = @XMLGRAPHICS_COMMONS@ +XML_APIS_EXT = @XML_APIS_EXT@ +XML_CONFIG = @XML_CONFIG@ +XML_FLAGS = @XML_FLAGS@ +XML_LIBS = @XML_LIBS@ +XML_VERSION = @XML_VERSION@ +X_CFLAGS = @X_CFLAGS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_LIBS = @X_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +abs_builddir = @abs_builddir@ +abs_srcdir = @abs_srcdir@ +abs_top_builddir = @abs_top_builddir@ +abs_top_srcdir = @abs_top_srcdir@ +ac_ct_AR = @ac_ct_AR@ +ac_ct_CC = @ac_ct_CC@ +ac_ct_CXX = @ac_ct_CXX@ +ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ +ac_ct_F77 = @ac_ct_F77@ +am__include = @am__include@ +am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ +am__tar = @am__tar@ +am__untar = @am__untar@ +bindir = @bindir@ +build = @build@ +build_alias = @build_alias@ +build_cpu = @build_cpu@ +build_os = @build_os@ +build_vendor = @build_vendor@ +builddir = @builddir@ +cxx_present = @cxx_present@ +datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ +exec_prefix = @exec_prefix@ +host = @host@ +host_alias = @host_alias@ +host_cpu = @host_cpu@ +host_os = @host_os@ +host_vendor = @host_vendor@ +htmldir = @htmldir@ +includedir = @includedir@ +infodir = @infodir@ +install_sh = @install_sh@ +libdir = @libdir@ +libexecdir = @libexecdir@ +localedir = @localedir@ +localstatedir = @localstatedir@ +mandir = @mandir@ +mkdir_p = @mkdir_p@ +oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ +prefix = @prefix@ +program_transform_name = @program_transform_name@ +psdir = @psdir@ +sbindir = @sbindir@ +sharedstatedir = @sharedstatedir@ +srcdir = @srcdir@ +sysconfdir = @sysconfdir@ +target_alias = @target_alias@ +top_build_prefix = @top_build_prefix@ +top_builddir = @top_builddir@ +top_srcdir = @top_srcdir@ + +#### Target ###### +modulename = javasci + +#### javasci : Conf files #### +libjavasci2_la_rootdir = $(mydatadir) +libjavasci2_la_root_DATA = license.txt + +#### javasci : init scripts #### +libjavasci2_la_etcdir = $(mydatadir)/etc +libjavasci2_la_etc_DATA = etc/javasci.quit etc/javasci.start + +### All the compilation process of java is deleguated to ant + +#### Javasci : sources #### +@JAVASCI_TRUE@JAVASCI_V2_C_SOURCES = \ +@JAVASCI_TRUE@src/jni/call_scilab_wrap.c \ +@JAVASCI_TRUE@src/jni/putLists.c \ +@JAVASCI_TRUE@src/c/javasci2_helper.c + +@JAVASCI_TRUE@pkglib_LTLIBRARIES = libjavasci2.la +@JAVASCI_TRUE@libjavasci2_la_SOURCES = $(JAVASCI_V2_C_SOURCES) + +# For the code check (splint) +@JAVASCI_TRUE@CHECK_SRC = $(JAVASCI_C_SOURCES) +@JAVASCI_TRUE@INCLUDE_FLAGS = $(libjavasci2_la_CPPFLAGS) +@JAVASCI_TRUE@libjavasci2_la_CPPFLAGS = -I$(srcdir)/includes/ \ +@JAVASCI_TRUE@ -I$(srcdir)/src/c/ \ +@JAVASCI_TRUE@ $(JAVA_JNI_INCLUDE) \ +@JAVASCI_TRUE@ $(TCL_INC_PATH) \ +@JAVASCI_TRUE@ $(TK_INC_PATH) \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/tclsci/includes/ \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/call_scilab/includes/ \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/api_scilab/includes/ \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/fileio/includes/ \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/localization/includes/ \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/output_stream/includes/ \ +@JAVASCI_TRUE@ $(AM_CPPFLAGS) + +@JAVASCI_TRUE@libjavasci2_la_LIBADD = \ +@JAVASCI_TRUE@ $(top_builddir)/modules/api_scilab/libsciapi_scilab.la \ +@JAVASCI_TRUE@ $(top_builddir)/modules/libscilab.la + +@JAVASCI_TRUE@BUILT_SOURCES = $(am__append_1) + +#### SWIG Declaration #### +@JAVASCI_TRUE@SWIG_WRAPPERS = src/jni/call_scilab.i +@JAVASCI_TRUE@USEANT = 1 + +# Where all the Scilab stuff is installed (macros, help, ...) +@JAVASCI_TRUE@mydatadir = $(pkgdatadir)/modules/$(modulename) + +# Set AM_* SCI detected settings +@JAVASCI_TRUE@AM_CPPFLAGS = $(SCI_CPPFLAGS) +@JAVASCI_TRUE@AM_CFLAGS = $(SCI_CFLAGS) +@JAVASCI_TRUE@AM_CXXFLAGS = $(SCI_CXXFLAGS) +# append includes to AM_FFLAGS to manage fortran includes +@JAVASCI_TRUE@AM_FFLAGS = $(SCI_FFLAGS) \ +@JAVASCI_TRUE@ -I$(top_srcdir)/modules/core/includes/ + +# Tag shared libraries with the Scilab version +@JAVASCI_TRUE@AM_LDFLAGS = $(SCI_LDFLAGS) -version-number \ +@JAVASCI_TRUE@ $(SCILAB_LIBRARY_VERSION) + +# splint options +@JAVASCI_TRUE@SPLINT_OPTIONS = -weak -booltype BOOL + +########################### JAVA ###################################### +#### We are delegating java compilation to ant... Thanks to that +#### the procedure will be the same with Microsoft Windows (C) +#### and Linux/Unix +####################################################################### +@JAVASCI_TRUE@TARGETS_ALL = $(am__append_2) + +################ MACROS ###################### +# Rule to build a macro +# NOT USED AT THE MOMENT +@JAVASCI_TRUE@SUFFIXES = .sci + +########### INSTALL DOCUMENTATION ################### + +# Install documentation files into the right target +# We do not use the automake mechanism (libxxxx_la_help_fr_DATA) because +# automake needs the html files to be present which is not the case when +# we are building Scilab + +# Where it should be installed +@JAVASCI_TRUE@pkgdocdir = $(mydatadir) + +# What is the mask of the help source +@JAVASCI_TRUE@DOCMASKXML = *.xml + +# What is the mask of the MathML sources +@JAVASCI_TRUE@DOCMASKMML = *.mml + +########### INSTALL DATA ################### +# Install macros, help & demos +# Where it should be installed +@JAVASCI_TRUE@pkgmacrosdir = $(mydatadir) +# Which directory we process +@JAVASCI_TRUE@MACRODIRS = macros/ +# Mask of the Scilab sources macros +@JAVASCI_TRUE@MACROMASK = *.sci +# Mask of the Scilab executable sources macros +@JAVASCI_TRUE@MACROBUILDMASK = *.sce +# Mask of the Scilab compiled macros +@JAVASCI_TRUE@MACROBINMASK = *.bin +# List of the standard directory for tests +@JAVASCI_TRUE@TESTS_DIR = tests/benchmarks tests/nonreg_tests tests/unit_tests tests/java +# Where the demos should be installed +@JAVASCI_TRUE@pkgdemosdir = $(mydatadir) +# List of the standard directory for demos +@JAVASCI_TRUE@DEMOS_DIR = demos +# List of the standard directory for examples +@JAVASCI_TRUE@EXAMPLES_DIR = examples +# Where to export JAVA archives (.jar) +@JAVASCI_TRUE@JARDIR = jar/ +# JAR files mask +@JAVASCI_TRUE@JARMASK = *.jar +# Chapter file +@JAVASCI_TRUE@HELP_CHAPTERDIR = help/ +@JAVASCI_TRUE@HELP_CHAPTERFILE = addchapter.sce +@JAVASCI_TRUE@HELP_CHAPTERLANG = en_US fr_FR pt_BR +all: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) all-am + +.SUFFIXES: +.SUFFIXES: .sci .bin .c .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps) + @for dep in $?; do \ + case '$(am__configure_deps)' in \ + *$$dep*) \ + ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ + && { if test -f $@; then exit 0; else break; fi; }; \ + exit 1;; \ + esac; \ + done; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign modules/javasci/Makefile'; \ + $(am__cd) $(top_srcdir) && \ + $(AUTOMAKE) --foreign modules/javasci/Makefile +.PRECIOUS: Makefile +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + @case '$?' in \ + *config.status*) \ + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ + *) \ + echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ + esac; +$(top_srcdir)/Makefile.incl.am: + +$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh + +$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) + cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh +$(am__aclocal_m4_deps): + +install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES) + @$(NORMAL_INSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + list2=; for p in $$list; do \ + if test -f $$p; then \ + list2="$$list2 $$p"; \ + else :; fi; \ + done; \ + test -z "$$list2" || { \ + echo " $(MKDIR_P) '$(DESTDIR)$(pkglibdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(pkglibdir)" || exit 1; \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(pkglibdir)'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(pkglibdir)"; \ + } + +uninstall-pkglibLTLIBRARIES: + @$(NORMAL_UNINSTALL) + @list='$(pkglib_LTLIBRARIES)'; test -n "$(pkglibdir)" || list=; \ + for p in $$list; do \ + $(am__strip_dir) \ + echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$f'"; \ + $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$f"; \ + done + +clean-pkglibLTLIBRARIES: + -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES) + @list='$(pkglib_LTLIBRARIES)'; \ + locs=`for p in $$list; do echo $$p; done | \ + sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \ + sort -u`; \ + test -z "$$locs" || { \ + echo rm -f $${locs}; \ + rm -f $${locs}; \ + } +src/jni/$(am__dirstamp): + @$(MKDIR_P) src/jni + @: > src/jni/$(am__dirstamp) +src/jni/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/jni/$(DEPDIR) + @: > src/jni/$(DEPDIR)/$(am__dirstamp) +src/jni/libjavasci2_la-call_scilab_wrap.lo: src/jni/$(am__dirstamp) \ + src/jni/$(DEPDIR)/$(am__dirstamp) +src/jni/libjavasci2_la-putLists.lo: src/jni/$(am__dirstamp) \ + src/jni/$(DEPDIR)/$(am__dirstamp) +src/c/$(am__dirstamp): + @$(MKDIR_P) src/c + @: > src/c/$(am__dirstamp) +src/c/$(DEPDIR)/$(am__dirstamp): + @$(MKDIR_P) src/c/$(DEPDIR) + @: > src/c/$(DEPDIR)/$(am__dirstamp) +src/c/libjavasci2_la-javasci2_helper.lo: src/c/$(am__dirstamp) \ + src/c/$(DEPDIR)/$(am__dirstamp) + +libjavasci2.la: $(libjavasci2_la_OBJECTS) $(libjavasci2_la_DEPENDENCIES) $(EXTRA_libjavasci2_la_DEPENDENCIES) + $(AM_V_CCLD)$(LINK) $(am_libjavasci2_la_rpath) $(libjavasci2_la_OBJECTS) $(libjavasci2_la_LIBADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) + -rm -f src/c/*.$(OBJEXT) + -rm -f src/c/*.lo + -rm -f src/jni/*.$(OBJEXT) + -rm -f src/jni/*.lo + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@src/jni/$(DEPDIR)/libjavasci2_la-putLists.Plo@am__quote@ + +.c.o: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< + +.c.obj: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ +@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` + +.c.lo: +@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ +@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ +@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< + +src/jni/libjavasci2_la-call_scilab_wrap.lo: src/jni/call_scilab_wrap.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/jni/libjavasci2_la-call_scilab_wrap.lo -MD -MP -MF src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Tpo -c -o src/jni/libjavasci2_la-call_scilab_wrap.lo `test -f 'src/jni/call_scilab_wrap.c' || echo '$(srcdir)/'`src/jni/call_scilab_wrap.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Tpo src/jni/$(DEPDIR)/libjavasci2_la-call_scilab_wrap.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/jni/call_scilab_wrap.c' object='src/jni/libjavasci2_la-call_scilab_wrap.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/jni/libjavasci2_la-call_scilab_wrap.lo `test -f 'src/jni/call_scilab_wrap.c' || echo '$(srcdir)/'`src/jni/call_scilab_wrap.c + +src/jni/libjavasci2_la-putLists.lo: src/jni/putLists.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/jni/libjavasci2_la-putLists.lo -MD -MP -MF src/jni/$(DEPDIR)/libjavasci2_la-putLists.Tpo -c -o src/jni/libjavasci2_la-putLists.lo `test -f 'src/jni/putLists.c' || echo '$(srcdir)/'`src/jni/putLists.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/jni/$(DEPDIR)/libjavasci2_la-putLists.Tpo src/jni/$(DEPDIR)/libjavasci2_la-putLists.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/jni/putLists.c' object='src/jni/libjavasci2_la-putLists.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/jni/libjavasci2_la-putLists.lo `test -f 'src/jni/putLists.c' || echo '$(srcdir)/'`src/jni/putLists.c + +src/c/libjavasci2_la-javasci2_helper.lo: src/c/javasci2_helper.c +@am__fastdepCC_TRUE@ $(AM_V_CC)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT src/c/libjavasci2_la-javasci2_helper.lo -MD -MP -MF src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Tpo -c -o src/c/libjavasci2_la-javasci2_helper.lo `test -f 'src/c/javasci2_helper.c' || echo '$(srcdir)/'`src/c/javasci2_helper.c +@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Tpo src/c/$(DEPDIR)/libjavasci2_la-javasci2_helper.Plo +@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='src/c/javasci2_helper.c' object='src/c/libjavasci2_la-javasci2_helper.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libjavasci2_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o src/c/libjavasci2_la-javasci2_helper.lo `test -f 'src/c/javasci2_helper.c' || echo '$(srcdir)/'`src/c/javasci2_helper.c + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + -rm -rf src/c/.libs src/c/_libs + -rm -rf src/jni/.libs src/jni/_libs +install-libjavasci2_la_etcDATA: $(libjavasci2_la_etc_DATA) + @$(NORMAL_INSTALL) + @list='$(libjavasci2_la_etc_DATA)'; test -n "$(libjavasci2_la_etcdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libjavasci2_la_etcdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libjavasci2_la_etcdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libjavasci2_la_etcdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(libjavasci2_la_etcdir)" || exit $$?; \ + done + +uninstall-libjavasci2_la_etcDATA: + @$(NORMAL_UNINSTALL) + @list='$(libjavasci2_la_etc_DATA)'; test -n "$(libjavasci2_la_etcdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libjavasci2_la_etcdir)'; $(am__uninstall_files_from_dir) +install-libjavasci2_la_rootDATA: $(libjavasci2_la_root_DATA) + @$(NORMAL_INSTALL) + @list='$(libjavasci2_la_root_DATA)'; test -n "$(libjavasci2_la_rootdir)" || list=; \ + if test -n "$$list"; then \ + echo " $(MKDIR_P) '$(DESTDIR)$(libjavasci2_la_rootdir)'"; \ + $(MKDIR_P) "$(DESTDIR)$(libjavasci2_la_rootdir)" || exit 1; \ + fi; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(libjavasci2_la_rootdir)'"; \ + $(INSTALL_DATA) $$files "$(DESTDIR)$(libjavasci2_la_rootdir)" || exit $$?; \ + done + +uninstall-libjavasci2_la_rootDATA: + @$(NORMAL_UNINSTALL) + @list='$(libjavasci2_la_root_DATA)'; test -n "$(libjavasci2_la_rootdir)" || list=; \ + files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \ + dir='$(DESTDIR)$(libjavasci2_la_rootdir)'; $(am__uninstall_files_from_dir) + +ID: $(am__tagged_files) + $(am__define_uniq_tagged_files); mkid -fID $$unique +tags: tags-am +TAGS: tags + +tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + set x; \ + here=`pwd`; \ + $(am__define_uniq_tagged_files); \ + shift; \ + if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ + test -n "$$unique" || unique=$$empty_fix; \ + if test $$# -gt 0; then \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + "$$@" $$unique; \ + else \ + $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$unique; \ + fi; \ + fi +ctags: ctags-am + +CTAGS: ctags +ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) + $(am__define_uniq_tagged_files); \ + test -z "$(CTAGS_ARGS)$$unique" \ + || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ + $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && $(am__cd) $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) "$$here" +cscopelist: cscopelist-am + +cscopelist-am: $(am__tagged_files) + list='$(am__tagged_files)'; \ + case "$(srcdir)" in \ + [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ + *) sdir=$(subdir)/$(srcdir) ;; \ + esac; \ + for i in $$list; do \ + if test -f "$$i"; then \ + echo "$(subdir)/$$i"; \ + else \ + echo "$$sdir/$$i"; \ + fi; \ + done >> $(top_builddir)/cscope.files + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags + +distdir: $(DISTFILES) + @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ + list='$(DISTFILES)'; \ + dist_files=`for file in $$list; do echo $$file; done | \ + sed -e "s|^$$srcdirstrip/||;t" \ + -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ + case $$dist_files in \ + */*) $(MKDIR_P) `echo "$$dist_files" | \ + sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ + sort -u` ;; \ + esac; \ + for file in $$dist_files; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ + dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test -d "$(distdir)/$$file"; then \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ + find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ + fi; \ + cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ + else \ + test -f "$(distdir)/$$file" \ + || cp -p $$d/$$file "$(distdir)/$$file" \ + || exit 1; \ + fi; \ + done +@JAVASCI_FALSE@check-local: +check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) check-local +check: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) check-am +@JAVASCI_FALSE@all-local: +all-am: Makefile $(LTLIBRARIES) $(DATA) all-local +installdirs: + for dir in "$(DESTDIR)$(pkglibdir)" "$(DESTDIR)$(libjavasci2_la_etcdir)" "$(DESTDIR)$(libjavasci2_la_rootdir)"; do \ + test -z "$$dir" || $(MKDIR_P) "$$dir"; \ + done +install: $(BUILT_SOURCES) + $(MAKE) $(AM_MAKEFLAGS) install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + if test -z '$(STRIP)'; then \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + install; \ + else \ + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ + "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ + fi +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) + -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) + -rm -f src/c/$(DEPDIR)/$(am__dirstamp) + -rm -f src/c/$(am__dirstamp) + -rm -f src/jni/$(DEPDIR)/$(am__dirstamp) + -rm -f src/jni/$(am__dirstamp) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." + -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) +@JAVASCI_FALSE@install-data-local: +@JAVASCI_FALSE@distclean-local: +@JAVASCI_FALSE@clean-local: +@JAVASCI_FALSE@install-html-local: +clean: clean-am + +clean-am: clean-generic clean-libtool clean-local \ + clean-pkglibLTLIBRARIES mostlyclean-am + +distclean: distclean-am + -rm -rf src/c/$(DEPDIR) src/jni/$(DEPDIR) + -rm -f Makefile +distclean-am: clean-am distclean-compile distclean-generic \ + distclean-local distclean-tags + +dvi: dvi-am + +dvi-am: + +html: html-am + +html-am: + +info: info-am + +info-am: + +install-data-am: install-data-local install-libjavasci2_la_etcDATA \ + install-libjavasci2_la_rootDATA + +install-dvi: install-dvi-am + +install-dvi-am: + +install-exec-am: install-pkglibLTLIBRARIES + +install-html: install-html-am + +install-html-am: install-html-local + +install-info: install-info-am + +install-info-am: + +install-man: + +install-pdf: install-pdf-am + +install-pdf-am: + +install-ps: install-ps-am + +install-ps-am: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + -rm -rf src/c/$(DEPDIR) src/jni/$(DEPDIR) + -rm -f Makefile +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +pdf: pdf-am + +pdf-am: + +ps: ps-am + +ps-am: + +uninstall-am: uninstall-libjavasci2_la_etcDATA \ + uninstall-libjavasci2_la_rootDATA uninstall-pkglibLTLIBRARIES + +.MAKE: all check check-am install install-am install-strip + +.PHONY: CTAGS GTAGS TAGS all all-am all-local check check-am \ + check-local clean clean-generic clean-libtool clean-local \ + clean-pkglibLTLIBRARIES cscopelist-am ctags ctags-am distclean \ + distclean-compile distclean-generic distclean-libtool \ + distclean-local distclean-tags distdir dvi dvi-am html html-am \ + info info-am install install-am install-data install-data-am \ + install-data-local install-dvi install-dvi-am install-exec \ + install-exec-am install-html install-html-am \ + install-html-local install-info install-info-am \ + install-libjavasci2_la_etcDATA install-libjavasci2_la_rootDATA \ + install-man install-pdf install-pdf-am \ + install-pkglibLTLIBRARIES install-ps install-ps-am \ + install-strip installcheck installcheck-am installdirs \ + maintainer-clean maintainer-clean-generic mostlyclean \ + mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ + pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am \ + uninstall-libjavasci2_la_etcDATA \ + uninstall-libjavasci2_la_rootDATA uninstall-pkglibLTLIBRARIES + + +# This target enables tests for Scilab +@JAVASCI_TRUE@check-local: $(top_builddir)/scilab-bin test +@JAVASCI_TRUE@ if test -d $(mydatadir)/tests; then \ +@JAVASCI_TRUE@ @COMMAND="try test_run('$(modulename)');catch exit(-1);end;exit(0)"; export LANG=C; $(top_builddir)/bin/scilab -nwni -nb -e "$$COMMAND"; \ +@JAVASCI_TRUE@ fi +@JAVASCI_TRUE@check-code: +@JAVASCI_TRUE@ if test -f build.xml; then \ +@JAVASCI_TRUE@ $(ANT) checkstyle; \ +@JAVASCI_TRUE@ fi +@JAVASCI_TRUE@ if test -x "$(SPLINT)"; then \ +@JAVASCI_TRUE@ $(SPLINT) $(SPLINT_OPTIONS) -I$(top_srcdir)/modules/core/includes/ -I$(top_srcdir)/libs/MALLOC/includes/ -I$(top_srcdir)/modules/localization/includes/ $(INCLUDE_FLAGS) $(CHECK_SRC); \ +@JAVASCI_TRUE@ fi +@JAVASCI_TRUE@@NEED_JAVA_TRUE@java: +# Some configurations needs to export JAVA_HOME in the current env +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ if test -f build.xml -a $$USEANT -eq 1; then \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ $(ANT); \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ fi + +@JAVASCI_TRUE@@NEED_JAVA_TRUE@clean-java: +# Some configurations needs to export JAVA_HOME in the current env +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ @if test "$(JAVA_HOME)"; then export JAVA_HOME=$(JAVA_HOME); fi; \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ if test -f build.xml -a $$USEANT -eq 1; then \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ $(ANT) clean; \ +@JAVASCI_TRUE@@NEED_JAVA_TRUE@ fi; + +# If the user request for the SWIG generation of the wrappers Java => C/C++ +# We call the target swig-build on the variable SWIG_WRAPPERS + +@JAVASCI_TRUE@@SWIG_TRUE@swig: $(SWIG_WRAPPERS) +@JAVASCI_TRUE@@SWIG_TRUE@ @SWIG_PACKAGENAME=org.scilab.modules.$(modulename); \ +@JAVASCI_TRUE@@SWIG_TRUE@ SWIG_OUTDIR=src/java/org/scilab/modules/$(modulename)/; \ +@JAVASCI_TRUE@@SWIG_TRUE@ if test -n "$(SWIG_WRAPPERS)"; then \ +@JAVASCI_TRUE@@SWIG_TRUE@ for file in $(SWIG_WRAPPERS) ; do \ +@JAVASCI_TRUE@@SWIG_TRUE@ echo "Swig process of $$file (Java) ..."; \ +@JAVASCI_TRUE@@SWIG_TRUE@ $(SWIG_BIN) $(SWIG_JAVA) -package $$SWIG_PACKAGENAME -outdir $$SWIG_OUTDIR $$file; \ +@JAVASCI_TRUE@@SWIG_TRUE@ done; \ +@JAVASCI_TRUE@@SWIG_TRUE@ fi + +@JAVASCI_TRUE@@SWIG_TRUE@swig-scilab: $(SWIG_SCILAB_WRAPPERS) +@JAVASCI_TRUE@@SWIG_TRUE@ @SWIG_OUTDIR=src/swig/; \ +@JAVASCI_TRUE@@SWIG_TRUE@ if test -n "$(SWIG_SCILAB_WRAPPERS)"; then \ +@JAVASCI_TRUE@@SWIG_TRUE@ for file in $(SWIG_SCILAB_WRAPPERS) ; do \ +@JAVASCI_TRUE@@SWIG_TRUE@ echo "Swig process of $$file (Scilab) ..."; \ +@JAVASCI_TRUE@@SWIG_TRUE@ $(SWIG_BIN) $(SWIG_SCILAB) -outdir $$SWIG_OUTDIR $$file; \ +@JAVASCI_TRUE@@SWIG_TRUE@ done; \ +@JAVASCI_TRUE@@SWIG_TRUE@ fi + +# If the user request for the SWIG generation of the wrappers Java => C/C++ +# We call the target swig-build on the variable SWIG_WRAPPERS + +@GIWS_TRUE@@JAVASCI_TRUE@giws: $(GIWS_WRAPPERS) +@GIWS_TRUE@@JAVASCI_TRUE@ @GIWS_OUTPUTDIR=src/jni/; \ +@GIWS_TRUE@@JAVASCI_TRUE@ MANDATORY_OPTIONS="--throws-exception-on-error --description-file"; \ +@GIWS_TRUE@@JAVASCI_TRUE@ if test -n "$(GIWS_WRAPPERS)"; then \ +@GIWS_TRUE@@JAVASCI_TRUE@ for file in $(GIWS_WRAPPERS) ; do \ +@GIWS_TRUE@@JAVASCI_TRUE@ echo "GIWS process of $$file ..."; \ +@GIWS_TRUE@@JAVASCI_TRUE@ if test -z "$(GIWS_OPTIONS)"; then \ +@GIWS_TRUE@@JAVASCI_TRUE@ $(GIWS_BIN) --disable-return-size-array --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \ +@GIWS_TRUE@@JAVASCI_TRUE@ else \ +@GIWS_TRUE@@JAVASCI_TRUE@ echo "Custom GIWS call with '$$GIWS_OPTIONS'"; \ +@GIWS_TRUE@@JAVASCI_TRUE@ $(GIWS_BIN) $$GIWS_OPTIONS --output-dir $$GIWS_OUTPUTDIR $$MANDATORY_OPTIONS $$file; \ +@GIWS_TRUE@@JAVASCI_TRUE@ fi \ +@GIWS_TRUE@@JAVASCI_TRUE@ done; \ +@GIWS_TRUE@@JAVASCI_TRUE@ fi + +@GIWS_TRUE@@JAVASCI_TRUE@giws-exception: +@GIWS_TRUE@@JAVASCI_TRUE@ @GIWS_OUTPUTDIR=src/jni/;\ +@GIWS_TRUE@@JAVASCI_TRUE@ echo "GIWS: Generation of exception class ..."; \ +@GIWS_TRUE@@JAVASCI_TRUE@ $(GIWS_BIN) --generate-exception-class --output-dir $$GIWS_OUTPUTDIR + +@JAVASCI_TRUE@macros: +@JAVASCI_TRUE@ -@( if test ! -x $(top_builddir)/scilab-bin; then \ +@JAVASCI_TRUE@ echo "Error : Cannot build $< : Scilab has not been built"; \ +@JAVASCI_TRUE@ else \ +@JAVASCI_TRUE@ $(top_builddir)/bin/scilab -ns -nwni -e "exec('macros/buildmacros.sce');quit;";\ +@JAVASCI_TRUE@ fi) + +# Removes the macros +@JAVASCI_TRUE@clean-macros: +# Removes macros (*.bin generated from .sci) +@JAVASCI_TRUE@ @for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \ +@JAVASCI_TRUE@ echo "rm -f $(builddir)/$$dir/$(MACROBINMASK)"; \ +@JAVASCI_TRUE@ rm -f $(builddir)/$$dir/$(MACROBINMASK); \ +@JAVASCI_TRUE@ done + +@JAVASCI_TRUE@test: +# More tests could be added here +@JAVASCI_TRUE@ @if test -z "$(USEANT)"; then USEANT=0; else USEANT=1; fi; \ +@JAVASCI_TRUE@ if test -f build.xml -a $$USEANT -eq 1; then \ +@JAVASCI_TRUE@ $(ANT) test; \ +@JAVASCI_TRUE@ fi + +@JAVASCI_TRUE@all-local: $(TARGETS_ALL) + +@JAVASCI_TRUE@.sci.bin: +@JAVASCI_TRUE@ -@( if test ! -x $(top_builddir)/scilab-bin; then \ +@JAVASCI_TRUE@ echo "Error : Cannot build $< : Scilab has not been build"; \ +@JAVASCI_TRUE@ else \ +@JAVASCI_TRUE@ echo "Creating $@"; \ +@JAVASCI_TRUE@ $(top_builddir)/bin/scilab -ns -nwni -e "exec('$(abs_srcdir)/$<');save('$(abs_srcdir)/$@');exit;"; \ +@JAVASCI_TRUE@ fi ) + +@JAVASCI_TRUE@install-html-local: + +@JAVASCI_TRUE@install-data-local-local: +# Mainly for javasci +@JAVASCI_TRUE@ @if test -d $(srcdir)/javadoc; then \ +@JAVASCI_TRUE@ cp -R $(srcdir)/javadoc $(DESTDIR)/$(mydatadir)/; \ +@JAVASCI_TRUE@ fi +# If the user wants the help sources to be installed +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ @echo "-------- Install of XML sources of help files --------"; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ for lang in $(ALL_LINGUAS); do \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ if test -d $(srcdir)/help/$$lang; then \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/$$lang && \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ if ls -lLd $(srcdir)/help/$$lang/$(DOCMASKXML) >/dev/null 2>&1; then \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ for file in $(srcdir)/help/$$lang/$(DOCMASKXML) ; do \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/$$lang" ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/$$lang ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ done ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ fi; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ fi; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ done; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ @echo "-------- Install of MathML sources --------"; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ if test -d $(srcdir)/help/mml/; then \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/help/mml/ && \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ if ls -lLd $(srcdir)/help/mml/$(DOCMASKMML) >/dev/null 2>&1; then \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ for file in $(srcdir)/help/mml/$(DOCMASKMML) ; do \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/help/mml" ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/help/mml ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ done ; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ fi; \ +@INSTALL_HELP_XML_TRUE@@JAVASCI_TRUE@ fi +@JAVASCI_TRUE@install-data-local: +# Install the tests +@JAVASCI_TRUE@ @echo "-------- Install tests (if any) --------"; \ +@JAVASCI_TRUE@ for dir in $(TESTS_DIR) $(TESTS_DIREXT) ; do \ +@JAVASCI_TRUE@ if test -d $(srcdir)/$$dir/; then \ +@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \ +@JAVASCI_TRUE@ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \ +@JAVASCI_TRUE@ if test -d "$(srcdir)/$$dir/$$file"; then \ +@JAVASCI_TRUE@ echo $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir/$$file; \ +@JAVASCI_TRUE@ $(mkinstalldirs) "$(DESTDIR)$(pkgmacrosdir)/$$dir/$$file"; \ +@JAVASCI_TRUE@ else \ +@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \ +@JAVASCI_TRUE@ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgmacrosdir)/`dirname $$dir/$$file`" ; \ +@JAVASCI_TRUE@ fi \ +@JAVASCI_TRUE@ done; \ +@JAVASCI_TRUE@ fi; \ +@JAVASCI_TRUE@ done +# Install the help chapter +@JAVASCI_TRUE@ @echo "-------- Install the help chapter (if any) --------"; \ +@JAVASCI_TRUE@ for lang in $(HELP_CHAPTERLANG); do \ +@JAVASCI_TRUE@ HELPFILE=$(srcdir)/$(HELP_CHAPTERDIR)$$lang/$(HELP_CHAPTERFILE); \ +@JAVASCI_TRUE@ if test -f $$HELPFILE; then \ +@JAVASCI_TRUE@ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \ +@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(HELP_CHAPTERDIR)/$$lang/; \ +@JAVASCI_TRUE@ echo $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \ +@JAVASCI_TRUE@ $(INSTALL_DATA) $$HELPFILE $(DESTDIR)$(pkgdocdir)/$$HELPFILE; \ +@JAVASCI_TRUE@ fi; \ +@JAVASCI_TRUE@ done +# Install the demos & examples +@JAVASCI_TRUE@ @echo "-------- Install demos & examples (if any) --------"; \ +@JAVASCI_TRUE@ for dir in $(DEMOS_DIR) $(DEMOS_DIREXT) $(EXAMPLES_DIR) $(EXAMPLES_DIREXT) ; do \ +@JAVASCI_TRUE@ if test -d $(srcdir)/$$dir/; then \ +@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir && \ +@JAVASCI_TRUE@ for file in `find $(srcdir)/$$dir | sed "s|^$(srcdir)/$$dir||" 2>/dev/null`; do \ +@JAVASCI_TRUE@ if test -d "$(srcdir)/$$dir/$$file"; then \ +@JAVASCI_TRUE@ echo $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$$dir/$$file; \ +@JAVASCI_TRUE@ $(mkinstalldirs) "$(DESTDIR)$(pkgdocdir)/$$dir/$$file"; \ +@JAVASCI_TRUE@ else \ +@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $(srcdir)/$$dir/$$file $(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \ +@JAVASCI_TRUE@ $(INSTALL_DATA) "$(srcdir)/$$dir/$$file" "$(DESTDIR)$(pkgdocdir)/`dirname $$dir/$$file`" ; \ +@JAVASCI_TRUE@ fi \ +@JAVASCI_TRUE@ done; \ +@JAVASCI_TRUE@ fi; \ +@JAVASCI_TRUE@ done +# Install the macros +@JAVASCI_TRUE@ @echo "-------- Install macros (if any) --------"; \ +@JAVASCI_TRUE@ for dir in $(MACRODIRS) $(MACROSDIRSEXT) ; do \ +@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgmacrosdir)/$$dir && \ +@JAVASCI_TRUE@ if test -d $(srcdir)/$$dir/; then \ +@JAVASCI_TRUE@ FILELIST="$(srcdir)/$$dir/$(MACROMASK) $(srcdir)/$$dir/$(MACROBINMASK) $(srcdir)/$$dir/$(MACROBUILDMASK) $(srcdir)/$$dir/names $(srcdir)/$$dir/lib";\ +@JAVASCI_TRUE@ if test -n "$(MACROSSPECIALEXT)"; then \ +@JAVASCI_TRUE@ specialExtDir=""; \ +@JAVASCI_TRUE@ for specialExt in $(MACROSSPECIALEXT); do \ +@JAVASCI_TRUE@ specialExtDir="$$specialExtDir $(srcdir)/$$dir/$$specialExt"; \ +@JAVASCI_TRUE@ done; \ +@JAVASCI_TRUE@ FILELIST="$$FILELIST $$specialExtDir"; \ +@JAVASCI_TRUE@ fi; \ +@JAVASCI_TRUE@ for file in `ls -1 $$FILELIST 2>/dev/null`; do \ +@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgmacrosdir)/$$dir" ; \ +@JAVASCI_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgmacrosdir)/$$dir ; \ +@JAVASCI_TRUE@ done; \ +@JAVASCI_TRUE@ fi; \ +@JAVASCI_TRUE@ done +# Install java files (.jar) +@JAVASCI_TRUE@ @if ls -lLd $(srcdir)/$(JARDIR)$(JARMASK) >/dev/null 2>&1; then \ +@JAVASCI_TRUE@ echo "-------- Install jar files --------"; \ +@JAVASCI_TRUE@ $(mkinstalldirs) $(DESTDIR)$(pkgdocdir)/$(JARDIR); \ +@JAVASCI_TRUE@ for file in $(srcdir)/$(JARDIR)$(JARMASK); do\ +@JAVASCI_TRUE@ echo "$(INSTALL_DATA) $$file $(DESTDIR)$(pkgdocdir)/$(JARDIR)" ; \ +@JAVASCI_TRUE@ $(INSTALL_DATA) "$$file" $(DESTDIR)$(pkgdocdir)/$(JARDIR) ; \ +@JAVASCI_TRUE@ done ; \ +@JAVASCI_TRUE@ fi + +########### CLEAN ################### +# Clean help (generated automatically by Scilab) +# It used to clean the macro (clean-macros) but this was causing +# make clean && make to fail Scilab startup +@JAVASCI_TRUE@@NEED_JAVA_TRUE@clean-local: clean-java +@JAVASCI_TRUE@@NEED_JAVA_FALSE@clean-local: + +@JAVASCI_TRUE@distclean-local: +@JAVASCI_TRUE@ rm -f $(builddir)/help/*/.last_successful_build_javaHelp $(builddir)/help/*/.list_* + +@JAVASCI_TRUE@.PHONY: macros java swig giws + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/modules/javasci/TODO b/modules/javasci/TODO new file mode 100755 index 000000000..8246ac205 --- /dev/null +++ b/modules/javasci/TODO @@ -0,0 +1,24 @@ +* write test on http://codereview.scilab.org/#change,5671 + +* check memory leaks + +* check what is the faster: + - From java, send variable [][] and convert into the JNI into variable[][] with row & col size + - From java, convert from [][] to [] directly and send it to the native code directly (avoid the conversion in the JNI) + +* Write documentation + +* scilab error management + +* if the function fails, .exec() should return false + +* check that a java [][] dimensions are consistent +/!\ it can impact performances. + +* move call_scilab.i into the right module (and helper) + +* handle of sparse data type +See: http://bugzilla.scilab.org/show_bug.cgi?id=7989 + +* handle of other data type (list, tlist, mlist) + diff --git a/modules/javasci/build.xml b/modules/javasci/build.xml new file mode 100755 index 000000000..96ba21814 --- /dev/null +++ b/modules/javasci/build.xml @@ -0,0 +1,40 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2007 - INRIA - Allan CORNET + * Copyright (C) 2007 - INRIA - Sylvestre LEDRU + * + * 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.1-en.txt + * + --> +<project name="javasci" default="jar"> + <import file="../../build.incl.xml"/> + <property name="library.name" value="${library.javasci.name}"/> + <property name="library.title" value="Scilab Java API"/> + <property name="junit.forkMode" value="perTest"/> + + <description> + Build the Java/Scilab connecter (javasci) module + </description> + <!-- Compile sources --> + <target name="compile" description="Build sources of Javasci v2" depends="init"> + <mkdir dir="${classes.dir}/v2"/> + <javac srcdir="src/java/" destdir="${classes.dir}/v2" classpathref="compile.classpath" deprecation="on" debug="${build.debug}" verbose="off" listfiles="on" includeAntRuntime="no" includes="org/**/*.java" source="6" target="6"/> + </target> + + <!-- Create the jar --> + <target name="jar" description="Build the jar file" depends="compile"> + <manifestclasspath property="manifest.classpath" jarfile="${build.jar.dir}/${library.name}"> + <classpath location="${library.jvm.dir}/${library.jvm.name}"/> + </manifestclasspath> + <jar destfile="${build.jar.dir}/${library.name}" basedir="${classes.dir}/v2/"> + <manifest> + <attribute name="Class-Path" value="${manifest.classpath}"/> + </manifest> + </jar> + </target> +</project> diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_Scilab.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_Scilab.class Binary files differnew file mode 100755 index 000000000..18a40292e --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_Scilab.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_ScilabJNI.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_ScilabJNI.class Binary files differnew file mode 100755 index 000000000..6ef937b6b --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Call_ScilabJNI.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$AlreadyRunningException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$AlreadyRunningException.class Binary files differnew file mode 100755 index 000000000..90e5cebfa --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$AlreadyRunningException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$InitializationException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$InitializationException.class Binary files differnew file mode 100755 index 000000000..c344b3ac3 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$InitializationException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabErrorException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabErrorException.class Binary files differnew file mode 100755 index 000000000..4c146472e --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabErrorException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabInternalException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabInternalException.class Binary files differnew file mode 100755 index 000000000..4b380d709 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$ScilabInternalException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UndefinedVariableException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UndefinedVariableException.class Binary files differnew file mode 100755 index 000000000..5142a9ca6 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UndefinedVariableException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnknownTypeException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnknownTypeException.class Binary files differnew file mode 100755 index 000000000..cc7d0bfab --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnknownTypeException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnsupportedTypeException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnsupportedTypeException.class Binary files differnew file mode 100755 index 000000000..5b6f7c775 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException$UnsupportedTypeException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException.class Binary files differnew file mode 100755 index 000000000..31c5ea251 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/JavasciException.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab$1.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab$1.class Binary files differnew file mode 100755 index 000000000..4f0dadda6 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab$1.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab.class Binary files differnew file mode 100755 index 000000000..f3f80c3e1 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/Scilab.class diff --git a/modules/javasci/build/classes/v2/org/scilab/modules/javasci/ScilabVariablesJavasci.class b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/ScilabVariablesJavasci.class Binary files differnew file mode 100755 index 000000000..6344ceef3 --- /dev/null +++ b/modules/javasci/build/classes/v2/org/scilab/modules/javasci/ScilabVariablesJavasci.class diff --git a/modules/javasci/etc/javasci.quit b/modules/javasci/etc/javasci.quit new file mode 100755 index 000000000..ab83f0c89 --- /dev/null +++ b/modules/javasci/etc/javasci.quit @@ -0,0 +1,10 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2007-2008 - INRIA +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + diff --git a/modules/javasci/etc/javasci.start b/modules/javasci/etc/javasci.start new file mode 100755 index 000000000..39a864b78 --- /dev/null +++ b/modules/javasci/etc/javasci.start @@ -0,0 +1,9 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2006 - INRIA +// +// 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.1-en.txt + diff --git a/modules/javasci/examples/v2/Example1.java b/modules/javasci/examples/v2/Example1.java new file mode 100755 index 000000000..d32db4609 --- /dev/null +++ b/modules/javasci/examples/v2/Example1.java @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2010 - DIGITEO - Sylvestre Ledru + * + * This file is released under the 3-clause BSD license. See COPYING-BSD. + * + */ + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +class Example1 { + + public static void main(String[] args) { + try { + + Scilab sci = new Scilab(); + + if (sci.open()) { + /* Send a Scilab instruction */ + sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];"); + + /* Retrieve the variable foo */ + ScilabType foo = sci.get("foo"); + + /* Display the variable */ + System.out.println("Representation of : " + foo); + + /* Get the data and retrieve the 2,2 value */ + double[][] aReal = ((ScilabDouble)foo).getRealPart(); + System.out.println("foo[1,1] = " + aReal[1][1]); + + /* Change the value of 2,2 */ + aReal[1][1] = Math.PI; + + /* Create a new variable */ + ScilabDouble bar = new ScilabDouble(aReal); + + /* Send it to Scilab */ + sci.put("bar", bar); + + /* Display it through Scilab */ + sci.exec("disp(bar)"); + + sci.close(); + } else { + System.out.println("Could not start Scilab "); + } + + + /* Can be improved by other exceptions: AlreadyRunningException, + * InitializationException, UndefinedVariableException, + * UnknownTypeException, etc + */ + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("An exception occurred: " + e.getLocalizedMessage()); + } + + } +} + diff --git a/modules/javasci/examples/v2/Makefile b/modules/javasci/examples/v2/Makefile new file mode 100755 index 000000000..83c274965 --- /dev/null +++ b/modules/javasci/examples/v2/Makefile @@ -0,0 +1,12 @@ +# A sample Makefile to build a Javasci v2-based application +# Path to Scilab data +SCI = /path/to/scilab/share/scilab/ +# Java API +CLASSPATH = $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar:$(SCI)/modules/types/jar/org.scilab.modules.types.jar +# Path to native libs +LIB_PATH = $(SCI)/../../lib/scilab/ +# Scilab binary: /path/to/scilab/lib/scilab/ +# with the source version: $(SCI)/modules/javasci/.libs/:$(SCI)/modules/.libs/ +all: + javac -cp $(CLASSPATH) Example1.java + java -cp $(CLASSPATH):. -DSCI=$(SCI) -Djava.library.path=$(LIB_PATH) Example1
\ No newline at end of file diff --git a/modules/javasci/examples/v2/build.bat b/modules/javasci/examples/v2/build.bat new file mode 100755 index 000000000..b9395e0cc --- /dev/null +++ b/modules/javasci/examples/v2/build.bat @@ -0,0 +1,9 @@ +rem Path to Scilab data +set SCI="C:\Program Files\scilab-5.3.0" +rem Java API +set CLASSPATH=%SCI%/modules/javasci/jar/org.scilab.modules.javasci.jar;%SCI%/modules/types/jar/org.scilab.modules.types.jar +rem Path to native libs +set LIB_PATH="%SCI%\bin" + +javac -cp %CLASSPATH% Example1.java +java -cp %CLASSPATH%;. -Djava.library.path=%LIB_PATH% Example1 diff --git a/modules/javasci/help/en_US/addchapter.sce b/modules/javasci/help/en_US/addchapter.sce new file mode 100755 index 000000000..f028379d1 --- /dev/null +++ b/modules/javasci/help/en_US/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + +add_help_chapter("Java Interface",SCI+"/modules/javasci/help/en_US",%T); + diff --git a/modules/javasci/help/en_US/compile_and_run_javasci.xml b/modules/javasci/help/en_US/compile_and_run_javasci.xml new file mode 100755 index 000000000..1c914e0cf --- /dev/null +++ b/modules/javasci/help/en_US/compile_and_run_javasci.xml @@ -0,0 +1,176 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="compile_and_run_javasci_v2" xml:lang="en"> + <refnamediv> + <refname>Compile and run with javasci v2</refname> + <refpurpose>How to compile a Java application using Javasci v2</refpurpose> + </refnamediv> + <refsection> + <title>Linux/Unix/MacOSX</title> + <para>On Linux/Unix/MacOSX, Scilab needs the SCI global variable to be set:</para> + <itemizedlist> + <listitem> + <para> + In the binary version of Scilab, SCI will point to <literal>/path/to/scilab/share/scilab/</literal> + </para> + </listitem> + <listitem> + <para> + In the source tree of Scilab, SCI will point to the root of the source tree <literal>/path/to/scilab/source/tree/</literal> + </para> + </listitem> + </itemizedlist> + + <para>To compile a Java application using Javasci v2, the path to the following libraries may have to be added in the classpath:</para> + <itemizedlist> + <listitem> + <literal>org.scilab.modules.javasci.jar</literal> (required for all Javasci applications) + </listitem> + <listitem> + <literal>org.scilab.modules.types.jar</literal> (if the application uses Javasci types) + </listitem> + </itemizedlist> + + <para>To compile the example code (the code is further in this page), the command line is:</para> + + <para> + <literal>javac -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample.java</literal> + </para> + + <para>To launch the Java application, the path to the libjavasci native library needs to be provided, either:</para> + <itemizedlist> + <listitem> + <para>In the LD_LIBRARY_PATH:</para> + <itemizedlist mark="opencircle"> + <listitem> + <para> + In the binary version of Scilab, LD_LIBRARY_PATH will point to <literal>/path/to/scilab/lib/scilab/</literal> and <literal>/path/to/scilab/lib/thirdparty/</literal> + </para> + </listitem> + <listitem> + <para> + In the source tree of Scilab, LD_LIBRARY_PATH will point to the root of the source tree <literal>/path/to/scilab/modules/javasci/.libs/</literal>, <literal>/path/to/scilab/modules/types/.libs/</literal> and <literal>/path/to/scilab/.libs/</literal> + </para> + </listitem> + </itemizedlist> + + <para>And the application is run with the command line:</para> + <literal>java -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample</literal> + </listitem> + <listitem> + <para>Or as argurment of java, in the command line:</para> + <para> + <literal>java -Djava.library.path=/path/to/libjavasci/:/path/to/scilab/lib/thirdparty/ -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample</literal> + </para> + </listitem> + </itemizedlist> + </refsection> + <refsection> + <title>Windows</title> + <para> + In this paragraph we suppose Scilab is installed in the directory <literal>C:\Program Files\scilab-XXXX</literal> (where XXXX is the version of Scilab, for example "5.4.0"). + </para> + + <para>On windows, no specific environment variable needs to be defined.</para> + + <para>To compile a Java application using Javasci v2, the path to the following libraries may have to be added in the classpath:</para> + <itemizedlist> + <listitem> + <literal>org.scilab.modules.javasci.jar</literal> (required for all Javasci applications) + </listitem> + <listitem> + <literal>org.scilab.modules.types.jar</literal> (if the application uses Javasci types) + </listitem> + </itemizedlist> + + <para>To compile the example code, the command line is:</para> + <para> + <literal>javac -cp "C:\Program Files\scilab-XXXX\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-XXXX\modules\types\jar\org.scilab.modules.types.jar";. BasicExample.java</literal> + </para> + + <para>For execution, the path to the native library libjavasci.dll and to its dependencies must be added in the PATH environment variable. + All the needed libraries are in the "bin" folder, so the command line is: + </para> + <para> + <literal>set PATH="C:\Program Files\scilab-XXXX\bin";%PATH%</literal> + </para> + + <para>To launch the Java application, the command line is quite the same as for Linux:</para> + <para> + <literal>java -cp "C:\Program Files\scilab-XXXX\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-XXXX\modules\types\jar\org.scilab.modules.types.jar";. BasicExample</literal> + </para> + </refsection> + <refsection> + <title>Options</title> + <para> + Optional options to launch java : <literal>-Djava.compiler=JIT -Xmx256m</literal> + </para> + <para>(With these arguments, javasci is started with same initial options like the standard scilab). + </para> + <para>Note that two environnement variables are taken in account for specific needs: + </para> + <itemizedlist> + <listitem> + <para> + <literal>SCI_DISABLE_TK=1</literal> disables Tk (Tcl's GUI) + </para> + </listitem> + <listitem> + <para> + <literal>SCI_JAVA_ENABLE_HEADLESS=1</literal> launches Java in headless mode (no AWT/Swing) + </para> + </listitem> + </itemizedlist> + </refsection> + <refsection> + <title>Examples</title> + <programlisting role="java"><![CDATA[ +// A simple Java example +// javasci v2 +// Filename: BasicExample.java + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; + +class BasicExample { + + public static void main(String[] args) { + try { + Scilab sci = new Scilab(); + sci.open(); + sci.exec("a=cos(%pi)*sin(%pi^2);"); + ScilabType a = sci.get("a"); + System.out.println("a = " + a); + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("Could not find variable type: " + e.getLocalizedMessage()); + } + } +} + + ]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> + </member> + <member> + <link linkend="javasci">Javasci</link> + </member> + <member> + <link linkend="javasci_faq_v2">Javasci FAQ</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/javasci/help/en_US/javasci.xml b/modules/javasci/help/en_US/javasci.xml new file mode 100755 index 000000000..455bd2ce5 --- /dev/null +++ b/modules/javasci/help/en_US/javasci.xml @@ -0,0 +1,118 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<!-- This document was created with Syntext Serna Free. --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci" xml:lang="en"> + <refnamediv> + <refname>javasci</refname> + <refpurpose>Call Scilab engine from a Java application</refpurpose> + </refnamediv> + <refsection> + <title>Description</title> + <para>Scilab offers the possibility to be called from a Java application.</para> + <para>This help describes the features of the javasci API.</para> + <para> + Since Scilab version 5.3.0, a new version of Javasci called Javasci v2 has been introduced. This version fixes most of the <link linkend="javasci_v1_limitations">limitations of Javasci v1</link>. + </para> + <para> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </para> + </refsection> + <refsection> + <title>Example of Javasci v2</title> + <programlisting role="java"><![CDATA[ +// A simple Java example with javasci v2 +// Filename: DisplayPI.java + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +class Example1 { + + public static void main(String[] args) { + + try { + Scilab sci = new Scilab(); + sci.open(); + sci.exec("disp(%pi);"); + + ScilabDouble a = new ScilabDouble(3.14); + sci.put("a",a); + sci.exec("b=sin(a);"); + ScilabType b = sci.get("b"); + System.out.println("b = " + b); + + sci.close(); + + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("An exception occurred: " + e.getLocalizedMessage()); + } + + } +} + +]]></programlisting> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </member> + <member> + <link linkend="compile_and_run_javasci_v2">Compile and run with Javasci v2</link> + </member> + <member> + <link linkend="javasci_faq_v2">Javasci v2 FAQ</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revdescription> + Javasci v1 is removed. + </revdescription> + </revision> + <revision> + <revnumber>5.4.0</revnumber> + <revdescription>New methods added: + <itemizedlist> + <listitem>Scilab.execException(String) + <para>Same as Scilab.exec(String) but returns an exception when a Scilab error occurs</para> + </listitem> + <listitem>Scilab.execException(String[]) + <para>Same as Scilab.exec(String[]) but returns an exception when a Scilab error occurs</para> + </listitem> + <listitem>Scilab.execException(File) + <para>Same as Scilab.exec(File) but returns an exception when a Scilab error occurs</para> + </listitem> + </itemizedlist> + </revdescription> + </revision> + <revision> + <revnumber>5.4.0</revnumber> + <revdescription> + <itemizedlist> + <listitem>Javasci supports sparse and boolean sparse datatypes.</listitem> + <listitem>Javasci supports tlists, mlists and lists datatypes.</listitem> + <listitem>Javasci supports polynomial datatypes.</listitem> + <listitem>Javasci supports struct datatypes under the form of an mList.</listitem> + </itemizedlist> + </revdescription> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/javasci/help/en_US/javasci_faq.xml b/modules/javasci/help/en_US/javasci_faq.xml new file mode 100755 index 000000000..a9ce12bcf --- /dev/null +++ b/modules/javasci/help/en_US/javasci_faq.xml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" scilab:needs-examples="no" xml:id="javasci_faq_v2" xml:lang="en"> + <refnamediv> + <refname>javasci FAQ</refname> + <refpurpose>The frequently asked questions for Javasci v2</refpurpose> + </refnamediv> + <refsection> + <title>Questions / Answers</title> + <qandaset> + <qandaentry> + <question> + <para>Running an application based on javasci, I get the error + <emphasis role="italic">Exception in thread "main" java.lang.NoClassDefFoundError: + org/scilab/modules/javasci/Scilab + </emphasis> + </para> + </question> + <answer> + <para>org.scilab.modules.javasci.jar is probably not defined in the CLASSPATH. See + <link linkend="compile_and_run_javasci_v2">Compile and run with javasci</link> + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>On Linux/Unix/MacOSX, the native library javasci2 does not exist or cannot be found.</para> + </question> + <answer> + <para>Probably the java.library.path value has not been set. See + <link linkend="compile_and_run_javasci_v2">Compile and run with javasci</link> + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>On Windows, the native library javasci.dll does not exist or cannot be found.</para> + </question> + <answer> + <para>The PATH environment variable may have not been set. See + <link linkend="compile_and_run_javasci_v2">Compile and run with javasci</link> + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>On Linux/Unix/MacOSX, the native library javasci2 does not exist or cannot be found even if the java.library.path is being set.</para> + </question> + <answer> + <para> + If the error is something like: <emphasis role="italic">java.lang.UnsatisfiedLinkError: /path/to/scilab/lib/scilab/libscilab.so.0.0.0: libsciparameters.so.5: cannot open shared object file: No such file or directory</emphasis>, try to set LD_LIBRARY_PATH to the path where Scilab native libraries are. + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>On Windows, the native library javasci.dll does not exist or cannot be found even if the PATH is being set.</para> + </question> + <answer> + <para> + If the error is something like: <emphasis role="italic">java.lang.UnsatisfiedLinkError: C:\Program Files\scilab-XXXX\bin\javasci.dll: The specified procedure could not be found</emphasis>, your PATH environment variable may introduce a conflict between the Scilab libraries with other libraries on your system. Try to move (in the PATH variable) the Scilab path to the front of paths. + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>A Javasci program fails to start with: + <emphasis role="italic">An exception occurred: Auto detection of SCI failed. + Could not retrieve the variable SCI + </emphasis> + </para> + </question> + <answer> + <para> + SCI should be set to <emphasis role="italic">scilab-X.Y.Z/share/scilab/ under GNU/Linux</emphasis>, <emphasis role="italic">scilab-X.Y.Z/Contents/MacOS/share/scilab/</emphasis> under Mac OS X and <emphasis role="italic">scilab-X.Y.Z/</emphasis> under Windows. + </para> + </answer> + </qandaentry> + + <qandaentry> + <question> + <para>I try to plot a graphic but the graphic never appears.</para> + </question> + <answer> + <para> + Make sure that you called the constructor (<emphasis role="italic">Scilab sci = new Scilab(true);</emphasis>) with the boolean value <emphasis role="italic">true</emphasis>. It starts Scilab in advanced mode. + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>I would like to attach a graphic from Javasci to an existing Swing application. I don't know how to do that?</para> + </question> + <answer> + <para>Well. For now, it is not possible out of the box. The feature should be available in a future version of Scilab. As always, contributions are welcome! + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para>I found the current way to manage Scilab graphic windows from javasci pretty hard. What should I do?</para> + </question> + <answer> + <para>This is embarassing. We are aware that the current solution is far from perfect. We hope we will be able to tackle this limitation in a future release. + </para> + </answer> + </qandaentry> + <qandaentry> + <question> + <para> + The Scilab instance has some external modules but fails to start with an <literal>undefined symbol:</literal> + </para> + </question> + <answer> + <para><literal> + <emphasis role="italic">atomsLoad: An error occurred while loading 'module-0.0.2': link : Library could not be loaded: /path/2.0-1/sci_gateway/c/../../src/cpp/libmy.so: undefined symbol: scirun_</emphasis> + </literal> + There are two potential solutions. First is to fix the module itself to build with the library providing the symbol. The second is to define the missing declared library with <literal>LD_PRELOAD=/path/to/the/lib/providing/the/symbol/libmy.so</literal> + </para> + </answer> + </qandaentry> + </qandaset> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </member> + <member> + <link linkend="javasci">Javasci</link> + </member> + <member> + <link linkend="compile_and_run_javasci_v2">Compile and run with javasci</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/javasci/help/en_US/javasci_limitations.xml b/modules/javasci/help/en_US/javasci_limitations.xml new file mode 100755 index 000000000..b59d97085 --- /dev/null +++ b/modules/javasci/help/en_US/javasci_limitations.xml @@ -0,0 +1,59 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> +<!-- This document was created with Syntext Serna Free. --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci_v1_limitations" scilab:needs-examples="no" xml:lang="en"> + <refnamediv> + <refname>javasci v1 limitations</refname> + <refpurpose>Why javasci v1 is now deprecated ?</refpurpose> + </refnamediv> + <refsection> + <title>Description</title> + <para>The version V1 of javasci has some important limitations:</para> + <itemizedlist> + <listitem>To retrieve any variable from the Scilab language, knowing the type of the variable is mandatory a priori.</listitem> + <listitem>Only a few types are managed by the interface (boolean, double, complex and string).</listitem> + <listitem>Lack of consistency between Scilab and Java. For example, in Scilab, a scalar (matrix of [1,1]) is a matrix. In the Java interface, there are two different datatypes (example: SciDouble and SciDoubleArray).</listitem> + <listitem>There is no serialization possible on most of the datatype.</listitem> + <listitem>Calling a Scilab function can be done only with the Exec method and increases the complexity of the retrieval of multiple output arguments.</listitem> + <listitem>The package name does not follow the package naming rules of Scilab and the Scilab Java checkstyle.</listitem> + <listitem>Hard to manage graphics windows (this problem is not addressed yet in Javasci v2)</listitem> + <listitem>No interaction with the event loop (this problem is not addressed yet in Javasci v2)</listitem> + <listitem>Cannot manage several instances of Scilab (this problem is not addressed yet in Javasci v2)</listitem> + </itemizedlist> + </refsection> + <refsection role="see also"> + <title>See Also</title> + <simplelist type="inline"> + <member> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </member> + <member> + <link linkend="compile_and_run_javasci_v2">Compile and run with Javasci</link> + </member> + <member> + <link linkend="javasci_faq_v2">Javasci FAQ</link> + </member> + </simplelist> + </refsection> + <refsection> + <title>History</title> + <revhistory> + <revision> + <revnumber>5.4.0</revnumber> + <revdescription> + Javasci v1 is removed. + </revdescription> + </revision> + </revhistory> + </refsection> +</refentry> diff --git a/modules/javasci/help/en_US/javasci_step_by_step.xml b/modules/javasci/help/en_US/javasci_step_by_step.xml new file mode 100755 index 000000000..6fd6fb375 --- /dev/null +++ b/modules/javasci/help/en_US/javasci_step_by_step.xml @@ -0,0 +1,169 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + --> +<!-- This document was created with Syntext Serna Free. --> +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci_step_by_step" scilab:needs-examples="no" xml:lang="en"> + <refnamediv> + <refname>javasci - Step by step</refname> + <refpurpose>How to write an application based on javasci v2</refpurpose> + </refnamediv> + <refsection> + <title>Step 1 - The code itself</title> + <para>Javasci v2 allows the call of Scilab engine from a Java API.</para> + <para> + Some objects and methods are provided to perform such tasks. The main class being <emphasis role="italic">Scilab</emphasis>. This object allows sending / receiving data from the Scilab engine, error management or execution of Scilab script/code. + </para> + <para>Classes are split in two packages: </para> + <itemizedlist> + <listitem>org.scilab.modules.javasci.*; // Contains the main Scilab class</listitem> + <listitem>org.scilab.modules.types.*; // Contains Scilab <=> Java mappings</listitem> + </itemizedlist> + <para> + <para>Here is an example of a classical use-case:</para> + </para> + <programlisting role="java"><![CDATA[ +/* + * + * This file is released under the 3-clause BSD license. See COPYING-BSD. + * + */ + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +class Example1 { + + public static void main(String[] args) { + try { + Scilab sci = new Scilab(); + if (sci.open()) { + /* Send a Scilab instruction */ + sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];"); + +/* Retrieve the variable foo */ + ScilabType foo = sci.get("foo"); + +/* Display the variable */ + System.out.println("Representation of : "+foo); + +/* Get the data and retrieve the 2,2 value */ + double[][] aReal = ((ScilabDouble)foo).getRealPart(); + System.out.println("foo[1,1] = " + aReal[1][1]); + +/* Change the value of 2,2 */ + aReal[1][1] = Math.PI; + +/* Create a new variable */ + ScilabDouble bar = new ScilabDouble(aReal); + +/* Send it to Scilab */ + sci.put("bar",bar); + +/* Display it through Scilab */ + sci.exec("disp(bar)"); + + sci.close(); + } else { + System.out.println("Could not start Scilab "); + } + + +/* Can be improved by other exceptions: AlreadyRunningException, + * InitializationException, UndefinedVariableException, + * UnknownTypeException, etc + */ + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("An exception occurred: " + e.getLocalizedMessage()); + } + } +} + + + ]]></programlisting> + <para>Note that the source are available in SCI/modules/javasci/examples/v2/</para> + <para>The output of the program will be:</para> + <programlisting><![CDATA[Representation of : [2.0, 4.0, 6.0 ; 4.0, 0.0, 10.0 ; 6.0, 10.0, 12.0] +foo[1,1] = 0.0 + +2. 4. 6. +4. 3.1415927 10. +6. 10. 12. + ]]></programlisting> + <para> + For more information about the objects and methods, browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </para> + </refsection> + <refsection> + <title>Step 2 - Build</title> + <para>Path to Scilab data is also expected under GNU/Linux and Mac OS X (under Microsoft Windows, it is automatically detected).</para> + <programlisting><![CDATA[# Variable SCI +# Under GNU/Linux with the Scilab binary, the path is: +/path/to/scilab-xxx/share/scilab/ +# Under GNU/Linux and Mac OS X with the source tree, the path is the base of the source tree +/path/to/scilab/sources/ +# Under Mac OS X, the path is: +/Applications/scilab-xxx/Contents/MacOS/share/scilab/ +# On Windows, the path is: +C:\Program Files\Scilab-5.3.0\ + ]]></programlisting> + <para>To build a code using Javasci v2, two jars files are necessary in the CLASSPATH.</para> + <programlisting role="example"><![CDATA[# For example, create a variable CLASSPATH +$(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar +$(SCI)/modules/types/jar/org.scilab.modules.types.jar +]]></programlisting> + </refsection> + <refsection> + <title>Step 3 - Execution</title> + <para>Like in the building step, both jars are expected. </para> + <para>Path(s) to native libraries have to be set in order for Java to communicate with Scilab.</para> + <para>Two libraries are needed by Javasci v2 on load libjavasci2.{so,dylib,dll} and libscilab.{so,dylib,dll}. Other Scilab libraries will be loaded transparently.</para> + <programlisting role="example"><![CDATA[# For example, create a variable LIBPATH +# Under GNU/Linux with the Scilab binary, the path is: +/path/to/scilab-xxx/lib/scilab/ +# Under GNU/Linux and Mac OS X with the source tree, the path is: +$(SCI)/modules/javasci/.libs/:$(SCI)/modules/.libs/ +# Under Mac OS X, the path is: +/Applications/scilab-xxx/Contents/MacOS/lib/scilab/ +# Under Windows, the path is: +set LIBPATH="C:\Program Files\Scilab-5.3.0\bin" + ]]></programlisting> + <para>The command to launch the program is the following:</para> + <programlisting>java -cp $CLASSPATH:. -DSCI=$SCI -Djava.library.path=$LIBPATH Example1</programlisting> + </refsection> + <refsection> + <title>A sample Makefile</title> + <para>A simple Makefile would be:</para> + <programlisting><![CDATA[SCI = /path/to/scilab/share/scilab/ +CLASSPATH = $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar:$(SCI)/modules/types/jar/org.scilab.modules.types.jar +LIB_PATH = /path/to/scilab/lib/scilab +all: +javac -cp $(CLASSPATH) Example1.java +java -cp $(CLASSPATH):. -DSCI=$(SCI) -Djava.library.path=$(LIB_PATH) Example1 + ]]></programlisting> + </refsection> + <para>See build.bat for Windows in SCI/modules/javasci/examples/v2 directory.</para> + <refsection> + <title>See Also</title> + <simplelist type="inline"> + <member> + Browse <link type="remote" linkend="javasci/javadoc/index.html">the documentation of Javasci v2.</link> (this will open the web browser). + </member> + <member> + <link linkend="compile_and_run_javasci_v2">Compile and run with Javasci v2</link> + </member> + <member> + <link linkend="javasci_faq_v2">Javasci v2 FAQ</link> + </member> + </simplelist> + </refsection> +</refentry> diff --git a/modules/javasci/help/fr_FR/addchapter.sce b/modules/javasci/help/fr_FR/addchapter.sce new file mode 100755 index 000000000..184e5e6c9 --- /dev/null +++ b/modules/javasci/help/fr_FR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + +add_help_chapter("Interface avec Java",SCI+"/modules/javasci/help/fr_FR",%T); + diff --git a/modules/javasci/help/ja_JP/addchapter.sce b/modules/javasci/help/ja_JP/addchapter.sce new file mode 100755 index 000000000..2a1664231 --- /dev/null +++ b/modules/javasci/help/ja_JP/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + +add_help_chapter("Java Interface",SCI+"/modules/javasci/help/ja_JP",%T); + diff --git a/modules/javasci/help/ja_JP/compile_and_run_javasci.xml b/modules/javasci/help/ja_JP/compile_and_run_javasci.xml new file mode 100755 index 000000000..abcf2e6b7 --- /dev/null +++ b/modules/javasci/help/ja_JP/compile_and_run_javasci.xml @@ -0,0 +1,396 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="compile_and_run_javasci_v2" xml:lang="ja"> + + <refnamediv> + + <refname>javasci v2でコンパイル/実行</refname> + + <refpurpose>Javasci v2によりJavaアプリケーションをコンパイルする方法</refpurpose> + + </refnamediv> + + <refsection> + + <title>Linux/Unix/MacOSX</title> + + <para>Linux/Unix/MacOSXでは, Scilab は グローバル変数SCIを以下のように設定する必要があります:</para> + + <itemizedlist> + + <listitem> + + <para> + + バイナリ版のScilabでは, SCI は <literal>/path/to/scilab/share/scilab/</literal>を指します + + </para> + + </listitem> + + <listitem> + + <para> + + Scilabのソースツリーでは, SCIはソースツリーのルート + + <literal>/path/to/scilab/source/tree/</literal>を指します + + </para> + + </listitem> + + </itemizedlist> + + + + <para> + + Javasci v2でJavaアプリケーションをコンパイルする際, + + 以下のライブラリへのパスをclasspathに追加する必要があります: + + </para> + + <itemizedlist> + + <listitem> + + <literal>org.scilab.modules.javasci.jar</literal> (全てのJavasciアプリケーションで必要) + + </listitem> + + <listitem> + + <literal>org.scilab.modules.types.jar</literal> (アプリケーションが + + Javasci型を使用する場合) + + </listitem> + + </itemizedlist> + + + + <para> + + 例に示すコード(コードはこのページに後述)をコンパイルするためには, + + 以下のようにコマンドラインに入力します: + + </para> + + + + <para> + + <literal>javac -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample.java</literal> + + </para> + + + + <para> + + Javaアプリケーションを起動するには, + + 以下のどちらかにより, + + libjavasci ネーティブライブラリへのパスを + + 指定する必要があります: + + </para> + + <itemizedlist> + + <listitem> + + <para>LD_LIBRARY_PATHで指定:</para> + + <itemizedlist mark="opencircle"> + + <listitem> + + <para> + + バイナリ版のScilabでは, LD_LIBRARY_PATH は + + <literal>/path/to/scilab/lib/scilab/</literal> および + + <literal>/path/to/scilab/lib/thirdparty/</literal>を指します + + </para> + + </listitem> + + <listitem> + + <para> + + Scilabのソースツリーでは, LD_LIBRARY_PATH は + + ソースツリーのルート + + <literal>/path/to/scilab/modules/javasci/.libs/</literal>, + + <literal>/path/to/scilab/modules/types/.libs/</literal> および + + <literal>/path/to/scilab/.libs/</literal> + + を指します. + + </para> + + </listitem> + + </itemizedlist> + + + + <para> + + アプリケーションは以下のコマンドライン入力により実行します: + + </para> + + <literal>java -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample</literal> + + </listitem> + + <listitem> + + <para> + + または, コマンドラインで, javaの引数として指定します: + + </para> + + <para> + + <literal>java -Djava.library.path=/path/to/libjavasci/:/path/to/scilab/lib/thirdparty/ -cp $SCI/modules/javasci/jar/org.scilab.modules.javasci.jar:$SCI/modules/types/jar/org.scilab.modules.types.jar:. BasicExample</literal> + + </para> + + </listitem> + + </itemizedlist> + + </refsection> + + <refsection> + + <title>Windows</title> + + <para> + + このパラグラフでは, Scilabがディレクトリ + + <literal>C:\Program Files\scilab-XXXX</literal> + + (ただし, XXXX は Scilabのバージョン, 例えば"5.4.0") + + にインストールされていると仮定します. + + </para> + + + + <para>Windowsでは, 特定の環境変数を定義する必要はありません.</para> + + + + <para> + + JavaアプリケーションをJavasci v2によりコンパイルするには, + + 以下のライブラリへのパスをclasspathに追加します: + + </para> + + <itemizedlist> + + <listitem> + + <literal>org.scilab.modules.javasci.jar</literal> (全てのJavasciアプリケーションで必要) + + </listitem> + + <listitem> + + <literal>org.scilab.modules.types.jar</literal> (アプリケーションがJavasci型を使用する場合) + + </listitem> + + </itemizedlist> + + + + <para> + + 例に示すコードをコンパイルする, コマンドラインを示します: + </para> + + <para> + + <literal>javac -cp "C:\Program Files\scilab-XXXX\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-XXXX\modules\types\jar\org.scilab.modules.types.jar";. BasicExample.java</literal> + + </para> + + + + <para> + + 実行の際には, ネーティブライブラリlibjavasci.dllと + + それが依存するものへのパスを環境変数PATHに追加する必要があります. + + 必要な全てのライブラリは"bin"フォルダにありますので, + + コマンドラインは以下のようになります: + + </para> + + <para> + + <literal>set PATH="C:\Program Files\scilab-XXXX\bin";%PATH%</literal> + + </para> + + + + <para>Javaアプリケーションを起動する際のコマンドラインはLinuxとほぼ同じです:</para> + + <para> + + <literal>java -cp "C:\Program Files\scilab-XXXX\modules\javasci\jar\org.scilab.modules.javasci.jar;C:\Program Files\scilab-XXXX\modules\types\jar\org.scilab.modules.types.jar";. BasicExample</literal> + + </para> + + </refsection> + + <refsection> + + <title>オプション</title> + + <para> + + javaを起動する際のオプション : <literal>-Djava.compiler=JIT -Xmx256m</literal> + + </para> + + <para>(これらの引数を指定すると, javasci は + + 標準scilabと同様に同じ初期オプションを指定して起動されます. + + </para> + + <para> + + 特定のニーズに基づき以下の2つの環境変数が使用される + + ことに注意してください: + + </para> + + <itemizedlist> + + <listitem> + + <para> + + <literal>SCI_DISABLE_TK=1</literal> はTk (TclのGUI)を無効にします + + </para> + + </listitem> + + <listitem> + + <para> + + <literal>SCI_JAVA_ENABLE_HEADLESS=1</literal> + + は, Javaをヘッドレスモード(AWT/Swingなし)で起動します. + + </para> + + </listitem> + + </itemizedlist> + + </refsection> + + <refsection> + + <title>例</title> + + <programlisting role="java"><![CDATA[ +// 簡単な Javaの例 +// javasci v2 +// Filename: BasicExample.java + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; + +class BasicExample { + + public static void main(String[] args) { + try { + Scilab sci = new Scilab(); + sci.open(); + sci.exec("a=cos(%pi)*sin(%pi^2);"); + ScilabType a = sci.get("a"); + System.out.println("a = " + a); + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("Could not find variable type: " + e.getLocalizedMessage()); + } + } +} + + ]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>参照</title> + + <simplelist type="inline"> + + <member> + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link>を閲覧. + + </member> + + <member> + + <link linkend="javasci">Javasci</link> + + </member> + + <member> + + <link linkend="javasci_faq_v2">Javasci FAQ</link> + + </member> + + </simplelist> + + </refsection> + +</refentry> + diff --git a/modules/javasci/help/ja_JP/javasci.xml b/modules/javasci/help/ja_JP/javasci.xml new file mode 100755 index 000000000..0d26eab96 --- /dev/null +++ b/modules/javasci/help/ja_JP/javasci.xml @@ -0,0 +1,234 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<!-- This document was created with Syntext Serna Free. --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci" xml:lang="ja"> + + <refnamediv> + + <refname>javasci</refname> + + <refpurpose>JavaアプリケーションからScilabエンジンをコール</refpurpose> + + </refnamediv> + + <refsection> + + <title>説明</title> + + <para> + + Scilab はJavaアプリケーションからコールできる機能を提供します. + + </para> + + <para> + + このヘルプは, javasci APIの機能を記述するものです. + + </para> + + <para> + + Scilab バージョン 5.3.0以降, + + Javasci v2と呼ばれる Javasciの新バージョンが導入されました. + + このバージョンは, + + <link linkend="javasci_v1_limitations">Javasci v1の制限</link>の多くを修正しています. + + </para> + + <para> + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link> を閲覧 + + (これによりWebブラウザがオープンします). + + </para> + + </refsection> + + <refsection> + + <title>Javasci v2の例</title> + + <programlisting role="java"><![CDATA[ +// javasci v2を使用する簡単なJavaの例 +// Filename: DisplayPI.java + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +class Example1 { + + public static void main(String[] args) { + + try { + Scilab sci = new Scilab(); + sci.open(); + sci.exec("disp(%pi);"); + + ScilabDouble a = new ScilabDouble(3.14); + sci.put("a",a); + sci.exec("b=sin(a);"); + ScilabType b = sci.get("b"); + System.out.println("b = " + b); + + sci.close(); + + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("An exception occurred: " + e.getLocalizedMessage()); + } + + } +} + +]]></programlisting> + + </refsection> + + <refsection role="see also"> + + <title>参照</title> + + <simplelist type="inline"> + + <member> + + <link type="remote" linkend="javasci/javadoc/index.html"> + + Javasci v2の文書 + </link> + を閲覧 (これによりWebブラウザがオープンします). + + </member> + + <member> + + <link linkend="compile_and_run_javasci_v2">Javasci v2でコンパイル/実行</link> + + </member> + + <member> + + <link linkend="javasci_faq_v2">Javasci v2 FAQ</link> + + </member> + + </simplelist> + + </refsection> + + <refsection> + + <title>履歴</title> + + <revhistory> + + <revision> + + <revnumber>5.4.0</revnumber> + + <revdescription> + + Javasci v1 が削除されました. + + </revdescription> + + </revision> + + <revision> + + <revnumber>5.4.0</revnumber> + + <revdescription>新規メソッド追加: + + <itemizedlist> + + <listitem>Scilab.execException(String) + + <para> + + Scilab.exec(String) と同じですが, Scilabエラーが + + 発生した際に例外を返します + + </para> + + </listitem> + + <listitem>Scilab.execException(String[]) + + <para> + + Scilab.exec(String[]) と同じですが, Scilabエラーが + + 発生した際に例外を返します + + </para> + + </listitem> + + <listitem>Scilab.execException(File) + + <para> + + Scilab.exec(File) と同じですが, Scilabエラーが + + 発生した際に例外を返します + + </para> + + </listitem> + + </itemizedlist> + + </revdescription> + + </revision> + + <revision> + + <revnumber>5.4.0</revnumber> + + <revdescription> + + <itemizedlist> + + <listitem>Javasci は疎行列と論理値疎行列データ型をサポートします.</listitem> + + <listitem>Javasci はtlists, mlists およびリストデータ型をサポートします.</listitem> + + <listitem>Javasci 多項式データ型をサポートします.</listitem> + + <listitem>mList形式のJavasciデータ型構造体をサポートします. + + </listitem> + + </itemizedlist> + + </revdescription> + + </revision> + + </revhistory> + + </refsection> + +</refentry> + diff --git a/modules/javasci/help/ja_JP/javasci_faq.xml b/modules/javasci/help/ja_JP/javasci_faq.xml new file mode 100755 index 000000000..253257cfd --- /dev/null +++ b/modules/javasci/help/ja_JP/javasci_faq.xml @@ -0,0 +1,403 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" scilab:needs-examples="no" xml:id="javasci_faq_v2" xml:lang="ja"> + + <refnamediv> + + <refname>javasci FAQ</refname> + + <refpurpose>Javasci v2に関するFAQ</refpurpose> + + </refnamediv> + + <refsection> + + <title>質問 / 回答</title> + + <qandaset> + + <qandaentry> + + <question> + + <para>javasciに基づくアプリケーションを実行した際,エラー + + <emphasis role="italic">Exception in thread "main" java.lang.NoClassDefFoundError: + + org/scilab/modules/javasci/Scilab + + </emphasis> + が発生しました. + + </para> + + </question> + + <answer> + + <para> + + おそらく, + + org.scilab.modules.javasci.jar が CLASSPATHで定義されていないと + + 思われます. + + <link linkend="compile_and_run_javasci_v2">javasciでコンパイル/実行</link> + + 参照ください. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Linux/Unix/MacOSXで,ネーティブライブラリjavasci2が存在しない + + または見つかりません. + + </para> + + </question> + + <answer> + + <para> + + おそらく the java.library.path の値が設定されていません. + + <link linkend="compile_and_run_javasci_v2">javasciでコンパイル/実行</link> + + 参照ください. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Windowsで, ネーティブライブラリ javasci.dll が存在しないまたは見つかりません. + + </para> + + </question> + + <answer> + + <para>環境変数 PATH が設定されていない可能性があります. + + <link linkend="compile_and_run_javasci_v2">javasciでコンパイル/実行</link> + + 参照ください. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Linux/Unix/MacOSXで, java.library.path を設定した + + 後でも,ネーティブライブラリjavasci2 が + + 存在しないまたは見つかりません. + + </para> + + </question> + + <answer> + + <para> + + 以下のようなエラーが発生した場合: <emphasis role="italic">java.lang.UnsatisfiedLinkError: /path/to/scilab/lib/scilab/libscilab.so.0.0.0: libsciparameters.so.5: cannot open shared object file: No such file or directory</emphasis>, + + LD_LIBRARY_PATHにScilabネーティブライブラリが存在するパスを設定して + + みてください. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Windowsで, PATHを設定した後でもネーティブライブラリ + + javasci.dll が存在しないまたは見つかりません. + + </para> + + </question> + + <answer> + + <para> + + 以下のようなエラーが発生した場合: <emphasis role="italic">java.lang.UnsatisfiedLinkError: C:\Program Files\scilab-XXXX\bin\javasci.dll: The specified procedure could not be found</emphasis>, + + 環境変数PATHにより,Scilabライブラリと使用するシステム上の他のライブラリが + + 衝突するようになった可能性があります. + + (PATH変数で)Scilabパスを他のパスの前に移動してみてください. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Javasciプログラムが以下のように起動に失敗します: + + <emphasis role="italic">An exception occurred: Auto detection of SCI failed. + + Could not retrieve the variable SCI + + </emphasis> + + </para> + + </question> + + <answer> + + <para> + + SCIを, GNU/Linuxでは + + <emphasis role="italic">scilab-X.Y.Z/share/scilab/</emphasis>, + + Mac OS Xでは + + <emphasis role="italic">scilab-X.Y.Z/Contents/MacOS/share/scilab/</emphasis>, + + Windowsでは + + <emphasis role="italic">scilab-X.Y.Z/</emphasis> + + に設定する必要があります. + + </para> + + </answer> + + </qandaentry> + + + + <qandaentry> + + <question> + + <para> + + グラフィックをプロットしようとしましたが, + + グラフィックが現れません. + + </para> + + </question> + + <answer> + + <para> + + 論理値 <emphasis role="italic">true</emphasis>を指定して + + コンストラクタ + + (<emphasis role="italic">Scilab sci = new Scilab(true);</emphasis>) + + をコールしたか確認してください. + + これにより, Scilab をアドバンスドモードで起動します. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Javasciから既存のSwingアプリケーションにアタッチしようと + + しています. + + どのようにすればよいのでしょう? + + </para> + + </question> + + <answer> + + <para> + + 現時点では, 簡単に行うことはできません. + + この機能は将来のバージョンのScilabで提供されます. + + いつもと同様, 貢献はウエルカムです! + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + javasciからScilabグラフィックウインドウを管理する現在の手法は + + 非常に大変とわかりました. + + どのようにすれば良いのでしょう? + + </para> + + </question> + + <answer> + + <para> + + 困りましたね. 我々は現在のソリューションは完全とはほど遠いと認識しています. + + この制限に将来のリリースで対応したいと考えています. + + </para> + + </answer> + + </qandaentry> + + <qandaentry> + + <question> + + <para> + + Scilabインスタンスが外部モジュールを有しますが, + + <literal>undefined symbol</literal>により起動に失敗しました: + + </para> + + </question> + + <answer> + + <para><literal> + + <emphasis role="italic">atomsLoad: An error occurred while loading 'module-0.0.2': link : Library could not be loaded: /path/2.0-1/sci_gateway/c/../../src/cpp/libmy.so: undefined symbol: scirun_</emphasis> + + </literal> + + これには,2種類の解決策が考えられます. + + 1番目は, + + シンボルを定義するライブラリを指定して構築することにより, + + モジュール自体を修正するものです. + + 2番目は,未定義の変数が宣言されたライブラリを + + <literal>LD_PRELOAD=/path/to/the/lib/providing/the/symbol/libmy.so</literal>で + + 定義することです. + + </para> + + </answer> + + </qandaentry> + + </qandaset> + + </refsection> + + <refsection role="see also"> + + <title>参照</title> + + <simplelist type="inline"> + + <member> + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link> を閲覧(これによりWebブラウザがオープンします). + + </member> + + <member> + + <link linkend="javasci">Javasci</link> + + </member> + + <member> + + <link linkend="compile_and_run_javasci_v2">javasciでコンパイル/実行</link> + + </member> + + </simplelist> + + </refsection> + +</refentry> + diff --git a/modules/javasci/help/ja_JP/javasci_limitations.xml b/modules/javasci/help/ja_JP/javasci_limitations.xml new file mode 100755 index 000000000..4e2283a35 --- /dev/null +++ b/modules/javasci/help/ja_JP/javasci_limitations.xml @@ -0,0 +1,156 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2008 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + --> + +<!-- This document was created with Syntext Serna Free. --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci_v1_limitations" scilab:needs-examples="no" xml:lang="ja"> + + <refnamediv> + + <refname>javasci v1 の制限</refname> + + <refpurpose>なぜjavasci v1は廃止されたのですか?</refpurpose> + + </refnamediv> + + <refsection> + + <title>説明</title> + + <para>javasciのバージョンV1には以下に示すいくつかの重要な制限がありました:</para> + + <itemizedlist> + + <listitem> + + Scilab言語か任意の変数を取得するためには, + + 事前に変数の型を知ることが必要でした. + + </listitem> + + <listitem> + + インターフェイスにより管理されるのは小数の型のみでした + + (論理値, double, 複素数および文字列). + + </listitem> + + <listitem> + + ScilabとJavaの間で整合性を欠いていました. + + 例えば, Scilab では,スカラー ([1,1]の行列)は行列です. + + Javaインターフェイスでは, 異なる2種類のデータ型 + + (例: SciDouble および SciDoubleArray)となります. + + </listitem> + + <listitem> + + 多くのデータ型ではシリアル化ができませんでした. + + </listitem> + + <listitem> + + Scilab関数のコールはExecメソッドでのみ可能で, + + 複数の出力引数を取得する場合に複雑になっていました. + + </listitem> + + <listitem> + + パッケージ名はScilabおよびScilab Java checkstyleの + + パッケージ名命名規則に従っていませんでした. + + </listitem> + + <listitem> + + グラフィックウインドウの管理が大変でした + + (この問題はJavasci v2でもまだ未解決です). + + </listitem> + + <listitem> + + イベントループとの連携がありません + + (この問題はJavasci v2でもまだ未解決です). + + </listitem> + + </itemizedlist> + + </refsection> + + <refsection role="see also"> + + <title>参照</title> + + <simplelist type="inline"> + + <member> + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link> を閲覧(これによりWebブラウザがオープンします). + + </member> + + <member> + + <link linkend="compile_and_run_javasci_v2">Javasciでコンパイル/実行</link> + + </member> + + <member> + + <link linkend="javasci_faq_v2">Javasci FAQ</link> + + </member> + + </simplelist> + + </refsection> + + <refsection> + + <title>履歴</title> + + <revhistory> + + <revision> + + <revnumber>5.4.0</revnumber> + + <revdescription> + + Javasci v1 が削除されました. + + </revdescription> + + </revision> + + </revhistory> + + </refsection> + +</refentry> + diff --git a/modules/javasci/help/ja_JP/javasci_step_by_step.xml b/modules/javasci/help/ja_JP/javasci_step_by_step.xml new file mode 100755 index 000000000..6b8eaeab8 --- /dev/null +++ b/modules/javasci/help/ja_JP/javasci_step_by_step.xml @@ -0,0 +1,279 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<!-- + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + --> + +<!-- This document was created with Syntext Serna Free. --> + +<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="javasci_step_by_step" scilab:needs-examples="no" xml:lang="ja"> + + <refnamediv> + + <refname>javasci - ステップバイステップ</refname> + + <refpurpose>javasci v2に基づくアプリケーションの書き方</refpurpose> + + </refnamediv> + + <refsection> + + <title>ステップ1 - コード本体</title> + + <para>Javasci v2 では Java APIからScilabエンジンをコールできます. + + </para> + + <para> + + いくつかのオブジェクトとメソッドがこのようなタスクを実行するために + + 提供されています. + + メインクラスは <emphasis role="italic">Scilab</emphasis>です. + + このオブジェクトにより, Scilabエンジンからのデータ送信/受信, + + エラー管理およびScilabスクリプト/コードの実行ができるようになります. + + </para> + + <para>クラスは以下の2つのパッケージに分割されています: </para> + + <itemizedlist> + + <listitem>org.scilab.modules.javasci.*; // 主要なScilabクラスを含む</listitem> + + <listitem>org.scilab.modules.types.*; // Scilab <=> Javaマッピングを含む</listitem> + + </itemizedlist> + + <para> + + <para>以下に古典的な使用例を示します:</para> + + </para> + + <programlisting role="java"><![CDATA[ +/* + * + * This file is released under the 3-clause BSD license. See COPYING-BSD. + * + */ + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +class Example1 { + + public static void main(String[] args) { + try { + Scilab sci = new Scilab(); + if (sci.open()) { + /* Send a Scilab instruction */ + sci.exec("foo = [ 2, 4, 6; 4, 0, 10; 6, 10, 12 ];"); + +/* Retrieve the variable foo */ + ScilabType foo = sci.get("foo"); + +/* Display the variable */ + System.out.println("Representation of : "+foo); + +/* Get the data and retrieve the 2,2 value */ + double[][] aReal = ((ScilabDouble)foo).getRealPart(); + System.out.println("foo[1,1] = " + aReal[1][1]); + +/* Change the value of 2,2 */ + aReal[1][1] = Math.PI; + +/* Create a new variable */ + ScilabDouble bar = new ScilabDouble(aReal); + +/* Send it to Scilab */ + sci.put("bar",bar); + +/* Display it through Scilab */ + sci.exec("disp(bar)"); + + sci.close(); + } else { + System.out.println("Could not start Scilab "); + } + + +/* Can be improved by other exceptions: AlreadyRunningException, + * InitializationException, UndefinedVariableException, + * UnknownTypeException, etc + */ + } catch (org.scilab.modules.javasci.JavasciException e) { + System.err.println("An exception occurred: " + e.getLocalizedMessage()); + } + } +} + + + ]]></programlisting> + + <para>ソースは SCI/modules/javasci/examples/v2/ で提供されています</para> + + <para>このプログラムの出力は以下のようになります:</para> + + <programlisting><![CDATA[Representation of : [2.0, 4.0, 6.0 ; 4.0, 0.0, 10.0 ; 6.0, 10.0, 12.0] +foo[1,1] = 0.0 + +2. 4. 6. +4. 3.1415927 10. +6. 10. 12. + ]]></programlisting> + + <para> + + オブジェクトおよびメソッドに関する詳細については, + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link> + + を閲覧してください (これによりWebブラウザがオープンします). + + </para> + + </refsection> + + <refsection> + + <title>ステップ 2 - 構築</title> + + <para> + + GNU/Linux および Mac OS Xでは + + Scilabデータへのパスも指定します + + (Microsoft Windowsでは,自動的に検出されます). + + </para> + + <programlisting><![CDATA[# Variable SCI +# GNU/LinuxのScilabバイナリのパス: +/path/to/scilab-xxx/share/scilab/ +# GNU/LinuxおよびMac OS Xのソースツリーでは, パスはソースツリーのトップです +/path/to/scilab/sources/ +# Mac OS X上の パス: +/Applications/scilab-xxx/Contents/MacOS/share/scilab/ +# Windows上のパス: +C:\Program Files\Scilab-5.3.0\ + ]]></programlisting> + + <para> + + Javasci v2によりコードを構築するには, + + CLASSPATHに2つのjarファイルがある必要があります. + + </para> + + <programlisting role="example"><![CDATA[# 例えば, 変数CLASSPATHを作成 +$(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar +$(SCI)/modules/types/jar/org.scilab.modules.types.jar +]]></programlisting> + + </refsection> + + <refsection> + + <title>ステップ3 - 実行</title> + + <para>構築ステップと同様, 2つのjarを指定します. </para> + + <para> + + JavaがScilabと通信するためにネーティブライブラリへのパスを設定する必要があります. + + </para> + + <para> + + Javasci v2は,2つのライブラリ + + libjavasci2.{so,dylib,dll} および libscilab.{so,dylib,dll}がロードされていることを + + 必要とします.他のライブラリは透過的にロードされます. + + </para> + + <programlisting role="example"><![CDATA[# 例えば, 変数CLASSPATHを作成 +# GNU/LinuxのScilabバイナリのパス: +/path/to/scilab-xxx/lib/scilab/ +# GNU/LinuxおよびMac OS Xのソースツリーのパス: +$(SCI)/modules/javasci/.libs/:$(SCI)/modules/.libs/ +# Mac OS X上の パス: +/Applications/scilab-xxx/Contents/MacOS/lib/scilab/ +# Windows上のパス: +set LIBPATH="C:\Program Files\Scilab-5.3.0\bin" + ]]></programlisting> + + <para>プログラムを起動するコマンドは以下のようになります:</para> + + <programlisting>java -cp $CLASSPATH:. -DSCI=$SCI -Djava.library.path=$LIBPATH Example1</programlisting> + + </refsection> + + <refsection> + + <title>Makefileの例</title> + + <para>シンプルなMakefileは以下のようになります:</para> + + <programlisting><![CDATA[SCI = /path/to/scilab/share/scilab/ +CLASSPATH = $(SCI)/modules/javasci/jar/org.scilab.modules.javasci.jar:$(SCI)/modules/types/jar/org.scilab.modules.types.jar +LIB_PATH = /path/to/scilab/lib/scilab +all: +javac -cp $(CLASSPATH) Example1.java +java -cp $(CLASSPATH):. -DSCI=$(SCI) -Djava.library.path=$(LIB_PATH) Example1 + ]]></programlisting> + + </refsection> + + <para>SCI/modules/javasci/examples/v2 ディレクトリにある + + Windows用build.batを参照ください. + </para> + + <refsection> + + <title>参照</title> + + <simplelist type="inline"> + + <member> + + <link type="remote" linkend="javasci/javadoc/index.html">Javasci v2の文書</link> を閲覧(これによりWebブラウザがオープンします). + + </member> + + <member> + + <link linkend="compile_and_run_javasci_v2">Javasci v2でコンパイル/実行</link> + + </member> + + <member> + + <link linkend="javasci_faq_v2">Javasci v2 FAQ</link> + + </member> + + </simplelist> + + </refsection> + +</refentry> + diff --git a/modules/javasci/help/pt_BR/addchapter.sce b/modules/javasci/help/pt_BR/addchapter.sce new file mode 100755 index 000000000..4f03d091d --- /dev/null +++ b/modules/javasci/help/pt_BR/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + +add_help_chapter("Interface Java",SCI+"/modules/javasci/help/pt_BR",%T); + diff --git a/modules/javasci/help/ru_RU/addchapter.sce b/modules/javasci/help/ru_RU/addchapter.sce new file mode 100755 index 000000000..5e3c28b2d --- /dev/null +++ b/modules/javasci/help/ru_RU/addchapter.sce @@ -0,0 +1,11 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2009 - DIGITEO +// +// 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.1-en.txt + +add_help_chapter("Java Interface",SCI+"/modules/javasci/help/ru_RU",%T); + diff --git a/modules/javasci/jar/org.scilab.modules.javasci.jar b/modules/javasci/jar/org.scilab.modules.javasci.jar Binary files differnew file mode 100755 index 000000000..dce4f57af --- /dev/null +++ b/modules/javasci/jar/org.scilab.modules.javasci.jar diff --git a/modules/javasci/javasci.iss b/modules/javasci/javasci.iss new file mode 100755 index 000000000..2df056e53 --- /dev/null +++ b/modules/javasci/javasci.iss @@ -0,0 +1,45 @@ +; +; Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +; Copyright (C) INRIA - Allan CORNET +; Copyright (C) DIGITEO - 2010-2012 - 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 +; http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt +; +;-------------------------------------------------------------------------------------------------------------- +; Inno Setup Script (5.3 and more) for Scilab (UNICODE version required) +; +;-------------------------------------------------------------------------------------------------------------- +; javasci module +;-------------------------------------------------------------------------------------------------------------- +; +#define JAVASCI "javasci" +; +Source: modules\{#JAVASCI}\license.txt; DestDir: {app}\modules\{#JAVASCI}; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: bin\{#JAVASCI}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +Source: modules\{#JAVASCI}\jar\org.scilab.modules.{#JAVASCI}.jar;DestDir: {app}\modules\{#JAVASCI}\jar; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: modules\{#JAVASCI}\etc\{#JAVASCI}.quit; DestDir: {app}\modules\{#JAVASCI}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +Source: modules\{#JAVASCI}\etc\{#JAVASCI}.start; DestDir: {app}\modules\{#JAVASCI}\etc; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: modules\{#JAVASCI}\macros\buildmacros.sce; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +Source: modules\{#JAVASCI}\macros\buildmacros.bat; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +Source: modules\{#JAVASCI}\macros\cleanmacros.bat; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +;Source: modules\{#JAVASCI}\macros\*.bin; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +;Source: modules\{#JAVASCI}\macros\*.sci; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +;Source: modules\{#JAVASCI}\macros\lib; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +;Source: modules\{#JAVASCI}\macros\names; DestDir: {app}\modules\{#JAVASCI}\macros; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +;Source: modules\{#JAVASCI}\includes\*.h; DestDir: {app}\modules\{#JAVASCI}\includes; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: modules\{#JAVASCI}\javadoc\*.*; DestDir: {app}\modules\{#JAVASCI}\javadoc; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: modules\{#JAVASCI}\examples\*.*; DestDir: {app}\modules\{#JAVASCI}\examples; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} +; +Source: modules\{#JAVASCI}\tests\*.*; DestDir: {app}\modules\{#JAVASCI}\tests; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE} and {#COMPN_TESTS} +; +;-------------------------------------------------------------------------------------------------------------- diff --git a/modules/javasci/javasci.rc b/modules/javasci/javasci.rc new file mode 100755 index 000000000..66c8cdee4 --- /dev/null +++ b/modules/javasci/javasci.rc @@ -0,0 +1,96 @@ +// Microsoft Visual C++ generated resource script. +// + + +#define APSTUDIO_READONLY_SYMBOLS +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 2 resource. +// +//#include "afxres.h" +#define APSTUDIO_HIDDEN_SYMBOLS +#include "windows.h" +///////////////////////////////////////////////////////////////////////////// +#undef APSTUDIO_READONLY_SYMBOLS + +///////////////////////////////////////////////////////////////////////////// +// French (France) resources + +#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA) +#ifdef _WIN32 +LANGUAGE LANG_FRENCH, SUBLANG_FRENCH +#pragma code_page(1252) +#endif //_WIN32 + +#ifdef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// TEXTINCLUDE +// + +1 TEXTINCLUDE +BEGIN + "resource.h\0" +END + +3 TEXTINCLUDE +BEGIN + "\r\n" + "\0" +END + +#endif // APSTUDIO_INVOKED + + +///////////////////////////////////////////////////////////////////////////// +// +// Version +// + +VS_VERSION_INFO VERSIONINFO + FILEVERSION 5,5,2,0 + PRODUCTVERSION 5,5,2,0 + FILEFLAGSMASK 0x17L +#ifdef _DEBUG + FILEFLAGS 0x1L +#else + FILEFLAGS 0x0L +#endif + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L +BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "040c04b0" + BEGIN + VALUE "FileDescription", "javasci module" + VALUE "FileVersion", "5, 5, 2, 0" + VALUE "InternalName", "javasci module" + VALUE "LegalCopyright", "Copyright (C) 2017" + VALUE "OriginalFilename", "javasci.dll" + VALUE "ProductName", "javasci module" + VALUE "ProductVersion", "5, 5, 2, 0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0x40c, 1200 + END +END + +#endif // French (France) resources +///////////////////////////////////////////////////////////////////////////// + + + +#ifndef APSTUDIO_INVOKED +///////////////////////////////////////////////////////////////////////////// +// +// Generated from the TEXTINCLUDE 3 resource. +// + + +///////////////////////////////////////////////////////////////////////////// +#endif // not APSTUDIO_INVOKED + diff --git a/modules/javasci/libjavasci2.la b/modules/javasci/libjavasci2.la new file mode 100755 index 000000000..2348b8439 --- /dev/null +++ b/modules/javasci/libjavasci2.la @@ -0,0 +1,42 @@ +# libjavasci2.la - a libtool library file +# Generated by libtool (GNU libtool) 2.4.2 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='libjavasci2.so.5' + +# Names of this library. +library_names='libjavasci2.so.5.5.2 libjavasci2.so.5 libjavasci2.so' + +# The name of the static archive. +old_library='' + +# Linker flags that can not go in dependency_libs. +inherited_linker_flags=' -pthread' + +# Libraries that this one depends upon. +dependency_libs=' /home/shashank/scilab-master_5.5.2/modules/libscilab.la -L/home/shashank/scilab-master_5.5.2/usr/lib -L/home/scilab/work/linux-prerequisites-sources/trunk/Dev-Tools/SE/Prerequirements/linux_x64/usr/lib -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64 -L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server /home/shashank/scilab-master_5.5.2/modules/gui/libscigui.la /home/shashank/scilab-master_5.5.2/modules/renderer/libscirenderer.la /home/shashank/scilab-master_5.5.2/modules/graphics/libscigraphics.la /home/shashank/scilab-master_5.5.2/modules/graphic_export/libscigraphic_export.la /home/shashank/scilab-master_5.5.2/modules/console/libsciconsole.la /home/shashank/scilab-master_5.5.2/modules/action_binding/libsciaction_binding.la /home/shashank/scilab-master_5.5.2/modules/graphic_objects/libscigraphic_objects.la /home/shashank/scilab-master_5.5.2/modules/scinotes/libsciscinotes.la /home/shashank/scilab-master_5.5.2/modules/ui_data/libsciui_data.la /home/shashank/scilab-master_5.5.2/modules/history_browser/libscihistory_browser.la /home/shashank/scilab-master_5.5.2/modules/tclsci/libscitclsci.la -ltk8.5 -ltcl8.5 /home/shashank/scilab-master_5.5.2/modules/preferences/libscipreferences.la /home/shashank/scilab-master_5.5.2/modules/external_objects_java/libsciexternal_objects_java.la /home/shashank/scilab-master_5.5.2/modules/helptools/libscihelptools.la /home/shashank/scilab-master_5.5.2/modules/types/libscitypes.la /home/shashank/scilab-master_5.5.2/modules/commons/libscicommons.la /home/shashank/scilab-master_5.5.2/modules/jvm/libscijvm.la -ljava -lverify -ljvm /home/shashank/scilab-master_5.5.2/modules/libscilab-cli.la -lcurl -lssl -lcrypto -lrt /home/shashank/scilab-master_5.5.2/modules/functions/libscifunctions.la /home/shashank/scilab-master_5.5.2/modules/call_scilab/libscicall_scilab.la /home/shashank/scilab-master_5.5.2/modules/localization/libscilocalization.la /home/shashank/scilab-master_5.5.2/modules/special_functions/libscispecial_functions.la /home/shashank/scilab-master_5.5.2/modules/completion/libscicompletion.la /home/shashank/scilab-master_5.5.2/modules/history_manager/libscihistory_manager.la -lpcreposix -lpcre /home/shashank/scilab-master_5.5.2/modules/hdf5/libscihdf5.la -lhdf5 -lhdf5_hl -lfftw3 /home/shashank/scilab-master_5.5.2/modules/statistics/libscistatistics.la /home/shashank/scilab-master_5.5.2/modules/xml/libscixml.la -lxml2 -lz /home/shashank/scilab-master_5.5.2/modules/external_objects/libsciexternal_objects.la /home/shashank/scilab-master_5.5.2/modules/preferences/libscipreferences-cli.la /home/shashank/scilab-master_5.5.2/modules/gui/libscigui-disable.la /home/shashank/scilab-master_5.5.2/modules/graphics/libscigraphics-disable.la /home/shashank/scilab-master_5.5.2/modules/graphic_export/libscigraphic_export-disable.la /home/shashank/scilab-master_5.5.2/modules/console/libsciconsole-minimal.la /home/shashank/scilab-master_5.5.2/modules/action_binding/libsciaction_binding-disable.la /home/shashank/scilab-master_5.5.2/modules/jvm/libscijvm-disable.la /home/shashank/scilab-master_5.5.2/modules/xcos/libscixcos-disable.la /home/shashank/scilab-master_5.5.2/modules/graphic_objects/libscigraphic_objects-disable.la /home/shashank/scilab-master_5.5.2/modules/scinotes/libsciscinotes-disable.la /home/shashank/scilab-master_5.5.2/modules/ui_data/libsciui_data-disable.la /home/shashank/scilab-master_5.5.2/modules/history_browser/libscihistory_browser-disable.la /home/shashank/scilab-master_5.5.2/modules/commons/libscicommons-disable.la -llapack -lblas -lpthread -ldl -lcurses -lm' + +# Names of additional weak libraries provided by this library +weak_library_names='' + +# Version information for libjavasci2. +current=10 +age=5 +revision=2 + +# Is this an already installed library? +installed=no + +# Should we warn about portability when linking against -modules? +shouldnotlink=no + +# Files to dlopen/dlpreopen +dlopen='' +dlpreopen='' + +# Directory that this library needs to be installed in: +libdir='/usr/local/lib/scilab' +relink_command="(cd /home/shashank/scilab-master_5.5.2/modules/javasci; /bin/bash /home/shashank/scilab-master_5.5.2/libtool --tag CC --mode=relink gcc -D_LARGEFILE64_SOURCE -DNDEBUG -m64 -fno-stack-protector -g -O2 -version-number 5:5:2 -Wl,--no-as-needed -o libjavasci2.la -rpath /usr/local/lib/scilab src/jni/libjavasci2_la-call_scilab_wrap.lo src/jni/libjavasci2_la-putLists.lo src/c/libjavasci2_la-javasci2_helper.lo ../../modules/api_scilab/libsciapi_scilab.la ../../modules/libscilab.la -lpthread -ldl -lcurses -lm @inst_prefix_dir@)" diff --git a/modules/javasci/license.txt b/modules/javasci/license.txt new file mode 100755 index 000000000..44b27c0b5 --- /dev/null +++ b/modules/javasci/license.txt @@ -0,0 +1,23 @@ +Copyright: +Copyright (c) 2008 - DIGITEO +Copyright (c) 1989-2008 - INRIA + +License: +This module must be used under the terms of the CeCILL. +This module 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.1-en.txt + +Examples: +========= + +Files: examples/ + +Copyright: +Copyright (c) 2008-2009 - DIGITEO +Copyright (c) 1989-2008 - INRIA +Copyright (c) 1989-2007 - ENPC + +Licenses: +Public domain diff --git a/modules/javasci/macros/buildmacros.bat b/modules/javasci/macros/buildmacros.bat new file mode 100755 index 000000000..2cdd2abe6 --- /dev/null +++ b/modules/javasci/macros/buildmacros.bat @@ -0,0 +1,11 @@ +rem Scilab ( http://mwww.scilab.org/ ) - This file is part of Scilab +rem Copyright (C) 2006 - INRIA +rem +rem This file must be used under the terms of the CeCILL. +rem This source file is licensed as described in the file COPYING, which +rem you should have received as part of this distribution. The terms +rem are also available at +rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + + +@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit;
\ No newline at end of file diff --git a/modules/javasci/macros/buildmacros.sce b/modules/javasci/macros/buildmacros.sce new file mode 100755 index 000000000..f501db8db --- /dev/null +++ b/modules/javasci/macros/buildmacros.sce @@ -0,0 +1,15 @@ +// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab +// Copyright (C) 2005 - 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 +// http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + +if (isdef("genlib") == %f) then + exec(SCI+"/modules/functions/scripts/buildmacros/loadgenlib.sce"); +end +//------------------------------------ +//genlib('javascilib','SCI/modules/Javasci/macros',%f,%t); +//------------------------------------ diff --git a/modules/javasci/macros/cleanmacros.bat b/modules/javasci/macros/cleanmacros.bat new file mode 100755 index 000000000..9cf5e61e0 --- /dev/null +++ b/modules/javasci/macros/cleanmacros.bat @@ -0,0 +1,13 @@ +rem Scilab ( http://mwww.scilab.org/ ) - This file is part of Scilab +rem Copyright (C) 2006 - INRIA +rem +rem This file must be used under the terms of the CeCILL. +rem This source file is licensed as described in the file COPYING, which +rem you should have received as part of this distribution. The terms +rem are also available at +rem http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + + +@del *.bin 2>NUL +@del lib 2>NUL +@del names 2>NUL
\ No newline at end of file diff --git a/modules/javasci/src/c/.deps/.dirstamp b/modules/javasci/src/c/.deps/.dirstamp new file mode 100755 index 000000000..e69de29bb --- /dev/null +++ b/modules/javasci/src/c/.deps/.dirstamp diff --git a/modules/javasci/src/c/.deps/libjavasci2_la-javasci2_helper.Plo b/modules/javasci/src/c/.deps/libjavasci2_la-javasci2_helper.Plo new file mode 100755 index 000000000..f972c4ab4 --- /dev/null +++ b/modules/javasci/src/c/.deps/libjavasci2_la-javasci2_helper.Plo @@ -0,0 +1,271 @@ +src/c/libjavasci2_la-javasci2_helper.lo: src/c/javasci2_helper.c \ + /usr/include/stdc-predef.h /usr/include/stdlib.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/select2.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ + /usr/include/x86_64-linux-gnu/bits/string2.h \ + /usr/include/x86_64-linux-gnu/bits/string3.h src/c/javasci2_helper.h \ + ../../modules/core/includes/BOOL.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/api_scilab/includes/api_scilab.h \ + ../../modules/core/includes/stack-c.h \ + ../../modules/core/includes/core_math.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ + /usr/include/x86_64-linux-gnu/bits/mathinline.h \ + ../../modules/core/includes/stack-def.h \ + ../../modules/core/includes/machine.h \ + ../../modules/core/includes/stackTypeVariable.h \ + ../../modules/core/includes/BOOL.h \ + ../../modules/core/includes/doublecomplex.h \ + ../../modules/core/includes/stack1.h \ + ../../modules/core/includes/scisparse.h \ + ../../modules/core/includes/stack2.h \ + ../../modules/core/includes/stack3.h \ + ../../modules/core/includes/stack-optional.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/api_scilab/includes/api_common.h \ + ../../modules/api_scilab/includes/api_scilab.h \ + ../../modules/api_scilab/includes/api_double.h \ + ../../modules/core/includes/doublecomplex.h \ + ../../modules/api_scilab/includes/api_string.h /usr/include/wchar.h \ + /usr/include/stdio.h /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/wchar2.h \ + ../../modules/api_scilab/includes/api_int.h \ + ../../modules/api_scilab/includes/api_poly.h \ + ../../modules/api_scilab/includes/api_sparse.h \ + ../../modules/api_scilab/includes/api_boolean.h \ + ../../modules/api_scilab/includes/api_boolean_sparse.h \ + ../../modules/api_scilab/includes/api_pointer.h \ + ../../modules/api_scilab/includes/api_list.h \ + ../../modules/api_scilab/includes/api_error.h \ + ../../modules/api_scilab/includes/api_handle.h \ + ../../modules/api_scilab/includes/api_optional.h \ + ../../modules/core/includes/stack-optional.h \ + ../../modules/api_scilab/includes/api_hypermat.h \ + ../../modules/core/includes/core_math.h \ + ../../modules/output_stream/includes/lasterror.h \ + ../../modules/output_stream/includes/dynlib_output_stream.h + +/usr/include/stdc-predef.h: + +/usr/include/stdlib.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap-16.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/select2.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-float.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/bits/string.h: + +/usr/include/x86_64-linux-gnu/bits/string2.h: + +/usr/include/x86_64-linux-gnu/bits/string3.h: + +src/c/javasci2_helper.h: + +../../modules/core/includes/BOOL.h: + +../../modules/core/includes/sci_types.h: + +../../modules/api_scilab/includes/api_scilab.h: + +../../modules/core/includes/stack-c.h: + +../../modules/core/includes/core_math.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/math-vector.h: + +/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/x86_64-linux-gnu/bits/mathinline.h: + +../../modules/core/includes/stack-def.h: + +../../modules/core/includes/machine.h: + +../../modules/core/includes/stackTypeVariable.h: + +../../modules/core/includes/BOOL.h: + +../../modules/core/includes/doublecomplex.h: + +../../modules/core/includes/stack1.h: + +../../modules/core/includes/scisparse.h: + +../../modules/core/includes/stack2.h: + +../../modules/core/includes/stack3.h: + +../../modules/core/includes/stack-optional.h: + +../../modules/core/includes/sci_types.h: + +../../modules/api_scilab/includes/api_common.h: + +../../modules/api_scilab/includes/api_scilab.h: + +../../modules/api_scilab/includes/api_double.h: + +../../modules/core/includes/doublecomplex.h: + +../../modules/api_scilab/includes/api_string.h: + +/usr/include/wchar.h: + +/usr/include/stdio.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/x86_64-linux-gnu/bits/wchar2.h: + +../../modules/api_scilab/includes/api_int.h: + +../../modules/api_scilab/includes/api_poly.h: + +../../modules/api_scilab/includes/api_sparse.h: + +../../modules/api_scilab/includes/api_boolean.h: + +../../modules/api_scilab/includes/api_boolean_sparse.h: + +../../modules/api_scilab/includes/api_pointer.h: + +../../modules/api_scilab/includes/api_list.h: + +../../modules/api_scilab/includes/api_error.h: + +../../modules/api_scilab/includes/api_handle.h: + +../../modules/api_scilab/includes/api_optional.h: + +../../modules/core/includes/stack-optional.h: + +../../modules/api_scilab/includes/api_hypermat.h: + +../../modules/core/includes/core_math.h: + +../../modules/output_stream/includes/lasterror.h: + +../../modules/output_stream/includes/dynlib_output_stream.h: diff --git a/modules/javasci/src/c/.dirstamp b/modules/javasci/src/c/.dirstamp new file mode 100755 index 000000000..e69de29bb --- /dev/null +++ b/modules/javasci/src/c/.dirstamp diff --git a/modules/javasci/src/c/.libs/libjavasci2_la-javasci2_helper.o b/modules/javasci/src/c/.libs/libjavasci2_la-javasci2_helper.o Binary files differnew file mode 100755 index 000000000..fe70acf09 --- /dev/null +++ b/modules/javasci/src/c/.libs/libjavasci2_la-javasci2_helper.o diff --git a/modules/javasci/src/c/DllmainJavasci.c b/modules/javasci/src/c/DllmainJavasci.c new file mode 100755 index 000000000..4b23d9192 --- /dev/null +++ b/modules/javasci/src/c/DllmainJavasci.c @@ -0,0 +1,33 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2005 - 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 + * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt + * + */ + +#include <windows.h> +/*--------------------------------------------------------------------------*/ +#pragma comment(lib,"../../bin/libintl.lib") +/*--------------------------------------------------------------------------*/ +int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved) +{ + switch (reason) + { + case DLL_PROCESS_ATTACH: + break; + case DLL_PROCESS_DETACH: + break; + case DLL_THREAD_ATTACH: + break; + case DLL_THREAD_DETACH: + break; + } + return 1; +} +/*--------------------------------------------------------------------------*/ + diff --git a/modules/javasci/src/c/javasci2_helper.c b/modules/javasci/src/c/javasci2_helper.c new file mode 100755 index 000000000..1420dcc2a --- /dev/null +++ b/modules/javasci/src/c/javasci2_helper.c @@ -0,0 +1,623 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +#include <stdlib.h> +#include <string.h> + +#define ENABLE_HELPERS +#include "javasci2_helper.h" +#include "api_scilab.h" +#include "lasterror.h" + +BOOL isComplexVar(char *variableName) +{ + /* 0 = not complex */ + return isNamedVarComplex(pvApiCtx, variableName) != 0; +} + +sci_int_types getIntegerPrecision(char *variableName) +{ + SciErr sciErr; + int iPrec; + + sciErr = getNamedMatrixOfIntegerPrecision(pvApiCtx, variableName, &iPrec); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return sciErr.iErr; + } + return iPrec; +} + +double *getDouble(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + double *matrixOfDouble = NULL; + + sciErr = readNamedMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfDouble = (double *)malloc(((*nbRow) * (*nbCol)) * sizeof(double)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, matrixOfDouble); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfDouble; + +} + +int putDouble(char *variableName, double *variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +double *getDoubleComplexReal(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + double *matrixOfDoubleComplexReal = NULL; + double *matrixOfDoubleComplexImg = NULL; + + sciErr = readNamedComplexMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, NULL, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfDoubleComplexReal = (double *)malloc(((*nbRow) * (*nbCol)) * sizeof(double)); + matrixOfDoubleComplexImg = (double *)malloc(((*nbRow) * (*nbCol)) * sizeof(double)); + + /* Load the matrix */ + sciErr = readNamedComplexMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, matrixOfDoubleComplexReal, matrixOfDoubleComplexImg); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfDoubleComplexReal; +} + +double *getDoubleComplexImg(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + double *matrixOfDoubleComplexReal = NULL; + double *matrixOfDoubleComplexImg = NULL; + + sciErr = readNamedComplexMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, NULL, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfDoubleComplexReal = (double *)malloc(((*nbRow) * (*nbCol)) * sizeof(double)); + matrixOfDoubleComplexImg = (double *)malloc(((*nbRow) * (*nbCol)) * sizeof(double)); + + /* Load the matrix */ + sciErr = readNamedComplexMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, matrixOfDoubleComplexReal, matrixOfDoubleComplexImg); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfDoubleComplexImg; + +} + +int putDoubleComplex(char* variableName, double *variable, int nbRow, int nbCol, double * imag, int nbRowI, int nbColI) +{ + SciErr sciErr; + + sciErr = createNamedComplexMatrixOfDouble(pvApiCtx, variableName, nbRow, nbCol, variable, imag); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +BOOL *getBoolean(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + BOOL *matrixOfBoolean = NULL; + + sciErr = readNamedMatrixOfBoolean(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfBoolean = (BOOL *) malloc(((*nbRow) * (*nbCol)) * sizeof(BOOL)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfBoolean(pvApiCtx, variableName, nbRow, nbCol, matrixOfBoolean); + + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfBoolean; + +} + +int putBoolean(char *variableName, BOOL * variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfBoolean(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; + +} + +///////////////////// byte / int8 +byte *getByte(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + byte *matrixOfByte = NULL; + + sciErr = readNamedMatrixOfInteger8(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfByte = (byte *) malloc(((*nbRow) * (*nbCol)) * sizeof(byte)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfInteger8(pvApiCtx, variableName, nbRow, nbCol, (char *)matrixOfByte); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfByte; + +} + +int putByte(char *variableName, byte * variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfInteger8(pvApiCtx, variableName, nbRow, nbCol, (const char *)variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +byte *getUnsignedByte(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + byte *matrixOfByte = NULL; + + sciErr = readNamedMatrixOfUnsignedInteger8(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfByte = (byte *) malloc(((*nbRow) * (*nbCol)) * sizeof(byte)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfUnsignedInteger8(pvApiCtx, variableName, nbRow, nbCol, matrixOfByte); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfByte; + +} + +int putUnsignedByte(char *variableName, byte * variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfUnsignedInteger8(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +//////////////////////////// short / int16 + +short *getShort(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + short *matrixOfShort = NULL; + + sciErr = readNamedMatrixOfInteger16(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfShort = (short *)malloc(((*nbRow) * (*nbCol)) * sizeof(short)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfInteger16(pvApiCtx, variableName, nbRow, nbCol, matrixOfShort); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfShort; + +} + +int putShort(char *variableName, short *variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfInteger16(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +unsigned short *getUnsignedShort(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + unsigned short *matrixOfShort = NULL; + + sciErr = readNamedMatrixOfUnsignedInteger16(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfShort = (unsigned short *)malloc(((*nbRow) * (*nbCol)) * sizeof(unsigned short)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfUnsignedInteger16(pvApiCtx, variableName, nbRow, nbCol, matrixOfShort); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfShort; + +} + +int putUnsignedShort(char *variableName, unsigned short *variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfUnsignedInteger16(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +////////////////////// int / int32 + +int *getInt(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + int *matrixOfInt = NULL; + + sciErr = readNamedMatrixOfInteger32(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfInt = (int *)malloc(((*nbRow) * (*nbCol)) * sizeof(int)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfInteger32(pvApiCtx, variableName, nbRow, nbCol, matrixOfInt); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfInt; + +} + +int putInt(char *variableName, int *variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfInteger32(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +unsigned int *getUnsignedInt(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + int *matrixOfInt = NULL; + + sciErr = readNamedMatrixOfUnsignedInteger32(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfInt = (int *)malloc(((*nbRow) * (*nbCol)) * sizeof(int)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfUnsignedInteger32(pvApiCtx, variableName, nbRow, nbCol, (unsigned int *)matrixOfInt); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return (unsigned int *)matrixOfInt; + +} + +int putUnsignedInt(char *variableName, unsigned int *variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfUnsignedInteger32(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +////////////////////// long / int64 +#ifdef __SCILAB_INT64__ + +long *getLong(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + long *matrixOfLong = NULL; + + sciErr = readNamedMatrixOfInteger64(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfLong = (long *)malloc(((*nbRow) * (*nbCol)) * sizeof(long)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfInteger64(pvApiCtx, variableName, nbRow, nbCol, matrixOfLong); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfLong; + +} + +int putLong(char *variableName, long *variable, int *nbRow, int *nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfInteger64(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +unsigned long *getUnsignedLong(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + long *matrixOfLong = NULL; + + sciErr = readNamedMatrixOfUnsignedInteger64(pvApiCtx, variableName, nbRow, nbCol, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + /* Alloc the memory */ + matrixOfLong = (long *)malloc(((*nbRow) * (*nbCol)) * sizeof(long)); + + /* Load the matrix */ + sciErr = readNamedMatrixOfUnsignedInteger64(pvApiCtx, variableName, nbRow, nbCol, matrixOfLong); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return matrixOfLong; + +} + +int putUnsignedLong(char *variableName, unsigned long *variable, int *nbRow, int *nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfUnsignedInteger64(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +#endif + +char **getString(char *variableName, int *nbRow, int *nbCol) +{ + SciErr sciErr; + int i = 0; + + int *piLen = NULL; + char **pstData = NULL; + + //first call to retrieve dimensions + sciErr = readNamedMatrixOfString(pvApiCtx, variableName, nbRow, nbCol, NULL, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + piLen = (int *)malloc(sizeof(int) * (*nbRow) * (*nbCol)); + + //second call to retrieve length of each string + sciErr = readNamedMatrixOfString(pvApiCtx, variableName, nbRow, nbCol, piLen, NULL); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + pstData = (char **)malloc(sizeof(char *) * (*nbRow) * (*nbCol)); + + for (i = 0; i < (*nbRow) * (*nbCol); i++) + { + pstData[i] = (char *)malloc(sizeof(char) * (piLen[i] + 1)); //+ 1 for null termination + } + //third call to retrieve data + sciErr = readNamedMatrixOfString(pvApiCtx, variableName, nbRow, nbCol, piLen, pstData); + if (sciErr.iErr) + { + printError(&sciErr, 0); + } + + return pstData; + +} + +int putString(char *variableName, char **variable, int nbRow, int nbCol) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfString(pvApiCtx, variableName, nbRow, nbCol, variable); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +int putSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL) +{ + SciErr sciErr; + + sciErr = createNamedSparseMatrix(pvApiCtx, variableName, nbRow, nbCol, colPosL, nbRowItem, colPos, data); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +int putComplexSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL, double * imag, int imagL) +{ + SciErr sciErr; + + sciErr = createNamedComplexSparseMatrix(pvApiCtx, variableName, nbRow, nbCol, colPosL, nbRowItem, colPos, data, imag); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +int putBooleanSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL) +{ + SciErr sciErr; + + sciErr = createNamedBooleanSparseMatrix(pvApiCtx, variableName, nbRow, nbCol, colPosL, nbRowItem, colPos); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +int putPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef) +{ + SciErr sciErr; + + sciErr = createNamedMatrixOfPoly(pvApiCtx, variableName, polyVarName, nbRow, nbCol, nbCoef, data); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + +int putComplexPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef, double ** imag, int nbRowI, int nbColI, int * nbCoefI) +{ + SciErr sciErr; + + sciErr = createNamedComplexMatrixOfPoly(pvApiCtx, variableName, polyVarName, nbRow, nbCol, nbCoef, data, imag); + if (sciErr.iErr) + { + printError(&sciErr, 0); + return -1; + } + return 0; +} + + +BOOL isExistingVariable(char *variableName) +{ + int iExisting = isNamedVarExist(pvApiCtx, variableName); + + return iExisting != 0; /* 0 = not existing variable */ +} diff --git a/modules/javasci/src/c/javasci2_helper.h b/modules/javasci/src/c/javasci2_helper.h new file mode 100755 index 000000000..5b14a8c2e --- /dev/null +++ b/modules/javasci/src/c/javasci2_helper.h @@ -0,0 +1,403 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + +#ifndef __JAVASCI2_HELPER_H__ +#define __JAVASCI2_HELPER_H__ + +/** + * This header describes a serie of helper functions. + * This function should be only used when writing a wrapper of Scilab into an + * other language (Java). + * All these functions are based on api_scilab. They provide a simple profile + * to be easily integrate into a SWIG wrapper. + */ + +#ifndef ENABLE_HELPERS +#error "This file cannot be used directly" +#endif +#include "BOOL.h" +#include "sci_types.h" + +typedef unsigned char byte; + +/** + * If the variable is complex or not + * + * @param variableName The name of the variable + * @return TRUE is complex, FALSE otherwise + */ +BOOL isComplex(char *variableName); + +/** + * Return the precision of an integer + * + * @param variableName The name of tbe variable + * @return the type of the integer (see sci_int_types) + */ +sci_int_types getIntegerPrecision(char* variableName); + + +/** + * Return a matrix of double (the default type in Scilab) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of double (column sorted) + */ +double * getDouble(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of double (the default type in Scilab) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putDouble(char* variableName, double *variable, int nbRow, int nbCol); + +/** + * Return the real part of a matrix of complex double + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The real part of a matrix of complex double (column sorted) + */ +double * getDoubleComplexReal(char* variableName, int *nbRow, int *nbCol); + +/** + * Return the imaginary part of a matrix of complex double + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The imaginary part of a matrix of complex double (column sorted) + */ +double * getDoubleComplexImg(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of complex double + * + * @param variableName The name of the variable + * @param variable The complex values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putDoubleComplex(char* variableName, double *variable, int nbRow, int nbCol, double * imag, int nbRowI, int nbColI); + +/** + * Return a matrix of boolean + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of boolean (column sorted) + */ +BOOL * getBoolean(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of boolean + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putBoolean(char* variableName, BOOL *variable, int nbRow, int nbCol); + +/** + * Return a matrix of byte (int8) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of byte (column sorted) + */ +byte * getByte(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of byte (int8) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putByte(char* variableName, byte *variable, int nbRow, int nbCol); + +/** + * Return a matrix of unsigned byte (uint8) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of unsigned byte (column sorted) + */ +byte * getUnsignedByte(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of unsigned byte (uint8) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putUnsignedByte(char* variableName, byte *variable, int nbRow, int nbCol); + +/** + * Return a matrix of short (int16) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of short (column sorted) + */ +short * getShort(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of short (int16) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putShort(char* variableName, short *variable, int nbRow, int nbCol); + +/** + * Return a matrix of unsigned short (uint16) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of unsigned short (column sorted) + */ +unsigned short * getUnsignedShort(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of unsigned short (uint16) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putUnsignedShort(char* variableName, unsigned short *variable, int nbRow, int nbCol); + +/** + * Return a matrix of integer (int32) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of integer (column sorted) + */ +int * getInt(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of integer (int32) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putInt(char* variableName, int *variable, int nbRow, int nbCol); + +/** + * Return a matrix of unsigned integer (uint32) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of unsigned integer (column sorted) + */ +unsigned int * getUnsignedInt(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of unsigned integer (uint32) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putUnsignedInt(char* variableName, unsigned int *variable, int nbRow, int nbCol); + +/** + * Return a matrix of long (int64) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of long (column sorted) + */ +long * getLong(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of long (int64) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putLong(char* variableName, long *variable, int nbRow, int nbCol); + +/** + * Return a matrix of unsigned long (uint64) + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of unsigned long (column sorted) + */ +unsigned long * getUnsignedLong(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of unsigned long (int64) + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putUnsignedLong(char* variableName, unsigned long *variable, int nbRow, int nbCol); + +/** + * Return a matrix of string + * + * @param variableName The name of the variable + * @param[out] nbRow Number of rows + * @param[out] nbCol Number of cols + * @return The matrix of string (column sorted) + */ +char ** getString(char* variableName, int *nbRow, int *nbCol); + +/** + * Set a matrix of string + * + * @param variableName The name of the variable + * @param variable The values + * @param nbRow Number of rows + * @param nbCol Number of cols + * @return 0 if successfull, != 0 otherwise + */ +int putString(char* variableName, char **variable, int nbRow, int nbCol); + +/** + * Set a sparse matrix + * + * @param variableName The name of the variable + * @param nbRow Number of rows + * @param nbCol Number of cols + * @param nbRowItem the number of non null items by row + * @param nbRowItemL the length of the previous array + * @param colPos the column position of each non null item + * @param colPosL the length of the previous array + * @param data the double data + * @param dataL the length of the previous array + * @return 0 if successfull, != 0 otherwise + */ +int putSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL); + +/** + * Set a complex sparse matrix + * + * @param variableName The name of the variable + * @param nbRow Number of rows + * @param nbCol Number of cols + * @param nbRowItem the number of non null items by row + * @param nbRowItemL the length of the previous array + * @param colPos the column position of each non null item + * @param colPosL the length of the previous array + * @param data the double data + * @param dataL the length of the previous array + * @param imag the double data + * @param imagL the length of the previous array + * @return 0 if successfull, != 0 otherwise + */ +int putComplexSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL, double * imag, int imagL); + +/** + * Set a boolean sparse matrix + * + * @param variableName The name of the variable + * @param nbRow Number of rows + * @param nbCol Number of cols + * @param nbRowItem the number of non null items by row + * @param nbRowItemL the length of the previous array + * @param colPos the column position of each non null item + * @param colPosL the length of the previous array + * @return 0 if successfull, != 0 otherwise + */ +int putBooleanSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL); + +/** + * Set a polynomial matrix + * + * @param variableName The name of the variable + * @param polyVarName The name of the polynomial variable + * @param data the double data + * @param nbRow Number of rows + * @param nbCol Number of cols + * @param nbCoef the number of coef of each polynomial + * @return 0 if successfull, != 0 otherwise + */ +int putPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef); + +/** + * Set a complex polynomial matrix + * + * @param variableName The name of the variable + * @param polyVarName The name of the polynomial variable + * @param data the double data + * @param nbRow Number of rows + * @param nbCol Number of cols + * @param imag the double data + * @param nbRowI Number of rows + * @param nbColI Number of cols + * @param nbCoef the number of coef of each polynomial + * @return 0 if successfull, != 0 otherwise + */ +int putComplexPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef, double ** imag, int nbRowI, int nbColI, int * nbCoefI); + +/** + * Check if a variable exists in Context + * + * @param variableName The name of the variable + * @return TRUE if the given variable exists, FALSE otherwise + */ +BOOL isExistingVariable(char* variableName); + +/** + * Check if a variable is complex. + * + * @param variableName The name of the variable + * @return TRUE if the given variable is complex, FALSE otherwise + */ +BOOL isComplexVar(char *variableName); +#endif /* __JAVASCI2_HELPER_H__ */ diff --git a/modules/javasci/src/c/libjavasci2_la-javasci2_helper.lo b/modules/javasci/src/c/libjavasci2_la-javasci2_helper.lo new file mode 100755 index 000000000..c5c027a09 --- /dev/null +++ b/modules/javasci/src/c/libjavasci2_la-javasci2_helper.lo @@ -0,0 +1,12 @@ +# src/c/libjavasci2_la-javasci2_helper.lo - a libtool object file +# Generated by libtool (GNU libtool) 2.4.2 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/libjavasci2_la-javasci2_helper.o' + +# Name of the non-PIC object +non_pic_object=none + diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/Call_Scilab.java b/modules/javasci/src/java/org/scilab/modules/javasci/Call_Scilab.java new file mode 100755 index 000000000..f9ee451ba --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/Call_Scilab.java @@ -0,0 +1,137 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.scilab.modules.javasci; + + +import org.scilab.modules.types.ScilabTypeEnum; +import org.scilab.modules.types.ScilabIntegerTypeEnum; + + /** + * Connector for Javasci v2. + * This class should <b>not</b> be used directly + * @see org.scilab.modules.javasci.Scilab + * @author DIGITEO - Sylvestre LEDRU + */ +public class Call_Scilab { + + /** + * Constructor + */ + protected Call_Scilab() { + throw new UnsupportedOperationException(); + } + public static int Call_ScilabOpen(String SCIpath, boolean advancedMode, String ScilabStartup, int Stacksize) { + return Call_ScilabJNI.Call_ScilabOpen(SCIpath, advancedMode, ScilabStartup, Stacksize); + } + + public static boolean TerminateScilab(String ScilabQuit) { + return Call_ScilabJNI.TerminateScilab(ScilabQuit); + } + + public static int SendScilabJob(String job) { + return Call_ScilabJNI.SendScilabJob(job); + } + + public static int SendScilabJobs(String[] jobs, int numberjobs) { + return Call_ScilabJNI.SendScilabJobs(jobs, numberjobs); + } + + public static void SetFromJavaToON() { + Call_ScilabJNI.SetFromJavaToON(); + } + + public static boolean isGraphicOpened() { + return Call_ScilabJNI.isGraphicOpened(); + } + + public static int GetLastErrorCode() { + return Call_ScilabJNI.GetLastErrorCode(); + } + + public static boolean isExistingVariable(String varname) { + return Call_ScilabJNI.isExistingVariable(varname); + } + + public static String getLastErrorMessage() { + return Call_ScilabJNI.getLastErrorMessage(); + } + + public static ScilabTypeEnum getVariableType(String varname) { + return ScilabTypeEnum.swigToEnum(Call_ScilabJNI.getVariableType(varname)); + } + + public static ScilabIntegerTypeEnum getIntegerPrecision(String varname) { + return ScilabIntegerTypeEnum.swigToEnum(Call_ScilabJNI.getIntegerPrecision(varname)); + } + + public static boolean isComplex(String varname) { + return Call_ScilabJNI.isComplex(varname); + } + + public static int putString(String variableName, String[][] variable) { + return Call_ScilabJNI.putString(variableName, variable); + } + + public static int putDoubleComplex(String variableName, double[][] variable, double[][] imag) { + return Call_ScilabJNI.putDoubleComplex(variableName, variable, imag); + } + + public static int putDouble(String variableName, double[][] variable) { + return Call_ScilabJNI.putDouble(variableName, variable); + } + + public static int putBoolean(String variableName, boolean[][] variable) { + return Call_ScilabJNI.putBoolean(variableName, variable); + } + + public static int putByte(String variableName, byte[][] variable) { + return Call_ScilabJNI.putByte(variableName, variable); + } + + public static int putUnsignedByte(String variableName, byte[][] variable) { + return Call_ScilabJNI.putUnsignedByte(variableName, variable); + } + + public static int putShort(String variableName, short[][] variable) { + return Call_ScilabJNI.putShort(variableName, variable); + } + + public static int putUnsignedShort(String variableName, short[][] variable) { + return Call_ScilabJNI.putUnsignedShort(variableName, variable); + } + + public static int putInt(String variableName, int[][] variable) { + return Call_ScilabJNI.putInt(variableName, variable); + } + + public static int putUnsignedInt(String variableName, int[][] variable) { + return Call_ScilabJNI.putUnsignedInt(variableName, variable); + } + + public static int putSparse(String variableName, int nbRow, int nbCol, int[] nbRowItem, int[] colPos, double[] data) { + return Call_ScilabJNI.putSparse(variableName, nbRow, nbCol, nbRowItem, colPos, data); + } + + public static int putComplexSparse(String variableName, int nbRow, int nbCol, int[] nbRowItem, int[] colPos, double[] data, double[] imag) { + return Call_ScilabJNI.putComplexSparse(variableName, nbRow, nbCol, nbRowItem, colPos, data, imag); + } + + public static int putBooleanSparse(String variableName, int nbRow, int nbCol, int[] nbRowItem, int[] colPos) { + return Call_ScilabJNI.putBooleanSparse(variableName, nbRow, nbCol, nbRowItem, colPos); + } + + public static int putPolynomial(String variableName, String polyVarName, double[][][] data) { + return Call_ScilabJNI.putPolynomial(variableName, polyVarName, data); + } + + public static int putComplexPolynomial(String variableName, String polyVarName, double[][][] data, double[][][] imag) { + return Call_ScilabJNI.putComplexPolynomial(variableName, polyVarName, data, imag); + } + +} diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/Call_ScilabJNI.java b/modules/javasci/src/java/org/scilab/modules/javasci/Call_ScilabJNI.java new file mode 100755 index 000000000..d157c450c --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/Call_ScilabJNI.java @@ -0,0 +1,74 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * Do not make changes to this file unless you know what you are doing--modify + * the SWIG interface file instead. + * ----------------------------------------------------------------------------- */ + +package org.scilab.modules.javasci; + + +/* It is generated code. Disable checkstyle */ +//CHECKSTYLE:OFF + /** + * Connector for Javasci v2. + * This class should <b>not</b> be used directly + * @see org.scilab.modules.javasci.Scilab + * @author DIGITEO - Sylvestre LEDRU + */ +class Call_ScilabJNI { + + /** + * Constructor + */ + protected Call_ScilabJNI() { + throw new UnsupportedOperationException(); + } + + static { + try { + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + System.loadLibrary("javasci"); + } else { + System.loadLibrary("javasci2"); + } + } catch (SecurityException e) { + System.err.println("A security manager exists and does not allow the loading of the specified dynamic library :"); + e.printStackTrace(System.err); + } catch (UnsatisfiedLinkError e) { + System.err.println("The native library javasci does not exist or cannot be found."); + e.printStackTrace(System.err); + } + } + + public final static native int putList(String varNmae, Object list, char type); + + public final static native int Call_ScilabOpen(String jarg1, boolean jarg2, String jarg3, int jarg4); + public final static native boolean TerminateScilab(String jarg1); + public final static native int SendScilabJob(String jarg1); + public final static native int SendScilabJobs(String[] jarg1, int jarg2); + public final static native void SetFromJavaToON(); + public final static native boolean isGraphicOpened(); + public final static native int GetLastErrorCode(); + public final static native boolean isExistingVariable(String jarg1); + public final static native String getLastErrorMessage(); + public final static native int getVariableType(String jarg1); + public final static native int getIntegerPrecision(String jarg1); + public final static native boolean isComplex(String jarg1); + public final static native int putString(String jarg1, String[][] jarg2); + public final static native int putDoubleComplex(String jarg1, double[][] jarg2, double[][] jarg5); + public final static native int putDouble(String jarg1, double[][] jarg2); + public final static native int putBoolean(String jarg1, boolean[][] jarg2); + public final static native int putByte(String jarg1, byte[][] jarg2); + public final static native int putUnsignedByte(String jarg1, byte[][] jarg2); + public final static native int putShort(String jarg1, short[][] jarg2); + public final static native int putUnsignedShort(String jarg1, short[][] jarg2); + public final static native int putInt(String jarg1, int[][] jarg2); + public final static native int putUnsignedInt(String jarg1, int[][] jarg2); + public final static native int putSparse(String jarg1, int jarg2, int jarg3, int[] jarg4, int[] jarg6, double[] jarg8); + public final static native int putComplexSparse(String jarg1, int jarg2, int jarg3, int[] jarg4, int[] jarg6, double[] jarg8, double[] jarg10); + public final static native int putBooleanSparse(String jarg1, int jarg2, int jarg3, int[] jarg4, int[] jarg6); + public final static native int putPolynomial(String jarg1, String jarg2, double[][][] jarg3); + public final static native int putComplexPolynomial(String jarg1, String jarg2, double[][][] jarg3, double[][][] jarg7); +} diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/JavasciException.java b/modules/javasci/src/java/org/scilab/modules/javasci/JavasciException.java new file mode 100755 index 000000000..329fa630d --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/JavasciException.java @@ -0,0 +1,132 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - INRIA - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + +package org.scilab.modules.javasci; + +/** + * This class provides a general exception class for Javasci v2 API. + */ +public abstract class JavasciException extends Exception { + + + /** + * This class provides a exception class when an error occurs on the + * initialization + */ + public static class InitializationException extends JavasciException { + + public InitializationException(String message) { + super(message); + } + + public InitializationException(String message, Throwable cause) { + super(message, cause); + } + + } + + + /** + * This class provides a exception class when an unsupported type is used + */ + public static class UnsupportedTypeException extends JavasciException { + + public UnsupportedTypeException(String message) { + super(message); + } + } + + + /** + * This class provides a exception class when a type is unknown + * This should be very very rare. + */ + public static class UnknownTypeException extends JavasciException { + + public UnknownTypeException(String message) { + super(message); + } + + } + + /** + * This class provides a exception class when Scilab is already running + */ + public static class AlreadyRunningException extends JavasciException { + + public AlreadyRunningException(String message) { + super(message); + } + } + + + /** + * This class provides a exception class when an internal error occurs + */ + public static class ScilabInternalException extends JavasciException { + + public ScilabInternalException(String message) { + super(message); + } + + } + + /** + * This class provides a exception class when a Scilab error occurs + * @since 5.4.0 + */ + public static class ScilabErrorException extends JavasciException { + + public ScilabErrorException(String message, int errorCode) { + super(message + "\nCode: " + errorCode); + } + + } + + + /** + * This class provides a exception class when an non-existing variable is + * accessed. + */ + public static class UndefinedVariableException extends JavasciException { + + public UndefinedVariableException(String message) { + super(message); + } + + } + + /** + * Default constructor + */ + public JavasciException() { + super(); + } + + /** + * Default constructor + */ + public JavasciException(String message) { + super(message); + } + + /** + * + * @param message the message to be printed + * @param cause the cause + */ + public JavasciException(String message, Throwable cause) { + super(message, cause); + } + + +} diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/Scilab.java b/modules/javasci/src/java/org/scilab/modules/javasci/Scilab.java new file mode 100755 index 000000000..207b8f1cd --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/Scilab.java @@ -0,0 +1,770 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - INRIA - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.modules.javasci; + +import java.io.File; +import java.io.FileNotFoundException; + +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabTypeEnum; +import org.scilab.modules.types.ScilabIntegerTypeEnum; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabList; +import org.scilab.modules.types.ScilabMList; +import org.scilab.modules.types.ScilabTList; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabBooleanSparse; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabPolynomial; +import org.scilab.modules.types.ScilabSparse; +import org.scilab.modules.javasci.Call_Scilab; +import org.scilab.modules.javasci.JavasciException.AlreadyRunningException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.javasci.JavasciException.UnknownTypeException; +import org.scilab.modules.javasci.JavasciException.ScilabInternalException; +import org.scilab.modules.javasci.JavasciException.ScilabErrorException; + +/** + * This class provides the capability to access to the Scilab engine from + * a Java application.<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab();<br /> + * if (sci.open()) {<br /> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabDouble aFromScilab = (ScilabDouble)sci.get("a");<br /> + * }<br /> + * </code> + * @see org.scilab.modules.types + */ +public class Scilab { + + private static int notHandledError = -999; + + private String SCI = null; + private boolean advancedMode = false; + + /** + * Creator of the Scilab Javasci object. <br /> + * Scilab data path is autodetected and advanced features disabled + */ + public Scilab() throws InitializationException { + this(null, false); + } + + /** + * Creator of the Scilab Javasci object with a specific Scilab path.<br /> + * Advanced features are disabled (faster) + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab("/path/to/Scilab/data/dir/");<br /> + * <br /> + * </code> + * @param SCI provide the path to Scilab data + */ + public Scilab(String SCI) throws InitializationException { + this(SCI, false); + } + + /** + * Creator of the Scilab Javasci object in advanced mode<br /> + * Scilab data path is autodetected + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab(true); // Starts in advanced mode<br /> + * <br /> + * </code> + * @param advancedMode true enables the advanced mode (GUI, graphics, Tcl/Tk, sciNotes...). Smaller. + */ + public Scilab(boolean advancedMode) throws InitializationException { + this(null, advancedMode); + } + + /** + * Creator of the Scilab Javasci object. <br /> + * Under GNU/Linux / Mac OS X, try to detect Scilab base path<br /> + * if the property SCI is set, use it<br /> + * if not, try with the global variable SCI<br /> + * if not, throws a new exception<br /> + * Under Windows, use also the registery<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab("/path/to/Scilab/data/dir/",true); // Starts in advanced mode<br /> + * <br /> + * </code> + * @param SCIPath the path to Scilab data + * @param advancedMode true enables the advanced mode (GUI, graphics, Tcl/Tk, sciNotes...). Smaller. + */ + public Scilab(String SCIPath, boolean advancedMode) throws InitializationException { + String SCI = SCIPath; + if (!System.getProperty("os.name").toLowerCase().contains("windows")) { + if (SCI == null) { + // Auto detect + try { + SCI = System.getProperty("SCI"); + if (SCI == null || SCI.length() == 0) { + SCI = System.getenv("SCI"); + if (SCI == null || SCI.length() == 0) { + throw new InitializationException("Auto detection of SCI failed.\nSCI empty."); + } + } + } catch (Exception e) { + throw new InitializationException("Auto detection of SCI failed.\nCould not retrieve the variable SCI.", e); + } + } + } + this.advancedMode = advancedMode; + this.initScilab(SCI); + + } + + + private void initScilab(String SCI) throws InitializationException { + /* Let Scilab engine knows that he is run through the Javasci API */ + Call_Scilab.SetFromJavaToON(); + if (!System.getProperty("os.name").toLowerCase().contains("windows")) { + File f = new File(SCI); + if (!f.isDirectory()) { + throw new InitializationException("Could not find directory " + f.getAbsolutePath()); + } + this.SCI = SCI; + } + } + + /** + * Open a connection to the Scilab engine<br /> + * This function is based on Call_ScilabOpen from call_scilab<br /> + * Note: For now, only one instance of Scilab can be launched<br /> + * A second launch will return FALSE<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab();<br /> + * sci.open();<br /> + * <br /> + * </code> + * @return if the operation is successful + * @throws AlreadyRunningException Scilab is already running + * @throws InitializationException Cannot start Scilab + */ + public boolean open() throws JavasciException { + int res = Call_Scilab.Call_ScilabOpen(this.SCI, this.advancedMode, null, -1); + switch (res) { + case 0: /* Success */ + return true; + case -1: + throw new AlreadyRunningException("Javasci already running."); + case -2: + /* Should not occurd (processed before) */ + throw new InitializationException("Could not find SCI."); + case -3: + throw new InitializationException("No existing directory."); + case 10001: + throw new InitializationException("Stacksize failed (not enought memory ?)."); + default: + throw new InitializationException("Unknown startup error: " + res); + } + } + + /** + * Open a connection to the Scilab engine and run the command job<br /> + * This function is based on Call_ScilabOpen from call_scilab<br /> + * Note: For now, only one instance of Scilab can be launched<br /> + * A second launch will return FALSE<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab();<br /> + * sci.open("a=%pi;");<br /> + * <br /> + * </code> + * @param job The job to run on startup + * @return if the operation is successful + */ + public boolean open(String job) throws JavasciException { + if (!this.open()) { + return false; + } + + return this.exec(job); + } + + /** + * Open a connection to the Scilab engine and run commands job<br /> + * This function is based on Call_ScilabOpen from call_scilab<br /> + * Note: For now, only one instance of Scilab can be launched<br /> + * A second launch will return FALSE<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab();<br /> + * sci.open(new String[]{"a=42*2;","b=44*2", "c=(a==b)"});<br /> + * <br /> + * </code> + * @param jobs The serie of jobs to run on startup + * @return if the operation is successful + */ + public boolean open(String jobs[]) throws JavasciException { + if (!this.open()) { + return false; + } + return this.exec(jobs); + } + + + /** + * Open a connection to the Scilab engine and run thefile scriptFilename<br /> + * This function is based on Call_ScilabOpen from call_scilab<br /> + * Note: For now, only one instance of Scilab can be launched<br /> + * A second launch will return FALSE<br /> + * <br /> + * Example:<br /> + * <code> + * Scilab sci = new Scilab();<br /> + * sci.open(new File("/tmp/myscript.sce"));<br /> + * <br /> + * </code> + * @param scriptFilename The script to execute on startup + * @return if the operation is successful + */ + public boolean open(File scriptFilename) throws JavasciException, FileNotFoundException { + if (!this.open()) { + return false; + } + + return this.exec(scriptFilename); + } + + + /** + * Execute a single command in Scilab<br /> + * This function is based on SendScilabJob from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.exec("a=2*%pi");<br /> + * <br /> + * </code> + * @param job the job to execute + * @return if the operation is successful + */ + public boolean exec(String job) { + try { + this.execException(job); + return true; + } catch (Exception e) { + return false; + } + } + + + /** + * Execute a single command in Scilab<br /> + * Returns a ScilabErrorException in case of Scilab problem<br /> + * This function is based on SendScilabJob from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.exec("a=2*%pi");<br /> + * <br /> + * </code> + * @param job the job to execute + * @since 5.4.0 + */ + public void execException(String job) throws ScilabErrorException { + int result = Call_Scilab.SendScilabJob(job); + if (result != 0) { + throw new ScilabErrorException("A Scilab error occurred: " + this.getLastErrorMessage(), this.getLastErrorCode()); + } + } + + + /** + * Execute several commands in Scilab<br /> + * This function is based on SendScilabJob from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.exec(new String[]{"a=42*2;","b=44*2", "c=(a==b)"});<br /> + * <br /> + * </code> + * @param jobs the serie of job to execute + * @return if the operation is successful + */ + public boolean exec(String jobs[]) { + try { + this.execException(jobs); + return true; + } catch (Exception e) { + return false; + } + } + + /** + * Execute several commands in Scilab<br /> + * Returns a ScilabErrorException in case of Scilab problem<br /> + * This function is based on SendScilabJob from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.exec(new String[]{"a=42*2;","b=44*2", "c=(a==b)"});<br /> + * <br /> + * </code> + * @param jobs the serie of job to execute + * @since 5.4.0 + */ + public void execException(String jobs[]) throws ScilabErrorException { + int result = Call_Scilab.SendScilabJobs(jobs, jobs.length); + if (result != 0) { + throw new ScilabErrorException("A Scilab error occurred: " + this.getLastErrorMessage(), this.getLastErrorCode()); + } + } + + /** + * Execute a Scilab script .sce/.sci and throws an exception in case<br /> + * of a Scilab error<br /> + * Returns a ScilabErrorException in case of Scilab problem<br /> + * This function is based on SendScilabJob from call_scilab<br /> + * Note that this function is a direct call on the Scilab function exec: + * <code> this.exec("exec('" + scriptFilename + "');");</code> + * <br /> + * Example:<br /> + * <code> + * sci.exec(new File("/tmp/myscript.sci"));<br /> + * <br /> + * </code> + * @param scriptFilename the script to execute + * @since 5.4.0 + */ + public void execException(File scriptFilename) throws FileNotFoundException, ScilabErrorException { + if (!scriptFilename.exists()) { + throw new FileNotFoundException("Could not find " + scriptFilename); + } + this.execException("exec('" + scriptFilename + "');"); + } + + /** + * Execute a Scilab script .sce/.sci and throws an exception in case<br /> + * the file is not found<br /> + * This function is based on SendScilabJob from call_scilab<br /> + * Note that this function is a direct call on the Scilab function exec: + * <code> this.exec("exec('" + scriptFilename + "');");</code> + * <br /> + * Example:<br /> + * <code> + * sci.exec(new File("/tmp/myscript.sci"));<br /> + * <br /> + * </code> + * @param scriptFilename the script to execute + * @return if the operation is successful + */ + public boolean exec(File scriptFilename) throws FileNotFoundException { + if (!scriptFilename.exists()) { + throw new FileNotFoundException("Could not find " + scriptFilename); + } + return this.exec("exec('" + scriptFilename + "');"); + } + + + /** + * Detect if a variable (varname) exists in Scilab + * <br /> + * Example:<br /> + * <code> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a);<br /> + * sci.put("a",aOriginal);<br /> + * assert sci.isExistingVariable("a") == true;<br /> + * <br /> + * </code> + * @param varname the variable to check + * @return if the variable exists or not + */ + public boolean isExistingVariable(String varname) { + return Call_Scilab.isExistingVariable(varname); + } + + + /** + * Shutdown Scilab<br /> + * This function is based on TerminateScilab from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.close();<br /> + * <br /> + * </code> + * @return if the operation is successful + */ + public boolean close() { + return Call_Scilab.TerminateScilab(null); + } + + + /** + * Return the last error code + * <br /> + * Example:<br /> + * <code> + * sci.open("a=1+"); // Wrong operation<br /> + * sci.getLastErrorCode() // Returns 2<br /> + * <br /> + * </code> + * @return the error code + */ + public int getLastErrorCode() { + return Call_Scilab.GetLastErrorCode(); + } + + + /** + * Return the last error message + * <br /> + * Example:<br /> + * <code> + * sci.open("a=1+");<br /> + * System.err.println(sci.getLastErrorMessage());<br /> + * <br /> + * </code> + * @return the error message itself + */ + public String getLastErrorMessage() { + return Call_Scilab.getLastErrorMessage(); + } + + + /** + * Detect if a Scilab graphic window is still opened<br /> + * This function is based on ScilabHaveAGraph from call_scilab + * <br /> + * Example:<br /> + * <code> + * sci.exec("plot3d();");<br /> + * sci.isGraphicOpened();<br /> + * <br /> + * </code> + * @return if the graphic is open or not + */ + public boolean isGraphicOpened() { + return Call_Scilab.isGraphicOpened(); + } + + /** + * Return the code type of a variable varname + * <br /> + * Example:<br /> + * <code> + * sci.exec("a = 2*%pi");<br /> + * if (sci.getVariableType("a") == ScilabTypeEnum.sci_matrix) {<br /> + * System.out.println("a is a double matrix");<br /> + * }<br /> + * <br /> + * </code> + * @param varName the name of the variable + * @return the type of the variable + * @throws UndefinedVariableException The variable does not exist + * @throws UnknownTypeException Cannot find the type + */ + public ScilabTypeEnum getVariableType(String varName) throws JavasciException { + return getVariableTypeInCurrentScilabSession(varName); + } + + /** + * Return the code type of a variable varname in the current Scilab session + * <br /> + * Example:<br /> + * <code> + * sci.exec("a = 2*%pi");<br /> + * if (sci.getVariableType("a") == ScilabTypeEnum.sci_matrix) {<br /> + * System.out.println("a is a double matrix");<br /> + * }<br /> + * <br /> + * </code> + * @param varName the name of the variable + * @return the type of the variable + * @throws UndefinedVariableException The variable does not exist + * @throws UnknownTypeException Cannot find the type + */ + public static ScilabTypeEnum getVariableTypeInCurrentScilabSession(String varName) throws JavasciException { + ScilabTypeEnum variableType = null; + try { + variableType = Call_Scilab.getVariableType(varName); + if (variableType == null ) { + throw new UndefinedVariableException("Could not find the type of the variable '" + varName + "'"); + } + } catch (IllegalArgumentException e) { + String lastWord = e.getMessage().substring(e.getMessage().lastIndexOf(' ') + 1); + if (lastWord.equals("-2")) { /* Crappy workaround. Parse the exception */ + throw new UndefinedVariableException("Could not find variable '" + varName + "'"); + } + throw new UnknownTypeException("Type of " + varName + " unknown"); + + } + return variableType; + } + + /** + * Returns a variable named varname<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * double [][]aImg={{212.2, 221.0, 423.0, 393.0},{234.2, 244.0, 441.0, 407.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a, aImg);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabDouble aFromScilab = (ScilabDouble)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @return return the variable + * @throws UnsupportedTypeException Type not managed yet. + */ + public ScilabType get(String varname) throws JavasciException { + return getInCurrentScilabSession(varname); + } + + /** + * Returns a reference variable named varname<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * double [][]aImg={{212.2, 221.0, 423.0, 393.0},{234.2, 244.0, 441.0, 407.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a, aImg);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabDouble aFromScilab = (ScilabDouble)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @return return the variable + * @throws UnsupportedTypeException Type not managed yet. + */ + public ScilabType getByReference(String varname) throws JavasciException { + return getInCurrentScilabSession(varname, true); + } + + /** + * Returns a variable named varname in the current Scilab session<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * double [][]aImg={{212.2, 221.0, 423.0, 393.0},{234.2, 244.0, 441.0, 407.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a, aImg);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabDouble aFromScilab = (ScilabDouble)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @return return the variable + * @throws UnsupportedTypeException Type not managed yet. + */ + public static ScilabType getInCurrentScilabSession(String varname) throws JavasciException { + return getInCurrentScilabSession(varname, false); + } + + /** + * Returns a variable named varname in the current Scilab session<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * double [][]a={{21.2, 22.0, 42.0, 39.0},{23.2, 24.0, 44.0, 40.0}};<br /> + * double [][]aImg={{212.2, 221.0, 423.0, 393.0},{234.2, 244.0, 441.0, 407.0}};<br /> + * ScilabDouble aOriginal = new ScilabDouble(a, aImg);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabDouble aFromScilab = (ScilabDouble)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @return return the variable + * @throws UnsupportedTypeException Type not managed yet. + */ + public static ScilabType getInCurrentScilabSession(String varname, boolean byref) throws JavasciException { + ScilabTypeEnum sciType = getVariableTypeInCurrentScilabSession(varname); + switch (sciType) { + case sci_matrix: + case sci_boolean: + case sci_strings: + + case sci_poly: + case sci_sparse: + case sci_boolean_sparse: + case sci_list: + case sci_tlist: + case sci_mlist: + return ScilabVariablesJavasci.getScilabVariable(varname, true, byref); + case sci_ints: + ScilabIntegerTypeEnum typeInt = Call_Scilab.getIntegerPrecision(varname); + + switch (typeInt) { + case sci_int8: + case sci_uint8: + case sci_int16: + case sci_uint16: + case sci_int32: + case sci_uint32: + return ScilabVariablesJavasci.getScilabVariable(varname, true, byref); + case sci_int64: + case sci_uint64: + // will be available in Scilab 6 + throw new UnsupportedTypeException("64 bit (signed and unsigned) integer types not managed in Scilab 5.X"); + + } + + default: + throw new UnsupportedTypeException("Type not managed: " + sciType); + } + } + + /** + * Send to Scilab a variable theVariable named varname<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * boolean [][]a={{true, true, false, false},{true, false, true, false}};<br /> + * ScilabBoolean aOriginal = new ScilabBoolean(a);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabBoolean aFromScilab = (ScilabBoolean)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @param theVariable the variable itself + * @return true if the operation is successful + * @throws UnsupportedTypeException Type not managed yet. + */ + public boolean put(String varname, ScilabType theVariable) throws JavasciException { + return putInCurrentScilabSession(varname, theVariable); + } + + /** + * Send to the current Scilab session a variable theVariable named varname<br /> + * Throws an exception if the datatype is not managed or if the variable is not available + * <br /> + * Example:<br /> + * <code> + * boolean [][]a={{true, true, false, false},{true, false, true, false}};<br /> + * ScilabBoolean aOriginal = new ScilabBoolean(a);<br /> + * sci.put("a",aOriginal);<br /> + * ScilabBoolean aFromScilab = (ScilabBoolean)sci.get("a");<br /> + * <br /> + * </code> + * @param varname the name of the variable + * @param theVariable the variable itself + * @return true if the operation is successful + * @throws UnsupportedTypeException Type not managed yet. + */ + public static boolean putInCurrentScilabSession(String varname, ScilabType theVariable) throws JavasciException { + int err = notHandledError; /* -999: if the type is not handled */ + + switch (theVariable.getType()) { + case sci_matrix : + ScilabDouble sciDouble = (ScilabDouble) theVariable; + if (sciDouble.isReal()) { + err = Call_Scilab.putDouble(varname, sciDouble.getRealPart()); + } else { + err = Call_Scilab.putDoubleComplex(varname, sciDouble.getRealPart(), sciDouble.getImaginaryPart()); + } + break; + case sci_poly : + ScilabPolynomial sciPoly = (ScilabPolynomial) theVariable; + if (sciPoly.isReal()) { + err = Call_Scilab.putPolynomial(varname, sciPoly.getPolyVarName(), sciPoly.getRealPart()); + } else { + err = Call_Scilab.putComplexPolynomial(varname, sciPoly.getPolyVarName(), sciPoly.getRealPart(), sciPoly.getImaginaryPart()); + } + break; + case sci_boolean : + ScilabBoolean sciBoolean = (ScilabBoolean) theVariable; + err = Call_Scilab.putBoolean(varname, sciBoolean.getData()); + break; + case sci_sparse : + ScilabSparse sciSparse = (ScilabSparse) theVariable; + if (sciSparse.isReal()) { + err = Call_Scilab.putSparse(varname, sciSparse.getHeight(), sciSparse.getWidth(), sciSparse.getNbItemRow(), sciSparse.getScilabColPos(), sciSparse.getRealPart()); + } else { + err = Call_Scilab.putComplexSparse(varname, sciSparse.getHeight(), sciSparse.getWidth(), sciSparse.getNbItemRow(), sciSparse.getScilabColPos(), sciSparse.getRealPart(), sciSparse.getImaginaryPart()); + } + break; + case sci_boolean_sparse : + ScilabBooleanSparse sciBooleanSparse = (ScilabBooleanSparse) theVariable; + err = Call_Scilab.putBooleanSparse(varname, sciBooleanSparse.getHeight(), sciBooleanSparse.getWidth(), sciBooleanSparse.getNbItemRow(), sciBooleanSparse.getScilabColPos()); + break; + case sci_ints : + ScilabInteger sciInteger = (ScilabInteger) theVariable; + switch (sciInteger.getPrec()) { + case sci_uint8: + err = Call_Scilab.putUnsignedByte(varname, sciInteger.getDataAsByte()); + break; + case sci_int8: + err = Call_Scilab.putByte(varname, sciInteger.getDataAsByte()); + break; + case sci_uint16: + err = Call_Scilab.putUnsignedShort(varname, sciInteger.getDataAsShort()); + break; + case sci_int16: + err = Call_Scilab.putShort(varname, sciInteger.getDataAsShort()); + break; + case sci_uint32: + err = Call_Scilab.putUnsignedInt(varname, sciInteger.getDataAsInt()); + break; + case sci_int32: + err = Call_Scilab.putInt(varname, sciInteger.getDataAsInt()); + break; + case sci_uint64: + // err = Call_Scilab.putUnsignedLong(varname, sciInteger.getData_()); + case sci_int64: + // err = Call_Scilab.putLong(varname, sciInteger.getData_()); + break; + } + break; + case sci_strings : + ScilabString sciString = (ScilabString) theVariable; + err = Call_Scilab.putString(varname, sciString.getData()); + break; + case sci_list : + ScilabList sciList = (ScilabList) theVariable; + err = Call_ScilabJNI.putList(varname, sciList.getSerializedObject(), 'l'); + break; + case sci_tlist : + ScilabTList sciTList = (ScilabTList) theVariable; + err = Call_ScilabJNI.putList(varname, sciTList.getSerializedObject(), 't'); + break; + case sci_mlist : + ScilabMList sciMList = (ScilabMList) theVariable; + err = Call_ScilabJNI.putList(varname, sciMList.getSerializedObject(), 'm'); + break; + } + + if (err == notHandledError) { + throw new UnsupportedTypeException("Type not managed: " + theVariable.getClass()); + } else { + if (err != 0) { + throw new ScilabInternalException("Storage of the variable '" + varname + "' (" + theVariable.getClass() + ") failed."); + } + } + return true; + } +} diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/ScilabVariablesJavasci.java b/modules/javasci/src/java/org/scilab/modules/javasci/ScilabVariablesJavasci.java new file mode 100755 index 000000000..ed01e1df0 --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/ScilabVariablesJavasci.java @@ -0,0 +1,90 @@ +/* + * Scilab (http://www.scilab.org/) - This file is part of Scilab + * Copyright (C) 2011 - DIGITEO - 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.1-en.txt + * + */ + +package org.scilab.modules.javasci; + +import java.util.HashMap; +import java.util.Map; + +import org.scilab.modules.types.GetScilabVariable; +import org.scilab.modules.types.ScilabVariables; +import org.scilab.modules.types.ScilabVariablesHandler; +import org.scilab.modules.types.ScilabType; + +/** + * Class to get Scilab data from a Java call + */ +public final class ScilabVariablesJavasci implements ScilabVariablesHandler { + + private static final Map<Thread, ScilabType> map = new HashMap<Thread, ScilabType>(); + + private static int id = -1; + + /** + * Constructor + */ + private ScilabVariablesJavasci() { } + + /** + * {@inheritDoc} + */ + public void handle(ScilabType var) { + map.put(Thread.currentThread(), var); + } + + /** + * Get a Scilab variable with a given name + * @param name the variable name + * @param swapRowCol if true the returned data will be stored row by row + * @param byref if true the variable is passed by reference if it is possible + * @return the corresponding ScilabType object + */ + public static final ScilabType getScilabVariable(String name, boolean swapRowCol, boolean byref) { + if (id == -1) { + id = ScilabVariables.addScilabVariablesHandler(new ScilabVariablesJavasci()); + } + + if (name != null && !name.isEmpty()) { + if (byref) { + GetScilabVariable.getScilabVariableAsReference(name, id); + } else { + GetScilabVariable.getScilabVariable(name, swapRowCol ? 1 : 0, id); + } + Thread t = Thread.currentThread(); + ScilabType var = map.get(t); + map.remove(t); + + return var; + } + + return null; + } + + /** + * Get a Scilab variable with a given name + * @param name the variable name + * @param swapRowCol if true the returned data will be stored row by row + * @return the corresponding ScilabType object + */ + public static final ScilabType getScilabVariable(String name, boolean swapRowCol) { + return getScilabVariable(name, swapRowCol, false); + } + + /** + * Get a Scilab variable with a given name + * @param name the variable name + * @return the corresponding ScilabType object where the data are stored row by row + */ + public static final ScilabType getScilabVariable(String name) { + return getScilabVariable(name, true); + } +} diff --git a/modules/javasci/src/java/org/scilab/modules/javasci/package.html b/modules/javasci/src/java/org/scilab/modules/javasci/package.html new file mode 100755 index 000000000..d65eeb7f4 --- /dev/null +++ b/modules/javasci/src/java/org/scilab/modules/javasci/package.html @@ -0,0 +1,18 @@ +<html> +<body> + +This package provides a way to use and call Scilab engine from a Java +application or library.<br /> +<br /> +Example:<br /> +<code> +Scilab sci = new Scilab();<br /> +sci.open();<br /> +sci.exec("b = matrix(1:100,10,10)");<br /> +ScilabType b = sci.get("b");<br /> +b.getHeight(); // 10 <br /> +b.getWidth(); // 10<br /> +ScilabDouble b2 = (ScilabDouble)sci.get("b");<br /> +b2.equals(b); // true<br /> +</body> +</html>
\ No newline at end of file diff --git a/modules/javasci/src/jni/.deps/.dirstamp b/modules/javasci/src/jni/.deps/.dirstamp new file mode 100755 index 000000000..e69de29bb --- /dev/null +++ b/modules/javasci/src/jni/.deps/.dirstamp diff --git a/modules/javasci/src/jni/.deps/libjavasci2_la-call_scilab_wrap.Plo b/modules/javasci/src/jni/.deps/libjavasci2_la-call_scilab_wrap.Plo new file mode 100755 index 000000000..4c903fe29 --- /dev/null +++ b/modules/javasci/src/jni/.deps/libjavasci2_la-call_scilab_wrap.Plo @@ -0,0 +1,321 @@ +src/jni/libjavasci2_la-call_scilab_wrap.lo: src/jni/call_scilab_wrap.c \ + /usr/include/stdc-predef.h \ + /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /usr/include/stdio.h \ + /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \ + /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ + /usr/include/x86_64-linux-gnu/bits/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/stdio2.h \ + /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h \ + /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/select2.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \ + /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \ + /usr/include/x86_64-linux-gnu/bits/string2.h \ + /usr/include/x86_64-linux-gnu/bits/string3.h \ + ../../modules/core/includes/BOOL.h src/c/javasci2_helper.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/core/includes/MALLOC.h \ + ../../modules/core/includes/sci_mem_alloc.h \ + src/jni/../../../call_scilab/includes/call_scilab.h \ + ../../modules/core/includes/stack-c.h \ + ../../modules/core/includes/core_math.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ + /usr/include/x86_64-linux-gnu/bits/mathinline.h \ + ../../modules/core/includes/stack-def.h \ + ../../modules/core/includes/machine.h \ + ../../modules/core/includes/stackTypeVariable.h \ + ../../modules/core/includes/BOOL.h \ + ../../modules/core/includes/doublecomplex.h \ + ../../modules/core/includes/stack1.h \ + ../../modules/core/includes/scisparse.h \ + ../../modules/core/includes/stack2.h \ + ../../modules/core/includes/stack3.h \ + ../../modules/core/includes/stack-optional.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/core/includes/machine.h \ + src/jni/../../../call_scilab/includes/fromjava.h \ + src/jni/../../../call_scilab/includes/dynlib_call_scilab.h \ + src/jni/../../../api_scilab/includes/api_scilab.h \ + src/jni/../../../api_scilab/includes/api_common.h \ + src/jni/../../../api_scilab/includes/api_scilab.h \ + src/jni/../../../api_scilab/includes/api_double.h \ + ../../modules/core/includes/doublecomplex.h \ + src/jni/../../../api_scilab/includes/api_string.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/wchar2.h \ + src/jni/../../../api_scilab/includes/api_int.h \ + src/jni/../../../api_scilab/includes/api_poly.h \ + src/jni/../../../api_scilab/includes/api_sparse.h \ + src/jni/../../../api_scilab/includes/api_boolean.h \ + src/jni/../../../api_scilab/includes/api_boolean_sparse.h \ + src/jni/../../../api_scilab/includes/api_pointer.h \ + src/jni/../../../api_scilab/includes/api_list.h \ + src/jni/../../../api_scilab/includes/api_error.h \ + src/jni/../../../api_scilab/includes/api_handle.h \ + src/jni/../../../api_scilab/includes/api_optional.h \ + ../../modules/core/includes/stack-optional.h \ + src/jni/../../../api_scilab/includes/api_hypermat.h \ + ../../modules/core/includes/core_math.h \ + src/jni/../../../output_stream/includes/lasterror.h \ + src/jni/../../../output_stream/includes/dynlib_output_stream.h \ + ../../modules/core/includes/../../../modules/graphic_objects/includes/FigureList.h \ + ../../modules/core/includes/../../../modules/graphic_objects/includes/dynlib_graphic_objects.h \ + src/jni/../../../core/includes/sci_types.h + +/usr/include/stdc-predef.h: + +/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h: + +/usr/include/stdio.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/x86_64-linux-gnu/bits/stdio.h: + +/usr/include/x86_64-linux-gnu/bits/stdio2.h: + +/usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap-16.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/select2.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-float.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib.h: + +/usr/include/string.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/bits/string.h: + +/usr/include/x86_64-linux-gnu/bits/string2.h: + +/usr/include/x86_64-linux-gnu/bits/string3.h: + +../../modules/core/includes/BOOL.h: + +src/c/javasci2_helper.h: + +../../modules/core/includes/sci_types.h: + +../../modules/core/includes/MALLOC.h: + +../../modules/core/includes/sci_mem_alloc.h: + +src/jni/../../../call_scilab/includes/call_scilab.h: + +../../modules/core/includes/stack-c.h: + +../../modules/core/includes/core_math.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/math-vector.h: + +/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/x86_64-linux-gnu/bits/mathinline.h: + +../../modules/core/includes/stack-def.h: + +../../modules/core/includes/machine.h: + +../../modules/core/includes/stackTypeVariable.h: + +../../modules/core/includes/BOOL.h: + +../../modules/core/includes/doublecomplex.h: + +../../modules/core/includes/stack1.h: + +../../modules/core/includes/scisparse.h: + +../../modules/core/includes/stack2.h: + +../../modules/core/includes/stack3.h: + +../../modules/core/includes/stack-optional.h: + +../../modules/core/includes/sci_types.h: + +../../modules/core/includes/machine.h: + +src/jni/../../../call_scilab/includes/fromjava.h: + +src/jni/../../../call_scilab/includes/dynlib_call_scilab.h: + +src/jni/../../../api_scilab/includes/api_scilab.h: + +src/jni/../../../api_scilab/includes/api_common.h: + +src/jni/../../../api_scilab/includes/api_scilab.h: + +src/jni/../../../api_scilab/includes/api_double.h: + +../../modules/core/includes/doublecomplex.h: + +src/jni/../../../api_scilab/includes/api_string.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/x86_64-linux-gnu/bits/wchar2.h: + +src/jni/../../../api_scilab/includes/api_int.h: + +src/jni/../../../api_scilab/includes/api_poly.h: + +src/jni/../../../api_scilab/includes/api_sparse.h: + +src/jni/../../../api_scilab/includes/api_boolean.h: + +src/jni/../../../api_scilab/includes/api_boolean_sparse.h: + +src/jni/../../../api_scilab/includes/api_pointer.h: + +src/jni/../../../api_scilab/includes/api_list.h: + +src/jni/../../../api_scilab/includes/api_error.h: + +src/jni/../../../api_scilab/includes/api_handle.h: + +src/jni/../../../api_scilab/includes/api_optional.h: + +../../modules/core/includes/stack-optional.h: + +src/jni/../../../api_scilab/includes/api_hypermat.h: + +../../modules/core/includes/core_math.h: + +src/jni/../../../output_stream/includes/lasterror.h: + +src/jni/../../../output_stream/includes/dynlib_output_stream.h: + +../../modules/core/includes/../../../modules/graphic_objects/includes/FigureList.h: + +../../modules/core/includes/../../../modules/graphic_objects/includes/dynlib_graphic_objects.h: + +src/jni/../../../core/includes/sci_types.h: diff --git a/modules/javasci/src/jni/.deps/libjavasci2_la-putLists.Plo b/modules/javasci/src/jni/.deps/libjavasci2_la-putLists.Plo new file mode 100755 index 000000000..8f22555d6 --- /dev/null +++ b/modules/javasci/src/jni/.deps/libjavasci2_la-putLists.Plo @@ -0,0 +1,292 @@ +src/jni/libjavasci2_la-putLists.lo: src/jni/putLists.c \ + /usr/include/stdc-predef.h /usr/include/string.h /usr/include/features.h \ + /usr/include/x86_64-linux-gnu/sys/cdefs.h \ + /usr/include/x86_64-linux-gnu/bits/wordsize.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs.h \ + /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/xlocale.h \ + /usr/include/x86_64-linux-gnu/bits/string.h \ + /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \ + /usr/include/x86_64-linux-gnu/bits/endian.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap.h \ + /usr/include/x86_64-linux-gnu/bits/types.h \ + /usr/include/x86_64-linux-gnu/bits/typesizes.h \ + /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \ + /usr/include/x86_64-linux-gnu/bits/string3.h \ + /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /usr/include/stdio.h \ + /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \ + /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \ + /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \ + /usr/include/x86_64-linux-gnu/bits/stdio.h \ + /usr/include/x86_64-linux-gnu/bits/stdio2.h \ + /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h \ + ../../modules/api_scilab/includes/api_scilab.h \ + ../../modules/core/includes/stack-c.h \ + ../../modules/core/includes/core_math.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h \ + /usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h \ + /usr/include/limits.h /usr/include/x86_64-linux-gnu/bits/posix1_lim.h \ + /usr/include/x86_64-linux-gnu/bits/local_lim.h \ + /usr/include/linux/limits.h \ + /usr/include/x86_64-linux-gnu/bits/posix2_lim.h /usr/include/math.h \ + /usr/include/x86_64-linux-gnu/bits/math-vector.h \ + /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ + /usr/include/x86_64-linux-gnu/bits/huge_val.h \ + /usr/include/x86_64-linux-gnu/bits/huge_valf.h \ + /usr/include/x86_64-linux-gnu/bits/huge_vall.h \ + /usr/include/x86_64-linux-gnu/bits/inf.h \ + /usr/include/x86_64-linux-gnu/bits/nan.h \ + /usr/include/x86_64-linux-gnu/bits/mathdef.h \ + /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ + /usr/include/x86_64-linux-gnu/bits/mathinline.h \ + /usr/include/x86_64-linux-gnu/bits/waitflags.h \ + /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ + /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \ + /usr/include/x86_64-linux-gnu/sys/select.h \ + /usr/include/x86_64-linux-gnu/bits/select.h \ + /usr/include/x86_64-linux-gnu/bits/sigset.h \ + /usr/include/x86_64-linux-gnu/bits/time.h \ + /usr/include/x86_64-linux-gnu/bits/select2.h \ + /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ + /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \ + /usr/include/x86_64-linux-gnu/bits/stdlib.h \ + ../../modules/core/includes/stack-def.h \ + ../../modules/core/includes/machine.h \ + ../../modules/core/includes/stackTypeVariable.h \ + ../../modules/core/includes/BOOL.h \ + ../../modules/core/includes/doublecomplex.h \ + ../../modules/core/includes/stack1.h \ + ../../modules/core/includes/scisparse.h \ + ../../modules/core/includes/stack2.h \ + ../../modules/core/includes/stack3.h \ + ../../modules/core/includes/stack-optional.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/api_scilab/includes/api_common.h \ + ../../modules/api_scilab/includes/api_scilab.h \ + ../../modules/api_scilab/includes/api_double.h \ + ../../modules/core/includes/doublecomplex.h \ + ../../modules/api_scilab/includes/api_string.h \ + /usr/include/x86_64-linux-gnu/bits/wchar.h \ + /usr/include/x86_64-linux-gnu/bits/wchar2.h \ + ../../modules/api_scilab/includes/api_int.h \ + ../../modules/api_scilab/includes/api_poly.h \ + ../../modules/api_scilab/includes/api_sparse.h \ + ../../modules/api_scilab/includes/api_boolean.h \ + ../../modules/api_scilab/includes/api_boolean_sparse.h \ + ../../modules/api_scilab/includes/api_pointer.h \ + ../../modules/api_scilab/includes/api_list.h \ + ../../modules/api_scilab/includes/api_error.h \ + ../../modules/api_scilab/includes/api_handle.h \ + ../../modules/api_scilab/includes/api_optional.h \ + ../../modules/core/includes/stack-optional.h \ + ../../modules/api_scilab/includes/api_hypermat.h \ + ../../modules/core/includes/core_math.h \ + ../../modules/core/includes/sci_types.h \ + ../../modules/core/includes/MALLOC.h \ + ../../modules/core/includes/sci_mem_alloc.h \ + ../../modules/core/includes/BOOL.h + +/usr/include/stdc-predef.h: + +/usr/include/string.h: + +/usr/include/features.h: + +/usr/include/x86_64-linux-gnu/sys/cdefs.h: + +/usr/include/x86_64-linux-gnu/bits/wordsize.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs.h: + +/usr/include/x86_64-linux-gnu/gnu/stubs-64.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h: + +/usr/include/xlocale.h: + +/usr/include/x86_64-linux-gnu/bits/string.h: + +/usr/include/x86_64-linux-gnu/bits/string2.h: + +/usr/include/endian.h: + +/usr/include/x86_64-linux-gnu/bits/endian.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap.h: + +/usr/include/x86_64-linux-gnu/bits/types.h: + +/usr/include/x86_64-linux-gnu/bits/typesizes.h: + +/usr/include/x86_64-linux-gnu/bits/byteswap-16.h: + +/usr/include/stdlib.h: + +/usr/include/x86_64-linux-gnu/bits/string3.h: + +/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h: + +/usr/include/stdio.h: + +/usr/include/libio.h: + +/usr/include/_G_config.h: + +/usr/include/wchar.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h: + +/usr/include/x86_64-linux-gnu/bits/stdio_lim.h: + +/usr/include/x86_64-linux-gnu/bits/sys_errlist.h: + +/usr/include/x86_64-linux-gnu/bits/stdio.h: + +/usr/include/x86_64-linux-gnu/bits/stdio2.h: + +/usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h: + +../../modules/api_scilab/includes/api_scilab.h: + +../../modules/core/includes/stack-c.h: + +../../modules/core/includes/core_math.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/limits.h: + +/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed/syslimits.h: + +/usr/include/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix1_lim.h: + +/usr/include/x86_64-linux-gnu/bits/local_lim.h: + +/usr/include/linux/limits.h: + +/usr/include/x86_64-linux-gnu/bits/posix2_lim.h: + +/usr/include/math.h: + +/usr/include/x86_64-linux-gnu/bits/math-vector.h: + +/usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h: + +/usr/include/x86_64-linux-gnu/bits/huge_val.h: + +/usr/include/x86_64-linux-gnu/bits/huge_valf.h: + +/usr/include/x86_64-linux-gnu/bits/huge_vall.h: + +/usr/include/x86_64-linux-gnu/bits/inf.h: + +/usr/include/x86_64-linux-gnu/bits/nan.h: + +/usr/include/x86_64-linux-gnu/bits/mathdef.h: + +/usr/include/x86_64-linux-gnu/bits/mathcalls.h: + +/usr/include/x86_64-linux-gnu/bits/mathinline.h: + +/usr/include/x86_64-linux-gnu/bits/waitflags.h: + +/usr/include/x86_64-linux-gnu/bits/waitstatus.h: + +/usr/include/x86_64-linux-gnu/sys/types.h: + +/usr/include/time.h: + +/usr/include/x86_64-linux-gnu/sys/select.h: + +/usr/include/x86_64-linux-gnu/bits/select.h: + +/usr/include/x86_64-linux-gnu/bits/sigset.h: + +/usr/include/x86_64-linux-gnu/bits/time.h: + +/usr/include/x86_64-linux-gnu/bits/select2.h: + +/usr/include/x86_64-linux-gnu/sys/sysmacros.h: + +/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h: + +/usr/include/alloca.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib-float.h: + +/usr/include/x86_64-linux-gnu/bits/stdlib.h: + +../../modules/core/includes/stack-def.h: + +../../modules/core/includes/machine.h: + +../../modules/core/includes/stackTypeVariable.h: + +../../modules/core/includes/BOOL.h: + +../../modules/core/includes/doublecomplex.h: + +../../modules/core/includes/stack1.h: + +../../modules/core/includes/scisparse.h: + +../../modules/core/includes/stack2.h: + +../../modules/core/includes/stack3.h: + +../../modules/core/includes/stack-optional.h: + +../../modules/core/includes/sci_types.h: + +../../modules/api_scilab/includes/api_common.h: + +../../modules/api_scilab/includes/api_scilab.h: + +../../modules/api_scilab/includes/api_double.h: + +../../modules/core/includes/doublecomplex.h: + +../../modules/api_scilab/includes/api_string.h: + +/usr/include/x86_64-linux-gnu/bits/wchar.h: + +/usr/include/x86_64-linux-gnu/bits/wchar2.h: + +../../modules/api_scilab/includes/api_int.h: + +../../modules/api_scilab/includes/api_poly.h: + +../../modules/api_scilab/includes/api_sparse.h: + +../../modules/api_scilab/includes/api_boolean.h: + +../../modules/api_scilab/includes/api_boolean_sparse.h: + +../../modules/api_scilab/includes/api_pointer.h: + +../../modules/api_scilab/includes/api_list.h: + +../../modules/api_scilab/includes/api_error.h: + +../../modules/api_scilab/includes/api_handle.h: + +../../modules/api_scilab/includes/api_optional.h: + +../../modules/core/includes/stack-optional.h: + +../../modules/api_scilab/includes/api_hypermat.h: + +../../modules/core/includes/core_math.h: + +../../modules/core/includes/sci_types.h: + +../../modules/core/includes/MALLOC.h: + +../../modules/core/includes/sci_mem_alloc.h: + +../../modules/core/includes/BOOL.h: diff --git a/modules/javasci/src/jni/.dirstamp b/modules/javasci/src/jni/.dirstamp new file mode 100755 index 000000000..e69de29bb --- /dev/null +++ b/modules/javasci/src/jni/.dirstamp diff --git a/modules/javasci/src/jni/.libs/libjavasci2_la-call_scilab_wrap.o b/modules/javasci/src/jni/.libs/libjavasci2_la-call_scilab_wrap.o Binary files differnew file mode 100755 index 000000000..d8872168b --- /dev/null +++ b/modules/javasci/src/jni/.libs/libjavasci2_la-call_scilab_wrap.o diff --git a/modules/javasci/src/jni/.libs/libjavasci2_la-putLists.o b/modules/javasci/src/jni/.libs/libjavasci2_la-putLists.o Binary files differnew file mode 100755 index 000000000..38cc962c2 --- /dev/null +++ b/modules/javasci/src/jni/.libs/libjavasci2_la-putLists.o diff --git a/modules/javasci/src/jni/call_scilab.i b/modules/javasci/src/jni/call_scilab.i new file mode 100755 index 000000000..aa2faeaae --- /dev/null +++ b/modules/javasci/src/jni/call_scilab.i @@ -0,0 +1,189 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * Copyright (C) 2011 - Scilab Enterprises - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + +/* Call_Scilab.i */ +/** + * Windows: swig -java -package org.scilab.modules.javasci -outdir ../java/org/scilab/modules/javasci/ call_scilab.i + * Other: Use the option --enable-build-swig to the configure +*/ + +//%rename(ScilabTypeEnum) sci_types; + +%module Call_Scilab +%{ +#include "BOOL.h" +#define ENABLE_HELPERS +#include "javasci2_helper.h" +#include "MALLOC.h" +#include "../../../call_scilab/includes/call_scilab.h" +#include "../../../call_scilab/includes/fromjava.h" +#include "../../../api_scilab/includes/api_scilab.h" +#include "../../../output_stream/includes/lasterror.h" +#include "../../../modules/graphic_objects/includes/FigureList.h" +#include "../../../core/includes/sci_types.h" +%} +%include "../../../jvm/src/jni/scilab_typemaps.i" + +%import "../../../types/src/jni/sci_types.i" + +#ifdef SWIGJAVA + +/* JavaDoc for Call_ScilabJNI class */ +%pragma(java) jniclassclassmodifiers=%{ +/* It is generated code. Disable checkstyle */ +//CHECKSTYLE:OFF + /** + * Connector for Javasci v2. + * This class should <b>not</b> be used directly + * @see org.scilab.modules.javasci.Scilab + * @author DIGITEO - Sylvestre LEDRU + */ +class%} + +/* Constructor for Call_ScilabJNI class */ +%pragma(java) jniclasscode=" + /** + * Constructor + */ + protected Call_ScilabJNI() { + throw new UnsupportedOperationException(); + }"; + +/* static load of library */ +%pragma(java) jniclasscode=%{ + static { + try { + if (System.getProperty("os.name").toLowerCase().contains("windows")) { + System.loadLibrary("javasci"); + } else { + System.loadLibrary("javasci2"); + } + } catch (SecurityException e) { + System.err.println("A security manager exists and does not allow the loading of the specified dynamic library :"); + e.printStackTrace(System.err); + } catch (UnsatisfiedLinkError e) { + System.err.println("The native library javasci does not exist or cannot be found."); + e.printStackTrace(System.err); + } + } + + public final static native int putList(String varNmae, Object list, char type); +%} + +/* JavaDoc for Call_Scilab class */ +%pragma(java) moduleclassmodifiers=" +import org.scilab.modules.types.ScilabTypeEnum; +import org.scilab.modules.types.ScilabIntegerTypeEnum; + + /** + * Connector for Javasci v2. + * This class should <b>not</b> be used directly + * @see org.scilab.modules.javasci.Scilab + * @author DIGITEO - Sylvestre LEDRU + */ +public class"; + +/* Constructor for Call_Scilab class */ +%pragma(java) modulecode=" + /** + * Constructor + */ + protected Call_Scilab() { + throw new UnsupportedOperationException(); + }"; + +#endif + + +int Call_ScilabOpen(char* SCIpath, BOOL advancedMode, char *ScilabStartup, int Stacksize); + +BOOL TerminateScilab(char *ScilabQuit); + +int SendScilabJob(char *job); + +int SendScilabJobs(char **jobs,int numberjobs); + +// Direct access to the Scilab function (no helper) +void SetFromJavaToON(void); + +// Direct access to the Scilab function (no helper) +%rename(isGraphicOpened) sciHasFigures; +BOOL sciHasFigures( void ); + +// Direct access to the Scilab function (no helper) +%rename(GetLastErrorCode) getLastErrorValue; +int getLastErrorValue(void); + +BOOL isExistingVariable(char* varname); + +%rename(getLastErrorMessage) getLastErrorMessageSingle; +const char* getLastErrorMessageSingle(); + +sci_types getVariableType(char *varname); + +sci_int_types getIntegerPrecision(char* varname); + +%rename(isComplex) isComplexVar; +BOOL isComplexVar(char* varname); + +%include "call_scilab_java_typemaps_string.i" +// string +int putString(char* variableName, char **variable, int nbRow, int nbCol); + +// This position matters. It will apply only to the following lines +%include "call_scilab_java_typemaps.i" + +int putDoubleComplex(char * variableName, double variable[], int nbRow, int nbCol, double imag[], int nbRowI, int nbColI); + +// double (default Scilab type) +int putDouble(char * variableName, double variable[], int nbRow, int nbCol); + +// boolean (%t / %f) +int putBoolean(char * variableName, BOOL variable[], int nbRow, int nbCol); + +// byte/char = int8 +int putByte(char * variableName, byte variable[], int nbRow, int nbCol); + +int putUnsignedByte(char * variableName, byte variable[], int nbRow, int nbCol); + +// short = int16 +int putShort(char * variableName, short variable[], int nbRow, int nbCol); + +int putUnsignedShort(char * variableName, unsigned short variable[], int nbRow, int nbCol); + +// int = int32 +int putInt(char * variableName, int variable[], int nbRow, int nbCol); + +int putUnsignedInt(char * variableName, unsigned int variable[], int nbRow, int nbCol); + +#ifdef __SCILAB_INT64__ +// long = int64 +int putLong(char * variableName, long variable[], int nbRow, int nbCol); + +int putUnsignedLong(char * variableName, unsigned long variable[], int nbRow, int nbCol); +#endif + +// This position matters. It will apply only to the following lines +%include "call_scilab_java_typemaps_sparse.i" + +int putSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL); + +int putComplexSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL, double * data, int dataL, double * imag, int imagL); + +int putBooleanSparse(char * variableName, int nbRow, int nbCol, int * nbRowItem, int nbRowItemL, int * colPos, int colPosL); + +// This position matters. It will apply only to the following lines +%include "call_scilab_java_typemaps_poly.i" + +int putPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef); +int putComplexPolynomial(char * variableName, char * polyVarName, double ** data, int nbRow, int nbCol, int * nbCoef, double ** imag, int nbRowI, int nbColI, int * nbCoefI); diff --git a/modules/javasci/src/jni/call_scilab_java_typemaps.i b/modules/javasci/src/jni/call_scilab_java_typemaps.i new file mode 100755 index 000000000..f37cc2b47 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_java_typemaps.i @@ -0,0 +1,111 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + + +////////////////////////////////////////////// + + + +////////////////////////////////////////////// + +%define JAVASCI_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JAVAPRIMITIVETYPE) + +%typemap(jni) (CTYPE *) "jobjectArray" +%typemap(jtype) (CTYPE *) "JAVAPRIMITIVETYPE[][]" +%typemap(jstype) (CTYPE *) "JAVAPRIMITIVETYPE[][]" +%typemap(javain) CTYPE *OUTVALUE "$javainput" +%typemap(javaout) (CTYPE *) { + return $jnicall; +} + + +%typemap(javain) CTYPE[ANY], CTYPE[] "$javainput" + +////////////////////////// + +//%include "arrays_java.i" + +/* Transform the input datatype CTYPE[] to JAVAPRIMITIVETYPE[][] to facilitate the +matching in Java */ +%typemap(jni) CTYPE[] "jobjectArray" +%typemap(jtype) CTYPE[] "JAVAPRIMITIVETYPE[][]" +%typemap(jstype) CTYPE[] "JAVAPRIMITIVETYPE[][]" + + +%typemap(argout) (CTYPE variable[], int nbRow, int nbCol) { +// Specific target because it was freeing the wrong argument + free($1); +} + + +%typemap(in) (CTYPE variable[], int nbRow, int nbCol) { +// Convert the CTYPE[][] => CTYPE * + int i = 0, j = 0; + $2 = (*jenv)->GetArrayLength(jenv, $input); + $3 = 0; + $1 = NULL; + + + for (; i < $2; i++) + { + jboolean isCopy = JNI_FALSE; + ##JNITYPE##* element = NULL; + ##JNITYPE##Array oneDim = (##JNITYPE##Array)(*jenv)->GetObjectArrayElement(jenv, $input, i); + if ($3 == 0) + { + /* First time we are here, init + create the array where we store the data */ + $3 = (*jenv)->GetArrayLength(jenv, oneDim); + $1 = (CTYPE*)malloc(sizeof(CTYPE) * $2 * $3); + } + isCopy = JNI_FALSE; + element = (##JNITYPE##*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < $3; j++) + { + $1[j * $2 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } +} + +%typemap(in) (CTYPE imag[], int nbRowI, int nbColI) = (CTYPE variable[], int nbRow, int nbCol); +%typemap(argout) (CTYPE imag[], int nbRowI, int nbColI) = (CTYPE variable[], int nbRow, int nbCol); +%enddef + +// See SWIG documentation for the full list: +// http://www.swig.org/Doc1.3/Java.html#default_primitive_type_mappings + +// Scilab: int8 +JAVASCI_ARRAYS_IMPL(byte, jbyte, Byte, byte) /* signed char[] */ +JAVASCI_ARRAYS_IMPL(unsigned char, jshort, Short, jshort) /* unsigned char */ + +// Scilab: int16 + +JAVASCI_ARRAYS_IMPL(short, jshort, Short, short) /* short[] */ +JAVASCI_ARRAYS_IMPL(unsigned short, jchar, Char, short) /* unsigned short[] */ + +// Scilab: int32 +JAVASCI_ARRAYS_IMPL(int, jint, Int, int) /* int[] */ +JAVASCI_ARRAYS_IMPL(unsigned int, jint, Int, int) /* unsigned int[] */ + +#ifdef __SCILAB_INT64__ +// Scilab: int64 +JAVASCI_ARRAYS_IMPL(long, jint, int, long) /* long[] */ +JAVASCI_ARRAYS_IMPL(unsigned long, jlong, Long, long) /* unsigned long[] */ +#endif + +//JAVASCI_ARRAYS_IMPL(float, jfloat, Float, float, ) /* float[] */ +// Scilab: double +JAVASCI_ARRAYS_IMPL(double, jdouble, Double, double) /* double[] */ +// Scilab: boolean +JAVASCI_ARRAYS_IMPL(BOOL, jboolean, Boolean, boolean) /* double[] */ diff --git a/modules/javasci/src/jni/call_scilab_java_typemaps_complex.i b/modules/javasci/src/jni/call_scilab_java_typemaps_complex.i new file mode 100755 index 000000000..15de13ac6 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_java_typemaps_complex.i @@ -0,0 +1,53 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + + +%define JAVASCI_COMPLEX_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JAVAPRIMITIVETYPE, JNICODE) + +/* Transform the input datatype CTYPE[] to JAVAPRIMITIVETYPE[][] to facilitate the +matching in Java */ +%typemap(jni) CTYPE[] "jobjectArray" +%typemap(jtype) CTYPE[] "JAVAPRIMITIVETYPE[]" +%typemap(jstype) CTYPE[] "JAVAPRIMITIVETYPE[]" + +%typemap(argout) (CTYPE variable[], int nbRow, int nbCol) { +// Specific target because it was freeing the wrong argument +} + +%typemap(in) (CTYPE variable[], int nbRow, int nbCol) { +// Convert the CTYPE[][] => CTYPE * + $2 = (*jenv)->GetArrayLength(jenv, $input); + $3 = 0; + $1 = NULL; + int i=0, j=0; + ##JNITYPE## *element = NULL; + + for(i=0; i<$2; i++) { + ##JNITYPE##Array oneDim=(##JNITYPE##Array)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if ($3==0) { + /* First time we are here, init + create the array where we store the data */ + $3 = (*jenv)->GetArrayLength(jenv, oneDim); + $1 = (CTYPE*)malloc(sizeof(##CTYPE##)*arg3*arg4); + } + element = (*jenv)->Get##JAVATYPE##ArrayElements(jenv, oneDim, 0); + + for(j=0; j<$3; j++) { + $1[j*$2+i]=element[j]; + } + } + +} +%enddef + + + +JAVASCI_COMPLEX_ARRAYS_IMPL(double, jdouble, Double, double, "[D") /* double[] */ diff --git a/modules/javasci/src/jni/call_scilab_java_typemaps_poly.i b/modules/javasci/src/jni/call_scilab_java_typemaps_poly.i new file mode 100755 index 000000000..6c2c57b22 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_java_typemaps_poly.i @@ -0,0 +1,82 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + + +////////////////////////////////////////////// + + + +////////////////////////////////////////////// + +%define JAVASCI_POLY_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JAVAPRIMITIVETYPE) + +%typemap(jni) (CTYPE **) "jobjectArray" +%typemap(jtype) (CTYPE **) "JAVAPRIMITIVETYPE[][][]" +%typemap(jstype) (CTYPE **) "JAVAPRIMITIVETYPE[][][]" +%typemap(javain) (CTYPE **) "$javainput" +%typemap(javaout) CTYPE** { + return $jnicall; +} + +////////////////////////// + +%typemap(argout) (CTYPE ** data, int nbRow, int nbCol, int * nbCoef) { +// Specific target because it was freeing the wrong argument + int i = 0; + for (; i < $2 * $3; i++) + { + FREE($1[i]); + } + FREE($1); + FREE($4); +} + + +%typemap(in) (CTYPE ** data, int nbRow, int nbCol, int * nbCoef) { +// Convert the CTYPE[][] => CTYPE * + int i = 0, j = 0, k = 0; + $2 = (*jenv)->GetArrayLength(jenv, $input); + $3 = 0; + $1 = NULL; + + for (; i < $2; i++) { + jobjectArray dblDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, $input, i); + if ($3 == 0) { + /* First time we are here, init + create the array where we store the data */ + $3 = (*jenv)->GetArrayLength(jenv, dblDim); + $1 = (CTYPE**)malloc(sizeof(##CTYPE##*) * $2 * $3); + $4 = (int*)malloc(sizeof(int) * $2 * $3); + } + for (j = 0; j < $3; j++) + { + ##JNITYPE##Array oneDim = (##JNITYPE##Array)(*jenv)->GetObjectArrayElement(jenv, dblDim, j); + jboolean isCopy = JNI_FALSE; + ##JNITYPE##* element = NULL; + $4[j * $2 + i] = (*jenv)->GetArrayLength(jenv, oneDim); + $1[j * $2 + i] = (##CTYPE##*)MALLOC(sizeof(##JNITYPE##) * $4[j * $2 + i]); + isCopy = JNI_FALSE; + element = (##JNITYPE##*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + memcpy($1[j * $2 + i], element, sizeof(##JNITYPE##) * $4[j * $2 + i]); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, dblDim); + } + } + +%typemap(argout) (CTYPE ** imag, int nbRowI, int nbColI, int * nbCoefI) = (CTYPE ** data, int nbRow, int nbCol, int * nbCoef); +%typemap(in) (CTYPE ** imag, int nbRowI, int nbColI, int * nbCoefI) = (CTYPE ** data, int nbRow, int nbCol, int * nbCoef); + +%enddef + +JAVASCI_POLY_ARRAYS_IMPL(double, jdouble, Double, double) /* double[] */ + diff --git a/modules/javasci/src/jni/call_scilab_java_typemaps_sparse.i b/modules/javasci/src/jni/call_scilab_java_typemaps_sparse.i new file mode 100755 index 000000000..986ede081 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_java_typemaps_sparse.i @@ -0,0 +1,63 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + + +////////////////////////////////////////////// + + + +////////////////////////////////////////////// + +%define JAVASCI_SPARSE_ARRAYS_IMPL(CTYPE, JNITYPE, JAVATYPE, JAVAPRIMITIVETYPE) + +%typemap(jni) (CTYPE *) "jobjectArray" +%typemap(jtype) (CTYPE *) "JAVAPRIMITIVETYPE[]" +%typemap(jstype) (CTYPE *) "JAVAPRIMITIVETYPE[]" +%typemap(javain) (CTYPE *) "$javainput" +%typemap(javaout) (CTYPE *) { + return $jnicall; +} + +////////////////////////// + +%typemap(argout) (CTYPE * nbRowItem, int nbRowItemL) { +// Specific target because it was freeing the wrong argument + FREE($1); +} + + +%typemap(in) (CTYPE * nbRowItem, int nbRowItemL) { + jboolean isCopy = JNI_FALSE; + ##JNITYPE##* element = NULL; +// Convert the CTYPE[][] => CTYPE * + $2 = (*jenv)->GetArrayLength(jenv, $input); + $1 = (CTYPE*)MALLOC(sizeof(##CTYPE##) * $2); + + isCopy = JNI_FALSE; + element = (##JNITYPE##*)(*jenv)->GetPrimitiveArrayCritical(jenv, $input, &isCopy); + memcpy($1, element, sizeof(##CTYPE##) * $2); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, $input, element, 0); + } + +%typemap(in) (CTYPE * colPos, int colPosL) = (CTYPE * nbRowItem, int nbRowItemL); +%typemap(argout) (CTYPE * colPos, int colPosL) = (CTYPE * nbRowItem, int nbRowItemL); +%typemap(in) (CTYPE * data, int dataL) = (CTYPE * nbRowItem, int nbRowItemL); +%typemap(argout) (CTYPE * data, int dataL) = (CTYPE * nbRowItem, int nbRowItemL); +%typemap(in) (CTYPE * imag, int imagL) = (CTYPE * nbRowItem, int nbRowItemL); +%typemap(argout) (CTYPE * imag, int imagL) = (CTYPE * nbRowItem, int nbRowItemL); +%enddef + +// See SWIG documentation for the full list: +// http://www.swig.org/Doc1.3/Java.html#default_primitive_type_mappings + +JAVASCI_SPARSE_ARRAYS_IMPL(double, jdouble, Double, double) /* double[] */ +JAVASCI_SPARSE_ARRAYS_IMPL(int, jint, Int, int) /* int[] */ diff --git a/modules/javasci/src/jni/call_scilab_java_typemaps_string.i b/modules/javasci/src/jni/call_scilab_java_typemaps_string.i new file mode 100755 index 000000000..fd4235af2 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_java_typemaps_string.i @@ -0,0 +1,110 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ + +%typemap(in) (char* variableName, int *nbRow, int *nbCol) { + $2 = &nbRow; + $3 = &nbCol; + $1 = 0; + if ($input) { + $1 = (char *)(*jenv)->GetStringUTFChars(jenv, $input, 0); + if (!$1) return 0; + } +} + +// retrieve from the native code a char ** => String[][] (java) +%typemap(out) (char **) (int nbRow, int nbCol) { + const jclass clazz = (*jenv)->FindClass(jenv, "java/lang/Object"); + int i = 0, j = 0; + + jresult = (*jenv)->NewObjectArray(jenv, nbRow,clazz, NULL); + + for (; i < nbRow; i++) + { + jobjectArray jarray = (*jenv)->NewObjectArray(jenv, nbCol, clazz, NULL); + if (jarray == NULL) + { + printf("Could not allocate\n"); + fflush(NULL); + } + + for (j = 0; j < nbCol; j++) { + /* Scilab is storing matrice cols by cols while Java is doing it + row by row. Therefor, we need to convert it */ + jstring temp_string = (*jenv)->NewStringUTF(jenv, (const char *)result[nbRow*j+i]); + (*jenv)->SetObjectArrayElement(jenv, jarray, j, temp_string); + (*jenv)->DeleteLocalRef(jenv, temp_string); + } + + (*jenv)->SetObjectArrayElement(jenv, jresult, i, jarray); + (*jenv)->DeleteLocalRef(jenv, jarray); + } + + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + free(result); +} + +/* Transform the input datatype char[] to char[][] to facilitate the +matching in Java */ +%typemap(jni) (char **) "jobjectArray" +%typemap(jtype) (char **) "String[][]" +%typemap(jstype) (char **) "String[][]" + +%typemap(argout) (char **variable, int nbRow, int nbCol) { +// Specific target because it was freeing the wrong argument + int i = 0; + for (; i < $2 * $3; i++) + { + FREE($1[i]); + } + FREE($1); +} + +%typemap(in) (char **variable, int nbRow, int nbCol) { + int i=0, j=0; + // Convert the String[][] => char * + $2 = (*jenv)->GetArrayLength(jenv, $input); + $3 = 0; + $1 = NULL; + + for (; i < $2; i++) + { + jobjectArray oneDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, $input, i); + if ($3 == 0) + { + /* First time we are here, init + create the array where we store the data */ + $3 = (*jenv)->GetArrayLength(jenv, oneDim); + $1 = (char**)malloc(sizeof(char*) * $2 * $3); + } + for (j = 0; j < $3; j++) + { + jstring j_string = (jstring)(*jenv)->GetObjectArrayElement(jenv, oneDim, j); + jboolean isCopy = JNI_FALSE; + char *str = (char *)(*jenv)->GetStringUTFChars(jenv, j_string, &isCopy); + $1[j * $2 + i] = (char*)MALLOC(sizeof(char)*(strlen(str) + 1)); + strcpy($1[j * $2 + i], str); + if (isCopy) + { + (*jenv)->ReleaseStringUTFChars(jenv, j_string, (const char *)str); + } + (*jenv)->DeleteLocalRef(jenv, j_string); + } + (*jenv)->DeleteLocalRef(jenv, oneDim); + } +} + +%typemap(javain) char[ANY], char[] "$javainput" + +%typemap(jtype) (char* variableName, int *nbRow, int *nbCol) "String" +%typemap(jstype) (char* variableName, int *nbRow, int *nbCol) "String" + + + diff --git a/modules/javasci/src/jni/call_scilab_wrap.c b/modules/javasci/src/jni/call_scilab_wrap.c new file mode 100755 index 000000000..820256049 --- /dev/null +++ b/modules/javasci/src/jni/call_scilab_wrap.c @@ -0,0 +1,1480 @@ +/* ---------------------------------------------------------------------------- + * This file was automatically generated by SWIG (http://www.swig.org). + * Version 2.0.7 + * + * This file is not intended to be easily readable and contains a number of + * coding conventions designed to improve portability and efficiency. Do not make + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. + * ----------------------------------------------------------------------------- */ + +#define SWIGJAVA + +/* ----------------------------------------------------------------------------- + * This section contains generic SWIG labels for method/variable + * declarations/attributes, and other compiler dependent labels. + * ----------------------------------------------------------------------------- */ + +/* template workaround for compilers that cannot correctly implement the C++ standard */ +#ifndef SWIGTEMPLATEDISAMBIGUATOR +# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) +# define SWIGTEMPLATEDISAMBIGUATOR template +# elif defined(__HP_aCC) +/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ +/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ +# define SWIGTEMPLATEDISAMBIGUATOR template +# else +# define SWIGTEMPLATEDISAMBIGUATOR +# endif +#endif + +/* inline attribute */ +#ifndef SWIGINLINE +# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) +# define SWIGINLINE inline +# else +# define SWIGINLINE +# endif +#endif + +/* attribute recognised by some compilers to avoid 'unused' warnings */ +#ifndef SWIGUNUSED +# if defined(__GNUC__) +# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +# elif defined(__ICC) +# define SWIGUNUSED __attribute__ ((__unused__)) +# else +# define SWIGUNUSED +# endif +#endif + +#ifndef SWIG_MSC_UNSUPPRESS_4505 +# if defined(_MSC_VER) +# pragma warning(disable : 4505) /* unreferenced local function has been removed */ +# endif +#endif + +#ifndef SWIGUNUSEDPARM +# ifdef __cplusplus +# define SWIGUNUSEDPARM(p) +# else +# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# endif +#endif + +/* internal SWIG method */ +#ifndef SWIGINTERN +# define SWIGINTERN static SWIGUNUSED +#endif + +/* internal inline SWIG method */ +#ifndef SWIGINTERNINLINE +# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE +#endif + +/* exporting methods */ +#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif +#endif + +#ifndef SWIGEXPORT +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# if defined(STATIC_LINKED) +# define SWIGEXPORT +# else +# define SWIGEXPORT __declspec(dllexport) +# endif +# else +# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) +# define SWIGEXPORT __attribute__ ((visibility("default"))) +# else +# define SWIGEXPORT +# endif +# endif +#endif + +/* calling conventions for Windows */ +#ifndef SWIGSTDCALL +# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) +# define SWIGSTDCALL __stdcall +# else +# define SWIGSTDCALL +# endif +#endif + +/* Deal with Microsoft's attempt at deprecating C standard runtime functions */ +#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) +# define _CRT_SECURE_NO_DEPRECATE +#endif + +/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ +#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) +# define _SCL_SECURE_NO_DEPRECATE +#endif + + + +/* Fix for jlong on some versions of gcc on Windows */ +#if defined(__GNUC__) && !defined(__INTEL_COMPILER) + typedef long long __int64; +#endif + +/* Fix for jlong on 64-bit x86 Solaris */ +#if defined(__x86_64) +# ifdef _LP64 +# undef _LP64 +# endif +#endif + +#include <jni.h> +#include <stdlib.h> +#include <string.h> + + +/* Support for throwing Java exceptions */ +typedef enum { + SWIG_JavaOutOfMemoryError = 1, + SWIG_JavaIOException, + SWIG_JavaRuntimeException, + SWIG_JavaIndexOutOfBoundsException, + SWIG_JavaArithmeticException, + SWIG_JavaIllegalArgumentException, + SWIG_JavaNullPointerException, + SWIG_JavaDirectorPureVirtual, + SWIG_JavaUnknownError +} SWIG_JavaExceptionCodes; + +typedef struct { + SWIG_JavaExceptionCodes code; + const char *java_exception; +} SWIG_JavaExceptions_t; + + +static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) { + jclass excep; + static const SWIG_JavaExceptions_t java_exceptions[] = { + { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" }, + { SWIG_JavaIOException, "java/io/IOException" }, + { SWIG_JavaRuntimeException, "java/lang/RuntimeException" }, + { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" }, + { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" }, + { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" }, + { SWIG_JavaNullPointerException, "java/lang/NullPointerException" }, + { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" }, + { SWIG_JavaUnknownError, "java/lang/UnknownError" }, + { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" } + }; + const SWIG_JavaExceptions_t *except_ptr = java_exceptions; + + while (except_ptr->code != code && except_ptr->code) + except_ptr++; + + (*jenv)->ExceptionClear(jenv); + excep = (*jenv)->FindClass(jenv, except_ptr->java_exception); + if (excep) + (*jenv)->ThrowNew(jenv, excep, msg); +} + + +/* Contract support */ + +#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else + + +#include "BOOL.h" +#define ENABLE_HELPERS +#include "javasci2_helper.h" +#include "MALLOC.h" +#include "../../../call_scilab/includes/call_scilab.h" +#include "../../../call_scilab/includes/fromjava.h" +#include "../../../api_scilab/includes/api_scilab.h" +#include "../../../output_stream/includes/lasterror.h" +#include "../../../modules/graphic_objects/includes/FigureList.h" +#include "../../../core/includes/sci_types.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_Call_1ScilabOpen(JNIEnv *jenv, jclass jcls, jstring jarg1, jboolean jarg2, jstring jarg3, jint jarg4) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + BOOL arg2 ; + char *arg3 = (char *) 0 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + if (jarg2 == JNI_TRUE) arg2 = TRUE; + else arg2 = FALSE; + } + arg3 = 0; + if (jarg3) { + arg3 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg3, 0); + if (!arg3) return 0; + } + arg4 = (int)jarg4; + result = (int)Call_ScilabOpen(arg1,arg2,arg3,arg4); + jresult = (jint)result; + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + if (arg3) (*jenv)->ReleaseStringUTFChars(jenv, jarg3, (const char *)arg3); + return jresult; +} + + +SWIGEXPORT jboolean JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_TerminateScilab(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jboolean jresult = 0 ; + char *arg1 = (char *) 0 ; + BOOL result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = TerminateScilab(arg1); + { + if (result) jresult = JNI_TRUE ; + else jresult = JNI_FALSE ; + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_SendScilabJob(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = (int)SendScilabJob(arg1); + jresult = (jint)result; + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_SendScilabJobs(JNIEnv *jenv, jclass jcls, jobjectArray jarg1, jint jarg2) { + jint jresult = 0 ; + char **arg1 = (char **) 0 ; + int arg2 ; + jint size1 ; + int result; + + (void)jenv; + (void)jcls; + { + int i = 0; + size1 = (*jenv)->GetArrayLength(jenv, jarg1); + arg1 = (char **) MALLOC((size1+1)*sizeof(char *)); + /* make a copy of each string */ + for (i = 0; i<size1; i++) { + jstring j_string = (jstring)(*jenv)->GetObjectArrayElement(jenv, jarg1, i); + const char * c_string = (*jenv)->GetStringUTFChars(jenv, j_string, 0); + arg1[i] = MALLOC((strlen(c_string)+1)*sizeof(const char *)); + strcpy(arg1[i], c_string); + (*jenv)->ReleaseStringUTFChars(jenv, j_string, c_string); + (*jenv)->DeleteLocalRef(jenv, j_string); + } + arg1[i] = 0; + } + arg2 = (int)jarg2; + result = (int)SendScilabJobs(arg1,arg2); + jresult = (jint)result; + { + int i; + for (i=0; i<size1-1; i++) { + FREE(arg1[i]); + arg1[i] = NULL; + } + FREE(arg1); + arg1 = NULL; + } + return jresult; +} + + +SWIGEXPORT void JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_SetFromJavaToON(JNIEnv *jenv, jclass jcls) { + (void)jenv; + (void)jcls; + SetFromJavaToON(); +} + + +SWIGEXPORT jboolean JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_isGraphicOpened(JNIEnv *jenv, jclass jcls) { + jboolean jresult = 0 ; + BOOL result; + + (void)jenv; + (void)jcls; + result = sciHasFigures(); + { + if (result) jresult = JNI_TRUE ; + else jresult = JNI_FALSE ; + } + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_GetLastErrorCode(JNIEnv *jenv, jclass jcls) { + jint jresult = 0 ; + int result; + + (void)jenv; + (void)jcls; + result = (int)getLastErrorValue(); + jresult = (jint)result; + return jresult; +} + + +SWIGEXPORT jboolean JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_isExistingVariable(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jboolean jresult = 0 ; + char *arg1 = (char *) 0 ; + BOOL result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = isExistingVariable(arg1); + { + if (result) jresult = JNI_TRUE ; + else jresult = JNI_FALSE ; + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jstring JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_getLastErrorMessage(JNIEnv *jenv, jclass jcls) { + jstring jresult = 0 ; + char *result = 0 ; + + (void)jenv; + (void)jcls; + result = (char *)getLastErrorMessageSingle(); + { + if (result != NULL) + { + jresult = (*jenv)->NewStringUTF(jenv, (const char *)result); + FREE(result); + result = NULL; + } + } + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_getVariableType(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + sci_types result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = (sci_types)getVariableType(arg1); + jresult = (jint)result; + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_getIntegerPrecision(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + sci_int_types result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = (sci_int_types)getIntegerPrecision(arg1); + jresult = (jint)result; + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jboolean JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_isComplex(JNIEnv *jenv, jclass jcls, jstring jarg1) { + jboolean jresult = 0 ; + char *arg1 = (char *) 0 ; + BOOL result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + result = isComplexVar(arg1); + { + if (result) jresult = JNI_TRUE ; + else jresult = JNI_FALSE ; + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putString(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + char **arg2 = (char **) 0 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + int i=0, j=0; + // Convert the String[][] => char * + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + for (; i < arg3; i++) + { + jobjectArray oneDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (char**)malloc(sizeof(char*) * arg3 * arg4); + } + for (j = 0; j < arg4; j++) + { + jstring j_string = (jstring)(*jenv)->GetObjectArrayElement(jenv, oneDim, j); + jboolean isCopy = JNI_FALSE; + char *str = (char *)(*jenv)->GetStringUTFChars(jenv, j_string, &isCopy); + arg2[j * arg3 + i] = (char*)MALLOC(sizeof(char)*(strlen(str) + 1)); + strcpy(arg2[j * arg3 + i], str); + if (isCopy) + { + (*jenv)->ReleaseStringUTFChars(jenv, j_string, (const char *)str); + } + (*jenv)->DeleteLocalRef(jenv, j_string); + } + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putString(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + int i = 0; + for (; i < arg3 * arg4; i++) + { + FREE(arg2[i]); + } + FREE(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putDoubleComplex(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2, jobjectArray jarg5) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + double *arg2 ; + int arg3 ; + int arg4 ; + double *arg5 ; + int arg6 ; + int arg7 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the double[][] => double * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (double*)malloc(sizeof(double) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + { + // Convert the double[][] => double * + int i = 0, j = 0; + arg6 = (*jenv)->GetArrayLength(jenv, jarg5); + arg7 = 0; + arg5 = NULL; + + + for (; i < arg6; i++) + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, jarg5, i); + if (arg7 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg7 = (*jenv)->GetArrayLength(jenv, oneDim); + arg5 = (double*)malloc(sizeof(double) * arg6 * arg7); + } + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg7; j++) + { + arg5[j * arg6 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putDoubleComplex(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + { + // Specific target because it was freeing the wrong argument + free(arg5); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putDouble(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + double *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the double[][] => double * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (double*)malloc(sizeof(double) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putDouble(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putBoolean(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + BOOL *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the BOOL[][] => BOOL * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jboolean* element = NULL; + jbooleanArray oneDim = (jbooleanArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (BOOL*)malloc(sizeof(BOOL) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jboolean*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putBoolean(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putByte(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + byte *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the byte[][] => byte * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jbyte* element = NULL; + jbyteArray oneDim = (jbyteArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (byte*)malloc(sizeof(byte) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jbyte*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putByte(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putUnsignedByte(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + byte *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the byte[][] => byte * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jbyte* element = NULL; + jbyteArray oneDim = (jbyteArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (byte*)malloc(sizeof(byte) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jbyte*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putUnsignedByte(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putShort(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + short *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the short[][] => short * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jshort* element = NULL; + jshortArray oneDim = (jshortArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (short*)malloc(sizeof(short) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jshort*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putShort(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putUnsignedShort(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + unsigned short *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the unsigned short[][] => unsigned short * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jchar* element = NULL; + jcharArray oneDim = (jcharArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (unsigned short*)malloc(sizeof(unsigned short) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jchar*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putUnsignedShort(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putInt(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + int *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the int[][] => int * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + jintArray oneDim = (jintArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (int*)malloc(sizeof(int) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putInt(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putUnsignedInt(JNIEnv *jenv, jclass jcls, jstring jarg1, jobjectArray jarg2) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + unsigned int *arg2 ; + int arg3 ; + int arg4 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + { + // Convert the unsigned int[][] => unsigned int * + int i = 0, j = 0; + arg3 = (*jenv)->GetArrayLength(jenv, jarg2); + arg4 = 0; + arg2 = NULL; + + + for (; i < arg3; i++) + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + jintArray oneDim = (jintArray)(*jenv)->GetObjectArrayElement(jenv, jarg2, i); + if (arg4 == 0) + { + /* First time we are here, init + create the array where we store the data */ + arg4 = (*jenv)->GetArrayLength(jenv, oneDim); + arg2 = (unsigned int*)malloc(sizeof(unsigned int) * arg3 * arg4); + } + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + + for (j = 0; j < arg4; j++) + { + arg2[j * arg3 + i] = element[j]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + } + result = (int)putUnsignedInt(arg1,arg2,arg3,arg4); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + free(arg2); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putSparse(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2, jint jarg3, jobjectArray jarg4, jobjectArray jarg6, jobjectArray jarg8) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + int arg2 ; + int arg3 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int *arg6 = (int *) 0 ; + int arg7 ; + double *arg8 = (double *) 0 ; + int arg9 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + arg2 = (int)jarg2; + arg3 = (int)jarg3; + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg5 = (*jenv)->GetArrayLength(jenv, jarg4); + arg4 = (int*)MALLOC(sizeof(int) * arg5); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg4, &isCopy); + memcpy(arg4, element, sizeof(int) * arg5); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg4, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg7 = (*jenv)->GetArrayLength(jenv, jarg6); + arg6 = (int*)MALLOC(sizeof(int) * arg7); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg6, &isCopy); + memcpy(arg6, element, sizeof(int) * arg7); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg6, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + // Convert the double[][] => double * + arg9 = (*jenv)->GetArrayLength(jenv, jarg8); + arg8 = (double*)MALLOC(sizeof(double) * arg9); + + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg8, &isCopy); + memcpy(arg8, element, sizeof(double) * arg9); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg8, element, 0); + } + result = (int)putSparse(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + FREE(arg4); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg6); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg8); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putComplexSparse(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2, jint jarg3, jobjectArray jarg4, jobjectArray jarg6, jobjectArray jarg8, jobjectArray jarg10) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + int arg2 ; + int arg3 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int *arg6 = (int *) 0 ; + int arg7 ; + double *arg8 = (double *) 0 ; + int arg9 ; + double *arg10 = (double *) 0 ; + int arg11 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + arg2 = (int)jarg2; + arg3 = (int)jarg3; + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg5 = (*jenv)->GetArrayLength(jenv, jarg4); + arg4 = (int*)MALLOC(sizeof(int) * arg5); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg4, &isCopy); + memcpy(arg4, element, sizeof(int) * arg5); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg4, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg7 = (*jenv)->GetArrayLength(jenv, jarg6); + arg6 = (int*)MALLOC(sizeof(int) * arg7); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg6, &isCopy); + memcpy(arg6, element, sizeof(int) * arg7); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg6, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + // Convert the double[][] => double * + arg9 = (*jenv)->GetArrayLength(jenv, jarg8); + arg8 = (double*)MALLOC(sizeof(double) * arg9); + + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg8, &isCopy); + memcpy(arg8, element, sizeof(double) * arg9); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg8, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + // Convert the double[][] => double * + arg11 = (*jenv)->GetArrayLength(jenv, jarg10); + arg10 = (double*)MALLOC(sizeof(double) * arg11); + + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg10, &isCopy); + memcpy(arg10, element, sizeof(double) * arg11); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg10, element, 0); + } + result = (int)putComplexSparse(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10,arg11); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + FREE(arg4); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg6); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg8); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg10); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putBooleanSparse(JNIEnv *jenv, jclass jcls, jstring jarg1, jint jarg2, jint jarg3, jobjectArray jarg4, jobjectArray jarg6) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + int arg2 ; + int arg3 ; + int *arg4 = (int *) 0 ; + int arg5 ; + int *arg6 = (int *) 0 ; + int arg7 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + arg2 = (int)jarg2; + arg3 = (int)jarg3; + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg5 = (*jenv)->GetArrayLength(jenv, jarg4); + arg4 = (int*)MALLOC(sizeof(int) * arg5); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg4, &isCopy); + memcpy(arg4, element, sizeof(int) * arg5); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg4, element, 0); + } + { + jboolean isCopy = JNI_FALSE; + jint* element = NULL; + // Convert the int[][] => int * + arg7 = (*jenv)->GetArrayLength(jenv, jarg6); + arg6 = (int*)MALLOC(sizeof(int) * arg7); + + isCopy = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jarg6, &isCopy); + memcpy(arg6, element, sizeof(int) * arg7); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jarg6, element, 0); + } + result = (int)putBooleanSparse(arg1,arg2,arg3,arg4,arg5,arg6,arg7); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + FREE(arg4); + } + { + // Specific target because it was freeing the wrong argument + FREE(arg6); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putPolynomial(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jobjectArray jarg3) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + double **arg3 = (double **) 0 ; + int arg4 ; + int arg5 ; + int *arg6 = (int *) 0 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + arg2 = 0; + if (jarg2) { + arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0); + if (!arg2) return 0; + } + { + // Convert the double[][] => double * + int i = 0, j = 0, k = 0; + arg4 = (*jenv)->GetArrayLength(jenv, jarg3); + arg5 = 0; + arg3 = NULL; + + for (; i < arg4; i++) { + jobjectArray dblDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, jarg3, i); + if (arg5 == 0) { + /* First time we are here, init + create the array where we store the data */ + arg5 = (*jenv)->GetArrayLength(jenv, dblDim); + arg3 = (double**)malloc(sizeof(double*) * arg4 * arg5); + arg6 = (int*)malloc(sizeof(int) * arg4 * arg5); + } + for (j = 0; j < arg5; j++) + { + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDim, j); + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + arg6[j * arg4 + i] = (*jenv)->GetArrayLength(jenv, oneDim); + arg3[j * arg4 + i] = (double*)MALLOC(sizeof(jdouble) * arg6[j * arg4 + i]); + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + memcpy(arg3[j * arg4 + i], element, sizeof(jdouble) * arg6[j * arg4 + i]); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, dblDim); + } + } + result = (int)putPolynomial(arg1,arg2,arg3,arg4,arg5,arg6); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + int i = 0; + for (; i < arg4 * arg5; i++) + { + FREE(arg3[i]); + } + FREE(arg3); + FREE(arg6); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, (const char *)arg2); + return jresult; +} + + +SWIGEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putComplexPolynomial(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2, jobjectArray jarg3, jobjectArray jarg7) { + jint jresult = 0 ; + char *arg1 = (char *) 0 ; + char *arg2 = (char *) 0 ; + double **arg3 = (double **) 0 ; + int arg4 ; + int arg5 ; + int *arg6 = (int *) 0 ; + double **arg7 = (double **) 0 ; + int arg8 ; + int arg9 ; + int *arg10 = (int *) 0 ; + int result; + + (void)jenv; + (void)jcls; + arg1 = 0; + if (jarg1) { + arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0); + if (!arg1) return 0; + } + arg2 = 0; + if (jarg2) { + arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0); + if (!arg2) return 0; + } + { + // Convert the double[][] => double * + int i = 0, j = 0, k = 0; + arg4 = (*jenv)->GetArrayLength(jenv, jarg3); + arg5 = 0; + arg3 = NULL; + + for (; i < arg4; i++) { + jobjectArray dblDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, jarg3, i); + if (arg5 == 0) { + /* First time we are here, init + create the array where we store the data */ + arg5 = (*jenv)->GetArrayLength(jenv, dblDim); + arg3 = (double**)malloc(sizeof(double*) * arg4 * arg5); + arg6 = (int*)malloc(sizeof(int) * arg4 * arg5); + } + for (j = 0; j < arg5; j++) + { + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDim, j); + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + arg6[j * arg4 + i] = (*jenv)->GetArrayLength(jenv, oneDim); + arg3[j * arg4 + i] = (double*)MALLOC(sizeof(jdouble) * arg6[j * arg4 + i]); + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + memcpy(arg3[j * arg4 + i], element, sizeof(jdouble) * arg6[j * arg4 + i]); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, dblDim); + } + } + { + // Convert the double[][] => double * + int i = 0, j = 0, k = 0; + arg8 = (*jenv)->GetArrayLength(jenv, jarg7); + arg9 = 0; + arg7 = NULL; + + for (; i < arg8; i++) { + jobjectArray dblDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, jarg7, i); + if (arg9 == 0) { + /* First time we are here, init + create the array where we store the data */ + arg9 = (*jenv)->GetArrayLength(jenv, dblDim); + arg7 = (double**)malloc(sizeof(double*) * arg8 * arg9); + arg10 = (int*)malloc(sizeof(int) * arg8 * arg9); + } + for (j = 0; j < arg9; j++) + { + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDim, j); + jboolean isCopy = JNI_FALSE; + jdouble* element = NULL; + arg10[j * arg8 + i] = (*jenv)->GetArrayLength(jenv, oneDim); + arg7[j * arg8 + i] = (double*)MALLOC(sizeof(jdouble) * arg10[j * arg8 + i]); + isCopy = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy); + memcpy(arg7[j * arg8 + i], element, sizeof(jdouble) * arg10[j * arg8 + i]); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, dblDim); + } + } + result = (int)putComplexPolynomial(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10); + jresult = (jint)result; + { + // Specific target because it was freeing the wrong argument + int i = 0; + for (; i < arg4 * arg5; i++) + { + FREE(arg3[i]); + } + FREE(arg3); + FREE(arg6); + } + { + // Specific target because it was freeing the wrong argument + int i = 0; + for (; i < arg8 * arg9; i++) + { + FREE(arg7[i]); + } + FREE(arg7); + FREE(arg10); + } + if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1); + if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, (const char *)arg2); + return jresult; +} + + +#ifdef __cplusplus +} +#endif + diff --git a/modules/javasci/src/jni/libjavasci2_la-call_scilab_wrap.lo b/modules/javasci/src/jni/libjavasci2_la-call_scilab_wrap.lo new file mode 100755 index 000000000..ecc3ecee8 --- /dev/null +++ b/modules/javasci/src/jni/libjavasci2_la-call_scilab_wrap.lo @@ -0,0 +1,12 @@ +# src/jni/libjavasci2_la-call_scilab_wrap.lo - a libtool object file +# Generated by libtool (GNU libtool) 2.4.2 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/libjavasci2_la-call_scilab_wrap.o' + +# Name of the non-PIC object +non_pic_object=none + diff --git a/modules/javasci/src/jni/libjavasci2_la-putLists.lo b/modules/javasci/src/jni/libjavasci2_la-putLists.lo new file mode 100755 index 000000000..37b498302 --- /dev/null +++ b/modules/javasci/src/jni/libjavasci2_la-putLists.lo @@ -0,0 +1,12 @@ +# src/jni/libjavasci2_la-putLists.lo - a libtool object file +# Generated by libtool (GNU libtool) 2.4.2 +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# Name of the PIC object. +pic_object='.libs/libjavasci2_la-putLists.o' + +# Name of the non-PIC object +non_pic_object=none + diff --git a/modules/javasci/src/jni/putLists.c b/modules/javasci/src/jni/putLists.c new file mode 100755 index 000000000..dc11de084 --- /dev/null +++ b/modules/javasci/src/jni/putLists.c @@ -0,0 +1,948 @@ +/* + * 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.1-en.txt + * + */ +/*--------------------------------------------------------------------------*/ +#include <string.h> +#include <jni.h> +#include "api_scilab.h" +#include "stack-c.h" +#include "sci_types.h" +#include "MALLOC.h" +#include "BOOL.h" + +#ifdef __cplusplus +extern "C" { +#endif + + /*--------------------------------------------------------------------------*/ + SciErr sendList(JNIEnv * jenv, jobject list, int * parentList, int pos, char * varName, char listType); + JNIEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putList(JNIEnv *jenv, jclass cl, jstring jvarName, jobject list, jchar type); + /*--------------------------------------------------------------------------*/ + + JNIEXPORT jint JNICALL Java_org_scilab_modules_javasci_Call_1ScilabJNI_putList(JNIEnv *jenv, jclass cl, jstring jvarName, jobject list, jchar type) + { + char * varName = (char*)(*jenv)->GetStringUTFChars(jenv, jvarName, 0); + SciErr sciErr = sendList(jenv, list, 0, 0, varName, (char)type); + (*jenv)->ReleaseStringUTFChars(jenv, jvarName, (const char *)varName); + + if (sciErr.iErr) + { + return -1; + } + + return 0; + } + + SciErr sendList(JNIEnv * jenv, jobject list, int * parentList, int pos, char * varName, char listType) + { + int listLen = (*jenv)->GetArrayLength(jenv, list); + jboolean isCopy = JNI_FALSE; + jintArray jtypes = (jintArray)(*jenv)->GetObjectArrayElement(jenv, list, 0); + jint * types = (*jenv)->GetIntArrayElements(jenv, jtypes, &isCopy); + int i = 0; + SciErr sciErr; + int * currentList = 0; + if (parentList) + { + switch (listType) + { + case 'l' : + sciErr = createListInNamedList(pvApiCtx, varName, parentList, pos, listLen - 1, ¤tList); + break; + case 't' : + sciErr = createTListInNamedList(pvApiCtx, varName, parentList, pos, listLen - 1, ¤tList); + break; + case 'm' : + sciErr = createMListInNamedList(pvApiCtx, varName, parentList, pos, listLen - 1, ¤tList); + break; + } + } + else + { + //cleanStackListAddress(); + switch (listType) + { + case 'l' : + sciErr = createNamedList(pvApiCtx, varName, listLen - 1, ¤tList); + break; + case 't' : + sciErr = createNamedTList(pvApiCtx, varName, listLen - 1, ¤tList); + break; + case 'm' : + sciErr = createNamedMList(pvApiCtx, varName, listLen - 1, ¤tList); + break; + } + } + + if (sciErr.iErr) + { + (*jenv)->ReleaseIntArrayElements(jenv, jtypes, types, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, jtypes); + return sciErr; + } + + //pushListAddress(currentList); + + for (; i < listLen - 1; i++) + { + switch (types[i]) + { + case sci_matrix : + { + int nbCol = 0; + int j = 0, k = 0; + double * real = 0; + double * imag = 0; + int nbRow = 0; + + jobjectArray infos = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, list, i + 1); + int isReal = (*jenv)->GetArrayLength(jenv, infos) == 1; + jobjectArray data = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, infos, 0); + + if (!data) + { + // empty matrix + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + (*jenv)->DeleteLocalRef(jenv, infos); + break; + } + + nbRow = (*jenv)->GetArrayLength(jenv, data); + + if (isReal) + { + // Get the matrix rowsw + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + real = (double*)MALLOC(sizeof(double) * nbRow * nbCol); + } + + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + real[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, data); + + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, real); + FREE(real); + } + else + { + jobject imagData = (jobject)(*jenv)->GetObjectArrayElement(jenv, infos, 1); + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jdouble* elementR = NULL; + jdouble* elementI = NULL; + jdoubleArray oneDimR = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + jdoubleArray oneDimI = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, imagData, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDimR); + real = (double*)MALLOC(sizeof(double) * nbRow * nbCol); + imag = (double*)MALLOC(sizeof(double) * nbRow * nbCol); + } + + elementR = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDimR, &isCopy1); + isCopy1 = JNI_FALSE; + elementI = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDimI, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + real[k * nbRow + j] = elementR[k]; + imag[k * nbRow + j] = elementI[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDimR, elementR, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDimI, elementI, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDimR); + (*jenv)->DeleteLocalRef(jenv, oneDimI); + } + (*jenv)->DeleteLocalRef(jenv, data); + (*jenv)->DeleteLocalRef(jenv, imagData); + + sciErr = createComplexMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, real, imag); + FREE(real); + FREE(imag); + } + (*jenv)->DeleteLocalRef(jenv, infos); + break; + } + case sci_poly : + { + jobjectArray infos = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, list, i + 1); + jobject data = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, data); + int isReal = 0; + jstring js; + char * polyVarName = NULL; + int nbCol = 0; + int j = 0, k = 0; + double ** real = NULL; + double ** imag = NULL; + int * nbCoef = NULL; + + if (!data || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!data) + { + (*jenv)->DeleteLocalRef(jenv, data); + } + (*jenv)->DeleteLocalRef(jenv, infos); + break; + } + + isReal = (*jenv)->GetArrayLength(jenv, infos) == 2; + js = (jstring)(*jenv)->GetObjectArrayElement(jenv, infos, 0); + polyVarName = (char*)(*jenv)->GetStringUTFChars(jenv, js, 0); + + if (isReal) + { + // Get the matrix rows + for (; j < nbRow; j++) + { + jobjectArray dblDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, dblDim); + real = (double**)MALLOC(sizeof(double*) * nbRow * nbCol); + nbCoef = (int*)MALLOC(sizeof(int) * nbRow * nbCol); + } + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + jboolean isCopy1 = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDim, k); + int len = (*jenv)->GetArrayLength(jenv, oneDim); + nbCoef[k * nbRow + j] = len; + real[k * nbRow + j] = (double*)MALLOC(sizeof(double) * len); + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + memcpy(real[k * nbRow + j], element, sizeof(double) * len); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, dblDim); + } + (*jenv)->DeleteLocalRef(jenv, data); + + sciErr = createMatrixOfPolyInNamedList(pvApiCtx, varName, currentList, i + 1, polyVarName, nbRow, nbCol, nbCoef, (const double * const*)real); + for (j = 0; j < nbRow * nbCol; j++) + { + FREE(real[j]); + } + FREE(real); + FREE(nbCoef); + } + else + { + jobject imagData = (*jenv)->GetObjectArrayElement(jenv, infos, 2); + // Get the matrix rows + for (; j < nbRow; j++) + { + jobjectArray dblDimR = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + jobjectArray dblDimI = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, imagData, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, dblDimR); + real = (double**)MALLOC(sizeof(double*) * nbRow * nbCol); + imag = (double**)MALLOC(sizeof(double*) * nbRow * nbCol); + nbCoef = (int*)MALLOC(sizeof(int) * nbRow * nbCol); + } + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + jboolean isCopy1 = JNI_FALSE; + jdouble* element = NULL; + jdoubleArray oneDimR = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDimR, k); + jdoubleArray oneDimI = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, dblDimI, k); + int len = (*jenv)->GetArrayLength(jenv, oneDimR); + nbCoef[k * nbRow + j] = len; + real[k * nbRow + j] = (double*)MALLOC(sizeof(double) * len); + imag[k * nbRow + j] = (double*)MALLOC(sizeof(double) * len); + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDimR, &isCopy1); + memcpy(real[k * nbRow + j], element, sizeof(double) * len); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDimR, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDimR); + isCopy1 = JNI_FALSE; + element = (jdouble*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDimI, &isCopy1); + memcpy(imag[k * nbRow + j], element, sizeof(double) * len); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDimI, element, 0); + (*jenv)->DeleteLocalRef(jenv, oneDimI); + } + (*jenv)->DeleteLocalRef(jenv, dblDimR); + (*jenv)->DeleteLocalRef(jenv, dblDimI); + } + (*jenv)->DeleteLocalRef(jenv, data); + (*jenv)->DeleteLocalRef(jenv, imagData); + + sciErr = createComplexMatrixOfPolyInNamedList(pvApiCtx, varName, currentList, i + 1, polyVarName, nbRow, nbCol, nbCoef, (const double * const*)real, (const double * const*)imag); + for (j = 0; j < nbRow * nbCol; j++) + { + FREE(real[j]); + FREE(imag[j]); + } + FREE(real); + FREE(imag); + FREE(nbCoef); + } + + (*jenv)->ReleaseStringUTFChars(jenv, js, polyVarName); + (*jenv)->DeleteLocalRef(jenv, js); + (*jenv)->DeleteLocalRef(jenv, infos); + break; + } + case sci_boolean : + { + jobject data = (*jenv)->GetObjectArrayElement(jenv, list, i + 1); + int nbRow = (*jenv)->GetArrayLength(jenv, data); + int nbCol = 0; + int j = 0, k; + int * b = 0; + + if (!data || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!data) + { + (*jenv)->DeleteLocalRef(jenv, data); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jboolean* element = NULL; + jdoubleArray oneDim = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + b = (int*)MALLOC(sizeof(int) * nbRow * nbCol); + } + + element = (jboolean*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + b[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, data); + + sciErr = createMatrixOfBooleanInNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, (const int *)b); + FREE(b); + break; + } + case sci_sparse : + { + jboolean isCopy1 = JNI_FALSE; + int* dims = NULL; + int* nbItemRow = NULL; + int* colPos = NULL; + double* data = NULL; + double * imagData = NULL; + jobjectArray infos = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, list, i + 1); + int isReal = (*jenv)->GetArrayLength(jenv, infos) == 4; + jintArray jdims = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 0); + jintArray jnbItemRow = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 1); + jintArray jcolPos = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 2); + jint nbNonNull = (*jenv)->GetArrayLength(jenv, jcolPos); + jdoubleArray jdata = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, infos, 3); + jdoubleArray jimagData; + + if (!isReal) + { + jimagData = (jdoubleArray)(*jenv)->GetObjectArrayElement(jenv, infos, 4); + } + + dims = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jdims, &isCopy1); + isCopy1 = JNI_FALSE; + nbItemRow = (int*)(*jenv)->GetPrimitiveArrayCritical(jenv, jnbItemRow, &isCopy1); + isCopy1 = JNI_FALSE; + colPos = (int*)(*jenv)->GetPrimitiveArrayCritical(jenv, jcolPos, &isCopy1); + isCopy1 = JNI_FALSE; + data = (double*)(*jenv)->GetPrimitiveArrayCritical(jenv, jdata, &isCopy1); + isCopy1 = JNI_FALSE; + + if (!isReal) + { + imagData = (double*)(*jenv)->GetPrimitiveArrayCritical(jenv, jimagData, &isCopy1); + } + + if (isReal) + { + sciErr = createSparseMatrixInNamedList(pvApiCtx, varName, currentList, i + 1, dims[0], dims[1], nbNonNull, nbItemRow, colPos, data); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jdata, data, JNI_ABORT); + } + else + { + sciErr = createComplexSparseMatrixInNamedList(pvApiCtx, varName, currentList, i + 1, dims[0], dims[1], nbNonNull, nbItemRow, colPos, data, imagData); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jimagData, imagData, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jdata, data, JNI_ABORT); + } + + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jcolPos, colPos, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jnbItemRow, nbItemRow, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jdims, dims, JNI_ABORT); + + if (!isReal) + { + (*jenv)->DeleteLocalRef(jenv, jimagData); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + (*jenv)->DeleteLocalRef(jenv, jcolPos); + (*jenv)->DeleteLocalRef(jenv, jnbItemRow); + (*jenv)->DeleteLocalRef(jenv, jdims); + (*jenv)->DeleteLocalRef(jenv, infos); + + break; + } + case sci_boolean_sparse : + { + jobjectArray infos = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, list, i + 1); + jintArray jdims = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 0); + jintArray jnbItemRow = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 1); + jintArray jcolPos = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 2); + jint nbNonNull = (*jenv)->GetArrayLength(jenv, jcolPos); + int* nbItemRow = NULL; + int* dims = NULL; + int* colPos = NULL; + + jboolean isCopy1 = JNI_FALSE; + + dims = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, jdims, &isCopy1); + isCopy1 = JNI_FALSE; + nbItemRow = (int*)(*jenv)->GetPrimitiveArrayCritical(jenv, jnbItemRow, &isCopy1); + isCopy1 = JNI_FALSE; + colPos = (int*)(*jenv)->GetPrimitiveArrayCritical(jenv, jcolPos, &isCopy1); + + sciErr = createBooleanSparseMatrixInNamedList(pvApiCtx, varName, currentList, i + 1, dims[0], dims[1], nbNonNull, nbItemRow, colPos); + + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jcolPos, colPos, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jnbItemRow, nbItemRow, JNI_ABORT); + (*jenv)->ReleasePrimitiveArrayCritical(jenv, jdims, dims, JNI_ABORT); + + (*jenv)->DeleteLocalRef(jenv, jcolPos); + (*jenv)->DeleteLocalRef(jenv, jnbItemRow); + (*jenv)->DeleteLocalRef(jenv, jdims); + (*jenv)->DeleteLocalRef(jenv, infos); + + break; + } + case sci_ints : + { + jobjectArray infos = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, list, i + 1); + jintArray jtype = (jintArray)(*jenv)->GetObjectArrayElement(jenv, infos, 0); + jint * typep = (*jenv)->GetIntArrayElements(jenv, jtype, 0); + int type = *typep; + + (*jenv)->ReleaseIntArrayElements(jenv, jtype, typep, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, jtype); + + switch (type) + { + case sci_int8 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + char * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jbyte* element = NULL; + jbyteArray oneDim = (jbyteArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (char*)MALLOC(sizeof(char) * nbRow * nbCol); + } + isCopy1 = JNI_FALSE; + element = (jbyte*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfInteger8InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + break; + } + case sci_uint8 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + unsigned char * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jbyte* element = NULL; + jboolean isCopy1 = JNI_FALSE; + jbyteArray oneDim = (jbyteArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (unsigned char*)MALLOC(sizeof(unsigned char) * nbRow * nbCol); + } + + element = (jbyte*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfUnsignedInteger8InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } + case sci_int16 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + short * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jshort* element = NULL; + jshortArray oneDim = (jshortArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (short*)MALLOC(sizeof(short) * nbRow * nbCol); + } + + element = (jshort*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfInteger16InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } + case sci_uint16 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + unsigned short * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jshort* element = NULL; + jshortArray oneDim = (jshortArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (unsigned short*)MALLOC(sizeof(unsigned short) * nbRow * nbCol); + } + isCopy1 = JNI_FALSE; + element = (jshort*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfUnsignedInteger16InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } + case sci_int32 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + int * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jint* element = NULL; + jintArray oneDim = (jintArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (int*)MALLOC(sizeof(int) * nbRow * nbCol); + } + isCopy1 = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfInteger32InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } + case sci_uint32 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + unsigned int * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jboolean isCopy1 = JNI_FALSE; + jint* element = NULL; + jintArray oneDim = (jintArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (unsigned int*)MALLOC(sizeof(unsigned int) * nbRow * nbCol); + } + isCopy1 = JNI_FALSE; + element = (jint*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfUnsignedInteger32InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } +#ifdef __SCILAB_INT64__ + case sci_int64 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + long * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jlongArray oneDim = (jlongArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (long*)MALLOC(sizeof(long) * nbRow * nbCol); + } + jboolean isCopy1 = JNI_FALSE; + jlong* element = (jlong*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfInteger64InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + + break; + } + case sci_uint64 : + { + jobject jdata = (*jenv)->GetObjectArrayElement(jenv, infos, 1); + int nbRow = (*jenv)->GetArrayLength(jenv, jdata); + int nbCol = 0; + int j = 0, k; + unsigned long * data = 0; + + if (!jdata || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!jdata) + { + (*jenv)->DeleteLocalRef(jenv, jdata); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jlongArray oneDim = (jlongArray)(*jenv)->GetObjectArrayElement(jenv, jdata, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + data = (unsigned long*)MALLOC(sizeof(unsigned long) * nbRow * nbCol); + } + jboolean isCopy1 = JNI_FALSE; + jlong* element = (jlong*)(*jenv)->GetPrimitiveArrayCritical(jenv, oneDim, &isCopy1); + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + data[k * nbRow + j] = element[k]; + } + (*jenv)->ReleasePrimitiveArrayCritical(jenv, oneDim, element, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, jdata); + + sciErr = createMatrixOfUnsignedInteger64InNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, data); + FREE(data); + break; + } +#endif + } + (*jenv)->DeleteLocalRef(jenv, infos); + break; + } + case sci_strings : + { + jobject data = (*jenv)->GetObjectArrayElement(jenv, list, i + 1); + int nbRow = (*jenv)->GetArrayLength(jenv, data); + int nbCol = 0; + int j = 0, k; + char ** strings = 0; + + if (!data || nbRow == 0) + { + sciErr = createMatrixOfDoubleInNamedList(pvApiCtx, varName, currentList, i + 1, 0, 0, 0); + if (!data) + { + (*jenv)->DeleteLocalRef(jenv, data); + } + break; + } + + // Get the matrix rows + for (; j < nbRow; j++) + { + jobjectArray oneDim = (jobjectArray)(*jenv)->GetObjectArrayElement(jenv, data, j); + if (nbCol == 0) + { + nbCol = (*jenv)->GetArrayLength(jenv, oneDim); + strings = (char**)MALLOC(sizeof(char*) * nbRow * nbCol); + } + + // Get the matrix element + for (k = 0; k < nbCol; k++) + { + jstring j_string = (jstring)(*jenv)->GetObjectArrayElement(jenv, oneDim, k); + jboolean isCopy1 = JNI_FALSE; + char *str = (char *)(*jenv)->GetStringUTFChars(jenv, j_string, &isCopy1); + strings[k * nbRow + j] = (char*)MALLOC(sizeof(char) * (strlen(str) + 1)); + strcpy(strings[k * nbRow + j], str); + if (isCopy1) + { + (*jenv)->ReleaseStringUTFChars(jenv, j_string, (const char *)str); + } + (*jenv)->DeleteLocalRef(jenv, j_string); + } + (*jenv)->DeleteLocalRef(jenv, oneDim); + } + (*jenv)->DeleteLocalRef(jenv, data); + + sciErr = createMatrixOfStringInNamedList(pvApiCtx, varName, currentList, i + 1, nbRow, nbCol, (const char * const*)strings); + for (j = 0; j < nbRow * nbCol; j++) + { + FREE(strings[j]); + } + FREE(strings); + break; + } + case sci_list : + { + jobject data = (*jenv)->GetObjectArrayElement(jenv, list, i + 1); + sciErr = sendList(jenv, data, currentList, i + 1, varName, 'l'); + (*jenv)->DeleteLocalRef(jenv, data); + break; + } + case sci_tlist : + { + jobject data = (*jenv)->GetObjectArrayElement(jenv, list, i + 1); + sciErr = sendList(jenv, data, currentList, i + 1, varName, 't'); + (*jenv)->DeleteLocalRef(jenv, data); + break; + } + case sci_mlist : + { + jobject data = (*jenv)->GetObjectArrayElement(jenv, list, i + 1); + sciErr = sendList(jenv, data, currentList, i + 1, varName, 'm'); + (*jenv)->DeleteLocalRef(jenv, data); + break; + } + } + + if (sciErr.iErr) + { + break; + } + } + + (*jenv)->ReleaseIntArrayElements(jenv, jtypes, types, JNI_ABORT); + (*jenv)->DeleteLocalRef(jenv, jtypes); + + //popListAddress(); + + if (!parentList) + { + //pushVariable(varName); + //cleanStackListAddress(); + } + + return sciErr; + } + +#ifdef __cplusplus +} +#endif diff --git a/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj b/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj new file mode 100755 index 000000000..c89563aab --- /dev/null +++ b/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{9BE8D73A-7E83-46ED-A9E2-1E3472F52AE5}</ProjectGuid> + <RootNamespace>javasci-java-tests</RootNamespace> + <Keyword>MakeFileProj</Keyword> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Makefile</ConfigurationType> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Makefile</ConfigurationType> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Makefile</ConfigurationType> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Makefile</ConfigurationType> + <PlatformToolset>v110</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup> + <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)modules\javasci\jar\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir> + <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test +</NMakeBuildCommandLine> + <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test + +</NMakeReBuildCommandLine> + <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" /> + <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> + <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath> + <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes> + <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath> + <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)modules\javasci\jar\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir> + <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test +</NMakeBuildCommandLine> + <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test + +</NMakeReBuildCommandLine> + <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" /> + <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> + <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath> + <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes> + <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath> + <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)modules\javasci\jar\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir> + <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test +</NMakeBuildCommandLine> + <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test + +</NMakeReBuildCommandLine> + <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" /> + <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> + <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath> + <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedIncludes)</NMakeForcedIncludes> + <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath> + <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies> + <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)modules\javasci\jar\</OutDir> + <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir> + <NMakeBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test +</NMakeBuildCommandLine> + <NMakeReBuildCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'">set JAVA_HOME=$(SolutionDir)java\jdk +set PATH=$(SolutionDir)java\ant\bin;$(SolutionDir)bin;%PATH%; +cd ..\.. +call ant test + +</NMakeReBuildCommandLine> + <NMakeCleanCommandLine Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <NMakeOutput Condition="'$(Configuration)|$(Platform)'=='Release|x64'" /> + <NMakePreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions> + <NMakeIncludeSearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeIncludeSearchPath)</NMakeIncludeSearchPath> + <NMakeForcedIncludes Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedIncludes)</NMakeForcedIncludes> + <NMakeAssemblySearchPath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeAssemblySearchPath)</NMakeAssemblySearchPath> + <NMakeForcedUsingAssemblies Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(NMakeForcedUsingAssemblies)</NMakeForcedUsingAssemblies> + </PropertyGroup> + <ItemDefinitionGroup> + </ItemDefinitionGroup> + <ItemGroup> + <ProjectReference Include="..\..\..\..\Visual-Studio-settings\ant-all\ant-all.vcxproj"> + <Project>{a9a2020d-5541-44f2-b080-df3c9426c409}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj.filters b/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj.filters new file mode 100755 index 000000000..834c44131 --- /dev/null +++ b/modules/javasci/tests/java/javasci-JAVA-tests.vcxproj.filters @@ -0,0 +1,9 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug10801.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug10801.java new file mode 100755 index 000000000..1dcf81340 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug10801.java @@ -0,0 +1,69 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2012 - DIGITEO - Vincent COUVERT + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testBug10801 { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(true); + assertTrue(sci.open()); + } + + @Test() + public void nonRegBug10801() throws NullPointerException, JavasciException { + try { + assertTrue(sci.exec("plot3d()")); + assertTrue(sci.isGraphicOpened()); + assertTrue(sci.exec("winId = winsid();")); + assertTrue(((ScilabDouble)sci.get("winId")).equals(new ScilabDouble(0))); + sci.close(); + sci.open(); + assertFalse(sci.isGraphicOpened()); + assertTrue(sci.exec("winId = winsid()")); + assertTrue(((ScilabDouble)sci.get("winId")).equals(new ScilabDouble())); + sci.close(); + } catch (Exception e) { + System.err.print("e = " + e); + } + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug4211.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug4211.java new file mode 100755 index 000000000..696b53b81 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug4211.java @@ -0,0 +1,60 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testBug4211 { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void nonRegBug4211() throws NullPointerException, JavasciException { + assertEquals(sci.exec("disp(plop);"), false); + assertEquals(sci.getLastErrorCode(), 4); + sci.close(); + + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug6651.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug6651.java new file mode 100755 index 000000000..321cdefd4 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug6651.java @@ -0,0 +1,68 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testBug6651 { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void nonRegBug6651() throws NullPointerException, JavasciException { + double[][] a = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; + + ScilabDouble A = new ScilabDouble(a); + sci.put("a", A); + assertTrue(sci.exec("b = a;")); + + ScilabDouble B = (ScilabDouble)sci.get("b"); + assertTrue(B.equals(A)); + + assertTrue(sci.exec("c = a;")); + ScilabDouble C = (ScilabDouble)sci.get("c"); + assertTrue(C.equals(A)); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug7054.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug7054.java new file mode 100755 index 000000000..3c97f36dd --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug7054.java @@ -0,0 +1,66 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testBug7054 { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test( expected = java.lang.ClassCastException.class) + public void nonRegBug7054() throws NullPointerException, JavasciException { + assertTrue(sci.exec("xx = 123;")); + /* Trigger an ClassCastException exception with the error: + * Exception in thread "main" java.lang.ClassCastException: org.scilab.modules.types.ScilabDouble cannot be cast to org.scilab.modules.types.ScilabInteger */ + ScilabInteger zz = (ScilabInteger)sci.get("xx"); + + } + + @Test() + public void nonRegBug7054Working() throws NullPointerException, JavasciException { + assertTrue(sci.exec("xx = int8(123);")); + ScilabInteger zz = (ScilabInteger)sci.get("xx"); + assertEquals(zz.getData()[0][0], 123); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9149.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9149.java new file mode 100755 index 000000000..08045d2bb --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9149.java @@ -0,0 +1,80 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2011 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.List; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.ScilabErrorException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabTypeEnum; +import org.scilab.modules.commons.ScilabCommons; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.SwingUtilities; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; + +public class testBug9149 { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test( expected = ScilabErrorException.class) + public void nonRegBug9149Working() throws NullPointerException, ScilabErrorException { + assertEquals(sci.isGraphicOpened(), false); + sci.execException("plot3d();"); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } + +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9544.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9544.java new file mode 100755 index 000000000..a3c4b65fa --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testBug9544.java @@ -0,0 +1,138 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2011 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.FileNotFoundException; +import java.util.ArrayList; +import java.util.List; + +import java.awt.GraphicsEnvironment; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabTypeEnum; +import org.scilab.modules.commons.ScilabCommons; + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Dimension; +import java.awt.Font; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +import javax.swing.SwingUtilities; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; + +public class testBug9544 { + private Scilab sci; + private Test_sci x; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(true); + assertTrue(sci.open()); + } + + @Test() + public void nonRegBug9544Working() throws NullPointerException, JavasciException, IOException { + if (!GraphicsEnvironment.isHeadless()) { + x = new Test_sci(); + } + } + + /** + * See #open() + */ + @After + public void close() { + if (!GraphicsEnvironment.isHeadless()) { + x.dispose(); + } + sci.close(); + + } + + public class Test_sci extends JFrame { + + private JPanel container = new JPanel(); + private JButton b = new JButton ("Auto clicked button"); + private JLabel resultat; + + private Scilab sci; + + + + public Test_sci() { /*throws IOException*/ + try { + sci = new Scilab(true); + } catch (org.scilab.modules.javasci.JavasciException f) { + System.err.println("An exception occurred: " + f.getLocalizedMessage()); + } + this.setTitle("bug 9544 non reg test"); + this.setSize(200, 100); + this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JPanel top = new JPanel(); + b.addActionListener(new BoutonListener()); + + top.add(b); + + this.setContentPane(top); + this.setVisible(true); + + new Thread(new Runnable() { + public void run() { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + b.doClick(); + } + }); + } + }).start(); + + } + + class BoutonListener implements ActionListener { + + public void actionPerformed(ActionEvent g) { + List<String> commands = new ArrayList<String>(); + commands.add("X = [1,2];"); + commands.add("Y = [3,4];"); + commands.add("plot(X,Y);"); + assertTrue(sci.exec(commands.toArray(new String[commands.size()]))); + } + + } + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testErrorManagement.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testErrorManagement.java new file mode 100755 index 000000000..37ee033fa --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testErrorManagement.java @@ -0,0 +1,109 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.ScilabErrorException; + + +public class testErrorManagement { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + + @Test() + public void getLastErrorCodeTest() throws NullPointerException, JavasciException { + assertEquals(sci.getLastErrorCode(), 0); // No error + sci.close(); + + assertEquals(sci.open("a=1+"), false); + assertEquals(sci.getLastErrorCode(), 2); + sci.exec("errclear();"); + sci.exec("a+b"); + assertEquals(sci.getLastErrorCode(), 4); + sci.exec("errclear();"); + } + + @Test() + public void getLastErrorMessageTest() throws NullPointerException, JavasciException { + sci.exec("errclear();"); // No error by default + assertTrue(sci.getLastErrorMessage().equals("")); + assertEquals(sci.getLastErrorMessage().length(), 0); + + sci.exec("errclear();"); + sci.close(); + + assertEquals(sci.open("a=1+"), false); + assertTrue(sci.getLastErrorMessage().length() > 0); + sci.exec("errclear();"); + sci.exec("a+b"); //undefined a & b + assertTrue(sci.getLastErrorMessage().length() > 0); + sci.exec("errclear();"); + sci.exec("a=rand(10,10);");//no error + assertEquals(sci.getLastErrorMessage().length(), 0); + } + + @Test() + public void getLastErrorMessageWithExceptionNonErrorTest() throws NullPointerException, JavasciException { + sci.execException("errclear();"); // No error by default + assertTrue(sci.getLastErrorMessage().equals("")); + assertEquals(sci.getLastErrorMessage().length(), 0); + + sci.execException("errclear();"); + } + + @Test() + public void getLastErrorMessageWithExceptionNonError2Test() throws NullPointerException, JavasciException { + sci.execException("errclear();"); // No error by default + assertTrue(sci.getLastErrorMessage().equals("")); + assertEquals(sci.getLastErrorMessage().length(), 0); + sci.execException("a=rand(10,10);");//no error + assertEquals(sci.getLastErrorMessage().length(), 0); + } + + + @Test( expected = ScilabErrorException.class) + public void getLastErrorMessageWithExceptionWithErrorTest() throws NullPointerException, ScilabErrorException { + sci.execException("a+b"); //undefined a & b + } + + @Test( expected = ScilabErrorException.class) + public void getLastErrorMessageWithExceptionWithError2Test() throws NullPointerException, ScilabErrorException { + sci.execException("a+b*"); //undefined a & b + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExec.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExec.java new file mode 100755 index 000000000..b3800fb8b --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExec.java @@ -0,0 +1,145 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.FileNotFoundException; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +public class testExec { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void execAndReadTest() throws NullPointerException, JavasciException { + + /* Scalar test */ + assertTrue(sci.exec("a = 1+1")); + ScilabType a = sci.get("a"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(a.getHeight(), 1); + assertEquals(a.getWidth(), 1); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 2.0, 1e-8); + + /* Matrix 10x10 */ + assertTrue(sci.exec("b = matrix(1:100,10,10)")); + + ScilabType b = sci.get("b"); + + assertEquals(b.getHeight(), 10); + assertEquals(b.getWidth(), 10); + + /* Check results of the addition of two matrixes */ + assertTrue(sci.exec("c = [42, 12; 32, 32] + [2, 1; 3, 2]; sumMatrix = sum(c);")); + ScilabType c = sci.get("c"); + + assertEquals(c.getHeight(), 2); + + assertEquals(c.getWidth(), 2); + + double sum = 0; + /* Compute ourself the sum of all matrices elements */ + for (int i = 0; i < c.getHeight(); i++) { + for (int j = 0; j < c.getWidth(); j++) { + sum += ((ScilabDouble)c).getRealPart()[i][j]; + } + } + ScilabType sumMatrix = sci.get("sumMatrix"); + /* Compare if they match */ + assertEquals(((ScilabDouble)sumMatrix).getRealPart()[0][0], sum, 1e-8); + sci.exec("b = matrix(1:100,10,10)") ; + ScilabType b2 = sci.get("b"); + b2.getHeight(); // 10 + b2.getWidth(); // 10 + ScilabDouble b3 = (ScilabDouble)sci.get("b"); + assertTrue(b3.equals(b2)); + } + + + @Test() + public void execFromFileTest() throws NullPointerException, JavasciException { + sci.close(); + + try { + // Create temp file. + File tempScript = File.createTempFile("tempScript", ".sci"); + + // Write to temp file + BufferedWriter out = new BufferedWriter(new FileWriter(tempScript)); + out.write("a=4+42;"); + out.close(); + + assertTrue(sci.open(tempScript)); + + ScilabType a = sci.get("a"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 46.0, 1e-8); + tempScript.delete(); + + } catch (IOException e) { + } + } + + @Test( expected = FileNotFoundException.class) + public void execFromNonExistingFileTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + sci.close(); + + File nonExistingFile = new File("/wrong/path/file"); + + sci.open(nonExistingFile); + } + + @Test() + public void execExecstrTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + sci.exec("execstr('toto = 111')"); + + ScilabType a = sci.get("toto"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 111.0, 1e-8); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExecException.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExecException.java new file mode 100755 index 000000000..87f85370b --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExecException.java @@ -0,0 +1,175 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.File; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; +import java.io.FileNotFoundException; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; + +public class testExecException { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void execAndReadTest() throws NullPointerException, JavasciException { + /* Scalar test */ + sci.execException("a = 1+1"); + ScilabType a = sci.get("a"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(a.getHeight(), 1); + assertEquals(a.getWidth(), 1); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 2.0, 1e-8); + + /* Matrix 10x10 */ + sci.execException("b = matrix(1:100,10,10)"); + + ScilabType b = sci.get("b"); + + assertEquals(b.getHeight(), 10); + assertEquals(b.getWidth(), 10); + + /* Check results of the addition of two matrixes */ + sci.execException("c = [42, 12; 32, 32] + [2, 1; 3, 2]; sumMatrix = sum(c);"); + ScilabType c = sci.get("c"); + + assertEquals(c.getHeight(), 2); + + assertEquals(c.getWidth(), 2); + + double sum = 0; + /* Compute ourself the sum of all matrices elements */ + for (int i = 0; i < c.getHeight(); i++) { + for (int j = 0; j < c.getWidth(); j++) { + sum += ((ScilabDouble)c).getRealPart()[i][j]; + } + } + ScilabType sumMatrix = sci.get("sumMatrix"); + /* Compare if they match */ + assertEquals(((ScilabDouble)sumMatrix).getRealPart()[0][0], sum, 1e-8); + sci.execException("b = matrix(1:100,10,10)") ; + ScilabType b2 = sci.get("b"); + b2.getHeight(); // 10 + b2.getWidth(); // 10 + ScilabDouble b3 = (ScilabDouble)sci.get("b"); + assertTrue(b3.equals(b2)); + } + + + @Test() + public void execFromFileTest() throws NullPointerException, JavasciException { + sci.close(); + + try { + // Create temp file. + File tempScript = File.createTempFile("tempScript", ".sci"); + + // Write to temp file + BufferedWriter out = new BufferedWriter(new FileWriter(tempScript)); + out.write("a=4+42;"); + out.close(); + + assertTrue(sci.open(tempScript)); + + ScilabType a = sci.get("a"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 46.0, 1e-8); + tempScript.delete(); + + } catch (IOException e) { + } + } + + @Test( expected = FileNotFoundException.class) + public void execFromNonExistingFileTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + sci.close(); + + File nonExistingFile = new File("/wrong/path/file"); + + sci.open(nonExistingFile); + } + + @Test() + public void execExecstrTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + sci.execException("execstr('toto = 111')"); + + ScilabType a = sci.get("toto"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 111.0, 1e-8); + } + + @Test() + public void execExecFileTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + + try { + // Create temp file. + File tempScript = File.createTempFile("tempScript", ".sci"); + + // Write to temp file + BufferedWriter out = new BufferedWriter(new FileWriter(tempScript)); + out.write("a=4+42;"); + out.close(); + + sci.execException(tempScript); + + ScilabType a = sci.get("a"); + double[][] aReal = ((ScilabDouble)a).getRealPart(); + + assertEquals(aReal[0][0], 46, 1e-8); + } catch (IOException e) { + } + + } + + @Test( expected = FileNotFoundException.class) + public void execExecNonFileTest() throws NullPointerException, InitializationException, FileNotFoundException, JavasciException { + + sci.execException(new File("Doesnotexist")); + + + + } + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExistingVariable.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExistingVariable.java new file mode 100755 index 000000000..a66da4652 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExistingVariable.java @@ -0,0 +1,72 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabDouble; + +public class testExistingVariable { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void existVariableTest() throws NullPointerException, JavasciException { + double [][]a = {{21.2, 22.0, 42.0, 39.0}, {23.2, 24.0, 44.0, 40.0}}; + ScilabDouble aOriginal = new ScilabDouble(a); + sci.put("a", aOriginal); + assertTrue(sci.isExistingVariable("a")); + } + + @Test() + public void notExistVariableTest() throws NullPointerException, JavasciException { + assertEquals(sci.isExistingVariable("a"), false); + assertEquals(sci.isExistingVariable("b"), false); + } + + + @Test() + public void existVariableAfterExecTest() throws NullPointerException, JavasciException { + assertTrue(sci.exec("a=rand(20,20);")); + assertTrue(sci.isExistingVariable("a")); + assertTrue(sci.exec("b='test variable';")); + assertTrue(sci.isExistingVariable("b")); + } + + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExportOffscreen.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExportOffscreen.java new file mode 100755 index 000000000..7f3fa117d --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testExportOffscreen.java @@ -0,0 +1,128 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2012 - Scilab Enterprises - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.File; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testExportOffscreen { + private Scilab sci; + private String tmpDir = System.getProperty("java.io.tmpdir"); + + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(true); + assertTrue(sci.open()); + } + + private String generateExportCommand(String type, File filename) { + String exportToFile = "driver('" + type + "'); xinit('" + filename.getAbsolutePath() + "'); plot3d(); xend()"; + return exportToFile; + } + + @Test() + public void exportToPSTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.ps"); + String exportToFile = generateExportCommand("ps", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToPOSTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.ps"); + String exportToFile = generateExportCommand("Pos", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToGIFTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.gif"); + String exportToFile = generateExportCommand("GIF", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToPPMTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.ppm"); + String exportToFile = generateExportCommand("PPM", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToJPGTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.jpg"); + String exportToFile = generateExportCommand("JPG", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToPDFTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.pdf"); + String exportToFile = generateExportCommand("PDF", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToSVGTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.svg"); + String exportToFile = generateExportCommand("SVG", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + @Test() + public void exportToPNGTest() throws NullPointerException, JavasciException { + File export = new File(tmpDir + "/foo.svg"); + String exportToFile = generateExportCommand("PNG", export); + sci.exec(exportToFile); + assertTrue(export.exists()); + assertTrue(export.length() > 0); + assertTrue(export.delete()); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } + +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testGraphics.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testGraphics.java new file mode 100755 index 000000000..654a9d10e --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testGraphics.java @@ -0,0 +1,63 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.awt.GraphicsEnvironment; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testGraphics { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(true); // True = enable advanced mode + assertTrue(sci.open()); + } + + @Test() + public void isGraphicOpenedTest() throws NullPointerException, JavasciException { + if (!GraphicsEnvironment.isHeadless()) { + sci.exec("plot3d();"); + assertTrue(sci.isGraphicOpened()); + } + } + + @Test() + public void isGraphicNotOpenedTest() throws NullPointerException, JavasciException { + + sci.exec("a=1+1;"); + assertEquals(sci.isGraphicOpened(), false); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testOpenClose.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testOpenClose.java new file mode 100755 index 000000000..61f5239d4 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testOpenClose.java @@ -0,0 +1,112 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.io.IOException; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.AlreadyRunningException; + +import org.scilab.modules.commons.ScilabConstants; + +public class testOpenClose { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void openTest() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void multipleOpenCloseTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + assertTrue(sci.open()); + assertTrue(sci.close()); + } + + @Test( expected = JavasciException.class) + public void specificWrongSCIPathTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + sci = new Scilab(System.getProperty("java.io.tmpdir") + "/non-existing-directory-scilab/"); + } + + + @Test() + public void specificPropertySCIPathTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + sci = new Scilab(System.getProperty("SCI")); + } + + @Test() + public void specificEnvSCIPathTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + String SCIPath = System.getProperty("SCI"); // Temp backup to set it again + System.clearProperty("SCI"); // Remove the property to check it is using the variable + sci = new Scilab(); + assertTrue(sci.open("a=42*2;")); + + } + + @Test() + public void OpenWithJobTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + assertTrue(sci.open("a=42*2;")); + + ScilabType a = sci.get("a"); + + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 84.0, 1e-8); + } + + @Test() + public void OpenWithJobsTest() throws NullPointerException, JavasciException { + assertTrue(sci.close()); + assertTrue(sci.open(new String[] {"a=42*2;", "b=44*2", "c=(a==b)"})); + + ScilabType a = sci.get("a"); + assertEquals(((ScilabDouble)a).getRealPart()[0][0], 84.0, 1e-8); + + ScilabType b = sci.get("b"); + assertEquals(((ScilabDouble)b).getRealPart()[0][0], 88.0, 1e-8); + + ScilabType c = sci.get("c"); + assertEquals(((ScilabBoolean)c).getData()[0][0], false); + } + + @Test( expected = AlreadyRunningException.class) + public void OpenMultipleTimeTest() throws NullPointerException, JavasciException { + assertTrue(sci.open("a=42*2;")); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWrite.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWrite.java new file mode 100755 index 000000000..7519b912c --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWrite.java @@ -0,0 +1,283 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.util.Arrays; +import java.util.Map; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabBooleanSparse; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabMList; +import org.scilab.modules.types.ScilabList; +import org.scilab.modules.types.ScilabTList; +import org.scilab.modules.types.ScilabPolynomial; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabSparse; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testReadWrite { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void putAndGetEmptyMatrixTest() throws NullPointerException, JavasciException { + ScilabDouble aOriginal = new ScilabDouble(); + sci.put("a", aOriginal); + ScilabDouble aFromScilab = (ScilabDouble)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetDoubleTest() throws NullPointerException, JavasciException { + double [][]a = {{21.2, 22.0, 42.0, 39.0}, {23.2, 24.0, 44.0, 40.0}}; + ScilabDouble aOriginal = new ScilabDouble(a); + sci.put("a", aOriginal); + assertTrue(sci.exec("somme = sum(a);")); + + ScilabDouble aFromScilab = (ScilabDouble)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetComplexDoubleTest() throws NullPointerException, JavasciException { + double [][]a = {{21.2, 22.0, 42.0, 39.0}, {23.2, 24.0, 44.0, 40.0}}; + double [][]aImg = {{212.2, 221.0, 423.0, 393.0}, {234.2, 244.0, 441.0, 407.0}}; + + ScilabDouble aOriginal = new ScilabDouble(a, aImg); + sci.put("a", aOriginal); + + ScilabDouble aFromScilab = (ScilabDouble)sci.get("a"); + assertTrue(aFromScilab.equals(aOriginal)); + } + + + @Test() + public void putAndGetBooleanTest() throws NullPointerException, JavasciException { + boolean [][]a = {{true, true, false, false}, {true, false, true, false}}; + ScilabBoolean aOriginal = new ScilabBoolean(a); + sci.put("a", aOriginal); + + ScilabBoolean aFromScilab = (ScilabBoolean)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetSparseTest() throws NullPointerException, JavasciException { + double [][]a = {{0, 22.0, 0, 39.0}, {23.2, 0, 0, 40.0}}; + ScilabSparse aOriginal = new ScilabSparse(a); + sci.put("a", aOriginal); + assertTrue(sci.exec("somme = sum(a);")); + + ScilabSparse aFromScilab = (ScilabSparse)sci.get("a"); + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetComplexSparseTest() throws NullPointerException, JavasciException { + double [][] a = {{0, 22.0, 0, 39.0}, {23.2, 0, 0, 40.0}}; + double [][] aImg = {{0, 11.0, 0, 18.5}, {1.34, 0, 0, 41.0}}; + ScilabSparse aOriginal = new ScilabSparse(a, aImg); + sci.put("a", aOriginal); + assertTrue(sci.exec("somme = sum(a);")); + + ScilabSparse aFromScilab = (ScilabSparse)sci.get("a"); + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetBooleanSparseTest() throws NullPointerException, JavasciException { + boolean [][]a = {{false, true, false, true}, {true, false, false, true}}; + ScilabBooleanSparse aOriginal = new ScilabBooleanSparse(a); + sci.put("a", aOriginal); + assertTrue(sci.exec("andA = and(a);")); + + ScilabBooleanSparse aFromScilab = (ScilabBooleanSparse)sci.get("a"); + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetPolynomialTest() throws NullPointerException, JavasciException { + double [][][] a = {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}}; + ScilabPolynomial aOriginal = new ScilabPolynomial(a, "X"); + sci.put("a", aOriginal); + assertTrue(sci.exec("somme = sum(a);")); + + ScilabPolynomial aFromScilab = (ScilabPolynomial)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetComplexPolynomialTest() throws NullPointerException, JavasciException { + double [][][] a = {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}}; + double [][][] aImg = {{{2, -1, 3}, {0}, {2, 0, 1, -3}}, {{3, 0, 1}, {1, -3, 0, 0, -2}, {0}}}; + ScilabPolynomial aOriginal = new ScilabPolynomial(a, aImg, "NAME"); + sci.put("a", aOriginal); + assertTrue(sci.exec("somme = sum(a);")); + + ScilabPolynomial aFromScilab = (ScilabPolynomial)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetStringTest() throws NullPointerException, JavasciException { + String [][]a = {{"String1", "String2", "String3", "String4"}, + {"String5", "String6", "My String 7", "String8"} + }; + ScilabString aOriginal = new ScilabString(a); + sci.put("a", aOriginal); + + assertTrue(sci.exec("checksize = and(size(a)==[2,4]);")); + + ScilabBoolean checksize = (ScilabBoolean)sci.get("checksize"); + assertTrue(checksize.getData()[0][0]); + + ScilabString aFromScilab = (ScilabString)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetListTest() throws NullPointerException, JavasciException { + ScilabList aOriginal = new ScilabList(); + aOriginal.add(new ScilabDouble(new double[][] {{1, 2, 3}, {3, 4, 5}})); + aOriginal.add(new ScilabInteger(new int[][] {{1, 2, 3}, {3, 4, 5}}, false)); + aOriginal.add(new ScilabString(new String[][] {{"1", "22", "333"}, {"333", "4444", "55555"}})); + aOriginal.add(new ScilabSparse(new double[][] {{0, 22.0, 0, 39.0}, {23.2, 0, 0, 40.0}})); + aOriginal.add(new ScilabDouble(new double[][] {{1, 2, 3}, {3, 4, 5}}, new double[][] {{3, 4, 5}, {1, 2, 3}})); + aOriginal.add(new ScilabBooleanSparse(new boolean[][] {{false, true, false, true}, {true, false, false, true}})); + aOriginal.add(new ScilabPolynomial(new double[][][] {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}})); + aOriginal.add(new ScilabInteger(new byte[][] {{1, 2, 3}, {3, 4, 5}}, true)); + aOriginal.add(new ScilabSparse(new double[][] {{0, 22.0, 0, 39.0}, {23.2, 0, 0, 40.0}}, new double[][] {{0, 11.0, 0, 18.5}, {1.34, 0, 0, 41.0}})); + aOriginal.add(new ScilabPolynomial(new double[][][] {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}}, new double[][][] {{{2, -1, 3}, {0}, {2, 0, 1, -3}}, {{3, 0, 1}, {1, -3, 0, 0, -2}, {0}}})); + + ScilabMList ml = new ScilabMList(); + aOriginal.add(ml); + ml.add(new ScilabDouble(new double[][] {{1, 2, 3}, {3, 4, 5}})); + ml.add(new ScilabPolynomial(new double[][][] {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}}, new double[][][] {{{2, -1, 3}, {0}, {2, 0, 1, -3}}, {{3, 0, 1}, {1, -3, 0, 0, -2}, {0}}})); + + ScilabList l = new ScilabList(); + ml.add(l); + l.add(new ScilabInteger(new short[][] {{1, 2, 3}, {3, 4, 5}}, false)); + l.add(new ScilabInteger(new short[][] {{1, 2, 3}, {3, 4, 5}}, true)); + ml.add(new ScilabPolynomial(new double[][][] {{{1, 2, 3}, {2}, {0, 0, 0, -4}}, {{ -1, 0, 2}, {0, 2, 0, 0, 3}, {0}}})); + + ScilabTList tl = new ScilabTList(); + ml.add(tl); + tl.add(new ScilabInteger(new short[][] {{1, 2, 3}, {3, 4, 5}}, true)); + + ScilabList l1 = new ScilabList(); + tl.add(l1); + l1.add(new ScilabInteger(new byte[][] {{1, 2, 3}, {3, 4, 5}}, false)); + aOriginal.add(new ScilabString(new String[][] {{"1", "22", "333"}, {"333", "4444", "55555"}})); + sci.put("a", aOriginal); + + ScilabList aFromScilab = (ScilabList)sci.get("a"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test() + public void putAndGetXCOSMListTest() throws NullPointerException, JavasciException { + String mlistcode = "mlist([\"diagram\", \"props\", \"objs\"], tlist([\"params\", \"wpar\", \"title\", \"tol\", \"tf\", \"context\", \"void1\", \"options\", \"void2\", \"void3\", \"doc\"], [600.0, 450.0, 0.0, 0.0, 600.0, 450.0], [\"CLSS\"], [1.0E-6, 1.0E-6, 1.0E-10, 100001.0, 0.0, 0.0, 0.0], [10.0], [\"\"], [], tlist([\"scsopt\", \"3D\", \"Background\", \"Link\", \"ID\", \"Cmap\"], list([%t], [33.0]), [8.0, 1.0], [1.0, 5.0], list([5.0, 1.0], [4.0, 1.0]), [0.8, 0.8, 0.8]), [], [], list()), list(mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [430.0, -180.0], [40.0, 40.0], [%t], [0.0], [], [], [], [], [7.0], list([\"xstringb(orig(1),orig(2),\"\"CLOCK_c\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [], [], [], [\"CLOCK_c;flip=false;mirror=false\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], [\"csuper\"], [], [], [], [], [], [], [], [-1.0], [], [], list(), mlist([\"diagram\", \"props\", \"objs\"], tlist([\"params\", \"wpar\", \"title\", \"tol\", \"tf\", \"context\", \"void1\", \"options\", \"void2\", \"void3\", \"doc\"], [600.0, 450.0, 0.0, 0.0, 600.0, 450.0], [\"Untitled\"], [1.0E-6, 1.0E-6, 1.0E-10, 100001.0, 0.0, 0.0, 0.0], [100000.0], [\"\"], [], tlist([\"scsopt\", \"3D\", \"Background\", \"Link\", \"ID\", \"Cmap\"], list([%t], [33.0]), [8.0, 1.0], [1.0, 5.0], list([5.0, 1.0], [4.0, 1.0]), [0.8, 0.8, 0.8]), [], [], list()), list(mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [440.0, -160.0], [40.0, 40.0], [%t], [0.0], [\"0.1\" ; \"0.1\"], [], [], [5.0], [6.0], list([\"xstringb(orig(1),orig(2),\"\"EVTDLY_c\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [], [], [], [\"EVTDLY_c\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], list([\"evtdly4\"], [4.0]), [], [], [], [], [], [], [-1.0], [-1.0], [], [], list(), [0.1 ; 0.1], [], list(), [\"d\"], [0.1], [%f, %f], [\"bedc105:13552780191:-7fc7\"], [0.0], [0.0], list()), [\"EVTDLY_c\"], list([\"bedc105:13552780191:-7fc7\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [519.0, -230.0], [20.0, 20.0], [%t], [0.0], [\"1\"], [], [], [4.0], [], list([\"xstringb(orig(1),orig(2),\"\"CLKOUT_f\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [], [], [], [\"CLKOUT_f\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], [\"output\"], [], [], [], [], [], [], [-1.0], [], [], [], list(), [], [1.0], list(), [\"d\"], [], [%f, %f], [\"bedc105:13552780191:-7fcb\"], [0.0], [0.0], list()), [\"CLKOUT_f\"], list([\"bedc105:13552780191:-7fcb\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [500.71066, -220.0], [8.0, 8.0], [%t], [0.0], [], [], [], [6.0], [4.0 ; 5.0], list([\"xstringb(orig(1),orig(2),\"\"CLKSPLIT_f\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [], [], [], [\"CLKSPLIT_f\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], [\"split\"], [], [], [], [], [], [], [-1.0], [-1.0 ; -1.0], [], [], list(), [], [], list(), [\"d\"], [-1.0 ; -1.0], [%f, %f], [\"bedc105:13552780191:-7fc2\"], [0.0], [0.0], list()), [\"CLKSPLIT_f\"], list([\"bedc105:13552780191:-7fc2\"])), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [500.71066 ; 529.0], [-216.0 ; -186.0], [\"drawlink\"], [0.0, 0.0], [5.0, -1.0], [3.0, 1.0, 1.0], [2.0, 1.0, 0.0]), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [510.71066 ; 533.71 ; 493.0 ; 460.0], [-216.0 ; -114.0 ; -114.0 ; -76.0], [\"drawlink\"], [0.0, 0.0], [5.0, -1.0], [3.0, 2.0, 1.0], [1.0, 1.0, 0.0]), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [460.0 ; 478.0 ; 500.71066], [-124.0 ; -276.0 ; -200.0], [\"drawlink\"], [0.0, 0.0], [5.0, -1.0], [1.0, 1.0, 1.0], [3.0, 1.0, 0.0])), [\"\"]), [], list(), [\"h\"], [-1.0], [%f, %f], [\"3bcfd9d2:12c7e695a9b:-7fc5\"], [0.0], [0.0], list()), [\"CLOCK_c\"], list([\"3bcfd9d2:12c7e695a9b:-7fc5\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [270.0, -300.0], [100.0, 70.0], [%t], [0.0], [\"[-2 -1/5;10 0]\" ; \"[1/5;0]\" ; \"[0 1]\" ; \"0\" ; \"[0 0.5]\"], [5.0], [6.0], [], [], list([\"xstringb(orig(1),orig(2),\"\"CLSS\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [\"E\"], [\"E\"], [\"ExplicitInputPort;align=center;labelPosition=right;verticalLabelPosition=middle;rotation=0;spacingLeft=5;flip=false;mirror=false\"], [\"ExplicitOutputPort;align=center;labelPosition=left;verticalLabelPosition=middle;rotation=0;spacingRight=5;flip=false;mirror=false\"], [\"CLSS;flip=false;mirror=false\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], list([\"csslti4\"], [4.0]), [1.0], [1.0], [1.0], [1.0], [1.0], [1.0], [], [], [0.0 ; 0.5], [], list(), [-2.0 ; 10.0 ; -0.2 ; 0.0 ; 0.2 ; 0.0 ; 0.0 ; 1.0 ; 0.0], [], list(), [\"c\"], [], [%f, %t], [\"3bcfd9d2:12c7e695a9b:-7fde\"], [0.0], [0.0], list()), [\"CLSS\"], list([\"3bcfd9d2:12c7e695a9b:-7fde\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [160.0, -290.0], [48.0, 40.0], [%t], [0.0], [], [], [5.0], [], [], list([\"xstringb(orig(1),orig(2),\"\"STEP_FUNCTION\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [\"E\"], [], [\"ExplicitOutputPort;align=center;labelPosition=left;verticalLabelPosition=middle;rotation=0;spacingRight=5;flip=false;mirror=false\"], [\"STEP_FUNCTION;flip=false;mirror=false\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], [\"csuper\"], [], [], [], [-1.0], [1.0], [1.0], [], [], [], [], list(), mlist([\"diagram\", \"props\", \"objs\"], tlist([\"params\", \"wpar\", \"title\", \"tol\", \"tf\", \"context\", \"void1\", \"options\", \"void2\", \"void3\", \"doc\"], [600.0, 450.0, 0.0, 0.0, 600.0, 450.0], [\"STEP_FUNCTION\"], [1.0E-4, 1.0E-6, 1.0E-10, 100001.0, 0.0, 0.0, 0.0], [14.0], [\" \"], [], tlist([\"scsopt\", \"3D\", \"Background\", \"Link\", \"ID\", \"Cmap\"], list([%t], [33.0]), [8.0, 1.0], [1.0, 5.0], list([5.0, 1.0], [4.0, 1.0]), [0.8, 0.8, 0.8]), [], [], list()), list(mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [202.230597, -160.0], [40.0, 40.0], [%t], [0.0], [\"1\" ; \"0\" ; \"1\"], [], [3.0], [4.0], [4.0], list([\"xstringb(orig(1),orig(2),\"\"STEP\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [], [\"E\"], [], [\"ExplicitOutputPort;align=right;verticalAlign=middle;spacing=10;rotation=0\"], [\"STEP\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], list([\"step_func\"], [4.0]), [], [], [], [1.0], [1.0], [1.0], [-1.0], [-1.0], [], [], list(), [0.0 ; 1.0], [], list(), [\"c\"], [1.0], [%f, %t], [\"bedc105:13552780191:-7fb7\"], [0.0], [0.0], list()), [\"STEP\"], list([\"bedc105:13552780191:-7fb7\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [270.80203, -150.0], [20.0, 20.0], [%t], [0.0], [\"1\"], [3.0], [], [], [], list([\"xstringb(orig(1),orig(2),\"\"OUT_f\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [\"E\"], [], [\"ExplicitInputPort;align=left;verticalAlign=middle;spacing=10;rotation=0\"], [], [\"OUT_f\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], [\"output\"], [-1.0], [-2.0], [-1.0], [], [], [], [], [], [], [], list(), [], [1.0], list(), [\"c\"], [], [%f, %f], [\"bedc105:13552780191:-7fb4\"], [0.0], [0.0], list()), [\"OUT_f\"], list([\"bedc105:13552780191:-7fb4\"])), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [246.230597 ; 266.80203], [-100.0 ; -120.0], [\"drawlink\"], [0.0, 0.0], [1.0, 1.0], [1.0, 1.0, 0.0], [2.0, 1.0, 1.0]), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [222.230597 ; 270.2306 ; 231.708992 ; 231.708992 ; 270.2306 ; 222.230597], [-124.0 ; -262.39289999999994 ; -262.39289999999994 ; -172.69678 ; -172.69678 ; -76.0], [\"drawlink\"], [0.0, 0.0], [5.0, -1.0], [1.0, 1.0, 1.0], [1.0, 1.0, 0.0])), [\"\"]), [], list(), [\"h\"], [], [%f, %f], [\"3bcfd9d2:12c7e695a9b:-7fd6\"], [0.0], [0.0], list()), [\"STEP_FUNCTION\"], list([\"3bcfd9d2:12c7e695a9b:-7fd6\"])), mlist([\"Block\", \"graphics\", \"model\", \"gui\", \"doc\"], mlist([\"graphics\", \"orig\", \"sz\", \"flip\", \"theta\", \"exprs\", \"pin\", \"pout\", \"pein\", \"peout\", \"gr_i\", \"id\", \"in_implicit\", \"out_implicit\", \"in_style\", \"out_style\", \"style\"], [430.0, -290.0], [40.0, 40.0], [%t], [0.0], [\"1 3 5 7 9 11 13 15\" ; \"-1\" ; \"[]\" ; \"[600;400]\" ; \"0.2\" ; \"1.1\" ; \"10\" ; \"20\" ; \"0\" ; \"\"], [6.0], [], [7.0], [], list([\"xstringb(orig(1),orig(2),\"\"CSCOPE\"\",sz(1),sz(2));\"], [8.0]), [\"\"], [\"E\"], [], [\"ExplicitInputPort;align=center;labelPosition=right;verticalLabelPosition=middle;rotation=0;spacingLeft=5;flip=false;mirror=false\"], [], [\"CSCOPE;flip=false;mirror=false\"]), mlist([\"model\", \"sim\", \"in\", \"in2\", \"intyp\", \"out\", \"out2\", \"outtyp\", \"evtin\", \"evtout\", \"state\", \"dstate\", \"odstate\", \"rpar\", \"ipar\", \"opar\", \"blocktype\", \"firing\", \"dep_ut\", \"label\", \"nzcross\", \"nmode\", \"equations\"], list([\"cscope\"], [4.0]), [-1.0], [1.0], [1.0], [], [], [], [-1.0], [], [], [], list(), [0.0 ; 0.2 ; 1.1 ; 10.0], [-1.0 ; 1.0 ; 20.0 ; 1.0 ; 3.0 ; 5.0 ; 7.0 ; 9.0 ; 11.0 ; 13.0 ; 15.0 ; -1.0 ; -1.0 ; 600.0 ; 400.0], list(), [\"c\"], [], [%t, %f], [\"3bcfd9d2:12c7e695a9b:-7fcd\"], [0.0], [0.0], list()), [\"CSCOPE\"], list([\"3bcfd9d2:12c7e695a9b:-7fcd\"])), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [212.0 ; 266.0], [-230.0 ; -200.0], [\"drawlink\"], [0.0, 0.0], [1.0, 1.0], [3.0, 1.0, 0.0], [2.0, 1.0, 1.0]), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [374.0 ; 426.0], [-200.0 ; -230.0], [\"drawlink\"], [0.0, 0.0], [1.0, 1.0], [2.0, 1.0, 0.0], [4.0, 1.0, 1.0]), mlist([\"Link\", \"xx\", \"yy\", \"id\", \"thick\", \"ct\", \"from\", \"to\"], [450.0 ; 450.0], [-144.0 ; -206.0], [\"drawlink\"], [0.0, 0.0], [5.0, -1.0], [1.0, 1.0, 1.0], [4.0, 1.0, 0.0])), [\"\"])"; + assertTrue(sci.exec("ml=" + mlistcode)); + ScilabMList mlFromScilab = (ScilabMList)sci.get("ml"); + sci.put("ml1", mlFromScilab); + + ScilabMList ml1FromScilab = (ScilabMList)sci.get("ml1"); + assertTrue(mlFromScilab.equals(ml1FromScilab)); + } + + // @Test( expected = UnsupportedTypeException.class) + @Test() + public void ReadSparseTypeTest() throws NullPointerException, JavasciException { + assertTrue(sci.exec("W=sparse([1,2;4,5;3,10],[1,2,3]);")); + assertEquals(sci.getVariableType("W"), ScilabTypeEnum.sci_sparse); + ScilabSparse aFromScilab = (ScilabSparse)sci.get("W"); + assertTrue(aFromScilab.toString().equals("sparse([1, 2 ; 3, 10 ; 4, 5], [1.0 ; 3.0 ; 2.0], [4, 10])")); + assertTrue(sci.exec("AZE= " + aFromScilab.toString())); + ScilabSparse aFromScilab2 = (ScilabSparse)sci.get("AZE"); + + assertTrue(Arrays.deepEquals(aFromScilab.getFullRealPart(), aFromScilab2.getFullRealPart())); + + ScilabSparse mySparse = new ScilabSparse(100, 100, 5, new int[] { 1, 1, 1, 1, 1}, new int[] { 1, 25, 50, 75, 99}, new double[] { 1.0, 2.0, 3.0, 4.0, 5.0}); + // sci.put with a sparse is not yet functional + // assertTrue(sci.put("mySparse", mySparse)); + // String ref="mySparseRef = sparse([1, 2 ; 2, 26 ; 3, 51 ; 4, 76 ; 5, 100], [1.0 ; 2.0 ; 3.0 ; 4.0 ; 5.0], [100, 100]);"; + // sci.exec("isEqual=(mySparseRef==mySparse)"); + // ScilabBoolean isEqual = (ScilabBoolean)sci.get("isEqual"); + // System.out.println("isequal " +isEqual); + + + } + + @Test() + public void ReadStructTest() throws NullPointerException, JavasciException { + assertTrue(sci.exec("myDate=struct('day',25,'month' ,'DEC','year',2006)")); + assertEquals(sci.getVariableType("myDate"), ScilabTypeEnum.sci_mlist); + + ScilabMList myDate = (ScilabMList)sci.get("myDate"); + assertTrue(myDate.toString().equals("mlist([\"st\", \"dims\", \"day\", \"month\", \"year\"], int32([1, 1]), [25.0], [\"DEC\"], [2006.0])")); + assertEquals(myDate.getHeight(), 1); + assertEquals(myDate.getWidth(), 5); + assertTrue(myDate.getVarName().equals("myDate")); + assertTrue(myDate.getMListType().equals("st")); + Map<String, ScilabType> listFields = myDate.getMListFields(); + ScilabString month = (ScilabString)listFields.get("month"); + assertTrue(month.getData()[0][0].equals("DEC")); + ScilabDouble year = (ScilabDouble)listFields.get("year"); + assertEquals(year.getRealPart()[0][0], 2006.0, 1e-8); + ScilabDouble day = (ScilabDouble)listFields.get("day"); + assertEquals(day.getRealPart()[0][0], 25.0, 1e-8); + + } + + @Test( expected = UndefinedVariableException.class) + public void UndefinedVariableExceptionTest() throws NullPointerException, JavasciException { + sci.get("undefinedVar"); /* Will launch an UnsupportedTypeException exception */ + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteBuf.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteBuf.java new file mode 100755 index 000000000..bb628c4d9 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteBuf.java @@ -0,0 +1,207 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import java.util.Arrays; +import java.util.Map; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabDouble; +import org.scilab.modules.types.ScilabBoolean; +import org.scilab.modules.types.ScilabBooleanSparse; +import org.scilab.modules.types.ScilabInteger; +import org.scilab.modules.types.ScilabMList; +import org.scilab.modules.types.ScilabList; +import org.scilab.modules.types.ScilabTList; +import org.scilab.modules.types.ScilabPolynomial; +import org.scilab.modules.types.ScilabString; +import org.scilab.modules.types.ScilabSparse; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testReadWriteBuf { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void putAndGetRefDoubleTest() throws NullPointerException, JavasciException { + double [][]a = {{21.2, 22.0, 42.0, 39.0}, {23.2, 24.0, 44.0, 40.0}}; + ScilabDouble aOriginal = new ScilabDouble(a); + sci.put("a", aOriginal); + + ScilabDouble aFromScilab = (ScilabDouble)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=12345;")); + assertTrue(aFromScilab.getRealElement(1, 2) == 12345); + aFromScilab.setRealElement(1, 2, 3.14159); + assertTrue(sci.exec("b=a(2,3);")); + ScilabDouble bFromScilab = (ScilabDouble)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabDouble(3.14159))); + } + + @Test() + public void putAndGetRefComplexDoubleTest() throws NullPointerException, JavasciException { + double [][]a = {{21.2, 22.0, 42.0, 39.0}, {23.2, 24.0, 44.0, 40.0}}; + double [][]aImg = {{212.2, 221.0, 423.0, 393.0}, {234.2, 244.0, 441.0, 407.0}}; + ScilabDouble aOriginal = new ScilabDouble(a, aImg); + sci.put("a", aOriginal); + + ScilabDouble aFromScilab = (ScilabDouble)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=12345+%i*5.4321;")); + assertTrue(aFromScilab.getRealElement(1, 2) == 12345 && aFromScilab.getImaginaryElement(1, 2) == 5.4321); + aFromScilab.setRealElement(1, 2, 3.14159); + aFromScilab.setImaginaryElement(1, 2, 2.71828); + assertTrue(sci.exec("b=a(2,3);")); + ScilabDouble bFromScilab = (ScilabDouble)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabDouble(3.14159, 2.71828))); + } + + @Test() + public void putAndGetRefInt8Test() throws NullPointerException, JavasciException { + byte[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=123;")); + assertTrue(aFromScilab.getElement(1, 2) == 123); + aFromScilab.setElement(1, 2, (byte) - 98); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((byte) - 98, false))); + } + + @Test() + public void putAndGetRefUInt8Test() throws NullPointerException, JavasciException { + byte[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=253;")); + assertTrue(aFromScilab.getElement(1, 2) == (byte)253); + aFromScilab.setElement(1, 2, (byte)189); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((byte)189, true))); + } + + @Test() + public void putAndGetRefInt16Test() throws NullPointerException, JavasciException { + short[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=123;")); + assertTrue(aFromScilab.getElement(1, 2) == 123); + aFromScilab.setElement(1, 2, (short) - 98); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((short) - 98, false))); + } + + @Test() + public void putAndGetRefUInt16Test() throws NullPointerException, JavasciException { + short[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=253;")); + assertTrue(aFromScilab.getElement(1, 2) == (short)253); + aFromScilab.setElement(1, 2, (short)189); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((short)189, true))); + } + + @Test() + public void putAndGetRefInt32Test() throws NullPointerException, JavasciException { + int[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=123;")); + assertTrue(aFromScilab.getElement(1, 2) == 123); + aFromScilab.setElement(1, 2, (int) - 98); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((int) - 98, false))); + } + + @Test() + public void putAndGetRefUInt32Test() throws NullPointerException, JavasciException { + int[][] a = {{1, 2, 3, 4}, {5, 6, 7, 8}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); + sci.put("a", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=253;")); + assertTrue(aFromScilab.getElement(1, 2) == (int)253); + aFromScilab.setElement(1, 2, (int)189); + assertTrue(sci.exec("b=a(2,3);")); + ScilabInteger bFromScilab = (ScilabInteger)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabInteger((int)189, true))); + } + + @Test() + public void putAndGetRefBooleanTest() throws NullPointerException, JavasciException { + boolean[][] a = {{true, false, true, true}, {false, false, true, true}}; + ScilabBoolean aOriginal = new ScilabBoolean(a); + sci.put("a", aOriginal); + + ScilabBoolean aFromScilab = (ScilabBoolean)sci.getByReference("a"); + assertTrue(aFromScilab.equals(aOriginal)); + assertTrue(sci.exec("a(2,3)=%f;")); + assertTrue(aFromScilab.getElement(1, 2) == false); + aFromScilab.setElement(1, 2, true); + assertTrue(sci.exec("b=a(2,3);")); + ScilabBoolean bFromScilab = (ScilabBoolean)sci.get("b"); + assertTrue(bFromScilab.equals(new ScilabBoolean(true))); + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + } +} diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteInteger.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteInteger.java new file mode 100755 index 000000000..8970935e3 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testReadWriteInteger.java @@ -0,0 +1,167 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.InitializationException; +import org.scilab.modules.javasci.JavasciException.UnsupportedTypeException; +import org.scilab.modules.types.ScilabType; +import org.scilab.modules.types.ScilabInteger; + +public class testReadWriteInteger { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void putAndGetInteger8UnsignedTest() throws NullPointerException, JavasciException { + + byte [][]a = {{21, 22, 42, 39}, {23, 24, 44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); /* unsigned */ + sci.put("b", aOriginal); + // assertTrue(sci.exec("somme = sum(a);")); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + // Test values + byte [][]z = {{ -1, -128, 0}}; + ScilabInteger zMatrix = new ScilabInteger(z, true); + sci.put("z", zMatrix); + sci.exec("sumElements=sum(z);"); + + ScilabInteger zFromScilab = (ScilabInteger)sci.get("z"); + assertTrue(zFromScilab.equals(zMatrix)); + } + + @Test() + public void putAndGetInteger8SignedTest() throws NullPointerException, JavasciException { + byte [][]a = {{ -21, 22, -42, 39}, {23, -24, -44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); /* signed */ + sci.put("b", aOriginal); + // assertTrue(sci.exec("somme = sum(a);")); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + byte [][]z = {{ -1, -128, 0}}; + ScilabInteger zMatrix = new ScilabInteger(z, false); + sci.put("z", zMatrix); + ScilabInteger zFromScilab = (ScilabInteger)sci.get("z"); + assertTrue(zFromScilab.equals(zMatrix)); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + @Test() + public void putAndGetInteger16UnsignedTest() throws NullPointerException, JavasciException { + short [][]a = {{21, 22, 42, 39}, {23, 24, 44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); /* unsigned */ + sci.put("b", aOriginal); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + @Test() + public void putAndGetInteger16SignedTest() throws NullPointerException, JavasciException { + short [][]a = {{ -21, 22, -42, 39}, {23, -24, -44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); /* signed */ + sci.put("b", aOriginal); + // assertTrue(sci.exec("somme = sum(a);")); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + @Test() + public void putAndGetInteger32UnsignedTest() throws NullPointerException, JavasciException { + + int [][]a = {{21, 22, 42, 39}, {23, 24, 44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); /* unsigned */ + + sci.put("b", aOriginal); + // assertTrue(sci.exec("somme = sum(a);")); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + @Test() + public void putAndGetInteger32SignedTest() throws NullPointerException, JavasciException { + int [][]a = {{ -21, 22, -42, 39}, {23, -24, -44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); /* signed */ + sci.put("b", aOriginal); + // assertTrue(sci.exec("somme = sum(a);")); + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + @Test( expected = UnsupportedTypeException.class) + // Will be unblocked for Scilab 6 + public void putAndGetInteger64UnsignedTest() throws NullPointerException, JavasciException { + long [][]a = {{21, 22, 42, 39}, {23, 24, 44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, true); /* unsigned */ + sci.put("b", aOriginal); /* Exception launched */ + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + } + + @Test( expected = UnsupportedTypeException.class) + // Will be unblocked for Scilab 6 + public void putAndGetInteger64SignedTest() throws NullPointerException, JavasciException { + long [][]a = {{ -21, 22, -42, 39}, {23, -24, -44, 40}}; + ScilabInteger aOriginal = new ScilabInteger(a, false); /* signed */ + sci.put("b", aOriginal); /* Exception launched */ + + ScilabInteger aFromScilab = (ScilabInteger)sci.get("b"); + + assertTrue(aFromScilab.equals(aOriginal)); + + } + + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +}
\ No newline at end of file diff --git a/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testTypes.java b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testTypes.java new file mode 100755 index 000000000..b4c21e833 --- /dev/null +++ b/modules/javasci/tests/java/org/scilab/tests/modules/javasci/testTypes.java @@ -0,0 +1,119 @@ +/* + * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab + * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU + * + * 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.1-en.txt + * + */ +package org.scilab.tests.modules.javasci; + +import org.junit.*; +import static org.junit.Assert.*; + +import org.scilab.modules.javasci.Scilab; +import org.scilab.modules.javasci.JavasciException; +import org.scilab.modules.javasci.JavasciException.UndefinedVariableException; +import org.scilab.modules.types.ScilabTypeEnum; + +public class testTypes { + private Scilab sci; + + /* + * This method will be called for each test. + * with @After, this ensures that all the time the engine is closed + * especially in case of error. + * Otherwise, the engine might be still running and all subsequent tests + * would fail. + */ + @Before + public void open() throws NullPointerException, JavasciException { + sci = new Scilab(); + assertTrue(sci.open()); + } + + @Test() + public void getVariableTypeTest() throws NullPointerException, JavasciException { + + sci.exec("a = 2*%pi"); + assertEquals(sci.getVariableType("a"), ScilabTypeEnum.sci_matrix); + + sci.exec("a = rand(10,10)"); + assertEquals(sci.getVariableType("a"), ScilabTypeEnum.sci_matrix); + + sci.exec("b = 'plop'"); + assertEquals(sci.getVariableType("b"), ScilabTypeEnum.sci_strings); + + sci.exec("b = ['plop', plip]"); + assertEquals(sci.getVariableType("b"), ScilabTypeEnum.sci_strings); + + sci.exec("s=poly(0,'s');p=1+s+2*s^2;"); + assertEquals(sci.getVariableType("p"), ScilabTypeEnum.sci_poly); + + sci.exec("b=%t;"); + assertEquals(sci.getVariableType("b"), ScilabTypeEnum.sci_boolean); + + sci.exec("b=[%t, %f];"); + assertEquals(sci.getVariableType("b"), ScilabTypeEnum.sci_boolean); + + sci.exec("sp=sparse([1,2;4,5;3,10],[1,2,3])"); + assertEquals(sci.getVariableType("sp"), ScilabTypeEnum.sci_sparse); + + sci.exec("a = sparse([%t, %f, %t ; %f, %t, %f ; %t, %f, %t]);"); + assertEquals(sci.getVariableType("a"), ScilabTypeEnum.sci_boolean_sparse); + + sci.exec("sp=sparse([1,2;4,5;3,10],[%t,%t,%t])"); + assertEquals(sci.getVariableType("sp"), ScilabTypeEnum.sci_boolean_sparse); + + sci.exec("i8=int8([1 -120 127 312])"); + assertEquals(sci.getVariableType("i8"), ScilabTypeEnum.sci_ints); + + sci.exec("i8=uint8([1 -120 127 312])"); + assertEquals(sci.getVariableType("i8"), ScilabTypeEnum.sci_ints); + + sci.exec("x=int32(-200:100:400)"); + assertEquals(sci.getVariableType("x"), ScilabTypeEnum.sci_ints); + + sci.exec("x=uint32(-200:100:400)"); + assertEquals(sci.getVariableType("x"), ScilabTypeEnum.sci_ints); + + sci.exec("t = tlist(['listtype','field1','field2'], [], []);"); + assertEquals(sci.getVariableType("t"), ScilabTypeEnum.sci_tlist); + + sci.exec("t.field1(1);"); + assertEquals(sci.getVariableType("t"), ScilabTypeEnum.sci_tlist); + + sci.exec("l = list(1,['a' 'b'])"); + assertEquals(sci.getVariableType("l"), ScilabTypeEnum.sci_list); + + sci.exec("l(0) = 'foo'"); + assertEquals(sci.getVariableType("l"), ScilabTypeEnum.sci_list); + + sci.exec("M=mlist(['V','name','value'],['a','b';'c' 'd'],[1 2; 3 4]);"); + assertEquals(sci.getVariableType("M"), ScilabTypeEnum.sci_mlist); + + } + + @Test( expected = UndefinedVariableException.class) + public void failGetVariableTypeTest() throws NullPointerException, IllegalArgumentException, JavasciException { + sci.getVariableType("nonexistingvariable"); + + } + + @Test( expected = UndefinedVariableException.class) + public void failGetVariableType2Test() throws NullPointerException, IllegalArgumentException, JavasciException { + sci.getVariableTypeInCurrentScilabSession("nonexistingvariable"); + + } + /** + * See #open() + */ + @After + public void close() { + sci.close(); + + } +} |