Add ExceptionMessage.* message for scilab exception in this file (windows)
Allan Cornet [Mon, 11 Dec 2006 10:47:35 +0000 (10:47 +0000)]
55 files changed:
scilab/modules/arnoldi/LibScilab_Import.def
scilab/modules/arnoldi/sci_gateway/gw_arnoldi.c
scilab/modules/boolean/sci_gateway/c/gw_boolean.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd0.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd1.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd2.c
scilab/modules/cacsd/sci_gateway/c/gw_cacsd3.c
scilab/modules/cacsd/sci_gateway/c/gw_slicot.c
scilab/modules/core/includes/ExceptionMessage.h [new file with mode: 0644]
scilab/modules/core/sci_gateway/c/gw_core.c
scilab/modules/core/src/c/ExceptionMessage.c [new file with mode: 0644]
scilab/modules/core/src/c/addinter.c
scilab/modules/core/src/c/realmain.c
scilab/modules/data_structures/sci_gateway/c/gw_data_structures1.c
scilab/modules/data_structures/sci_gateway/c/gw_data_structures2.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations1.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations2.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations3.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations4.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations5.c
scilab/modules/differential_equations/sci_gateway/c/gw_differential_equations6.c
scilab/modules/elementaries_functions/sci_gateway/c/gw_elementaries_functions.c
scilab/modules/fftw/LibScilab_Import.def
scilab/modules/fftw/sci_gateway/gw_fftw.c
scilab/modules/fileio/sci_gateway/gw_fileio.c
scilab/modules/graphics/sci_gateway/gw_graphics.c
scilab/modules/gui/sci_gateway/c/gw_gui.c
scilab/modules/integer/sci_gateway/c/gw_integer.c
scilab/modules/interpolation/sci_gateway/c/gw_interpolation.c
scilab/modules/io/sci_gateway/c/gw_io.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra.c
scilab/modules/linear_algebra/sci_gateway/c/gw_linear_algebra2.c
scilab/modules/metanet/sci_gateway/c/gw_metanet.c
scilab/modules/metanet/src/c/LibScilab_Import.def
scilab/modules/optimization/sci_gateway/c/gw_optim.c
scilab/modules/polynomials/sci_gateway/c/gw_polynomials.c
scilab/modules/pvm/sci_gateway/gw_pvm.c
scilab/modules/randlib/sci_gateway/gw_randlib.c
scilab/modules/scicos/sci_gateway/c/gw_cscicos.c
scilab/modules/scicos/sci_gateway/c/gw_scicos.c
scilab/modules/scicos/src/c/LibScilab_Import.def
scilab/modules/signal_processing/sci_gateway/c/gw_signal.c
scilab/modules/sound/LibScilab_Import.def
scilab/modules/sound/sci_gateway/gw_sound.c
scilab/modules/sparse/sci_gateway/c/gw_sparse.c
scilab/modules/special_functions/sci_gateway/c/gw_special_functions1.c
scilab/modules/special_functions/sci_gateway/c/gw_special_functions2.c
scilab/modules/statistics/sci_gateway/c/gw_statistics.c
scilab/modules/string/sci_gateway/c/gw_string.c
scilab/modules/symbolic/sci_gateway/c/gw_symbolic.c
scilab/modules/tclsci/LibScilab_Import.def
scilab/modules/tclsci/sci_gateway/gw_tclsci.c
scilab/modules/time/LibScilab_Import.def
scilab/modules/time/sci_gateway/gw_time.c
scilab/modules/wintools/sci_gateway/gw_wintools.c

index c531fe2..ebc8bc5 100644 (file)
@@ -10,4 +10,4 @@ EXPORTS
  checkrhs_
  errorinfo_
  sciprint
- GetExceptionString
\ No newline at end of file
+ ExceptionMessage
\ No newline at end of file
index 4dbed55..2c9fbeb 100644 (file)
@@ -1,16 +1,16 @@
-#include <math.h>
-#include <string.h>
 /*-----------------------------------------------------------------------------------*/
 /* INRIA 2006 */
 /* Allan CORNET */
 /*-----------------------------------------------------------------------------------*/
-#include "MALLOC.h"
-#include "stack-c.h"
-#include "sciprint.h"
+#include <math.h>
+#include <string.h>
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include <Windows.h>
+#include "ExceptionMessage.h"
 #endif
+#include "stack-c.h"
+#include "sciprint.h"
 /*-----------------------------------------------------------------------------------*/
 typedef int (*Arpack_Interf) __PARAMS((char *fname,unsigned long l));
 
