move Initialization modules in modules
Allan Cornet [Wed, 14 Feb 2007 09:18:33 +0000 (09:18 +0000)]
25 files changed:
scilab/modules/core/Makefile.am
scilab/modules/core/includes/InitializeCore.h [new file with mode: 0644]
scilab/modules/core/src/c/InitScilab.c
scilab/modules/core/src/c/InitScilab.h
scilab/modules/core/src/c/InitializeCore.c [new file with mode: 0644]
scilab/modules/core/src/c/LoadFunctionsTab.h [new file with mode: 0644]
scilab/modules/core/src/c/core.vcproj
scilab/modules/jvm/Makefile.am
scilab/modules/jvm/includes/InitializeJVM.h [new file with mode: 0644]
scilab/modules/jvm/includes/exportimport.h [new file with mode: 0644]
scilab/modules/jvm/src/InitializeJVM.c [new file with mode: 0644]
scilab/modules/jvm/src/LibScilab_Import.def
scilab/modules/jvm/src/jvm_common.h
scilab/modules/jvm/src/libjvm.vcproj
scilab/modules/localization/Makefile.am
scilab/modules/localization/includes/InitializeLocalization.h [new file with mode: 0644]
scilab/modules/localization/src/InitializeLocalization.c [new file with mode: 0644]
scilab/modules/localization/src/LibScilab_Import.def
scilab/modules/localization/src/localization.vcproj
scilab/modules/tclsci/Makefile.am
scilab/modules/tclsci/etc/tclsci.start
scilab/modules/tclsci/includes/InitializeTclTk.h [new file with mode: 0644]
scilab/modules/tclsci/src/InitializeTclTk.c [new file with mode: 0644]
scilab/modules/tclsci/src/notclsci/notclsci.c
scilab/modules/tclsci/tclsci.vcproj

index 134c928..05e8646 100644 (file)
@@ -68,7 +68,8 @@ src/c/version.c \
 src/c/stackinfo.c \
 src/c/scirun.c \
 src/c/SCIHOME.c \
-src/c/warningmode.c
+src/c/warningmode.c \
+src/c/InitializeCore.c
 
 
 CORE_FORTRAN_SOURCES = src/fortran/algebre.f \
diff --git a/scilab/modules/core/includes/InitializeCore.h b/scilab/modules/core/includes/InitializeCore.h
new file mode 100644 (file)
index 0000000..184b61f
--- /dev/null
@@ -0,0 +1,13 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#ifndef __INITIALIZECORE_H__\r
+#define __INITIALIZECORE_H__\r
+\r
+#include "machine.h"\r
+\r
+BOOL InitializeCore(void);\r
+\r
+#endif /* __INITIALIZECORE_H__ */\r
+/*-----------------------------------------------------------------------------------*/ \r
index 30a1b8a..90f7b0b 100644 (file)
@@ -3,54 +3,24 @@
 /* Allan CORNET */
 /*-----------------------------------------------------------------------------------*/
 #include "InitScilab.h"
-#include "MALLOC.h"
-#include "getmodules.h"
-#include "SciEnv.h"
-#include "InitScilab.h"
-#include "hashtable_core.h"
-#include "prompt.h"
-#include "sciprint.h"
-
+#include "InitializeCore.h"
+#include "../../tclsci/includes/InitializeTclTk.h"
 #ifdef _MSC_VER
-extern int InitializeHashTableScilabErrors(char* SCIPATH);
-extern char *GetScilabDirectory(BOOL UnixStyle);
-extern int StartJVMs(char *SCILAB_PATH); 
-#endif
-
-#ifdef WITH_TK
-extern void initTCLTK ();
+#include "../../localization/includes/InitializeLocalization.h"
+#include "../../jvm/includes/InitializeJVM.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 int C2F(initscilab)(void)
 {
-       #ifdef _MSC_VER
-       char *SCIPATH=NULL;
-       #endif
-       int pause=0;
-       SciEnv();
+       InitializeCore();
 
-       getmodules();
-
-       if ( create_hashtable_scilab_functions(MAXTAB) == 0 ) 
-       {
-               sciprint("Fatal Error : Can't create table for scilab functions \n");
-               exit(1);
-       }
-
-       LoadFunctionsTab();
-
-       #ifdef WITH_TK
-               initTCLTK();
-       #endif
+       InitializeTclTk();
 
        #ifdef _MSC_VER
-       SCIPATH=GetScilabDirectory(TRUE);
-       InitializeHashTableScilabErrors(SCIPATH);
-       StartJVMs(SCIPATH);
-       if (SCIPATH) {FREE(SCIPATH);SCIPATH=NULL;}
+       InitializeLocalization();
+       InitializeJVM();
        #endif
-
-       C2F(setprlev)(&pause);
+       
        return 0;
 }
 /*-----------------------------------------------------------------------------------*/
