summaryrefslogtreecommitdiffstats
path: root/scilab/modules/core
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-04-07 13:43:52 +0200
committerAllan CORNET <allan.cornet@scilab.org>2010-04-07 13:43:52 +0200
commit42697f744fa7d572d99606f6f3b877b846413985 (patch)
treea003c39651e792fb46683c5c4f9ff948ca30bf97 /scilab/modules/core
parent34111cf90ce1102a17ad760a7d15ad65c1adff03 (diff)
downloadscilab-42697f744fa7d572d99606f6f3b877b846413985.zip
scilab-42697f744fa7d572d99606f6f3b877b846413985.tar.gz
bug 6863 + bug 6866 + cleaning
Diffstat (limited to 'scilab/modules/core')
-rw-r--r--scilab/modules/core/Makefile.am2
-rw-r--r--scilab/modules/core/core.iss1
-rw-r--r--scilab/modules/core/help/en_US/getversion.xml49
-rw-r--r--scilab/modules/core/help/pt_BR/getversion.xml26
-rw-r--r--scilab/modules/core/includes/getversion.h117
-rw-r--r--scilab/modules/core/includes/gw_core.h2
-rw-r--r--scilab/modules/core/includes/inisci-c.h62
-rw-r--r--scilab/modules/core/macros/with_atlas.sci6
-rw-r--r--scilab/modules/core/macros/with_tk.sci5
-rw-r--r--scilab/modules/core/sci_gateway/c/gw_core.c2
-rw-r--r--scilab/modules/core/sci_gateway/c/sci_getversion.c408
-rw-r--r--scilab/modules/core/src/c/core.vcproj8
-rw-r--r--scilab/modules/core/src/c/dynamic_tclsci.c11
-rw-r--r--scilab/modules/core/src/c/dynamic_tclsci.h13
-rw-r--r--scilab/modules/core/src/c/getstaticDebugInfo_Windows.c3
-rw-r--r--scilab/modules/core/src/c/getversion.c342
-rw-r--r--scilab/modules/core/src/c/inisci-c.c44
-rw-r--r--scilab/modules/core/src/c/terme.c2
-rw-r--r--scilab/modules/core/src/fortran/inisci.f33
19 files changed, 739 insertions, 397 deletions
diff --git a/scilab/modules/core/Makefile.am b/scilab/modules/core/Makefile.am
index 021c63d..d1ce123 100644
--- a/scilab/modules/core/Makefile.am
+++ b/scilab/modules/core/Makefile.am
@@ -84,6 +84,7 @@ src/c/inittypenames.c \
84src/c/funcprot.c \ 84src/c/funcprot.c \
85src/c/eqid.c \ 85src/c/eqid.c \
86src/c/exitCodeValue.c \ 86src/c/exitCodeValue.c \
87src/c/getversion.c \
87src/c/dynamic_tclsci.c 88src/c/dynamic_tclsci.c
88 89
89CORE_CPP_SOURCES = src/cpp/hashtable_core.cpp 90CORE_CPP_SOURCES = src/cpp/hashtable_core.cpp
@@ -367,6 +368,7 @@ includes/stack3.h \
367includes/stackinfo.h \ 368includes/stackinfo.h \
368includes/stackTypeVariable.h \ 369includes/stackTypeVariable.h \
369includes/version.h \ 370includes/version.h \
371includes/getversion.h \
370includes/warningmode.h 372includes/warningmode.h
371 373
372include $(top_srcdir)/Makefile.incl.am 374include $(top_srcdir)/Makefile.incl.am
diff --git a/scilab/modules/core/core.iss b/scilab/modules/core/core.iss
index e0c21f2..e192ccd 100644
--- a/scilab/modules/core/core.iss
+++ b/scilab/modules/core/core.iss
@@ -47,6 +47,7 @@ Source: modules\{#CORE}\includes\stackinfo.h; DestDir: {app}\modules\{#CORE}\inc
47Source: modules\{#CORE}\includes\stackTypeVariable.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB} 47Source: modules\{#CORE}\includes\stackTypeVariable.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
48Source: modules\{#CORE}\includes\version.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB} 48Source: modules\{#CORE}\includes\version.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
49Source: modules\{#CORE}\includes\warningmode.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB} 49Source: modules\{#CORE}\includes\warningmode.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
50Source: modules\{#CORE}\includes\getversion.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
50; 51;
51Source: modules\{#CORE}\macros\buildmacros.sce; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB} 52Source: modules\{#CORE}\macros\buildmacros.sce; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB}
52Source: modules\{#CORE}\macros\buildmacros.bat; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB} 53Source: modules\{#CORE}\macros\buildmacros.bat; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB}
diff --git a/scilab/modules/core/help/en_US/getversion.xml b/scilab/modules/core/help/en_US/getversion.xml
index baf2f2b..d2003f3 100644
--- a/scilab/modules/core/help/en_US/getversion.xml
+++ b/scilab/modules/core/help/en_US/getversion.xml
@@ -20,12 +20,12 @@
20 <refsynopsisdiv> 20 <refsynopsisdiv>
21 <title>Calling Sequence</title> 21 <title>Calling Sequence</title>
22 22
23 <synopsis>version=getversion() 23 <synopsis>version = getversion()
24[version,opts]=getversion() 24[version, opts] = getversion()
25ver=getversion('scilab') 25version_numbers = getversion('scilab')
26versioninfo=getversion('scilab','string_info') 26versioninfo = getversion('scilab', 'string_info')
27ver=getversion('&lt;module&gt;') 27version_numbers = getversion('&lt;module&gt;')
28versioninfo=getversion('&lt;module&gt;','string_info')</synopsis> 28versioninfo = getversion('&lt;module&gt;','string_info')</synopsis>
29 </refsynopsisdiv> 29 </refsynopsisdiv>
30 30
31 <refsection> 31 <refsection>
@@ -49,7 +49,7 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
49 </varlistentry> 49 </varlistentry>
50 50
51 <varlistentry> 51 <varlistentry>
52 <term>ver</term> 52 <term>version_numbers</term>
53 53
54 <listitem> 54 <listitem>
55 <para>a integer vector</para> 55 <para>a integer vector</para>
@@ -68,8 +68,8 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
68 <term>opts</term> 68 <term>opts</term>
69 69
70 <listitem> 70 <listitem>
71 <para>a vector of string with seven entries 71 <para>a vector of string
72 :<literal>[compiler, pvm, tk, modelicac, release_mode, release_date, release_time]</literal></para> 72 :<literal>[compiler, architecture,[ pvm, tk, modelicac, atlas,] release_mode, release_date, release_time]</literal></para>
73 </listitem> 73 </listitem>
74 </varlistentry> 74 </varlistentry>
75 </variablelist> 75 </variablelist>
@@ -80,7 +80,14 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
80 80
81 <para>return in <literal>version</literal> the Scilab version name and in 81 <para>return in <literal>version</literal> the Scilab version name and in
82 <literal>opts</literal> build options which can be used to determine if 82 <literal>opts</literal> build options which can be used to determine if
83 scilab has been build with pvm, tk or modelicac and give release date and time.</para> 83 scilab has been build with pvm, tk , atlas or modelicac and give release date and time.</para>
84 <para> [ pvm, tk, modelicac, atlas,] are optional. </para>
85 <para> compiler: returns compiler used to build scilab ('GCC', 'VC++', 'PGI', 'ICC', 'SUN', 'UKN' unknown)</para>
86 <para> archicteture: 'x86' or 'x64'.</para>
87 <para> pvm: 'pvm' if pvm is enabled.</para>
88 <para> tk: 'tk' if tcl/tk is enabled.</para>
89 <para> modelicac: 'modelicac' if modelica compiler is ditributed with scilab/xcos.</para>
90 <para> atlas: 'atlas' if scilab was built with atlas (or MKL).</para>
84 </refsection> 91 </refsection>
85 92
86 <refsection> 93 <refsection>
@@ -88,11 +95,23 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
88 95
89 <programlisting role="example"><![CDATA[ 96 <programlisting role="example"><![CDATA[
90getversion() 97getversion()
91[version,opts]=getversion() 98
92ver=getversion('scilab') 99[version, opts] = getversion()
93verstr=getversion('scilab','string_info') 100COMPILER = opts(1)
94ver=getversion('overloading') 101ARCH = opts(2)
95verstr=getversion('overloading','string_info') 102or(opt == 'modelicac')
103or(opt == 'pvm')
104or(opt == 'tk')
105or(opt == 'atlas')
106RELEASE_MODE = opts($-2)
107RELEASE_DATE = opts($-1)
108RELEASE_TIME = opts($)
109
110version = getversion('scilab')
111versionstr = getversion('scilab','string_info')
112version = getversion('overloading')
113versionstr = getversion('overloading','string_info')
114
96 ]]></programlisting> 115 ]]></programlisting>
97 </refsection> 116 </refsection>
98 117
diff --git a/scilab/modules/core/help/pt_BR/getversion.xml b/scilab/modules/core/help/pt_BR/getversion.xml
index 87f241a..6a9ad8e 100644
--- a/scilab/modules/core/help/pt_BR/getversion.xml
+++ b/scilab/modules/core/help/pt_BR/getversion.xml
@@ -68,8 +68,8 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
68 <term>opts</term> 68 <term>opts</term>
69 69
70 <listitem> 70 <listitem>
71 <para>um vetor de strings de 7 entradas: 71 <para>um vetor de strings:
72 <literal>[compiler, pvm, tk, modelicac, release_mode, release_date, release_time]</literal></para> 72 <literal>[compiler, architecture, [pvm, tk, modelicac, atlas,] release_mode, release_date, release_time]</literal></para>
73 </listitem> 73 </listitem>
74 </varlistentry> 74 </varlistentry>
75 </variablelist> 75 </variablelist>
@@ -89,11 +89,23 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
89 89
90 <programlisting role="example"><![CDATA[ 90 <programlisting role="example"><![CDATA[
91getversion() 91getversion()
92[version,opts]=getversion() 92
93ver=getversion('scilab') 93[version, opts] = getversion()
94verstr=getversion('scilab','string_info') 94COMPILER = opts(1)
95ver=getversion('overloading') 95ARCH = opts(2)
96verstr=getversion('overloading','string_info') 96or(opt == 'modelicac')
97or(opt == 'pvm')
98or(opt == 'tk')
99or(opt == 'atlas')
100RELEASE_MODE = opts($-2)
101RELEASE_DATE = opts($-1)
102RELEASE_TIME = opts($)
103
104version = getversion('scilab')
105versionstr = getversion('scilab','string_info')
106version = getversion('overloading')
107versionstr = getversion('overloading','string_info')
108
97 ]]></programlisting> 109 ]]></programlisting>
98 </refsection> 110 </refsection>
99 111
diff --git a/scilab/modules/core/includes/getversion.h b/scilab/modules/core/includes/getversion.h
new file mode 100644
index 0000000..723fb8a
--- /dev/null
+++ b/scilab/modules/core/includes/getversion.h
@@ -0,0 +1,117 @@
1/*
2* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3* Copyright (C) 2010 - DIGITEO - Allan CORNET
4*
5* This file must be used under the terms of the CeCILL.
6* This source file is licensed as described in the file COPYING, which
7* you should have received as part of this distribution. The terms
8* are also available at
9* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10*
11*/
12/*--------------------------------------------------------------------------*/
13#ifndef __GETVERSION_H__
14#define __GETVERSION_H__
15
16#include "BOOL.h"
17
18/**
19* get Scilab Version as a int array
20* @param[out] size of returned array
21* @return int array ver
22* ver[0] Major version
23* ver[1] Minor version
24* ver[2] Maintenance version
25* ver[3] timestamp
26*/
27int *getScilabVersion(int *sizeArrayReturned);
28
29/**
30* get Scilab version as a string
31* @return scilab version
32*/
33char *getScilabVersionAsString(void);
34
35/**
36* get module version as a int array
37* @param[in] module name
38* @param[out] size of returned array
39* @return int array ver
40* ver[0] Major version
41* ver[1] Minor version
42* ver[2] Maintenance version
43* ver[3] timestamp
44*/
45int* getModuleVersion(char *modulename, int *sizeArrayReturned);
46
47/**
48* get module version as a string
49* @param[in] module name
50* @return scilab version
51*/
52char *getModuleVersionInfoAsString(char *modulename);
53
54/**
55* get options used for this version
56* @param[out]
57* @return char ** with options used
58*/
59char **getScilabVersionOptions(int *sizeArrayReturned);
60
61/**
62* get release mode
63* @return 'release' or 'debug'
64*/
65char *getReleaseMode(void);
66
67/**
68* get release date
69* @return date of version
70*/
71char *getReleaseDate(void);
72
73/**
74* get release time
75* @return time of version
76*/
77char *getReleaseTime(void);
78
79/**
80* get compiler used to build scilab
81* @return 'VC++', 'ICC', 'GCC'
82*/
83char *getCompilerUsedToBuildScilab(void);
84
85/**
86* get Compiler Architecture
87* @return 'x86' or 'x64'
88*/
89char *getCompilerArchitecture(void);
90
91/**
92* with atlas ?
93* @return TRUE or FALSE
94*/
95BOOL with_atlas(void);
96
97/**
98* with pvm ?
99* @return TRUE or FALSE
100*/
101BOOL with_pvm(void);
102
103/**
104* with modelica compiler ?
105* @return TRUE or FALSE
106*/
107BOOL with_modelica_compiler(void);
108
109/**
110* with tcl/tk ?
111* @return TRUE or FALSE
112*/
113BOOL with_tk(void);
114
115#endif /* __GETVERSION_H__ */
116/*--------------------------------------------------------------------------*/
117
diff --git a/scilab/modules/core/includes/gw_core.h b/scilab/modules/core/includes/gw_core.h
index 4273e60..d7f2a3d 100644
--- a/scilab/modules/core/includes/gw_core.h
+++ b/scilab/modules/core/includes/gw_core.h
@@ -57,7 +57,7 @@ int C2F(sci_isglobal)(char *fname,unsigned long fname_len);
57int C2F(sci_gstacksize)(char *fname,unsigned long fname_len); 57int C2F(sci_gstacksize)(char *fname,unsigned long fname_len);
58int C2F(sci_intppty)(char *fname,unsigned long fname_len); 58int C2F(sci_intppty)(char *fname,unsigned long fname_len);
59int C2F(sci_lasterror)(char *fname,unsigned long fname_len); 59int C2F(sci_lasterror)(char *fname,unsigned long fname_len);
60int C2F(sci_getversion)(char *fname,unsigned long fname_len); 60int sci_getversion(char *fname,unsigned long fname_len);
61int C2F(sci_macr2tree)(char *fname,unsigned long fname_len); 61int C2F(sci_macr2tree)(char *fname,unsigned long fname_len);
62int C2F(sci_getos)(char *fname,unsigned long fname_len); 62int C2F(sci_getos)(char *fname,unsigned long fname_len);
63int C2F(sci_banner)(char *fname,unsigned long fname_len); 63int C2F(sci_banner)(char *fname,unsigned long fname_len);
diff --git a/scilab/modules/core/includes/inisci-c.h b/scilab/modules/core/includes/inisci-c.h
index 31729de..fe8f756 100644
--- a/scilab/modules/core/includes/inisci-c.h
+++ b/scilab/modules/core/includes/inisci-c.h
@@ -17,68 +17,6 @@
17 17
18/** 18/**
19 * TODO : comment 19 * TODO : comment
20 * @param rep
21 * @return
22 */
23int C2F(withscicos)(int *rep);
24
25/**
26 * TODO : comment
27 * @param rep
28 * @return
29 */
30int C2F(withmodelicac)(int *rep);
31
32/**
33 * TODO : comment
34 * @param rep
35 * @return
36 */
37int C2F(withjavasci)(int *rep);
38
39/**
40 * TODO : comment
41 * @param rep
42 * @return
43 */
44int C2F(withmsdos)(int *rep);
45
46/**
47 * TODO : comment
48 * @param buf
49 * @param nbuf
50 * @param lbuf
51 * @return
52 */
53int C2F(getcomp)(char *buf,int *nbuf,long int lbuf);
54
55
56/**
57 * TODO : comment
58 * @return
59 */
60int ExistJavaSciUnix(void);
61
62/**
63 * TODO : comment
64 * @return
65 */
66BOOL ExistModelicac(void);
67
68/**
69 * TODO : comment
70 * @return
71 */
72BOOL ExistScicos(void);
73
74/**
75 * TODO : comment
76 * @return
77 */
78BOOL ExistJavaSciWin(void);
79
80/**
81 * TODO : comment
82 * @return 20 * @return
83 */ 21 */
84int SetSci(void); 22int SetSci(void);
diff --git a/scilab/modules/core/macros/with_atlas.sci b/scilab/modules/core/macros/with_atlas.sci
index 74dd454..ca8b791 100644
--- a/scilab/modules/core/macros/with_atlas.sci
+++ b/scilab/modules/core/macros/with_atlas.sci
@@ -7,7 +7,7 @@
7// are also available at 7// are also available at
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 9
10function r=with_atlas() 10function r = with_atlas()
11 [v,opt]=getversion() 11 [v, opt] = getversion();
12 r=or(opt=='atlas') 12 r = or(opt == 'atlas');
13endfunction 13endfunction
diff --git a/scilab/modules/core/macros/with_tk.sci b/scilab/modules/core/macros/with_tk.sci
index fcaad97..458aad5 100644
--- a/scilab/modules/core/macros/with_tk.sci
+++ b/scilab/modules/core/macros/with_tk.sci
@@ -7,7 +7,6 @@
7// are also available at 7// are also available at
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9 9
10function r=with_tk() 10function r = with_tk()
11 [v,opt]=getversion() 11 r = (with_module('tclsci') & getscilabmode() <> 'NWNI');
12 r=or(opt=='tk')
13endfunction 12endfunction
diff --git a/scilab/modules/core/sci_gateway/c/gw_core.c b/scilab/modules/core/sci_gateway/c/gw_core.c
index abba3c7..9ad9d64 100644
--- a/scilab/modules/core/sci_gateway/c/gw_core.c
+++ b/scilab/modules/core/sci_gateway/c/gw_core.c
@@ -60,7 +60,7 @@ static gw_generic_table Tab[]=
60{C2F(sci_gstacksize),"gstacksize"}, 60{C2F(sci_gstacksize),"gstacksize"},
61{C2F(sci_intppty),"intppty"}, 61{C2F(sci_intppty),"intppty"},
62{C2F(sci_lasterror),"lasterror"}, 62{C2F(sci_lasterror),"lasterror"},
63{C2F(sci_getversion),"getversion"}, 63{sci_getversion,"getversion"},
64{C2F(sci_macr2tree),"macr2tree"}, 64{C2F(sci_macr2tree),"macr2tree"},
65{C2F(sci_getos),"getos"}, 65{C2F(sci_getos),"getos"},
66{C2F(sci_banner),"banner"}, 66{C2F(sci_banner),"banner"},
diff --git a/scilab/modules/core/sci_gateway/c/sci_getversion.c b/scilab/modules/core/sci_gateway/c/sci_getversion.c
index 8047e27..01b0e53 100644
--- a/scilab/modules/core/sci_gateway/c/sci_getversion.c
+++ b/scilab/modules/core/sci_gateway/c/sci_getversion.c
@@ -2,6 +2,7 @@
2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab 2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2006 - INRIA - Allan CORNET 3 * Copyright (C) 2006 - INRIA - Allan CORNET
4 * Copyright (C) 2008 - INRIA - Bruno JOFRET 4 * Copyright (C) 2008 - INRIA - Bruno JOFRET
5 * Copyright (C) 2010 - DIGITEO - Allan CORNET
5 * 6 *
6 * This file must be used under the terms of the CeCILL. 7 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which 8 * This source file is licensed as described in the file COPYING, which
@@ -10,319 +11,302 @@
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 11 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11 * 12 *
12 */ 13 */
14/*--------------------------------------------------------------------------*/
13#include <string.h> 15#include <string.h>
14#include <stdio.h> 16#include "api_scilab.h"
15#include "gw_core.h" 17#include "gw_core.h"
16#include "stack-c.h" 18#include "stack-c.h"
17#include "version.h" 19#include "getversion.h"
18#include "MALLOC.h" 20#include "MALLOC.h"
19#include "with_module.h"
20#include "loadversion.h"
21#include "inisci-c.h"
22#include "Scierror.h"
23#include "dynamic_tclsci.h"
24#include "localization.h" 21#include "localization.h"
25#ifdef _MSC_VER 22#include "Scierror.h"
26#include "strdup_windows.h" 23#include "with_module.h"
27#endif 24#include "freeArrayOfString.h"
28/*--------------------------------------------------------------------------*/
29static int getversion_no_rhs(void);
30static int getversion_one_rhs(void);
31static int getversion_two_rhs(void);
32/*--------------------------------------------------------------------------*/ 25/*--------------------------------------------------------------------------*/
33#define VERSION_STRING "string_info" 26#define VERSION_STRING "string_info"
34/*--------------------------------------------------------------------------*/ 27/*--------------------------------------------------------------------------*/
35int C2F(sci_getversion)(char *fname,unsigned long fname_len) 28static int getversion_no_rhs(char *fname);
29static int getversion_one_rhs(char *fname);
30static int getversion_two_rhs(char *fname);
31/*--------------------------------------------------------------------------*/
32int sci_getversion(char *fname, unsigned long fname_len)
36{ 33{
37 Rhs=Max(0,Rhs); 34 Rhs = Max(0,Rhs);
38 35
39 CheckRhs(0,2); 36 CheckRhs(0,2);
40 CheckLhs(1,2); 37
41 38 if (Rhs == 0)
42 if ( Rhs == 0 )
43 { 39 {
44 getversion_no_rhs(); 40 CheckLhs(1,2);
41 getversion_no_rhs(fname);
45 } 42 }
46 else if ( Rhs == 1) 43 else if (Rhs == 1)
47 { 44 {
48 getversion_one_rhs(); 45 CheckLhs(1,1);
46 getversion_one_rhs(fname);
49 } 47 }
50 else /* Rhs == 2 */ 48 else /* Rhs == 2 */
51 { 49 {
52 getversion_two_rhs(); 50 CheckLhs(1,1);
51 getversion_two_rhs(fname);
53 } 52 }
54 return 0; 53 return 0;
55} 54}
56/*--------------------------------------------------------------------------*/ 55/*--------------------------------------------------------------------------*/
57static int getversion_no_rhs(void) 56int getversion_no_rhs(char *fname)
58{ 57{
59 static char Version[]=SCI_VERSION; 58 char *version = getScilabVersionAsString();
60 static int n1,m1; 59 if (version)
61 char *v = Version ;
62
63 n1=1;
64 CreateVarFromPtr( Rhs+1,STRING_DATATYPE,(m1=(int)strlen(Version), &m1),&n1,&v);
65 LhsVar(1) = Rhs+1;
66 if (Lhs==2)
67 { 60 {
68 static char *Str[12]; 61 createSingleString(pvApiCtx, Rhs + 1, version);
69 static int irep,nbuf; 62 LhsVar(1) = Rhs + 1;
70 char tk[]="tk"; 63 FREE(version);
71 char pvm[]="pvm"; 64 version = NULL;
72 char modelicac[]="modelicac"; 65 }
73 66 else
74 #ifdef WITH_ATLAS 67 {
75 char atlas[]="atlas"; 68 Scierror(999,_("%s: Memory allocation error.\n"), fname);
76 #endif 69 return 0;
77 70 }
78 #ifdef NDEBUG
79 char releasemode[]="release";
80 #else
81 char debugmode[]="debug";
82 #endif
83
84 #ifdef __TIME__
85 char TimeBuild[]=__TIME__;
86 #endif
87
88 #ifdef __DATE__
89 char DateBuild[]=__DATE__;
90 #endif
91
92
93 n1=0;
94
95 C2F(getcomp)( C2F(cha1).buf,&nbuf,128);
96 Str[n1]=C2F(cha1).buf;
97 n1++;
98
99
100 if (with_module("pvm"))
101 {
102 Str[n1] = pvm;
103 n1++;
104 }
105
106
107 if (withtk())
108 {
109 Str[n1]=tk;
110 n1++;
111 }
112 71
113 C2F(withmodelicac)(&irep); 72 if (Lhs == 2)
114 if (irep) 73 {
115 { 74 int sizeOptions = 0;
116 Str[n1]=modelicac; 75 char **ScilabOptions = getScilabVersionOptions(&sizeOptions);
117 n1++;
118 }
119 76
120 #ifdef WITH_ATLAS 77 if (ScilabOptions)
121 { 78 {
122 Str[n1]=atlas; 79 SciErr sciErr;
123 n1++; 80 int m = 1;
124 } 81 int n = sizeOptions;
125 #endif 82 sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, m, n, ScilabOptions);
83 freeArrayOfString(ScilabOptions, sizeOptions);
126 84
127 #ifdef _MSC_VER 85 if(sciErr.iErr)
128 #ifdef _DEBUG
129 {
130 Str[n1]=debugmode;
131 n1++;
132 }
133 #else
134 {
135 Str[n1]=releasemode;
136 n1++;
137 }
138 #endif
139 #else
140 #ifdef NDEBUG
141 { 86 {
142 Str[n1]=releasemode; 87 printError(&sciErr, 0);
143 n1++; 88 return 0;
144 }
145 #else
146 {
147 Str[n1]=debugmode;
148 n1++;
149 } 89 }
150 #endif
151 #endif
152 90
153 #ifdef __TIME__ 91 LhsVar(2) = Rhs + 2;
154 {
155 Str[n1]=DateBuild;
156 n1++;
157 } 92 }
158 #endif 93 else
159
160 #ifdef __DATE__
161 { 94 {
162 Str[n1]=TimeBuild; 95 Scierror(999,_("%s: Memory allocation error.\n"), fname);
163 n1++; 96 return 0;
164 } 97 }
165 #endif
166
167 m1=1;
168 CreateVarFromPtr(Rhs+ 2,MATRIX_OF_STRING_DATATYPE, &m1, &n1, Str);
169 LhsVar(2) = Rhs+2;
170 } 98 }
99
171 C2F(putlhsvar)(); 100 C2F(putlhsvar)();
172 101
173 return 0; 102 return 0;
174} 103}
175/*--------------------------------------------------------------------------*/ 104/*--------------------------------------------------------------------------*/
176static int getversion_one_rhs(void) 105int getversion_one_rhs(char *fname)
177{ 106{
178 if (Lhs == 2) 107 SciErr sciErr;
108 int *piAddressVarOne = NULL;
109
110 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
111 if(sciErr.iErr)
179 { 112 {
180 Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",1); 113 printError(&sciErr, 0);
181 return 0; 114 return 0;
182 } 115 }
183 116
184 if (GetType(1) == sci_strings) 117 if (isStringType(pvApiCtx, piAddressVarOne))
185 { 118 {
186 static int l1,n1,m1; 119 char *modulename = NULL;
187 char *Param=NULL;
188 int *VERSIONMATRIX=NULL;
189
190 GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
191 Param=cstk(l1);
192 120
193 VERSIONMATRIX=(int *)MALLOC( (4)*sizeof(int) ); 121 if (!isScalar(pvApiCtx, piAddressVarOne))
194
195 if (strcmp(Param,"scilab") == 0)
196 { 122 {
197 VERSIONMATRIX[0]=(int)SCI_VERSION_MAJOR; 123 Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
198 VERSIONMATRIX[1]=(int)SCI_VERSION_MINOR; 124 return 0;
199 VERSIONMATRIX[2]=(int)SCI_VERSION_MAINTENANCE;
200 VERSIONMATRIX[3]=(int)SCI_VERSION_TIMESTAMP;
201 } 125 }
202 else if (with_module(Param)) 126
127 if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0)
203 { 128 {
204 char versionstring[1024]; 129 if (modulename)
130 {
131 if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
132 {
133 int versionSize = 0;
134 int *version = getModuleVersion(modulename, &versionSize);
135
136 if (version)
137 {
138 int m = 1;
139 int n = versionSize;
140
141 freeAllocatedSingleString(modulename);
142 modulename = NULL;
143
144 sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m, n, (double*)version);
145 FREE(version);
146 version = NULL;
147
148 if(sciErr.iErr)
149 {
150 printError(&sciErr, 0);
151 return 0;
152 }
153
154 LhsVar(1) = Rhs + 1;
155 C2F(putlhsvar)();
156 }
157 else
158 {
159 Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
160
161 freeAllocatedSingleString(modulename);
162 modulename = NULL;
163
164 return 0;
165 }
166 }
167 else
168 {
169 Scierror(999,_("%s: Wrong module name %s.\n"), fname , modulename);
205 170
206 int version_module_major=0; 171 freeAllocatedSingleString(modulename);
207 int version_module_minor=0; 172 modulename = NULL;
208 int version_module_maintenance=0;
209 int version_module_revision=0;
210 173
211 if (getversionmodule(Param,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision)) 174 return 0;
212 { 175 }
213 VERSIONMATRIX[0]=version_module_major; 176 freeAllocatedSingleString(modulename);
214 VERSIONMATRIX[1]=version_module_minor; 177 modulename = NULL;
215 VERSIONMATRIX[2]=version_module_maintenance;
216 VERSIONMATRIX[3]=version_module_revision;
217 } 178 }
218 else 179 else
219 { 180 {
220 Scierror(999,_("%s: Wrong file VERSION %s.\n"),"getversion",Param); 181 Scierror(999,_("%s: Memory allocation error.\n"), fname);
221 return 0; 182 return 0;
222 } 183 }
223 } 184 }
224 else 185 else
225 { 186 {
226 Scierror(999,_("%s: Wrong module name %s.\n"),"getversion",Param); 187 Scierror(999,_("%s: Memory allocation error.\n"), fname);
227 return 0; 188 return 0;
228 } 189 }
229 m1=1;
230 n1=4;
231 CreateVarFromPtr(Rhs+1,MATRIX_OF_INTEGER_DATATYPE, &m1, &n1 ,&VERSIONMATRIX);
232 LhsVar(1)=Rhs+1;
233 PutLhsVar();
234 if (VERSIONMATRIX){ FREE(VERSIONMATRIX); VERSIONMATRIX=NULL;}
235 } 190 }
236 else 191 else
237 { 192 {
238 Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), "getversion",1); 193 Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname, 1);
239 return 0; 194 return 0;
240 } 195 }
241 return 0; 196 return 0;
242} 197}
243/*--------------------------------------------------------------------------*/ 198/*--------------------------------------------------------------------------*/
244static int getversion_two_rhs(void) 199int getversion_two_rhs(char *fname)
245{ 200{
246 if (Lhs == 2) 201 SciErr sciErr;
202 int *piAddressVarOne = NULL;
203 int *piAddressVarTwo = NULL;
204
205 sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
206 if(sciErr.iErr)
247 { 207 {
248 Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",2); 208 printError(&sciErr, 0);
249 return 0; 209 return 0;
250 } 210 }
251 211
252 if ( (GetType(1) == sci_strings) && (GetType(2) == sci_strings) ) 212 sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);
213 if(sciErr.iErr)
253 { 214 {
254 static int l2,n2,m2; 215 printError(&sciErr, 0);
255 char *ParamRhs2=NULL; 216 return 0;
217 }
256 218
257 GetRhsVar(2,STRING_DATATYPE,&m2,&n2,&l2); 219 if (isStringType(pvApiCtx, piAddressVarOne) && isStringType(pvApiCtx, piAddressVarTwo))
258 ParamRhs2=cstk(l2); 220 {
221 char *modulename = NULL;
222 char *optionname = NULL;
259 223
260 if (strcmp(ParamRhs2,VERSION_STRING)==0) 224 if (!isScalar(pvApiCtx, piAddressVarOne))
261 { 225 {
262 static int l1,n1,m1; 226 Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
263 char *ParamRhs1=NULL; 227 return 0;
264 228 }
265 GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
266 ParamRhs1=cstk(l1);
267
268 if (strcmp(ParamRhs1,"scilab") == 0)
269 {
270 char *output=NULL ;
271 output = strdup(SCI_VERSION_STRING);
272 229
273 n1=1; 230 if (!isScalar(pvApiCtx, piAddressVarTwo))
274 CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output); 231 {
275 if (output) {FREE(output);output=NULL;} 232 Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
233 return 0;
234 }
276 235
277 LhsVar(1) = Rhs+1; 236 if ( (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0) &&
278 C2F(putlhsvar)(); 237 (getAllocatedSingleString(pvApiCtx, piAddressVarTwo, &optionname) == 0) )
279 return 0; 238 {
280 } 239 if ( (modulename) && (optionname) )
281 else if (with_module(ParamRhs1))
282 { 240 {
283 #define LineMax 1024 241 if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
284 char versionstring[LineMax];
285
286 int version_module_major=0;
287 int version_module_minor=0;
288 int version_module_maintenance=0;
289 int version_module_revision=0;
290
291 if (getversionmodule(ParamRhs1,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision))
292 { 242 {
293 char *output = NULL ; 243 if ( strcmp(optionname, VERSION_STRING) == 0)
294 output = strdup(versionstring); 244 {
295 245 char *versionInfo = getModuleVersionInfoAsString(modulename);
296 n1=1; 246
297 CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output); 247 if (versionInfo)
298 if (output) {FREE(output);output=NULL;} 248 {
299 249 createSingleString(pvApiCtx, Rhs + 1, versionInfo);
300 LhsVar(1) = Rhs+1; 250
301 C2F(putlhsvar)(); 251 FREE(versionInfo);
302 return 0; 252 versionInfo = NULL;
253
254 LhsVar(1) = Rhs + 1;
255 C2F(putlhsvar)();
256 }
257 else
258 {
259 Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
260
261 freeAllocatedSingleString(modulename);
262 modulename = NULL;
263 freeAllocatedSingleString(optionname);
264 optionname = NULL;
265
266 return 0;
267 }
268 }
269 else
270 {
271 freeAllocatedSingleString(modulename);
272 modulename = NULL;
273 freeAllocatedSingleString(optionname);
274 optionname = NULL;
275
276 Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"), fname, 2, VERSION_STRING);
277 return 0;
278 }
303 } 279 }
304 else 280 else
305 { 281 {
306 Scierror(999,_("%s: Wrong file VERSION in %s.\n"),"getversion",ParamRhs1); 282 Scierror(999,_("%s: Wrong module name %s.\n"), fname , modulename);
283
284 freeAllocatedSingleString(modulename);
285 modulename = NULL;
286 freeAllocatedSingleString(optionname);
287 optionname = NULL;
288
307 return 0; 289 return 0;
308 } 290 }
309 } 291 }
310 else 292 else
311 { 293 {
312 Scierror(999,_("%s: Wrong module name %s.\n"),"getversion",ParamRhs1); 294 Scierror(999,_("%s: Memory allocation error.\n"), fname);
313 return 0; 295 return 0;
314 } 296 }
315 } 297 }
316 else 298 else
317 { 299 {
318 Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"),"getversion",2,VERSION_STRING); 300 Scierror(999,_("%s: Memory allocation error.\n"), fname);
319 return 0; 301 return 0;
320 } 302 }
321 } 303 }
322 else 304 else
323 { 305 {
324 Scierror(999,_("%s: Wrong type for input arguments #%d and #%d: Strings expected.\n"),"getversion",1,2); 306 Scierror(999,_("%s: Wrong type for input arguments #%d and #%d: Strings expected.\n"), fname, 1, 2);
325 return 0; 307 return 0;
326 } 308 }
309
310 return 0;
327} 311}
328/*--------------------------------------------------------------------------*/ 312/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/core.vcproj b/scilab/modules/core/src/c/core.vcproj
index 4d9b49a..5468318 100644
--- a/scilab/modules/core/src/c/core.vcproj
+++ b/scilab/modules/core/src/c/core.vcproj
@@ -473,6 +473,10 @@
473 > 473 >
474 </File> 474 </File>
475 <File 475 <File
476 RelativePath=".\getversion.c"
477 >
478 </File>
479 <File
476 RelativePath=".\GetXmlFileEncoding.c" 480 RelativePath=".\GetXmlFileEncoding.c"
477 > 481 >
478 </File> 482 </File>
@@ -1054,6 +1058,10 @@
1054 > 1058 >
1055 </File> 1059 </File>
1056 <File 1060 <File
1061 RelativePath="..\..\includes\getversion.h"
1062 >
1063 </File>
1064 <File
1057 RelativePath="..\..\includes\GetXmlFileEncoding.h" 1065 RelativePath="..\..\includes\GetXmlFileEncoding.h"
1058 > 1066 >
1059 </File> 1067 </File>
diff --git a/scilab/modules/core/src/c/dynamic_tclsci.c b/scilab/modules/core/src/c/dynamic_tclsci.c
index 280dc72..e1c61d1 100644
--- a/scilab/modules/core/src/c/dynamic_tclsci.c
+++ b/scilab/modules/core/src/c/dynamic_tclsci.c
@@ -71,14 +71,3 @@ BOOL dynamic_TerminateTclTk(void)
71 return FALSE; 71 return FALSE;
72} 72}
73/*--------------------------------------------------------------------------*/ 73/*--------------------------------------------------------------------------*/
74int C2F(withtk)(int *rep)
75{
76 *rep = (int)withtk();
77 return 0;
78}
79/*--------------------------------------------------------------------------*/
80BOOL withtk(void)
81{
82 return with_module(TCLSCI_MODULE_NAME) && (getScilabMode() != SCILAB_NWNI);
83}
84/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/dynamic_tclsci.h b/scilab/modules/core/src/c/dynamic_tclsci.h
index 441950c..f8ab47a 100644
--- a/scilab/modules/core/src/c/dynamic_tclsci.h
+++ b/scilab/modules/core/src/c/dynamic_tclsci.h
@@ -33,18 +33,5 @@ int dynamic_setenvtcl(char *string, char *value);
33*/ 33*/
34BOOL dynamic_TerminateTclTk(void); 34BOOL dynamic_TerminateTclTk(void);
35 35
36/**
37* check if it is with TCL/TK
38* @param rep 1 (WITH) or 0 (WITHOUT)
39* @return 0
40*/
41int C2F(withtk)(int *rep);
42
43/**
44* check if it is with TCL/TK
45* @return TRUE or FALSE
46*/
47BOOL withtk(void);
48
49#endif /* __DYNAMIC_TCLSCI_H__ */ 36#endif /* __DYNAMIC_TCLSCI_H__ */
50/*--------------------------------------------------------------------------*/ 37/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/getstaticDebugInfo_Windows.c b/scilab/modules/core/src/c/getstaticDebugInfo_Windows.c
index 00f8c30..6f2d7e6 100644
--- a/scilab/modules/core/src/c/getstaticDebugInfo_Windows.c
+++ b/scilab/modules/core/src/c/getstaticDebugInfo_Windows.c
@@ -22,6 +22,7 @@
22#include "getstaticDebugInfo_Windows.h" 22#include "getstaticDebugInfo_Windows.h"
23#include "localization.h" 23#include "localization.h"
24#include "version.h" 24#include "version.h"
25#include "getversion.h"
25#include "dynamic_tclsci.h" 26#include "dynamic_tclsci.h"
26#include "..\..\..\..\libs\pcre\pcre.h" 27#include "..\..\..\..\libs\pcre\pcre.h"
27/*--------------------------------------------------------------------------*/ 28/*--------------------------------------------------------------------------*/
@@ -98,7 +99,7 @@ char **getStaticDebugInfo_Windows(int *sizeArray)
98 outputDynamicList = appendStringStaticDebugInfo(outputDynamicList,&nb_info,str_info); 99 outputDynamicList = appendStringStaticDebugInfo(outputDynamicList,&nb_info,str_info);
99 } 100 }
100 101
101 if ( withtk() ) 102 if ( with_tk() )
102 { 103 {
103 str_info = (char*)MALLOC(sizeof(char)*BUFFER_LEN); 104 str_info = (char*)MALLOC(sizeof(char)*BUFFER_LEN);
104 if (str_info) 105 if (str_info)
diff --git a/scilab/modules/core/src/c/getversion.c b/scilab/modules/core/src/c/getversion.c
new file mode 100644
index 0000000..e85c24c
--- /dev/null
+++ b/scilab/modules/core/src/c/getversion.c
@@ -0,0 +1,342 @@
1/*
2* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3* Copyright (C) 2010 - DIGITEO - Allan CORNET
4*
5* This file must be used under the terms of the CeCILL.
6* This source file is licensed as described in the file COPYING, which
7* you should have received as part of this distribution. The terms
8* are also available at
9* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10*
11*/
12/*--------------------------------------------------------------------------*/
13#include <string.h>
14#include "getversion.h"
15#include "version.h"
16#include "scilabmode.h"
17#include "scilabDefaults.h"
18#ifdef _MSC_VER
19#include "strdup_windows.h"
20#endif
21#include "with_module.h"
22#include "loadversion.h"
23#include "MALLOC.h"
24#include "../../../io/includes/getenvc.h"
25/*--------------------------------------------------------------------------*/
26#define TCLSCI_MODULE_NAME "tclsci"
27#define PVM_MODULE_NAME "pvm"
28#define PVM_OPTION_STRING "pvm"
29#define TCLTK_OPTION_STRING "tk"
30#define ATLAS_OPTION_STRING "atlas"
31#define MODELICAC_OPTION_STRING "modelicac"
32#define X86_STRING "x86"
33#define X64_STRING "x64"
34#define ICC_STRING "ICC"
35#define VC_STRING "VC++"
36#define GCC_STRING "GCC"
37#define PGI_STRING "PGI"
38#define SUN_STRING "SUN"
39#define UNKNOW_STRING "UKN"
40#define RELEASE_STRING "release"
41#define DEBUG_STRING "debug"
42#define DEFAULT_VERSION_ARRAY_SIZE 4
43#define SCILAB_STRING "scilab"
44/*--------------------------------------------------------------------------*/
45int *getScilabVersion(int *sizeArrayReturned)
46{
47 int *returnedArray = (int *)MALLOC(sizeof(int) * DEFAULT_VERSION_ARRAY_SIZE);
48 *sizeArrayReturned = 0;
49 if (returnedArray)
50 {
51 returnedArray[0] = (int)SCI_VERSION_MAJOR;
52 returnedArray[1] = (int)SCI_VERSION_MINOR;
53 returnedArray[2] = (int)SCI_VERSION_MAINTENANCE;
54 returnedArray[3] = (int)SCI_VERSION_TIMESTAMP;
55
56 *sizeArrayReturned = DEFAULT_VERSION_ARRAY_SIZE;
57 }
58 return returnedArray;
59}
60/*--------------------------------------------------------------------------*/
61char *getScilabVersionAsString(void)
62{
63 return strdup(SCI_VERSION_STRING);
64}
65/*--------------------------------------------------------------------------*/
66int* getModuleVersion(char *modulename, int *sizeArrayReturned)
67{
68 int *returnedArray = NULL;
69
70 if (modulename)
71 {
72 if (strcmp(modulename, SCILAB_STRING) == 0)
73 {
74 returnedArray = getScilabVersion(sizeArrayReturned);
75 return returnedArray;
76 }
77 }
78
79 if (with_module(modulename))
80 {
81 #define LineMax 1024
82 char versionstring[LineMax];
83 int version_module_major = 0;
84 int version_module_minor = 0;
85 int version_module_maintenance = 0;
86 int version_module_revision = 0;
87
88 if (getversionmodule(modulename, &version_module_major, &version_module_minor,
89 &version_module_maintenance, versionstring,
90 &version_module_revision))
91 {
92 returnedArray = (int *)MALLOC(sizeof(int) * DEFAULT_VERSION_ARRAY_SIZE);
93 if (returnedArray)
94 {
95 returnedArray[0] = version_module_major;
96 returnedArray[1] = version_module_minor;
97 returnedArray[2] = version_module_maintenance;
98 returnedArray[3] = version_module_revision;
99 *sizeArrayReturned = DEFAULT_VERSION_ARRAY_SIZE;
100 }
101 else
102 {
103 *sizeArrayReturned = 0;
104 }
105 }
106 }
107 else
108 {
109 *sizeArrayReturned = 0;
110 }
111 return returnedArray;
112}
113/*--------------------------------------------------------------------------*/
114char *getModuleVersionInfoAsString(char *modulename)
115{
116 char *infoString = NULL;
117
118 if (modulename)
119 {
120 if (strcmp(modulename, SCILAB_STRING) == 0)
121 {
122 infoString = getScilabVersionAsString();
123 return infoString;
124 }
125 }
126
127 if (with_module(modulename))
128 {
129 #define LineMax 1024
130 char versionstring[LineMax];
131 int version_module_major = 0;
132 int version_module_minor = 0;
133 int version_module_maintenance = 0;
134 int version_module_revision = 0;
135 if (getversionmodule(modulename, &version_module_major, &version_module_minor,
136 &version_module_maintenance, versionstring,
137 &version_module_revision))
138 {
139 infoString = strdup(versionstring);
140 }
141 }
142 return infoString;
143}
144/*--------------------------------------------------------------------------*/
145char **getScilabVersionOptions(int *sizeArrayReturned)
146{
147 char **options = NULL;
148 int nbOptions = 2;
149 *sizeArrayReturned = 0;
150
151 options = (char**)MALLOC(sizeof(char*) * nbOptions);
152 if (options)
153 {
154 options[0] = getCompilerUsedToBuildScilab();
155 options[1] = getCompilerArchitecture();
156
157 if (with_pvm())
158 {
159 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
160 if (options)
161 {
162 options[nbOptions] = strdup(PVM_OPTION_STRING);
163 nbOptions++;
164 }
165 else
166 {
167 return NULL;
168 }
169 }
170
171 if (with_tk())
172 {
173 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
174 if (options)
175 {
176 options[nbOptions] = strdup(TCLTK_OPTION_STRING);
177 nbOptions++;
178 }
179 else
180 {
181 return NULL;
182 }
183 }
184
185 if (with_modelica_compiler())
186 {
187 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
188 if (options)
189 {
190 options[nbOptions] = strdup(MODELICAC_OPTION_STRING);
191 nbOptions++;
192 }
193 else
194 {
195 return NULL;
196 }
197 }
198
199 if (with_atlas())
200 {
201 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
202 if (options)
203 {
204 options[nbOptions] = strdup(ATLAS_OPTION_STRING);
205 nbOptions++;
206 }
207 else
208 {
209 return NULL;
210 }
211 }
212
213 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
214 if (options)
215 {
216 options[nbOptions] = getReleaseMode();
217 nbOptions++;
218 }
219 else
220 {
221 return NULL;
222 }
223
224 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
225 if (options)
226 {
227 options[nbOptions] = getReleaseDate();
228 nbOptions++;
229 }
230 else
231 {
232 return NULL;
233 }
234
235 options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
236 if (options)
237 {
238 options[nbOptions] = getReleaseTime();
239 nbOptions++;
240 }
241 else
242 {
243 return NULL;
244 }
245
246 *sizeArrayReturned = nbOptions;
247 }
248 return options;
249}
250/*--------------------------------------------------------------------------*/
251char *getReleaseMode(void)
252{
253 #ifdef NDEBUG
254 return strdup(RELEASE_STRING);
255 #else
256 return strdup(DEBUG_STRING);
257 #endif
258}
259/*--------------------------------------------------------------------------*/
260char *getReleaseDate(void)
261{
262 return strdup(__DATE__);
263}
264/*--------------------------------------------------------------------------*/
265char *getReleaseTime(void)
266{
267 return strdup(__TIME__);
268}
269/*--------------------------------------------------------------------------*/
270char *getCompilerUsedToBuildScilab(void)
271{
272 #ifdef __INTEL_COMPILER
273 return strdup(ICC_STRING);
274 #else
275 #ifdef _MSC_VER
276 return strdup(VC_STRING);
277 #else
278 #ifdef __GNUC__
279 return strdup(GCC_STRING);
280 #else
281 #ifdef __PGI
282 return strdup(PGI_STRING);
283 #else
284 #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
285 return strdup(SUN_STRING);
286 #else
287 return strdup(UNKNOW_STRING);
288 #endif
289 #endif
290 #endif
291 #endif
292 #endif
293}
294/*--------------------------------------------------------------------------*/
295char *getCompilerArchitecture(void)
296{
297 #ifdef _MSC_VER
298 #ifdef _WIN64
299 return strdup(X64_STRING);
300 #else
301 return strdup(X86_STRING);
302 #endif
303 #else
304 #ifdef _LP64
305 return strdup(X64_STRING);
306 #else
307 return strdup(X86_STRING);
308 #endif
309 #endif
310}
311/*--------------------------------------------------------------------------*/
312BOOL with_pvm(void)
313{
314 return with_module(PVM_MODULE_NAME);
315}
316/*--------------------------------------------------------------------------*/
317BOOL with_modelica_compiler(void)
318{
319 char *fullpathModelicac = searchEnv(ModelicacName, "PATH");
320 if (fullpathModelicac)
321 {
322 FREE(fullpathModelicac);
323 fullpathModelicac = NULL;
324 return TRUE;
325 }
326 return FALSE;
327}
328/*--------------------------------------------------------------------------*/
329BOOL with_tk(void)
330{
331 return with_module(TCLSCI_MODULE_NAME) && (getScilabMode() != SCILAB_NWNI);
332}
333/*--------------------------------------------------------------------------*/
334BOOL with_atlas(void)
335{
336 #ifdef WITH_ATLAS
337 return TRUE;
338 #else
339 return FALSE;
340 #endif
341}
342/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/c/inisci-c.c b/scilab/modules/core/src/c/inisci-c.c
index fbcff7e..9bbe59c 100644
--- a/scilab/modules/core/src/c/inisci-c.c
+++ b/scilab/modules/core/src/c/inisci-c.c
@@ -31,38 +31,6 @@
31#include "PATH_MAX.h" 31#include "PATH_MAX.h"
32#include "scilabDefaults.h" 32#include "scilabDefaults.h"
33/*--------------------------------------------------------------------------*/ 33/*--------------------------------------------------------------------------*/
34int C2F(withmodelicac)(int *rep)
35{
36 if (ExistModelicac())
37 {
38 *rep =1;
39 }
40 else
41 {
42 *rep =0;
43 }
44 return 0;
45}
46/*--------------------------------------------------------------------------*/
47int C2F(withmsdos)(int *rep)
48{
49#ifdef _MSC_VER
50 *rep =1;
51#else
52 *rep =0;
53#endif
54 return 0;
55}
56/*--------------------------------------------------------------------------*/
57int C2F(getcomp)(char *buf,int *nbuf,long int lbuf)
58{
59 int ierr,iflag=0,l1buf=lbuf;
60 C2F(getenvc)(&ierr,"COMPILER",buf,&l1buf,&iflag);
61 if ( ierr== 1) strncpy(buf,"NO",lbuf);
62 *nbuf = (int)strlen(buf);
63 return 0;
64}
65/*--------------------------------------------------------------------------*/
66/** 34/**
67 * Set the SCI path and initialize the scilab environement path 35 * Set the SCI path and initialize the scilab environement path
68 * 36 *
@@ -175,18 +143,6 @@ int C2F(gettmpdir)(char *buf,int *nbuf,long int lbuf)
175 return 0; 143 return 0;
176} 144}
177/*--------------------------------------------------------------------------*/ 145/*--------------------------------------------------------------------------*/
178BOOL ExistModelicac(void)
179{
180 char *fullpathModelicac = searchEnv( ModelicacName,"PATH");
181 if (fullpathModelicac)
182 {
183 FREE(fullpathModelicac);
184 fullpathModelicac = NULL;
185 return TRUE;
186 }
187 return FALSE;
188}
189/*--------------------------------------------------------------------------*/
190int C2F(withgui)(int *rep) 146int C2F(withgui)(int *rep)
191{ 147{
192 *rep = (getScilabMode() != SCILAB_NWNI); 148 *rep = (getScilabMode() != SCILAB_NWNI);
diff --git a/scilab/modules/core/src/c/terme.c b/scilab/modules/core/src/c/terme.c
index a56080a..7a34d72 100644
--- a/scilab/modules/core/src/c/terme.c
+++ b/scilab/modules/core/src/c/terme.c
@@ -9,10 +9,12 @@
9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt 9 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
10 * 10 *
11 */ 11 */
12#include <stdio.h>
12#include "terme.h" 13#include "terme.h"
13#include "stack-def.h" 14#include "stack-def.h"
14#include "stack-c.h" 15#include "stack-c.h"
15#include "Scierror.h" 16#include "Scierror.h"
17#include "basout.h"
16/*--------------------------------------------------------------------------*/ 18/*--------------------------------------------------------------------------*/
17extern int C2F(getsym)(); 19extern int C2F(getsym)();
18/*--------------------------------------------------------------------------*/ 20/*--------------------------------------------------------------------------*/
diff --git a/scilab/modules/core/src/fortran/inisci.f b/scilab/modules/core/src/fortran/inisci.f
index 77f16c8..850e603 100644
--- a/scilab/modules/core/src/fortran/inisci.f
+++ b/scilab/modules/core/src/fortran/inisci.f
@@ -189,27 +189,25 @@ c get default global stackize from c
189 gbot=isizt 189 gbot=isizt
190 lstk(gbot)=lstk(gtop+1)+vsizg-1 190 lstk(gbot)=lstk(gtop+1)+vsizg-1
191c 191c
192c 15 is the number of predefined variables 192c 13 is the number of predefined variables
193c 16 - 1 blank not include 193c 14 - 1 blank not include
194 bot=isiz-15 194 bot = isiz - 13
195 bbot=bot 195 bbot = bot
196 bot0=bot 196 bot0 = bot
197c memory requested for predefined variables 197c memory requested for predefined variables
198c mxn bmat -> size : sadr(2+m*n+2) 198c mxn bmat -> size : sadr(2+m*n+2)
199c $ -> size : sadr(10-1) + 2 199c $ -> size : sadr(10-1) + 2
200c mxn mat -> size : sadr(3)+m*n*(it+1) 200c mxn mat -> size : sadr(3)+m*n*(it+1)
201c string -> size : sadr(6+nchar)+1 201c string -> size : sadr(6+nchar)+1
202c 4 strings 202c 3 strings
203c 5 booleans 203c 4 booleans
204 call getcomp(bufcomp,nbcomp)
205 call getsci(bufsci,nbsci) 204 call getsci(bufsci,nbsci)
206 call getscihome(bufscihome,nbscihome) 205 call getscihome(bufscihome,nbscihome)
207 call gettmpdir(buftmp,nbtmpdir) 206 call gettmpdir(buftmp,nbtmpdir)
208 lpvar = (sadr(10-1) + 2) 207 lpvar = (sadr(10-1) + 2)
209 $ + 5*sadr(5) 208 $ + 4*sadr(5)
210 $ + 4*(sadr(3)+1) 209 $ + 3*(sadr(3)+1)
211 $ + 2*(sadr(3)+2) 210 $ + 2*(sadr(3)+2)
212 $ + 1*(sadr(6+nbcomp)+1)
213 $ + 1*(sadr(6+nbsci)+1) 211 $ + 1*(sadr(6+nbsci)+1)
214 $ + 1*(sadr(6+nbscihome)+1) 212 $ + 1*(sadr(6+nbscihome)+1)
215 $ + 1*(sadr(6+nbtmpdir)+1) 213 $ + 1*(sadr(6+nbtmpdir)+1)
@@ -217,12 +215,6 @@ c 5 booleans
217 l=vsizr-lpvar 215 l=vsizr-lpvar
218 k=bot 216 k=bot
219 lstk(k)=lstk(1)-1+l 217 lstk(k)=lstk(1)-1+l
220C . COMPILER
221 vname = ' '
222 vname(1:8) = "COMPILER"
223 call cvname(idloc,vname,0)
224 call cresmatvar(idloc,k,bufcomp,nbcomp)
225 k=k+1
226c . SCI 218c . SCI
227 vname = ' ' 219 vname = ' '
228 vname(1:3) = "SCI" 220 vname(1:3) = "SCI"
@@ -248,13 +240,6 @@ c . %gui
248 call cvname(idloc,vname,0) 240 call cvname(idloc,vname,0)
249 call crebmatvar(idloc,k,1,1,irep) 241 call crebmatvar(idloc,k,1,1,irep)
250 k=k+1 242 k=k+1
251c . %tk
252 vname = ' '
253 vname(1:3) = "%tk"
254 call withtk(irep)
255 call cvname(idloc,vname,0)
256 call crebmatvar(idloc,k,1,1,irep)
257 k=k+1
258c . %fftw 243c . %fftw
259 vname = ' ' 244 vname = ' '
260 vname(1:5) = "%fftw" 245 vname(1:5) = "%fftw"