@@ -50,9 +50,7 @@ int C2F(gw_arnoldi)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index 9fe7a40..3a65f28 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 static int C2F(sci_find) _PARAMS((char *fname,unsigned long fname_len));
@@ -35,9 +34,7 @@ int C2F(gw_boolean)()
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 7fb31ba..efe9f84 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_gschur) _PARAMS((char *fname,unsigned long fname_len));
@@ -34,9 +33,7 @@ int C2F(gw_cacsd0)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index d5a8ac5..2ec21b2 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(scilyap) _PARAMS((char *fname,unsigned long fname_len));
@@ -32,9 +31,7 @@ int C2F(gw_cacsd1)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 1b10fef..d89650a 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_ppol) _PARAMS((char *fname,unsigned long fname_len));
@@ -43,9 +42,7 @@ int C2F(gw_cacsd2)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 8b32ce7..9ca8abf 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_arl2) _PARAMS((char *fname,unsigned long fname_len));
@@ -33,9 +32,7 @@ int C2F(gw_cacsd3)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index af129ae..7dc45ec 100644 (file)
@@ -3,8 +3,8 @@
 #include <string.h>
 /*-----------------------------------------------------------------------------------*/ 
 #if _MSC_VER
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include <Windows.h>
+#include "ExceptionMessage.h"
 #endif
 
 #include "../../../mexlib/includes/mex.h"
@@ -46,9 +46,7 @@ int C2F(gw_slicot)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);
diff --git a/scilab/modules/core/includes/ExceptionMessage.h b/scilab/modules/core/includes/ExceptionMessage.h
new file mode 100644 (file)
index 0000000..e54e034
--- /dev/null
@@ -0,0 +1,10 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/\r
+#ifndef _EXCEPTIONMESSAGE_H_\r
+#define _EXCEPTIONMESSAGE_H_\r
+/*-----------------------------------------------------------------------------------*/\r
+void ExceptionMessage(DWORD ExceptionCode,char *functionname);\r
+/*-----------------------------------------------------------------------------------*/\r
+#endif /* _EXCEPTIONMESSAGE_H_ */\r
index ae04af6..03b538b 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_debug) _PARAMS((char *fname,unsigned long fname_len));
@@ -162,9 +161,7 @@ int C2F(gw_core)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
diff --git a/scilab/modules/core/src/c/ExceptionMessage.c b/scilab/modules/core/src/c/ExceptionMessage.c
new file mode 100644 (file)
index 0000000..d07bf57
--- /dev/null
@@ -0,0 +1,25 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/\r
+#include "MALLOC.h"\r
+#include "GetExceptionCode.h"\r
+#include "ExceptionMessage.h"\r
+#include "sciprint.h"\r
+/*-----------------------------------------------------------------------------------*/\r
+extern char *GetExceptionString(DWORD ExceptionCode);\r
+/*-----------------------------------------------------------------------------------*/\r
+void ExceptionMessage(DWORD ExceptionCode,char *functionname)\r
+{\r
+       char *ExceptionString=GetExceptionString(ExceptionCode);\r
+       if (functionname)\r
+       {\r
+               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nSave your data and restart Scilab.\n",ExceptionString,functionname);\r
+       }\r
+       else\r
+       {\r
+               sciprint("Warning !!!\nScilab has found a critical error (%s).\nSave your data and restart Scilab.\n",ExceptionString);\r
+       }\r
+       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
index db65f40..5ab74c8 100644 (file)
@@ -12,7 +12,7 @@
 
 #include "stack-def.h"
 #include "MALLOC.h" /* MALLOC */
-
+#include "ExceptionMessage.h"
 
 extern int C2F(namstr) __PARAMS((integer *id, integer *str, integer *n, integer *job));
 extern int C2F(funtab) __PARAMS((int *id, int *fptr, int *job,char *namefunction,unsigned long namefunction_len));  
@@ -277,10 +277,7 @@ void C2F(userlk)(integer *k)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       extern char *GetExceptionString(DWORD ExceptionCode);
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,DynInterf[k1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),DynInterf[k1].name);
                }
          #else
                (*DynInterf[k1].func)();
index eae4eed..2cc01b6 100644 (file)
@@ -20,7 +20,7 @@ extern void sci_usr1_signal(int n);
 extern void sci_exit(int n);
 extern int C2F(sciiargc) (void);
 #ifdef _MSC_VER
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #else
 extern int IsNoInteractiveWindow(void);
 extern void InitXsession(void);