index 1656bf0..98ffb76 100644 (file)
@@ -5,6 +5,6 @@
 #include "machine.h"
 
 int C2F(initscilab)(void);
-void LoadFunctionsTab(void);
+
 /*-----------------------------------------------------------------------------------*/ 
 
diff --git a/scilab/modules/core/src/c/InitializeCore.c b/scilab/modules/core/src/c/InitializeCore.c
new file mode 100644 (file)
index 0000000..7fe19c0
--- /dev/null
@@ -0,0 +1,36 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include "InitializeCore.h"\r
+#include "SciEnv.h"\r
+#include "getmodules.h"\r
+#include "hashtable_core.h"\r
+#include "sciprint.h"\r
+#include "LoadFunctionsTab.h"\r
+#include "prompt.h"\r
+/*-----------------------------------------------------------------------------------*/ \r
+BOOL InitializeCore(void)\r
+{\r
+       BOOL bOK=FALSE;\r
+       int pause=0;\r
+\r
+       SciEnv();\r
+\r
+       getmodules();\r
+\r
+       if ( create_hashtable_scilab_functions(MAXTAB) == 0 ) \r
+       {\r
+               sciprint("Fatal Error : Can't create table for scilab functions \n");\r
+               exit(1);\r
+       }\r
+\r
+       LoadFunctionsTab();\r
+\r
+       /* Set prompt level */\r
+       C2F(setprlev)(&pause);\r
+\r
+       return bOK;\r
+}\r
+/*-----------------------------------------------------------------------------------*/ \r
+\r
diff --git a/scilab/modules/core/src/c/LoadFunctionsTab.h b/scilab/modules/core/src/c/LoadFunctionsTab.h
new file mode 100644 (file)
index 0000000..65f6cb4
--- /dev/null
@@ -0,0 +1,11 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/\r
+#ifndef __LOADFUNCTIONSTAB_H__\r
+#define __LOADFUNCTIONSTAB_H__\r
+\r
+void LoadFunctionsTab(void);\r
+\r
+#endif /* __LOADFUNCTIONSTAB_H__ */\r
+/*-----------------------------------------------------------------------------------*/
\ No newline at end of file
index cbb7b7e..9bea942 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\InitializeCore.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\InitScilab.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\..\includes\InitializeCore.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\includes\InitScilab.h"
                                >
                        </File>
index 6adb02b..18d7f4e 100644 (file)
@@ -7,7 +7,8 @@ if JAVA
 
 JVM_C_SOURCES = src/JVM_CONSOLE.c \
 src/JVM_Unix.c \
-src/jvms.c
+src/jvms.c\
+src/InitializeJVM.c
 
 libsciscijvm_la_CFLAGS=  $(JAVA_JNI_INCLUDE) -I$(top_srcdir)/libs/MALLOC/includes/
 
diff --git a/scilab/modules/jvm/includes/InitializeJVM.h b/scilab/modules/jvm/includes/InitializeJVM.h
new file mode 100644 (file)
index 0000000..207e071
--- /dev/null
@@ -0,0 +1,14 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#ifndef __INITIALIZEJVM_H__\r
+#define __INITIALIZEJVM_H__\r
+\r
+#include "machine.h"\r
+#include "exportimport.h"\r
+\r
+IMPORT_EXPORT_LIBJVM_DLL int InitializeJVM(void);\r
+\r
+#endif /* __INITIALIZEJVM_H__ */\r
+/*-----------------------------------------------------------------------------------*/ \r
diff --git a/scilab/modules/jvm/includes/exportimport.h b/scilab/modules/jvm/includes/exportimport.h
new file mode 100644 (file)
index 0000000..02084ab
--- /dev/null
@@ -0,0 +1,26 @@
+/*-----------------------------------------------------------------------------------*/ \r
+/* INRIA 2007 */\r
+/* Allan CORNET*/\r
+/*-----------------------------------------------------------------------------------*/ \r
+\r
+#ifndef __EXPORTIMPORT_H__\r
+#define __EXPORTIMPORT_H__\r
+\r
+#ifdef _MSC_VER\r
+       #ifdef EXPORT_LIBJVM_DLL\r
+               #define IMPORT_EXPORT_LIBJVM_DLL __declspec(dllexport)\r
+       #else\r
+               #define IMPORT_EXPORT_LIBJVM_DLL __declspec(dllimport)\r
+       #endif\r
+#else\r
+       #define IMPORT_EXPORT_LIBJVM_DLL   extern\r
+#endif\r
+\r
+#ifdef _MSC_VER\r
+       #define IMPORT_DLL __declspec(dllimport)\r
+#else\r
+       #define IMPORT_DLL   extern\r
+#endif\r
+\r
+#endif /* __EXPORTIMPORT_H__ */\r
+/*-----------------------------------------------------------------------------------*/ \r
diff --git a/scilab/modules/jvm/src/InitializeJVM.c b/scilab/modules/jvm/src/InitializeJVM.c
new file mode 100644 (file)
index 0000000..0bd2351
--- /dev/null
@@ -0,0 +1,22 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include "InitializeJVM.h"\r
+#include "jvms.h"\r
+#include "setgetSCIpath.h"\r
+#include "MALLOC.h"\r
+/*-----------------------------------------------------------------------------------*/ \r
+IMPORT_EXPORT_LIBJVM_DLL BOOL InitializeJVM(void)\r
+{\r
+       BOOL bOK=FALSE;\r
+       char *SCIPATH=NULL;\r
+\r
+       SCIPATH=getSCIpath();\r
+       StartJVMs(SCIPATH);\r
+       if (SCIPATH) {FREE(SCIPATH);SCIPATH=NULL;}\r
+\r
+       return bOK;\r
+}\r
+/*-----------------------------------------------------------------------------------*/ \r
+\r
index ca1f67f..b0c0381 100644 (file)
@@ -3,4 +3,5 @@ LIBRARY    LibScilab.dll
 
 EXPORTS
 