@@ -140,9 +140,7 @@ void realmain(int nowin,int no_startup_flag_l,char *initial_script,int initial_s
        {
                Rerun:
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s).\nScilab may become unstable.\n",ExceptionString);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),NULL);
                }
                _try
                {
index e88630b..5b8ed95 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_glist) _PARAMS((char *fname,unsigned long fname_len));
@@ -52,9 +51,7 @@ int C2F(gwdatastructures1)()
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index aa7eb86..a470fed 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern C2F(error)();
@@ -51,9 +50,7 @@ int C2F(gwdatastructures2)()
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 24d1863..cff9d87 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -54,9 +53,7 @@ int C2F(gw_differential_equations1)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 72a2a60..58e8c8f 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -46,9 +45,7 @@ int C2F(gw_differential_equations2)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 4e3ca7d..4624f3b 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -47,9 +46,7 @@ int C2F(gw_differential_equations3)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 4da7af6..ffbcad4 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -46,9 +45,7 @@ int C2F(gw_differential_equations4)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 7867325..528aebd 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -47,9 +46,7 @@ int C2F(gw_differential_equations5)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index b1e6618..e056895 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include <string.h>
@@ -42,9 +41,7 @@ int C2F(gw_differential_equations6)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 69920d3..a994a9a 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_abs) _PARAMS((char *fname,unsigned long fname_len));
@@ -123,9 +122,7 @@ int C2F(gw_elementaries_functions)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 06743c1..71516d6 100644 (file)
@@ -12,7 +12,7 @@ EXPORTS
  checklhs_
  checkrhs_
  Scierror
- GetExceptionString
+ ExceptionMessage
  createcvar_
  vartype_
  check_dims
index 446b17e..4007aac 100644 (file)
@@ -6,8 +6,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int  Scierror __PARAMS((int iv,char *fmt,...));
@@ -62,9 +61,7 @@ int C2F(gw_fftw)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index f719ad1..672ce47 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
        #include <Windows.h>
-       #include "MALLOC.h"
-       extern char *GetExceptionString(DWORD ExceptionCode);
+       #include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 /* interface for the function Table */ 
@@ -73,9 +72,7 @@ int C2F(gw_fileio)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 71ff02a..cc943cb 100644 (file)
@@ -4,11 +4,10 @@
 /*-----------------------------------------------------------------------------------*/ 
 #include "gw_graphics.h"
 #include <string.h>
-#include "MALLOC.h"
-/*-----------------------------------------------------------------------------------*/ 
 #if _MSC_VER
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
+/*-----------------------------------------------------------------------------------*/ 
 extern int GetWITH_GUI(void);
 /*-----------------------------------------------------------------------------------*/ 
 static MatdesTable Tab[]={
@@ -98,8 +97,8 @@ static MatdesTable Tab[]={
        {sci_get,"get"},
        {sci_set,"set"},
        {sci_newaxes,"newaxes"},
-        {sci_relocate_handle,"relocate_handle"},
-        {sci_swap_handles,"swap_handles"},
+    {sci_relocate_handle,"relocate_handle"},
+    {sci_swap_handles,"swap_handles"},
      /* NG end */
        {sci_xsort,"gsort"},
        {sci_help_gtk,"help_gtk"},
@@ -124,9 +123,7 @@ int C2F(gw_graphics)(void)
          }
          _except (EXCEPTION_EXECUTE_HANDLER)
          {
-                 char *ExceptionString=GetExceptionString(GetExceptionCode());
-                 sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                 if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                 ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
          }
 #else
          (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 5e19592..d8f319e 100644 (file)
@@ -5,10 +5,8 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
-
 /*-----------------------------------------------------------------------------------*/
 static GuiTable Tab[]=
 {
@@ -46,9 +44,7 @@ int C2F(gw_gui)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 0fec1cd..dfd575c 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sciint32) _PARAMS((char *fname,unsigned long fname_len));
@@ -80,9 +79,7 @@ int C2F(gw_integer)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 1fe2a4c..f32a05f 100644 (file)
@@ -4,7 +4,7 @@
 #include "gw_interpolation.h"
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int intsplin(char *fname,unsigned long fname_len); 
@@ -45,9 +45,7 @@ int C2F(gw_interpolation)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f))(Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index b1c462a..4ac5d7a 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_oldload) _PARAMS((char *fname,unsigned long fname_len));
@@ -139,9 +138,7 @@ int C2F(gw_io)()
                 }
                 _except (EXCEPTION_EXECUTE_HANDLER)
                 {      
-                        char *ExceptionString=GetExceptionString(GetExceptionCode());
-                        sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                        if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                        ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                 }
                #else
                 (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index e5c81a9..914b810 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/ 
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/ 
 extern int C2F(inthess) _PARAMS((char *fname, unsigned long fname_len));
@@ -41,9 +40,7 @@ int C2F(gw_linear_algebra)()
                        }
                        _except (EXCEPTION_EXECUTE_HANDLER)
                        {
-                               char *ExceptionString=GetExceptionString(GetExceptionCode());
-                               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                        }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 0d1190c..dc0ff0b 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/ 
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/ 
 extern int C2F(intqr) _PARAMS((char *fname,unsigned long fname_len));
@@ -54,9 +53,7 @@ int C2F(gw_linear_algebra2)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index cc78d5a..2e98fb7 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(intsm6loadg) _PARAMS((char *fname,unsigned long fname_len));
@@ -125,9 +124,7 @@ int C2F(gw_metanet)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index 589bce1..0a1c925 100644 (file)
@@ -5,7 +5,7 @@ EXPORTS
 ;core
 com_
 sciprint
-GetExceptionString
+ExceptionMessage
 ;
 ;intersci
 cerro
\ No newline at end of file
index 9ac1614..c8fb67f 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_optim) _PARAMS((char *fname,unsigned long fname_len));
@@ -38,9 +37,7 @@ int C2F(gw_optim)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 9afa785..2b84b03 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_poly) _PARAMS((char *fname,unsigned long fname_len));
@@ -60,9 +59,7 @@ int C2F(gw_polynomials)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 6aad2a2..fa38dc4 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
   #include <Windows.h>
-  #include "win_mem_alloc.h"
-  extern char *GetExceptionString(DWORD ExceptionCode);
+  #include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int sci_gateway __PARAMS((char *fname, GatefuncS F));
@@ -91,9 +90,7 @@ int C2F(gw_pvm)()
                        }
                        _except (EXCEPTION_EXECUTE_HANDLER)
                        {       
-                               char *ExceptionString=GetExceptionString(GetExceptionCode());
-                               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                        }
                #else
                        (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);
index 7c08752..9120866 100644 (file)
@@ -4,8 +4,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "win_mem_alloc.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 
 #include "stack-c.h"
@@ -28,9 +27,7 @@ int C2F(gw_randlib)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 3afc34c..f704af0 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "win_mem_alloc.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 /* interface for the previous function Table */ 
@@ -56,9 +55,7 @@ int C2F(gw_cscicos)()
                        }
                        _except (EXCEPTION_EXECUTE_HANDLER)
                        {
-                               char *ExceptionString=GetExceptionString(GetExceptionCode());
-                               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                        }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index ca85c28..addc216 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "win_mem_alloc.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 /* interface for the previous function Table */ 
@@ -47,9 +46,7 @@ int C2F(gw_scicos)()
                        }
                        _except (EXCEPTION_EXECUTE_HANDLER)
                        {
-                               char *ExceptionString=GetExceptionString(GetExceptionCode());
-                               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                        }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index 56ebc8f..86065d2 100644 (file)
@@ -12,7 +12,7 @@ errgst_
 cha1_
 iop_
 sciprint
-GetExceptionString
+ExceptionMessage
 Scierror
 putlhsvar_
 ExistScicos
index d283d21..4500fad 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 static SignalTable Tab[]=
@@ -32,9 +31,7 @@ int C2F(gw_signal)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index b133d95..80736b6 100644 (file)
@@ -15,4 +15,4 @@ EXPORTS
  intersci_
  createvarfromptr_
  Scierror