-xscion_
\ No newline at end of file
+xscion_
+getSCIpath
\ No newline at end of file
index ad116a6..75c8028 100644 (file)
@@ -2,23 +2,9 @@
 /* INRIA 2006 */
 /* Allan CORNET*/
 /*-----------------------------------------------------------------------------------*/ 
-#define JRE_PATH "/modules/jvm/bin/jre"
+#include "exportimport.h"
 /*-----------------------------------------------------------------------------------*/ 
-#ifdef _MSC_VER
-       #ifdef EXPORT_LIBJVM_DLL
-               #define IMPORT_EXPORT_LIBJVM_DLL __declspec(dllexport)
-       #else
-               #define IMPORT_EXPORT_LIBJVM_DLL __declspec(dllimport)
-       #endif
-#else
-       #define IMPORT_EXPORT_LIBJVM_DLL   extern
-#endif
-
-#ifdef _MSC_VER
-       #define IMPORT_DLL __declspec(dllimport)
-#else
-       #define IMPORT_DLL   extern
-#endif
+#define JRE_PATH "/modules/jvm/bin/jre"
 /*-----------------------------------------------------------------------------------*/ 
 #ifdef _MSC_VER
        #define PATH_SEPARATOR ';'
index 69cffb9..1745468 100644 (file)
@@ -43,7 +43,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories="../bin/jdk/include;../bin/jdk/include/win32;../../core/includes;../../../libs/MALLOC/includes"
+                               AdditionalIncludeDirectories="../bin/jdk/include;../bin/jdk/include/win32;../includes;../../core/includes;../../../libs/MALLOC/includes"
                                PreprocessorDefinitions="STRICT;_DEBUG;_CRT_SECURE_NO_DEPRECATE;EXPORT_LIBJVM_DLL"
                                BasicRuntimeChecks="0"
                                RuntimeLibrary="3"
                                Optimization="2"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
-                               AdditionalIncludeDirectories="../bin/jdk/include;../bin/jdk/include/win32;../../core/includes;../../../libs/MALLOC/includes"
+                               AdditionalIncludeDirectories="../bin/jdk/include;../bin/jdk/include/win32;../includes;../../core/includes;../../../libs/MALLOC/includes"
                                PreprocessorDefinitions="STRICT;NDEBUG;_CRT_SECURE_NO_DEPRECATE;EXPORT_LIBJVM_DLL"
                                StringPooling="true"
                                RuntimeLibrary="2"
                                >
                        </File>
                        <File
+                               RelativePath=".\InitializeJVM.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\JVM_CONSOLE.c"
                                >
                        </File>
                        Filter="h;hpp;hxx;hm;inl"
                        >
                        <File
+                               RelativePath="..\includes\InitializeJVM.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\jvm_common.h"
                                >
                        </File>
index 497e2c9..5136782 100644 (file)
@@ -4,8 +4,9 @@
 ##########
 
 LOCALIZATION_C_SOURCES = src/hashtable_localization.c \
-src/localization.c\
-src/setgetlanguage.c
+src/localization.c \
+src/setgetlanguage.c \
+src/InitializeLocalization.c
 
 GATEWAY_C_SOURCES = sci_gateway/gw_localization.c \
 sci_gateway/sci_setlanguage.c \
diff --git a/scilab/modules/localization/includes/InitializeLocalization.h b/scilab/modules/localization/includes/InitializeLocalization.h
new file mode 100644 (file)
index 0000000..1d0ca32
--- /dev/null
@@ -0,0 +1,13 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#ifndef __INITIALIZELOCALIZATION_H__\r
+#define __INITIALIZELOCALIZATION_H__\r
+\r
+#include "machine.h"\r
+\r
+BOOL InitializeLocalization(void);\r
+\r
+#endif /* __INITIALIZELOCALIZATION_H__ */\r
+/*-----------------------------------------------------------------------------------*/ \r
diff --git a/scilab/modules/localization/src/InitializeLocalization.c b/scilab/modules/localization/src/InitializeLocalization.c
new file mode 100644 (file)
index 0000000..f8ceb0c
--- /dev/null
@@ -0,0 +1,22 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include "InitializeLocalization.h"\r
+#include "localization.h"\r
+#include "setgetSCIpath.h"\r
+#include "MALLOC.h"\r
+/*-----------------------------------------------------------------------------------*/ \r
+BOOL InitializeLocalization(void)\r
+{\r
+       BOOL bOK=FALSE;\r
+\r
+       char *SCIPATH=NULL;\r
+       SCIPATH=getSCIpath();\r
+       InitializeHashTableScilabErrors(SCIPATH);\r
+       if (SCIPATH) {FREE(SCIPATH);SCIPATH=NULL;}\r
+\r
+       return bOK;\r
+}\r
+/*-----------------------------------------------------------------------------------*/ \r
+\r
index 626a7af..04f16dd 100644 (file)
@@ -18,4 +18,6 @@ EXPORTS
  gettype_
  vstk_
  createvar_
+ getSCIpath
  
\ No newline at end of file
index 33dbb90..461f857 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\InitializeLocalization.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\localization.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\includes\InitializeLocalization.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\includes\localization.h"
                                >
                        </File>
index da3b17a..88458b1 100644 (file)
@@ -12,7 +12,8 @@ src/ScilabEval.c \
 src/TclEvents.c \
 src/setenvtcl.c \
 src/with_tk.c \
-src/TclUiSet.c
+src/TclUiSet.c \
+src/InitializeTclTk.c
 
 # a priori utilisé seulement par windows
 # src/EnvTclTk.c
index 35573fc..cae155a 100644 (file)
@@ -8,3 +8,10 @@ load('SCI/modules/tclsci/macros/lib');
 //add help chapter
 exec(SCI+'/modules/tclsci/help/'+getlanguage()+'/addchapter.sce');
 // ====================================================================
+// add demos
+path = get_absolute_file_path('tclsci.start');
+path = getshortpathname(path);
+pathdemos = pathconvert(part(path,1:(length(path)-5))+'/demos/tk/tk.dem',%f,%f);
+add_demo('Tcl/Tk',pathdemos);
+clear path pathdemos get_absolute_file_path;
+// ====================================================================
diff --git a/scilab/modules/tclsci/includes/InitializeTclTk.h b/scilab/modules/tclsci/includes/InitializeTclTk.h
new file mode 100644 (file)
index 0000000..010644b
--- /dev/null
@@ -0,0 +1,13 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#ifndef __INITIALIZETCLTK_H__\r
+#define __INITIALIZETCLTK_H__\r
+\r
+#include "machine.h"\r
+\r
+BOOL InitializeTclTk(void);\r
+\r
+#endif /* __INITIALIZETCLTK_H__ */\r
+/*-----------------------------------------------------------------------------------*/ \r
diff --git a/scilab/modules/tclsci/src/InitializeTclTk.c b/scilab/modules/tclsci/src/InitializeTclTk.c
new file mode 100644 (file)
index 0000000..c52466d
--- /dev/null
@@ -0,0 +1,17 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include "InitializeTclTk.h"\r
+#include "InitTclTk.h"\r
+/*-----------------------------------------------------------------------------------*/ \r
+BOOL InitializeTclTk(void)\r
+{\r
+       BOOL bOK=FALSE;\r
+\r
+       initTCLTK ();\r
+\r
+       return bOK;\r
+}\r
+/*-----------------------------------------------------------------------------------*/ \r
+\r
index 497cf45..057bba8 100644 (file)
@@ -70,3 +70,9 @@ void C2F(tksynchro)( int *l)
 {
 }
 /*-----------------------------------------------------------------------------------*/ 
+BOOL InitializeTclTk(void)
+{
+       BOOL bOK=FALSE;
+       return bOK;
+}
+/*-----------------------------------------------------------------------------------*/ 
\ No newline at end of file
index 3319e51..a37ccb4 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\src\InitializeTclTk.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\src\InitTclTk.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath=".\includes\InitializeTclTk.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\includes\InitTclTk.h"
                                >
                        </File>