- GetExceptionString
+ ExceptionMessage
index 0f8cc28..cc26417 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 /* interface for the previous function Table */ 
@@ -35,9 +34,7 @@ int C2F(gw_sound)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index 80a3ec9..45f9473 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "../../../../libs/MALLOC/includes/MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_sparsefunc) _PARAMS((char *fname,unsigned long fname_len));
@@ -76,9 +75,7 @@ int C2F(gw_sparse)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 8e3230c..b9b4211 100644 (file)
@@ -4,8 +4,7 @@
 #include "gw_special_functions1.h"
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
-       #include "MALLOC.h"
-       extern char *GetExceptionString(DWORD ExceptionCode);
+       #include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_oldbesseli) _PARAMS((char *fname,unsigned long fname_len));
@@ -40,9 +39,7 @@ int C2F(gw_special_functions1)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f))(Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 1eb8c9d..6b15129 100644 (file)
@@ -7,8 +7,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
        #include <Windows.h>
-       #include "MALLOC.h"
-       extern char *GetExceptionString(DWORD ExceptionCode);
+       #include "ExceptionMessage.h"
 #endif
 #include "stack-c.h"
 #include "sciprint.h"
@@ -49,9 +48,7 @@ int C2F(gw_special_functions2)(void)
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f))(Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index b2918b2..c15b422 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int cdfbetI(char* fname,unsigned long l);
@@ -47,9 +46,7 @@ int C2F(gw_statistics)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 3790cc9..35c734f 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 int C2F(gw_string)(void);
@@ -41,9 +40,7 @@ int C2F(gw_string)(void)
        }
        _except (EXCEPTION_EXECUTE_HANDLER)
        {       
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
        }
 #else
        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 5ae40db..0291c79 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
 #include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 
@@ -40,9 +39,7 @@ int C2F(gw_symbolic)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {       
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
        #else
                (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));
index 04f5d11..1b4f425 100644 (file)
@@ -29,7 +29,7 @@ EXPORTS
  intersci_
  createvarfromptr_
  Scierror
- GetExceptionString
+ ExceptionMessage
  set_cf_type
  getSCIpath
  FileExist
\ No newline at end of file
index cc0864b..46a4ef9 100644 (file)
@@ -4,10 +4,10 @@
 /* Allan CORNET */
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
-#include <Windows.h>
-#include "MALLOC.h"
-extern char *GetExceptionString(DWORD ExceptionCode);
+       #include <Windows.h>
+       #include "ExceptionMessage.h"
 #endif
+/*-----------------------------------------------------------------------------------*/
 extern int GetWITH_GUI(void);
 extern void sciprint __PARAMS((char *fmt,...));
 /*-----------------------------------------------------------------------------------*/
@@ -73,9 +73,7 @@ int C2F(gw_tclsci)()
                        }
                        _except (EXCEPTION_EXECUTE_HANDLER)
                        {       
-                               char *ExceptionString=GetExceptionString(GetExceptionCode());
-                               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                        }
 #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index cca8941..626a7af 100644 (file)
@@ -3,7 +3,7 @@ LIBRARY    LibScilab.dll
 
 EXPORTS
  sciprint
- GetExceptionString
+ ExceptionMessage
  putlhsvar_
  intersci_
  Scierror
index db379f5..f6287cd 100644 (file)
@@ -3,11 +3,9 @@
 /* INRIA 2006 */
 /* Allan CORNET */
 /*-----------------------------------------------------------------------------------*/
-#include "MALLOC.h"
 #include "sciprint.h"
 #if _MSC_VER
-#include <Windows.h>
-extern char *GetExceptionString(DWORD ExceptionCode);
+#include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 /* interface for the previous function Table */ 
@@ -41,9 +39,7 @@ int C2F(gw_time)()
                }
                _except (EXCEPTION_EXECUTE_HANDLER)
                {
-                       char *ExceptionString=GetExceptionString(GetExceptionCode());
-                       sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-                       if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+                       ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
                }
                #else
                        (*(Tab[Fin-1].f)) (Tab[Fin-1].name,(unsigned long)strlen(Tab[Fin-1].name));
index d9233ea..6ea37f6 100644 (file)
@@ -5,8 +5,7 @@
 /*-----------------------------------------------------------------------------------*/
 #if _MSC_VER
   #include <Windows.h>
-  #include "win_mem_alloc.h"
-  extern char *GetExceptionString(DWORD ExceptionCode);
+  #include "ExceptionMessage.h"
 #endif
 /*-----------------------------------------------------------------------------------*/
 extern int C2F(sci_winopen) _PARAMS((char *fname,unsigned long l));
@@ -75,9 +74,7 @@ int C2F(gw_wintools)()
     }
     _except (EXCEPTION_EXECUTE_HANDLER)
     {
-               char *ExceptionString=GetExceptionString(GetExceptionCode());
-               sciprint("Warning !!!\nScilab has found a critical error (%s)\nwith \"%s\" function.\nScilab may become unstable.\n",ExceptionString,Tab[Fin-1].name);
-               if (ExceptionString) {FREE(ExceptionString);ExceptionString=NULL;}
+               ExceptionMessage(GetExceptionCode(),Tab[Fin-1].name);
     }
     #else
       (*(Tab[Fin-1].f)) (Tab[Fin-1].name,strlen(Tab[Fin-1].name));