Set svn:eol-style to native
Pierre Marechal [Sun, 2 Dec 2007 11:25:43 +0000 (11:25 +0000)]
49 files changed:
scilab/modules/STRING_V2/includes/InitializeString.h
scilab/modules/STRING_V2/includes/cvstr.h
scilab/modules/STRING_V2/includes/getfastcode.h
scilab/modules/STRING_V2/sci_gateway/c/sci_isalphanum.c
scilab/modules/STRING_V2/sci_gateway/c/sci_isdigit.c
scilab/modules/STRING_V2/sci_gateway/c/sci_isletter.c
scilab/modules/STRING_V2/sci_gateway/c/sci_strcmp.c
scilab/modules/STRING_V2/src/c/InitializeString.c
scilab/modules/STRING_V2/src/c/config.h
scilab/modules/STRING_V2/src/c/cvstr.c
scilab/modules/STRING_V2/src/c/getfastcode.c
scilab/modules/STRING_V2/src/c/isalphanum.c
scilab/modules/STRING_V2/src/c/isalphanum.h
scilab/modules/STRING_V2/src/c/isdigit.c
scilab/modules/STRING_V2/src/c/isdigit.h
scilab/modules/STRING_V2/src/c/isletter.c
scilab/modules/STRING_V2/src/c/isletter.h
scilab/modules/STRING_V2/src/c/pcre_private.h
scilab/modules/STRING_V2/src/c/setScilabCharactersCodes.c
scilab/modules/STRING_V2/src/c/setScilabCharactersCodes.h
scilab/modules/STRING_V2/src/c/stringsCompare.c
scilab/modules/STRING_V2/src/c/stringsCompare.h
scilab/modules/STRING_V2/unit_tests/memory_leak/addstring.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/ascii.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/code2str.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/convstr.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/emptystr.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/grep.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/grep_new.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/length.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/part.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/str2code.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/strcat.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/strindex.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/stripblanks.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/strsplit.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/strsubst.tst
scilab/modules/STRING_V2/unit_tests/memory_leak/tokens.tst
scilab/modules/STRING_V2/unit_tests/strcmp.dia.ref
scilab/modules/STRING_V2/unit_tests/strcmp.tst
scilab/modules/core/includes/freeArrayOfString.h
scilab/modules/core/src/c/freeArrayOfString.c
scilab/modules/graphics/Gui_Import.def
scilab/modules/gui/src/c/DllmainGUI.c
scilab/modules/output_stream/src/c/String_Import.def
scilab/modules/string/includes/InitializeString.h
scilab/modules/string/src/c/InitializeString.c
scilab/modules/string/src/c/setScilabCharactersCodes.c
scilab/modules/string/src/c/setScilabCharactersCodes.h

index f0e0a2f..9663d4d 100644 (file)
@@ -1,13 +1,13 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#ifndef __INITIALIZESTRING_H__\r
-#define __INITIALIZESTRING_H__\r
-\r
-#include "BOOL.h"\r
-\r
-BOOL InitializeString(void);\r
-\r
-#endif /* __INITIALIZESTRING_H__ */\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#ifndef __INITIALIZESTRING_H__
+#define __INITIALIZESTRING_H__
+
+#include "BOOL.h"
+
+BOOL InitializeString(void);
+
+#endif /* __INITIALIZESTRING_H__ */
+/*--------------------------------------------------------------------------*/ 
index 4b0a063..7f24333 100644 (file)
@@ -1,58 +1,58 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Sylvestre LEDRU */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __CVSTR_H__\r
-#define __CVSTR_H__\r
-\r
-#include "machine.h" /* C2F */\r
-\r
-/**\r
-* converts from ascii to Scilab internal coding \r
-* @param n integer, length of the string to be converted integer\r
-* @param line: integer array (where Scilab coded string are stored ) \r
-* @param str: string \r
-* @param job: integer flag \r
-* @param str_len : length of str\r
-* @return 1: code-->ascii \r
-* @return 0: ascii-->code \r
-*/\r
-int C2F(cvstr)(integer * n,integer * line,char * str,integer * job,unsigned long str_len);\r
-\r
-/**\r
-* converts from ascii to Scilab internal coding \r
-* ascii->code is performed from end to the begining \r
-* @param n integer, length of the string to be converted integer\r
-* @param line: integer array (where Scilab coded string are stored ) \r
-* @param str: string \r
-* @param job: integer flag \r
-* @param str_len : length of str\r
-* @return 0: ascii-->code \r
-*/\r
-int C2F(cvstr1)(integer *n,integer * line,char * str,integer * job,unsigned long str_len);\r
-\r
-/**\r
-* converts from Scilab internal coding to ascii\r
-* @param n integer, length of the string to be converted integer\r
-* @param line: integer array (where Scilab coded string are stored ) \r
-* @param str: string \r
-* @param str_len : length of str\r
-* @return 0\r
-*/\r
-int C2F(codetoascii)(integer *n,integer * line,char * str, unsigned long str_len);\r
-\r
-/**\r
-* converts from ascii to Scilab internal coding \r
-* @param n integer, length of the string to be converted integer\r
-* @param line: integer array (where Scilab coded string are stored ) \r
-* @param str: string \r
-* @param flagx:  1 or -1 and this is used when the \r
-* conversion is made with line and str stored at overlapping \r
-* memory zone \r
-* @param str_len : length of str\r
-* @return 0\r
-*/\r
-int C2F(asciitocode)(integer * n,integer * line,char * str,integer * flagx,unsigned long  str_len);\r
-\r
-#endif /* __CVSTR_H__ */\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Sylvestre LEDRU */
+/*--------------------------------------------------------------------------*/
+#ifndef __CVSTR_H__
+#define __CVSTR_H__
+
+#include "machine.h" /* C2F */
+
+/**
+* converts from ascii to Scilab internal coding 
+* @param n integer, length of the string to be converted integer
+* @param line: integer array (where Scilab coded string are stored ) 
+* @param str: string 
+* @param job: integer flag 
+* @param str_len : length of str
+* @return 1: code-->ascii 
+* @return 0: ascii-->code 
+*/
+int C2F(cvstr)(integer * n,integer * line,char * str,integer * job,unsigned long str_len);
+
+/**
+* converts from ascii to Scilab internal coding 
+* ascii->code is performed from end to the begining 
+* @param n integer, length of the string to be converted integer
+* @param line: integer array (where Scilab coded string are stored ) 
+* @param str: string 
+* @param job: integer flag 
+* @param str_len : length of str
+* @return 0: ascii-->code 
+*/
+int C2F(cvstr1)(integer *n,integer * line,char * str,integer * job,unsigned long str_len);
+
+/**
+* converts from Scilab internal coding to ascii
+* @param n integer, length of the string to be converted integer
+* @param line: integer array (where Scilab coded string are stored ) 
+* @param str: string 
+* @param str_len : length of str
+* @return 0
+*/
+int C2F(codetoascii)(integer *n,integer * line,char * str, unsigned long str_len);
+
+/**
+* converts from ascii to Scilab internal coding 
+* @param n integer, length of the string to be converted integer
+* @param line: integer array (where Scilab coded string are stored ) 
+* @param str: string 
+* @param flagx:  1 or -1 and this is used when the 
+* conversion is made with line and str stored at overlapping 
+* memory zone 
+* @param str_len : length of str
+* @return 0
+*/
+int C2F(asciitocode)(integer * n,integer * line,char * str,integer * flagx,unsigned long  str_len);
+
+#endif /* __CVSTR_H__ */
+/*--------------------------------------------------------------------------*/
index 832ee38..353b330 100644 (file)
@@ -1,35 +1,35 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Sylvestre LEDRU */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __GETFASTCODE_H__\r
-#define __GETFASTCODE_H__\r
-\r
-#include "machine.h"\r
-\r
-/**\r
-* converts from ascii to Scilab internal coding \r
-* @param n integer, length of the string to be converted integer\r
-* @param line: integer array (where Scilab coded string are stored ) \r
-* @param a char\r
-* @return internal code\r
-* getfastcode uses convertAsciiCodeToScilabCode\r
-*/\r
-integer C2F(getfastcode)(unsigned char *c, unsigned long c_len);\r
-\r
-/**\r
-* converts from ascii to Scilab internal coding \r
-* @param[in] ascii char\r
-* @return scilab code\r
-*/\r
-int convertAsciiCodeToScilabCode(unsigned char scilab_char);\r
-\r
-/**\r
-* converts Scilab internal coding to ascii code\r
-* @param[in] scilab_code\r
-* @return ascii_code [0 255]\r
-*/\r
-char convertScilabCodeToAsciiCode(int scilab_code);\r
-\r
-#endif /* __GETFASTCODE_H__ */\r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Sylvestre LEDRU */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/
+#ifndef __GETFASTCODE_H__
+#define __GETFASTCODE_H__
+
+#include "machine.h"
+
+/**
+* converts from ascii to Scilab internal coding 
+* @param n integer, length of the string to be converted integer
+* @param line: integer array (where Scilab coded string are stored ) 
+* @param a char
+* @return internal code
+* getfastcode uses convertAsciiCodeToScilabCode
+*/
+integer C2F(getfastcode)(unsigned char *c, unsigned long c_len);
+
+/**
+* converts from ascii to Scilab internal coding 
+* @param[in] ascii char
+* @return scilab code
+*/
+int convertAsciiCodeToScilabCode(unsigned char scilab_char);
+
+/**
+* converts Scilab internal coding to ascii code
+* @param[in] scilab_code
+* @return ascii_code [0 255]
+*/
+char convertScilabCodeToAsciiCode(int scilab_code);
+
+#endif /* __GETFASTCODE_H__ */
index 15b0a7b..b67681e 100644 (file)
@@ -1,74 +1,74 @@
-/*-----------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                  */\r
-/* @Author : Allan CORNET                                                */\r
-/*-----------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <stdio.h>\r
-#include "gw_string.h"\r
-#include "machine.h"\r
-#include "stack-c.h"\r
-#include "Scierror.h"\r
-#include "localization.h"\r
-#include "BOOL.h"\r
-#include "freeArrayOfString.h"\r
-#include "isalphanum.h"\r
-#include "MALLOC.h"\r
-/*----------------------------------------------------------------------------*/\r
-int C2F(sci_isalphanum) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       int Type_One = 0;\r
-       \r
-       CheckRhs(1,1);\r
-       CheckLhs(1,1);\r
-\r
-       Type_One = VarType(1);\r
-       if (Type_One == sci_strings)\r
-       {\r
-               char **Input_StringMatrix = NULL;\r
-               BOOL *values = NULL;\r
-               int Row_Num = 0,Col_Num = 0;\r
-               int mn = 0; /* Row_Num * Col_Num */\r
-\r
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);\r
-               mn = Row_Num * Col_Num;\r
-\r
-               if (mn != 1)\r
-               {\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);\r
-                       return 0;\r
-               }\r
-\r
-               values = isalphanum(Input_StringMatrix[0]);\r
-\r
-               if (values)\r
-               {\r
-                       int m1 = 1;\r
-                       int n1 = (int)strlen(Input_StringMatrix[0]);\r
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);\r
-                       LhsVar(1)=Rhs+1;\r
-                       C2F(putlhsvar)();\r
-\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       if (values) {FREE(values);values = NULL;}\r
-               }\r
-               else\r
-               {\r
-                       /* returns [] */\r
-                       int m1 = 0;\r
-                       int n1 = 0;\r
-                       int l = 0;\r
-                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);\r
-                       LhsVar(1) = Rhs+1 ;\r
-                       C2F(putlhsvar)();\r
-                       return 0;\r
-               }\r
-       }\r
-       else\r
-       {\r
-               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);\r
-       }\r
-       return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-\r
+/*-----------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                  */
+/* @Author : Allan CORNET                                                */
+/*-----------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#include "gw_string.h"
+#include "machine.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "BOOL.h"
+#include "freeArrayOfString.h"
+#include "isalphanum.h"
+#include "MALLOC.h"
+/*----------------------------------------------------------------------------*/
+int C2F(sci_isalphanum) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int Type_One = 0;
+       
+       CheckRhs(1,1);
+       CheckLhs(1,1);
+
+       Type_One = VarType(1);
+       if (Type_One == sci_strings)
+       {
+               char **Input_StringMatrix = NULL;
+               BOOL *values = NULL;
+               int Row_Num = 0,Col_Num = 0;
+               int mn = 0; /* Row_Num * Col_Num */
+
+               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);
+               mn = Row_Num * Col_Num;
+
+               if (mn != 1)
+               {
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);
+                       return 0;
+               }
+
+               values = isalphanum(Input_StringMatrix[0]);
+
+               if (values)
+               {
+                       int m1 = 1;
+                       int n1 = (int)strlen(Input_StringMatrix[0]);
+                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);
+                       LhsVar(1)=Rhs+1;
+                       C2F(putlhsvar)();
+
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       if (values) {FREE(values);values = NULL;}
+               }
+               else
+               {
+                       /* returns [] */
+                       int m1 = 0;
+                       int n1 = 0;
+                       int l = 0;
+                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);
+                       LhsVar(1) = Rhs+1 ;
+                       C2F(putlhsvar)();
+                       return 0;
+               }
+       }
+       else
+       {
+               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/
+
index 0e87183..8752307 100644 (file)
@@ -1,74 +1,74 @@
-/*-----------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                  */\r
-/* @Author : Allan CORNET                                                */\r
-/*-----------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <stdio.h>\r
-#include "gw_string.h"\r
-#include "machine.h"\r
-#include "stack-c.h"\r
-#include "Scierror.h"\r
-#include "localization.h"\r
-#include "BOOL.h"\r
-#include "freeArrayOfString.h"\r
-#include "isdigit.h"\r
-#include "MALLOC.h"\r
-/*----------------------------------------------------------------------------*/\r
-int C2F(sci_isdigit) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       int Type_One = 0;\r
-       \r
-       CheckRhs(1,1);\r
-       CheckLhs(1,1);\r
-\r
-       Type_One = VarType(1);\r
-       if (Type_One == sci_strings)\r
-       {\r
-               char **Input_StringMatrix = NULL;\r
-               BOOL *values = NULL;\r
-               int Row_Num = 0,Col_Num = 0;\r
-               int mn = 0; /* Row_Num * Col_Num */\r
-\r
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);\r
-               mn = Row_Num * Col_Num;\r
-\r
-               if (mn != 1)\r
-               {\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);\r
-                       return 0;\r
-               }\r
-\r
-               values = IsDigit(Input_StringMatrix[0]);\r
-\r
-               if (values)\r
-               {\r
-                       int m1 = 1;\r
-                       int n1 = (int)strlen(Input_StringMatrix[0]);\r
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);\r
-                       LhsVar(1)=Rhs+1;\r
-                       C2F(putlhsvar)();\r
-\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       if (values) {FREE(values);values = NULL;}\r
-               }\r
-               else\r
-               {\r
-                       /* returns [] */\r
-                       int m1 = 0;\r
-                       int n1 = 0;\r
-                       int l = 0;\r
-                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);\r
-                       LhsVar(1) = Rhs+1 ;\r
-                       C2F(putlhsvar)();\r
-                       return 0;\r
-               }\r
-       }\r
-       else\r
-       {\r
-               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);\r
-       }\r
-       return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-\r
+/*-----------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                  */
+/* @Author : Allan CORNET                                                */
+/*-----------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#include "gw_string.h"
+#include "machine.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "BOOL.h"
+#include "freeArrayOfString.h"
+#include "isdigit.h"
+#include "MALLOC.h"
+/*----------------------------------------------------------------------------*/
+int C2F(sci_isdigit) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int Type_One = 0;
+       
+       CheckRhs(1,1);
+       CheckLhs(1,1);
+
+       Type_One = VarType(1);
+       if (Type_One == sci_strings)
+       {
+               char **Input_StringMatrix = NULL;
+               BOOL *values = NULL;
+               int Row_Num = 0,Col_Num = 0;
+               int mn = 0; /* Row_Num * Col_Num */
+
+               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);
+               mn = Row_Num * Col_Num;
+
+               if (mn != 1)
+               {
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);
+                       return 0;
+               }
+
+               values = IsDigit(Input_StringMatrix[0]);
+
+               if (values)
+               {
+                       int m1 = 1;
+                       int n1 = (int)strlen(Input_StringMatrix[0]);
+                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);
+                       LhsVar(1)=Rhs+1;
+                       C2F(putlhsvar)();
+
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       if (values) {FREE(values);values = NULL;}
+               }
+               else
+               {
+                       /* returns [] */
+                       int m1 = 0;
+                       int n1 = 0;
+                       int l = 0;
+                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);
+                       LhsVar(1) = Rhs+1 ;
+                       C2F(putlhsvar)();
+                       return 0;
+               }
+       }
+       else
+       {
+               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/
+
index 5ad2d28..635f614 100644 (file)
@@ -1,74 +1,74 @@
-/*-----------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                  */\r
-/* @Author : Allan CORNET                                                */\r
-/*-----------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <stdio.h>\r
-#include "gw_string.h"\r
-#include "machine.h"\r
-#include "stack-c.h"\r
-#include "Scierror.h"\r
-#include "localization.h"\r
-#include "BOOL.h"\r
-#include "freeArrayOfString.h"\r
-#include "isletter.h"\r
-#include "MALLOC.h"\r
-/*----------------------------------------------------------------------------*/\r
-int C2F(sci_isletter) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       int Type_One = 0;\r
-       \r
-       CheckRhs(1,1);\r
-       CheckLhs(1,1);\r
-\r
-       Type_One = VarType(1);\r
-       if (Type_One == sci_strings)\r
-       {\r
-               char **Input_StringMatrix = NULL;\r
-               BOOL *values = NULL;\r
-               int Row_Num = 0,Col_Num = 0;\r
-               int mn = 0; /* Row_Num * Col_Num */\r
-\r
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);\r
-               mn = Row_Num * Col_Num;\r
-\r
-               if (mn != 1)\r
-               {\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);\r
-                       return 0;\r
-               }\r
-\r
-               values = isletter(Input_StringMatrix[0]);\r
-\r
-               if (values)\r
-               {\r
-                       int m1 = 1;\r
-                       int n1 = (int)strlen(Input_StringMatrix[0]);\r
-                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);\r
-                       LhsVar(1)=Rhs+1;\r
-                       C2F(putlhsvar)();\r
-\r
-                       freeArrayOfString(Input_StringMatrix,mn);\r
-                       if (values) {FREE(values);values = NULL;}\r
-               }\r
-               else\r
-               {\r
-                       /* returns [] */\r
-                       int m1 = 0;\r
-                       int n1 = 0;\r
-                       int l = 0;\r
-                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);\r
-                       LhsVar(1) = Rhs+1 ;\r
-                       C2F(putlhsvar)();\r
-                       return 0;\r
-               }\r
-       }\r
-       else\r
-       {\r
-               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);\r
-       }\r
-       return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-\r
+/*-----------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                  */
+/* @Author : Allan CORNET                                                */
+/*-----------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#include "gw_string.h"
+#include "machine.h"
+#include "stack-c.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "BOOL.h"
+#include "freeArrayOfString.h"
+#include "isletter.h"
+#include "MALLOC.h"
+/*----------------------------------------------------------------------------*/
+int C2F(sci_isletter) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int Type_One = 0;
+       
+       CheckRhs(1,1);
+       CheckLhs(1,1);
+
+       Type_One = VarType(1);
+       if (Type_One == sci_strings)
+       {
+               char **Input_StringMatrix = NULL;
+               BOOL *values = NULL;
+               int Row_Num = 0,Col_Num = 0;
+               int mn = 0; /* Row_Num * Col_Num */
+
+               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&Row_Num,&Col_Num,&Input_StringMatrix);
+               mn = Row_Num * Col_Num;
+
+               if (mn != 1)
+               {
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       Scierror(999,_("%s : First input argument has a wrong dimension, expecting a string.\n"),fname);
+                       return 0;
+               }
+
+               values = isletter(Input_StringMatrix[0]);
+
+               if (values)
+               {
+                       int m1 = 1;
+                       int n1 = (int)strlen(Input_StringMatrix[0]);
+                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &m1, &n1, &values);
+                       LhsVar(1)=Rhs+1;
+                       C2F(putlhsvar)();
+
+                       freeArrayOfString(Input_StringMatrix,mn);
+                       if (values) {FREE(values);values = NULL;}
+               }
+               else
+               {
+                       /* returns [] */
+                       int m1 = 0;
+                       int n1 = 0;
+                       int l = 0;
+                       CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l);
+                       LhsVar(1) = Rhs+1 ;
+                       C2F(putlhsvar)();
+                       return 0;
+               }
+       }
+       else
+       {
+               Scierror(999,_("%s : First input argument has a wrong type, expecting a string.\n"),fname);
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/
+
index 1b19cbe..ad45d65 100644 (file)
-/*-----------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007                                                  */\r
-/* @Author : Allan CORNET                                                */\r
-/*-----------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <stdio.h>\r
-#include "gw_string.h"\r
-#include "machine.h"\r
-#include "stack-c.h"\r
-#include "MALLOC.h"\r
-#include "Scierror.h"\r
-#include "localization.h"\r
-#include "freeArrayOfString.h"\r
-#include "BOOL.h"\r
-#include "stringsCompare.h"\r
-/*----------------------------------------------------------------------------*/\r
-#define CHAR_I 'i'\r
-#define CHAR_S 's'\r
-/*----------------------------------------------------------------------------*/\r
-int C2F(sci_strcmp) _PARAMS((char *fname,unsigned long fname_len))\r
-{\r
-       int Type_One = 0;\r
-       int Type_Two = 0;\r
-       BOOL do_stricmp = FALSE;\r
-\r
-       CheckRhs(2,3);\r
-       CheckLhs(1,1);\r
-\r
-       Type_One = VarType(1);\r
-       Type_Two = VarType(2);\r
-\r
-       if (Rhs == 3)\r
-       {\r
-               int Type_Three = VarType(3);\r
-               if (Type_Three == sci_strings) \r
-               {\r
-                       int Row_Num_Two = 0,Col_Num_Two = 0,Stack_Pos=0;\r
-\r
-                       GetRhsVar(3,STRING_DATATYPE,&Row_Num_Two,&Col_Num_Two,&Stack_Pos);\r
-                       if ( (Row_Num_Two*Col_Num_Two) == 1 )\r
-                       {\r
-                               char typ = 's';\r
-                               /* To put "flag" into typ; whether "i"*/\r
-                               typ = cstk(Stack_Pos)[0];\r
-                               if ( (typ != CHAR_I) && (typ != CHAR_S)) \r
-                               {\r
-                                       Scierror(999,_("%s : Third input argument must be 'i' (stricmp) or 's' (strcmp).\n"),fname);\r
-                                       return 0;       \r
-                               }\r
-                                if (typ == CHAR_I) do_stricmp = TRUE;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       Scierror(999,_("%s : Third input argument must be 'i' (stricmp) or 's' (strcmp).\n"),fname);\r
-                       return 0;\r
-               }\r
-       }\r
-       \r
-       if ( (Type_One == sci_strings) && (Type_Two == sci_strings) )\r
-       {\r
-               char **Input_Strings_One = NULL;\r
-               int m1 = 0, n1 = 0;\r
-               int m1n1 = 0;\r
-\r
-               char **Input_Strings_Two = NULL;\r
-               int m2 = 0, n2 = 0;\r
-               int m2n2 = 0;\r
-\r
-               /* To input the string matrix */\r
-               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&Input_Strings_One); \r
-               m1n1 = m1 * n1;\r
-\r
-               GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&m2,&n2,&Input_Strings_Two); \r
-               m2n2 = m2 * n2;\r
-\r
-               if ( ( (m2 == m1) && (n2 == n1) ) || (m2n2 == 1) )\r
-               {\r
-                       int *values = stringsCompare(Input_Strings_One,m1n1,Input_Strings_Two,m2n2,do_stricmp);\r
-\r
-                       if (values == NULL)\r
-                       {\r
-                               freeArrayOfString(Input_Strings_One,m1n1);\r
-                               freeArrayOfString(Input_Strings_Two,m2n2);\r
-                               Scierror(999,_("%s : Memory allocation error\n"),fname);\r
-                       }\r
-                       else\r
-                       {\r
-                               int outIndex = 0 ;\r
-                               int x = 0;\r
-\r
-                               CreateVar( Rhs+1, MATRIX_OF_DOUBLE_DATATYPE, &m1,&n1, &outIndex );\r
-                               for  ( x = 0; x < m1n1; x++ )\r
-                               {\r
-                                       stk(outIndex)[x] = values[x];\r
-                               }\r
-                               LhsVar(1) = Rhs+1 ;\r
-                               C2F(putlhsvar)();\r
-\r
-                               freeArrayOfString(Input_Strings_One,m1n1);\r
-                               freeArrayOfString(Input_Strings_Two,m2n2);\r
-                               FREE(values);\r
-                               values = NULL;\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       freeArrayOfString(Input_Strings_One,m1n1);\r
-                       freeArrayOfString(Input_Strings_Two,m2n2);\r
-                       Scierror(999,_("%s : Second input argument has a wrong dimension,\nexpecting a string or string matrix as same dimension as first argument.\n"),fname);\r
-               }\r
-       }\r
-       else\r
-       {\r
-               Scierror(999,_("%s : input argument has a wrong type, expecting string or string matrix.\n"),fname);\r
-       }\r
-       return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*-----------------------------------------------------------------------*/
+/* Copyright INRIA 2007                                                  */
+/* @Author : Allan CORNET                                                */
+/*-----------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#include "gw_string.h"
+#include "machine.h"
+#include "stack-c.h"
+#include "MALLOC.h"
+#include "Scierror.h"
+#include "localization.h"
+#include "freeArrayOfString.h"
+#include "BOOL.h"
+#include "stringsCompare.h"
+/*----------------------------------------------------------------------------*/
+#define CHAR_I 'i'
+#define CHAR_S 's'
+/*----------------------------------------------------------------------------*/
+int C2F(sci_strcmp) _PARAMS((char *fname,unsigned long fname_len))
+{
+       int Type_One = 0;
+       int Type_Two = 0;
+       BOOL do_stricmp = FALSE;
+
+       CheckRhs(2,3);
+       CheckLhs(1,1);
+
+       Type_One = VarType(1);
+       Type_Two = VarType(2);
+
+       if (Rhs == 3)
+       {
+               int Type_Three = VarType(3);
+               if (Type_Three == sci_strings) 
+               {
+                       int Row_Num_Two = 0,Col_Num_Two = 0,Stack_Pos=0;
+
+                       GetRhsVar(3,STRING_DATATYPE,&Row_Num_Two,&Col_Num_Two,&Stack_Pos);
+                       if ( (Row_Num_Two*Col_Num_Two) == 1 )
+                       {
+                               char typ = 's';
+                               /* To put "flag" into typ; whether "i"*/
+                               typ = cstk(Stack_Pos)[0];
+                               if ( (typ != CHAR_I) && (typ != CHAR_S)) 
+                               {
+                                       Scierror(999,_("%s : Third input argument must be 'i' (stricmp) or 's' (strcmp).\n"),fname);
+                                       return 0;       
+                               }
+                                if (typ == CHAR_I) do_stricmp = TRUE;
+                       }
+               }
+               else
+               {
+                       Scierror(999,_("%s : Third input argument must be 'i' (stricmp) or 's' (strcmp).\n"),fname);
+                       return 0;
+               }
+       }
+       
+       if ( (Type_One == sci_strings) && (Type_Two == sci_strings) )
+       {
+               char **Input_Strings_One = NULL;
+               int m1 = 0, n1 = 0;
+               int m1n1 = 0;
+
+               char **Input_Strings_Two = NULL;
+               int m2 = 0, n2 = 0;
+               int m2n2 = 0;
+
+               /* To input the string matrix */
+               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&Input_Strings_One); 
+               m1n1 = m1 * n1;
+
+               GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&m2,&n2,&Input_Strings_Two); 
+               m2n2 = m2 * n2;
+
+               if ( ( (m2 == m1) && (n2 == n1) ) || (m2n2 == 1) )
+               {
+                       int *values = stringsCompare(Input_Strings_One,m1n1,Input_Strings_Two,m2n2,do_stricmp);
+
+                       if (values == NULL)
+                       {
+                               freeArrayOfString(Input_Strings_One,m1n1);
+                               freeArrayOfString(Input_Strings_Two,m2n2);
+                               Scierror(999,_("%s : Memory allocation error\n"),fname);
+                       }
+                       else
+                       {
+                               int outIndex = 0 ;
+                               int x = 0;
+
+                               CreateVar( Rhs+1, MATRIX_OF_DOUBLE_DATATYPE, &m1,&n1, &outIndex );
+                               for  ( x = 0; x < m1n1; x++ )
+                               {
+                                       stk(outIndex)[x] = values[x];
+                               }
+                               LhsVar(1) = Rhs+1 ;
+                               C2F(putlhsvar)();
+
+                               freeArrayOfString(Input_Strings_One,m1n1);
+                               freeArrayOfString(Input_Strings_Two,m2n2);
+                               FREE(values);
+                               values = NULL;
+                       }
+               }
+               else
+               {
+                       freeArrayOfString(Input_Strings_One,m1n1);
+                       freeArrayOfString(Input_Strings_Two,m2n2);
+                       Scierror(999,_("%s : Second input argument has a wrong dimension,\nexpecting a string or string matrix as same dimension as first argument.\n"),fname);
+               }
+       }
+       else
+       {
+               Scierror(999,_("%s : input argument has a wrong type, expecting string or string matrix.\n"),fname);
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/
index 1408f6e..fcc3edb 100644 (file)
@@ -1,13 +1,13 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#include "InitializeString.h"\r
-#include "setScilabCharactersCodes.h"\r
-/*--------------------------------------------------------------------------*/ \r
-BOOL InitializeString(void)\r
-{\r
-       setScilabCharactersCodes();\r
-       return TRUE;\r
-}\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#include "InitializeString.h"
+#include "setScilabCharactersCodes.h"
+/*--------------------------------------------------------------------------*/ 
+BOOL InitializeString(void)
+{
+       setScilabCharactersCodes();
+       return TRUE;
+}
+/*--------------------------------------------------------------------------*/ 
index 3d9fe7c..e7daa91 100644 (file)
@@ -1,31 +1,31 @@
-/* config.h for CMake builds */\r
-\r
-/* #undef HAVE_DIRENT_H */\r
-/* #undef HAVE_UNISTD_H */\r
-#define HAVE_SYS_STAT_H\r
-#define HAVE_SYS_TYPES_H\r
-/* #undef HAVE_TYPE_TRAITS_H */\r
-/* #undef HAVE_BITS_TYPE_TRAITS_H */\r
-\r
-/* #undef HAVE_BCOPY */\r
-#define HAVE_MEMMOVE\r
-#define HAVE_STRERROR\r
-\r
-/* #undef PCRE_STATIC */\r
-\r
-/* #undef SUPPORT_UTF8 */\r
-/* #undef SUPPORT_UCP */\r
-/* #undef EBCDIC */\r
-/* #undef BSR_ANYCRLF */\r
-/* #undef NO_RECURSE */\r
-\r
-#define NEWLINE                        10\r
-#define POSIX_MALLOC_THRESHOLD 10\r
-#define LINK_SIZE              2\r
-#define MATCH_LIMIT            10000000\r
-#define MATCH_LIMIT_RECURSION  MATCH_LIMIT\r
-\r
-#define MAX_NAME_SIZE  32\r
-#define MAX_NAME_COUNT 10000\r
-\r
-/* end config.h for CMake builds */\r
+/* config.h for CMake builds */
+
+/* #undef HAVE_DIRENT_H */
+/* #undef HAVE_UNISTD_H */
+#define HAVE_SYS_STAT_H
+#define HAVE_SYS_TYPES_H
+/* #undef HAVE_TYPE_TRAITS_H */
+/* #undef HAVE_BITS_TYPE_TRAITS_H */
+
+/* #undef HAVE_BCOPY */
+#define HAVE_MEMMOVE
+#define HAVE_STRERROR
+
+/* #undef PCRE_STATIC */
+
+/* #undef SUPPORT_UTF8 */
+/* #undef SUPPORT_UCP */
+/* #undef EBCDIC */
+/* #undef BSR_ANYCRLF */
+/* #undef NO_RECURSE */
+
+#define NEWLINE                        10
+#define POSIX_MALLOC_THRESHOLD 10
+#define LINK_SIZE              2
+#define MATCH_LIMIT            10000000
+#define MATCH_LIMIT_RECURSION  MATCH_LIMIT
+
+#define MAX_NAME_SIZE  32
+#define MAX_NAME_COUNT 10000
+
+/* end config.h for CMake builds */
index 1252172..8e3f138 100644 (file)
@@ -1,58 +1,58 @@
-/*--------------------------------------------------------------------------*/\r
-#include "cvstr.h"\r
-#include "stack-c.h"\r
-#include "core_math.h"\r
-#include "getfastcode.h"\r
-/*--------------------------------------------------------------------------*/\r
-/* Table of constant values */\r
-static integer cx1 = 1;\r
-static integer c_n1 = -1;\r
-/*--------------------------------------------------------------------------*/\r
-int C2F(cvstr)(integer * n,integer * line,char * str,integer * job,unsigned long str_len)\r
-{\r
-  if (*job == 0) C2F(asciitocode)(n, line, str, &cx1, str_len);\r
-  else C2F(codetoascii)(n, line, str, str_len);\r
-  return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-int C2F(cvstr1)(integer *n,integer * line,char * str,integer * job,    unsigned long  str_len)\r
-{\r
-  if (*job == 0) C2F(asciitocode)(n, line, str, &c_n1, str_len);\r
-  else C2F(codetoascii)(n, line, str, str_len);\r
-  return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-int C2F(codetoascii)(integer *n,integer * line,char * str, unsigned long str_len)\r
-{\r
-  int j = 0;\r
-\r
-  /* conversion code ->ascii */\r
-  for (j = 0; j < *n; ++j)\r
-  {\r
-       str[j] = convertScilabCodeToAsciiCode(line[j]);\r
-  }\r
-  return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-int C2F(asciitocode)(integer * n,integer * line,char * str,integer * flagx,unsigned long  str_len)\r
-{\r
-       integer j = 0;\r
-       if (*flagx == 1) \r
-       {\r
-               for (j = 0; j < *n ; ++j) \r
-               {\r
-                       unsigned char current_char = str[j];\r
-                       line[j] = convertAsciiCodeToScilabCode(current_char);\r
-               }\r
-       } \r
-       else \r
-       {\r
-               for (j = *n -1 ; j >= 0; --j) \r
-               {\r
-                       unsigned char current_char = str[j];\r
-                       line[j] = convertAsciiCodeToScilabCode(current_char);\r
-               }\r
-       }\r
-       return 0;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+#include "cvstr.h"
+#include "stack-c.h"
+#include "core_math.h"
+#include "getfastcode.h"
+/*--------------------------------------------------------------------------*/
+/* Table of constant values */
+static integer cx1 = 1;
+static integer c_n1 = -1;
+/*--------------------------------------------------------------------------*/
+int C2F(cvstr)(integer * n,integer * line,char * str,integer * job,unsigned long str_len)
+{
+  if (*job == 0) C2F(asciitocode)(n, line, str, &cx1, str_len);
+  else C2F(codetoascii)(n, line, str, str_len);
+  return 0;
+}
+/*--------------------------------------------------------------------------*/
+int C2F(cvstr1)(integer *n,integer * line,char * str,integer * job,    unsigned long  str_len)
+{
+  if (*job == 0) C2F(asciitocode)(n, line, str, &c_n1, str_len);
+  else C2F(codetoascii)(n, line, str, str_len);
+  return 0;
+}
+/*--------------------------------------------------------------------------*/
+int C2F(codetoascii)(integer *n,integer * line,char * str, unsigned long str_len)
+{
+  int j = 0;
+
+  /* conversion code ->ascii */
+  for (j = 0; j < *n; ++j)
+  {
+       str[j] = convertScilabCodeToAsciiCode(line[j]);
+  }
+  return 0;
+}
+/*--------------------------------------------------------------------------*/
+int C2F(asciitocode)(integer * n,integer * line,char * str,integer * flagx,unsigned long  str_len)
+{
+       integer j = 0;
+       if (*flagx == 1) 
+       {
+               for (j = 0; j < *n ; ++j) 
+               {
+                       unsigned char current_char = str[j];
+                       line[j] = convertAsciiCodeToScilabCode(current_char);
+               }
+       } 
+       else 
+       {
+               for (j = *n -1 ; j >= 0; --j) 
+               {
+                       unsigned char current_char = str[j];
+                       line[j] = convertAsciiCodeToScilabCode(current_char);
+               }
+       }
+       return 0;
+}
+/*--------------------------------------------------------------------------*/
index cc34a58..33da133 100644 (file)
@@ -1,68 +1,68 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#include "getfastcode.h"\r
-#include "stack-c.h"\r
-#include "stack-def.h"\r
-#include "core_math.h"\r
-/*--------------------------------------------------------------------------*/\r
-/**\r
-* Scilab not uses ASCII code in internal kernel\r
-* TO DO : Remove this with a new kernel\r
-* To understand Scilab coding style :\r
-* scilab code --> ascii code\r
-*           0 --> 0\r
-*           9 --> 9\r
-*          10 --> a\r
-*          35 --> z\r
-*         -10 --> A\r
-*         -35 --> Z\r
-*/\r
-#define NUMBER_INTERNAL_CHARACTERS 128\r
-static int INTERNAL_CHARACTERS_TABLE_CODES_FOR_SCILAB[NUMBER_INTERNAL_CHARACTERS] =  \r
-{ 100,101,102,103,104,105,106,107,108,-40,\r
-  110,111,112,113,114,115,116,117,118,119,\r
-  120,121,122,123,124,125,126,127,128,129,\r
-  130,131, 40, 38,-53, 37, 39, 56, 58, 53,\r
-   41, 42, 47, 45, 52, 46, 51, 48,  0,  1,\r
-    2,  3,  4,  5,  6,  7,  8,  9, 44, 43,\r
-   59, 50, 60,-38,-61,-10,-11,-12,-13,-14,\r
-  -15,-16,-17,-18,-19,-20,-21,-22,-23,-24,\r
-  -25,-26,-27,-28,-29,-30,-31,-32,-33,-34,\r
-  -35, 54, 49, 55, 62, 36,-59, 10, 11, 12,\r
-   13, 14, 15, 16, 17, 18, 19, 20, 21, 22,\r
-   23, 24, 25, 26, 27, 28, 29, 30, 31, 32,\r
-   33, 34, 35,-54, 57,-55, 61,227 };\r
-/*--------------------------------------------------------------------------*/\r
-integer C2F(getfastcode)(unsigned char *c, unsigned long c_len) \r
-{\r
-       return convertAsciiCodeToScilabCode(c[0]);\r
-} \r
-/*--------------------------------------------------------------------------*/\r
-int convertAsciiCodeToScilabCode(unsigned char scilab_char)\r
-{\r
-       int k = (int)scilab_char ;\r
-       int val = 0;\r
-       if (k < NUMBER_INTERNAL_CHARACTERS) val = INTERNAL_CHARACTERS_TABLE_CODES_FOR_SCILAB[k];\r
-       else val = k + 100;\r
-       return val;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
-char convertScilabCodeToAsciiCode(int scilab_code)\r
-{\r
-       #define eol 99\r
-       #define EXCLAMATION_CHAR '!'\r
-       char ascii_code = 0;\r
-\r
-       if (scilab_code == eol) ascii_code = EXCLAMATION_CHAR;\r
-       else if (Abs(scilab_code) > csiz) \r
-       {\r
-               if (scilab_code > eol) ascii_code = (char)(scilab_code - (eol + 1));\r
-               else ascii_code = EXCLAMATION_CHAR;\r
-       } \r
-       else if (scilab_code < 0) ascii_code = C2F(cha1).alfb[Abs(scilab_code)];\r
-       else ascii_code = C2F(cha1).alfa[scilab_code];\r
-\r
-       return ascii_code;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#include "getfastcode.h"
+#include "stack-c.h"
+#include "stack-def.h"
+#include "core_math.h"
+/*--------------------------------------------------------------------------*/
+/**
+* Scilab not uses ASCII code in internal kernel
+* TO DO : Remove this with a new kernel
+* To understand Scilab coding style :
+* scilab code --> ascii code
+*           0 --> 0
+*           9 --> 9
+*          10 --> a
+*          35 --> z
+*         -10 --> A
+*         -35 --> Z
+*/
+#define NUMBER_INTERNAL_CHARACTERS 128
+static int INTERNAL_CHARACTERS_TABLE_CODES_FOR_SCILAB[NUMBER_INTERNAL_CHARACTERS] =  
+{ 100,101,102,103,104,105,106,107,108,-40,
+  110,111,112,113,114,115,116,117,118,119,
+  120,121,122,123,124,125,126,127,128,129,
+  130,131, 40, 38,-53, 37, 39, 56, 58, 53,
+   41, 42, 47, 45, 52, 46, 51, 48,  0,  1,
+    2,  3,  4,  5,  6,  7,  8,  9, 44, 43,
+   59, 50, 60,-38,-61,-10,-11,-12,-13,-14,
+  -15,-16,-17,-18,-19,-20,-21,-22,-23,-24,
+  -25,-26,-27,-28,-29,-30,-31,-32,-33,-34,
+  -35, 54, 49, 55, 62, 36,-59, 10, 11, 12,
+   13, 14, 15, 16, 17, 18, 19, 20, 21, 22,
+   23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
+   33, 34, 35,-54, 57,-55, 61,227 };
+/*--------------------------------------------------------------------------*/
+integer C2F(getfastcode)(unsigned char *c, unsigned long c_len) 
+{
+       return convertAsciiCodeToScilabCode(c[0]);
+} 
+/*--------------------------------------------------------------------------*/
+int convertAsciiCodeToScilabCode(unsigned char scilab_char)
+{
+       int k = (int)scilab_char ;
+       int val = 0;
+       if (k < NUMBER_INTERNAL_CHARACTERS) val = INTERNAL_CHARACTERS_TABLE_CODES_FOR_SCILAB[k];
+       else val = k + 100;
+       return val;
+}
+/*--------------------------------------------------------------------------*/
+char convertScilabCodeToAsciiCode(int scilab_code)
+{
+       #define eol 99
+       #define EXCLAMATION_CHAR '!'
+       char ascii_code = 0;
+
+       if (scilab_code == eol) ascii_code = EXCLAMATION_CHAR;
+       else if (Abs(scilab_code) > csiz) 
+       {
+               if (scilab_code > eol) ascii_code = (char)(scilab_code - (eol + 1));
+               else ascii_code = EXCLAMATION_CHAR;
+       } 
+       else if (scilab_code < 0) ascii_code = C2F(cha1).alfb[Abs(scilab_code)];
+       else ascii_code = C2F(cha1).alfa[scilab_code];
+
+       return ascii_code;
+}
+/*--------------------------------------------------------------------------*/
index 2015155..74e22ae 100644 (file)
@@ -1,33 +1,33 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <ctype.h>\r
-#include "isalphanum.h"\r
-#include "MALLOC.h"\r
-/*--------------------------------------------------------------------------*/\r
-BOOL *isalphanum(char *input_string)\r
-{\r
-       BOOL *returnedValues = NULL;\r
-       if (input_string)\r
-       {\r
-               int i = 0;\r
-               int length_input_string = (int)strlen(input_string);\r
-\r
-               if (length_input_string > 0)\r
-               {\r
-                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);\r
-                       if (returnedValues)\r
-                       {\r
-                               for (i = 0;i < length_input_string; i++)\r
-                               {\r
-                                       if ( isalnum(input_string[i]) ) returnedValues[i] = TRUE;\r
-                                       else returnedValues[i] = FALSE;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       return returnedValues;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include <ctype.h>
+#include "isalphanum.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+BOOL *isalphanum(char *input_string)
+{
+       BOOL *returnedValues = NULL;
+       if (input_string)
+       {
+               int i = 0;
+               int length_input_string = (int)strlen(input_string);
+
+               if (length_input_string > 0)
+               {
+                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);
+                       if (returnedValues)
+                       {
+                               for (i = 0;i < length_input_string; i++)
+                               {
+                                       if ( isalnum(input_string[i]) ) returnedValues[i] = TRUE;
+                                       else returnedValues[i] = FALSE;
+                               }
+                       }
+               }
+       }
+       return returnedValues;
+}
+/*--------------------------------------------------------------------------*/
index 9f785c6..caa75d6 100644 (file)
@@ -1,18 +1,18 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __ISALPHANUM_H__\r
-#define __ISALPHANUM_H__\r
-\r
-#include "BOOL.h"\r
-\r
-/**\r
-* array elements that are alphabetic letters or digits\r
-* @param[in] a string\r
-* @return BOOL array \r
-*/\r
-BOOL *isalphanum(char *input_string);\r
-\r
-#endif /* __ISALPHANUM_H__ */\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#ifndef __ISALPHANUM_H__
+#define __ISALPHANUM_H__
+
+#include "BOOL.h"
+
+/**
+* array elements that are alphabetic letters or digits
+* @param[in] a string
+* @return BOOL array 
+*/
+BOOL *isalphanum(char *input_string);
+
+#endif /* __ISALPHANUM_H__ */
+/*--------------------------------------------------------------------------*/
index ce20ef3..cd0717a 100644 (file)
@@ -1,33 +1,33 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <ctype.h>\r
-#include "isletter.h"\r
-#include "MALLOC.h"\r
-/*--------------------------------------------------------------------------*/\r
-BOOL *IsDigit(char *input_string)\r
-{\r
-       BOOL *returnedValues = NULL;\r
-       if (input_string)\r
-       {\r
-               int i = 0;\r
-               int length_input_string = (int)strlen(input_string);\r
-\r
-               if (length_input_string > 0)\r
-               {\r
-                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);\r
-                       if (returnedValues)\r
-                       {\r
-                               for (i = 0;i < length_input_string; i++)\r
-                               {\r
-                                       if ( isdigit(input_string[i]) ) returnedValues[i] = TRUE;\r
-                                       else returnedValues[i] = FALSE;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       return returnedValues;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include <ctype.h>
+#include "isletter.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+BOOL *IsDigit(char *input_string)
+{
+       BOOL *returnedValues = NULL;
+       if (input_string)
+       {
+               int i = 0;
+               int length_input_string = (int)strlen(input_string);
+
+               if (length_input_string > 0)
+               {
+                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);
+                       if (returnedValues)
+                       {
+                               for (i = 0;i < length_input_string; i++)
+                               {
+                                       if ( isdigit(input_string[i]) ) returnedValues[i] = TRUE;
+                                       else returnedValues[i] = FALSE;
+                               }
+                       }
+               }
+       }
+       return returnedValues;
+}
+/*--------------------------------------------------------------------------*/
index bf79a70..d5f8a99 100644 (file)
@@ -1,18 +1,18 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __ISDIGIT_H__\r
-#define __ISDIGIT_H__\r
-\r
-#include "BOOL.h"\r
-\r
-/**\r
-* array elements that are digit between 0 and 9\r
-* @param[in] a string\r
-* @return BOOL array \r
-*/\r
-BOOL *IsDigit(char *input_string);\r
-\r
-#endif /* __ISDIGIT_H__ */\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#ifndef __ISDIGIT_H__
+#define __ISDIGIT_H__
+
+#include "BOOL.h"
+
+/**
+* array elements that are digit between 0 and 9
+* @param[in] a string
+* @return BOOL array 
+*/
+BOOL *IsDigit(char *input_string);
+
+#endif /* __ISDIGIT_H__ */
+/*--------------------------------------------------------------------------*/
index 6f6ad07..f6b1cd4 100644 (file)
@@ -1,33 +1,33 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include <ctype.h>\r
-#include "isletter.h"\r
-#include "MALLOC.h"\r
-/*--------------------------------------------------------------------------*/\r
-BOOL *isletter(char *input_string)\r
-{\r
-       BOOL *returnedValues = NULL;\r
-       if (input_string)\r
-       {\r
-               int i = 0;\r
-               int length_input_string = (int)strlen(input_string);\r
-\r
-               if (length_input_string > 0)\r
-               {\r
-                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);\r
-                       if (returnedValues)\r
-                       {\r
-                               for (i = 0;i < length_input_string; i++)\r
-                               {\r
-                                       if ( isalpha(input_string[i]) ) returnedValues[i] = TRUE;\r
-                                       else returnedValues[i] = FALSE;\r
-                               }\r
-                       }\r
-               }\r
-       }\r
-       return returnedValues;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include <ctype.h>
+#include "isletter.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+BOOL *isletter(char *input_string)
+{
+       BOOL *returnedValues = NULL;
+       if (input_string)
+       {
+               int i = 0;
+               int length_input_string = (int)strlen(input_string);
+
+               if (length_input_string > 0)
+               {
+                       returnedValues = (BOOL*)MALLOC(sizeof(BOOL)*length_input_string);
+                       if (returnedValues)
+                       {
+                               for (i = 0;i < length_input_string; i++)
+                               {
+                                       if ( isalpha(input_string[i]) ) returnedValues[i] = TRUE;
+                                       else returnedValues[i] = FALSE;
+                               }
+                       }
+               }
+       }
+       return returnedValues;
+}
+/*--------------------------------------------------------------------------*/
index 7bff557..51b03d6 100644 (file)
@@ -1,18 +1,18 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __ISLETTER_H__\r
-#define __ISLETTER_H__\r
-\r
-#include "BOOL.h"\r
-\r
-/**\r
-* array elements that are alphabetic letters\r
-* @param[in] a string\r
-* @return BOOL array \r
-*/\r
-BOOL *isletter(char *input_string);\r
-\r
-#endif /* __ISLETTER_H__ */\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#ifndef __ISLETTER_H__
+#define __ISLETTER_H__
+
+#include "BOOL.h"
+
+/**
+* array elements that are alphabetic letters
+* @param[in] a string
+* @return BOOL array 
+*/
+BOOL *isletter(char *input_string);
+
+#endif /* __ISLETTER_H__ */
+/*--------------------------------------------------------------------------*/
index 2e2a8c7..0210cfa 100644 (file)
@@ -1,10 +1,10 @@
-/*------------------------------------------------------------------------*/\r
-/* Copyright INRIA 2007*/\r
-/*------------------------------------------------------------------------*/\r
-#ifndef __PCRE_PRIVATE_H__\r
-#define __PCRE_PRIVATE_H__\r
-\r
-int pcre_private(char *INPUT_LINE,char *INPUT_PAT,int *Output_Start,int *Output_End);\r
-\r
-#endif /* __PCRE_PRIVATE_H__ */\r
-/*------------------------------------------------------------------------*/\r
+/*------------------------------------------------------------------------*/
+/* Copyright INRIA 2007*/
+/*------------------------------------------------------------------------*/
+#ifndef __PCRE_PRIVATE_H__
+#define __PCRE_PRIVATE_H__
+
+int pcre_private(char *INPUT_LINE,char *INPUT_PAT,int *Output_Start,int *Output_End);
+
+#endif /* __PCRE_PRIVATE_H__ */
+/*------------------------------------------------------------------------*/
index 9277382..012433e 100644 (file)
@@ -1,34 +1,34 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#include "setScilabCharactersCodes.h"\r
-#include "stack-def.h"\r
-/*--------------------------------------------------------------------------*/ \r
-void setScilabCharactersCodes(void)\r
-{\r
-       static char alpha[csiz+1] ={ \r
-               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"\r
-               "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"\r
-               "k" "l" "m" "n" "o" "p" "q" "r" "s" "t"\r
-               "u" "v" "w" "x" "y" "z" "_" "#" "!" "$"\r
-               " " "(" ")" ";" ":" "+" "-" "*" "/" "\\"\r
-               "=" "." "," "'" "[" "]" "%" "|" "&" "<"\r
-               ">" "~" "^"};\r
-       static char alphb[csiz+1] ={ \r
-               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"\r
-               "A" "B" "C" "D" "E" "F" "G" "H" "I" "J"\r
-               "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T"\r
-               "U" "V" "W"     "X" "Y" "Z" "0" "0" "?" "0"\r
-               "\t" "0" "0" "0" "0" "0" "0" "0" "0" "$"\r
-               "0" "0" "0" "\"" "{" "}" "0" "0" "0" "`"\r
-               "0" "@" "0"};\r
-\r
-       int i = 0;\r
-       for (i = 0; i < csiz; i++) \r
-       {\r
-               *(unsigned char *)&C2F(cha1).alfa[i] = *(unsigned char *)&alpha[i];\r
-               *(unsigned char *)&C2F(cha1).alfb[i] = *(unsigned char *)&alphb[i];\r
-       }\r
-}\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#include "setScilabCharactersCodes.h"
+#include "stack-def.h"
+/*--------------------------------------------------------------------------*/ 
+void setScilabCharactersCodes(void)
+{
+       static char alpha[csiz+1] ={ 
+               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
+               "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
+               "k" "l" "m" "n" "o" "p" "q" "r" "s" "t"
+               "u" "v" "w" "x" "y" "z" "_" "#" "!" "$"
+               " " "(" ")" ";" ":" "+" "-" "*" "/" "\\"
+               "=" "." "," "'" "[" "]" "%" "|" "&" "<"
+               ">" "~" "^"};
+       static char alphb[csiz+1] ={ 
+               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
+               "A" "B" "C" "D" "E" "F" "G" "H" "I" "J"
+               "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T"
+               "U" "V" "W"     "X" "Y" "Z" "0" "0" "?" "0"
+               "\t" "0" "0" "0" "0" "0" "0" "0" "0" "$"
+               "0" "0" "0" "\"" "{" "}" "0" "0" "0" "`"
+               "0" "@" "0"};
+
+       int i = 0;
+       for (i = 0; i < csiz; i++) 
+       {
+               *(unsigned char *)&C2F(cha1).alfa[i] = *(unsigned char *)&alpha[i];
+               *(unsigned char *)&C2F(cha1).alfb[i] = *(unsigned char *)&alphb[i];
+       }
+}
+/*--------------------------------------------------------------------------*/ 
index 9b25c95..7719e2b 100644 (file)
@@ -1,49 +1,49 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#ifndef __SETSCILABCHARACTERSCODES_H__\r
-#define __SETSCILABCHARACTERSCODES_H__\r
-\r
-#include "BOOL.h" /* BOOL */\r
-\r
-/** ASCII printable characters\r
-*  http://en.wikipedia.org/wiki/ASCII\r
-*/\r
-\r
-/**\r
-* Scilab codes for known characters\r
-* In Scilab, chars are first converted as integers (positives and some\r
-* negatives) and we have :\r
-*\r
-*        code | 0  1 .... 9 | 10  11 ...  35 | 36  37  38  39 | 40\r
-*        -----+-------------+----------------+----------------+------\r
-*        char | 0  1 .... 9 |  a   b ...   z |  _   #   !   $ | blank\r
-*        ============================================================\r
-*        char |             |  A   B ...   Z |          ?     | tab\r
-*        -------------------+----------------+----------------+------\r
-*        code |             |-10 -11 ... -35 |         -38    ! -40\r
-*\r
-*       In fact (for the mapping code -> char), code = -1 \r
-*       to -9 correspond also to chars 1 to 9 and code = -36,-37,-39 \r
-*       to the char 0\r
-*\r
-*       So if c is a scilab coded char then :\r
-*\r
-*           abs(c) <= 9  => c is a digit\r
-*           abs(c) < 40  => c is an alphanum Scilab char (which\r
-*                           comprise _ but also # ! $ ?). Moreover\r
-*                           Scilab names may begin with % \r
-*           abs(c) == 40 => c is a blank "like" (blank or tab) char  \r
-*      The upper-case characters and some equivalents are coded by the lower-case code with a sign\r
-*      change.\r
-*   ref : Guide for Developers (Scilab Internals)\r
-*/\r
-\r
-/**\r
-* Set Scilab Characters Codes in C2F(cha1)\r
-*/\r
-void setScilabCharactersCodes(void);\r
-\r
-#endif /* __SETSCILABCHARACTERSCODES_H__ */\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#ifndef __SETSCILABCHARACTERSCODES_H__
+#define __SETSCILABCHARACTERSCODES_H__
+
+#include "BOOL.h" /* BOOL */
+
+/** ASCII printable characters
+*  http://en.wikipedia.org/wiki/ASCII
+*/
+
+/**
+* Scilab codes for known characters
+* In Scilab, chars are first converted as integers (positives and some
+* negatives) and we have :
+*
+*        code | 0  1 .... 9 | 10  11 ...  35 | 36  37  38  39 | 40
+*        -----+-------------+----------------+----------------+------
+*        char | 0  1 .... 9 |  a   b ...   z |  _   #   !   $ | blank
+*        ============================================================
+*        char |             |  A   B ...   Z |          ?     | tab
+*        -------------------+----------------+----------------+------
+*        code |             |-10 -11 ... -35 |         -38    ! -40
+*
+*       In fact (for the mapping code -> char), code = -1 
+*       to -9 correspond also to chars 1 to 9 and code = -36,-37,-39 
+*       to the char 0
+*
+*       So if c is a scilab coded char then :
+*
+*           abs(c) <= 9  => c is a digit
+*           abs(c) < 40  => c is an alphanum Scilab char (which
+*                           comprise _ but also # ! $ ?). Moreover
+*                           Scilab names may begin with % 
+*           abs(c) == 40 => c is a blank "like" (blank or tab) char  
+*      The upper-case characters and some equivalents are coded by the lower-case code with a sign
+*      change.
+*   ref : Guide for Developers (Scilab Internals)
+*/
+
+/**
+* Set Scilab Characters Codes in C2F(cha1)
+*/
+void setScilabCharactersCodes(void);
+
+#endif /* __SETSCILABCHARACTERSCODES_H__ */
+/*--------------------------------------------------------------------------*/ 
index cd671fa..517a58c 100644 (file)
@@ -1,41 +1,41 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#include <string.h>\r
-#include "stringsCompare.h"\r
-#include "MALLOC.h"\r
-/*--------------------------------------------------------------------------*/\r
-#ifdef _MSC_VER\r
-#define stricmp _stricmp\r
-#endif\r
-/*--------------------------------------------------------------------------*/\r
-int * stringsCompare(char **Input_String_One,int dim_One,char **Input_String_Two,int dim_Two,BOOL dostricmp)\r
-{\r
-       int *returnedValues = NULL;\r
-\r
-       returnedValues = (int*)MALLOC(sizeof(int)*dim_One);\r
-       if (returnedValues)\r
-       {\r
-               if ( dim_Two == 1 )\r
-               {\r
-                       int i = 0;\r
-                       for (i = 0;i < dim_One; i++)\r
-                       {\r
-                               if (dostricmp) returnedValues[i] = stricmp(Input_String_One[i],Input_String_Two[0]);\r
-                               else returnedValues[i] = strcmp(Input_String_One[i],Input_String_Two[0]);\r
-                       }\r
-               }\r
-               else\r
-               {\r
-                       int i = 0;\r
-                       for (i = 0;i < dim_One; i++)\r
-                       {\r
-                               if (dostricmp) returnedValues[i] = stricmp(Input_String_One[i],Input_String_Two[i]);\r
-                               else returnedValues[i] = strcmp(Input_String_One[i],Input_String_Two[i]);\r
-                       }\r
-               }\r
-       }\r
-       return returnedValues;\r
-}\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include "stringsCompare.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#define stricmp _stricmp
+#endif
+/*--------------------------------------------------------------------------*/
+int * stringsCompare(char **Input_String_One,int dim_One,char **Input_String_Two,int dim_Two,BOOL dostricmp)
+{
+       int *returnedValues = NULL;
+
+       returnedValues = (int*)MALLOC(sizeof(int)*dim_One);
+       if (returnedValues)
+       {
+               if ( dim_Two == 1 )
+               {
+                       int i = 0;
+                       for (i = 0;i < dim_One; i++)
+                       {
+                               if (dostricmp) returnedValues[i] = stricmp(Input_String_One[i],Input_String_Two[0]);
+                               else returnedValues[i] = strcmp(Input_String_One[i],Input_String_Two[0]);
+                       }
+               }
+               else
+               {
+                       int i = 0;
+                       for (i = 0;i < dim_One; i++)
+                       {
+                               if (dostricmp) returnedValues[i] = stricmp(Input_String_One[i],Input_String_Two[i]);
+                               else returnedValues[i] = strcmp(Input_String_One[i],Input_String_Two[i]);
+                       }
+               }
+       }
+       return returnedValues;
+}
+/*--------------------------------------------------------------------------*/
index acf6b2c..4ffc7c4 100644 (file)
@@ -1,22 +1,22 @@
-/*--------------------------------------------------------------------------*/\r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*--------------------------------------------------------------------------*/\r
-#ifndef __STRINGSCOMPARE_H__\r
-#define __STRINGSCOMPARE_H__\r
-\r
-#include "BOOL.h"\r
-\r
-/** \r
-* Compare strings matrix\r
-* @param[in] String matrix One\r
-* @param[in] Dimension m*n of String matrix one\r
-* @param[in] String matrix Two\r
-* @param[in] Dimension m*n of String matrix two\r
-* @param[in] BOOL to do stricmp\r
-* @return a integer matrix (result of strcmp)\r
-*/\r
-int * stringsCompare(char **Input_String_One,int dim_One,char **Input_String_Two,int dim_Two,BOOL dostricmp);\r
-\r
-#endif /* __STRINGSCOMPARE_H__ */\r
-/*--------------------------------------------------------------------------*/\r
+/*--------------------------------------------------------------------------*/
+/* Allan CORNET */
+/* INRIA 2007 */
+/*--------------------------------------------------------------------------*/
+#ifndef __STRINGSCOMPARE_H__
+#define __STRINGSCOMPARE_H__
+
+#include "BOOL.h"
+
+/** 
+* Compare strings matrix
+* @param[in] String matrix One
+* @param[in] Dimension m*n of String matrix one
+* @param[in] String matrix Two
+* @param[in] Dimension m*n of String matrix two
+* @param[in] BOOL to do stricmp
+* @return a integer matrix (result of strcmp)
+*/
+int * stringsCompare(char **Input_String_One,int dim_One,char **Input_String_Two,int dim_Two,BOOL dostricmp);
+
+#endif /* __STRINGSCOMPARE_H__ */
+/*--------------------------------------------------------------------------*/
index a3b0078..72db792 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test add strings\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "strings op.";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = '1' + '1';\r
-  clear r;\r
-end\r
-  \r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test add strings
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "strings op.";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = '1' + '1';
+  clear r;
+end
+  
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 0525dca..f350f81 100644 (file)
@@ -1,19 +1,19 @@
-//======================================\r
-// test ascii\r
-// memory\r
-//======================================\r
-clear;\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-\r
-for i=1:NB_LOOPS \r
-  r = ascii(ascii("scilab"));\r
-  clear r;\r
-end\r
-  \r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (AFTER_USED - BEFORE_USED > REF_4_1_2 ) then disp("MEMORY LEAK"),end;\r
-//====================================\r
+//======================================
+// test ascii
+// memory
+//======================================
+clear;
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+
+for i=1:NB_LOOPS 
+  r = ascii(ascii("scilab"));
+  clear r;
+end
+  
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (AFTER_USED - BEFORE_USED > REF_4_1_2 ) then disp("MEMORY LEAK"),end;
+//====================================
index 5e2123d..f5059c8 100644 (file)
@@ -1,19 +1,19 @@
-//======================================\r
-// test code2str\r
-// memory\r
-//======================================\r
-clear;\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-\r
-for i=1:NB_LOOPS\r
-  r = code2str([-28 12 18 21 10 11]);\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (AFTER_USED - BEFORE_USED > REF_4_1_2 ) then disp("MEMORY LEAK"),end;\r
-//====================================\r
+//======================================
+// test code2str
+// memory
+//======================================
+clear;
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+
+for i=1:NB_LOOPS
+  r = code2str([-28 12 18 21 10 11]);
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (AFTER_USED - BEFORE_USED > REF_4_1_2 ) then disp("MEMORY LEAK"),end;
+//====================================
index a18d5e6..a5045d5 100644 (file)
@@ -1,22 +1,22 @@
-//======================================\r
-// test convstr\r
-// memory\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "convstr";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = convstr('ABC','u');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test convstr
+// memory
+//======================================
+clear;
+FUNCTION_TO_TEST = "convstr";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = convstr('ABC','u');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 3d71a2d..72c6387 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test emptystr\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "emptystr";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS\r
-  r = emptystr();\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test emptystr
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "emptystr";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS
+  r = emptystr();
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index bcd9513..e836b43 100644 (file)
@@ -1,28 +1,28 @@
-//======================================\r
-// test grep\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "grep";\r
-NB_LOOPS = 1000000;\r
-txt=['find matches of a string in a vector of strings'\r
-     'search position of a character string in an other string'\r
-     'Compare Strings'];\r
-\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  [a,b]=grep(txt,['strings' 'Strings']);\r
-  clear a;\r
-  clear b;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test grep
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "grep";
+NB_LOOPS = 1000000;
+txt=['find matches of a string in a vector of strings'
+     'search position of a character string in an other string'
+     'Compare Strings'];
+
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  [a,b]=grep(txt,['strings' 'Strings']);
+  clear a;
+  clear b;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 4ddb7b6..3e18dce 100644 (file)
@@ -1,28 +1,28 @@
-//======================================\r
-// test grep \r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "grep";\r
-NB_LOOPS = 1000000;\r
-txt=['find matches of a string in a vector of strings'\r
-     'search position of a character string in an other string'\r
-     'Compare Strings'];\r
-\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  [a,b]=grep('abc','/abc/','r');\r
-  clear a;\r
-  clear b;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test grep 
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "grep";
+NB_LOOPS = 1000000;
+txt=['find matches of a string in a vector of strings'
+     'search position of a character string in an other string'
+     'Compare Strings'];
+
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  [a,b]=grep('abc','/abc/','r');
+  clear a;
+  clear b;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index bc1fd8a..2a59f9b 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test length\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "length";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = length('abdefefefefecvvevev');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test length
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "length";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = length('abdefefefefecvvevev');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 5816369..0a1e2be 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test part\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "part";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS\r
-  c=part(['a','abc','abcd'],[1,1,2]);\r
-  clear c;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//======================================\r
+//======================================
+// test part
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "part";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS
+  c=part(['a','abc','abcd'],[1,1,2]);
+  clear c;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//======================================
index 0d45b00..621901f 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test str2code\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "str2code";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS\r
-  r = str2code('0123456789');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test str2code
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "str2code";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS
+  r = str2code('0123456789');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 32afd6e..38812fc 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test strcat\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "strcat";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = strcat('abc','sd');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test strcat
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "strcat";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = strcat('abc','sd');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 5c02e8b..ebd3826 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test strindex\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "strindex";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = strindex('SCI/demos/scicos','/');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test strindex
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "strindex";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = strindex('SCI/demos/scicos','/');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 656276b..b6e0b89 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test tokens\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "stripblanks";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = stripblanks(['  123   ',' xyz']);\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test tokens
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "stripblanks";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = stripblanks(['  123   ',' xyz']);
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 87e8992..cd2fb04 100644 (file)
@@ -1,27 +1,27 @@
-//======================================\r
-// test strsplit\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "strsplit";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-STR_SPLITED = ['strsplit splits';'a string';'into';'a vector of strings'];\r
-STR = 'strsplit splits a string into a vector of strings';\r
-INDICES = [15 25 30];\r
-\r
-for i=1:NB_LOOPS \r
-  r = strsplit(STR,INDICES);\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test strsplit
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "strsplit";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+STR_SPLITED = ['strsplit splits';'a string';'into';'a vector of strings'];
+STR = 'strsplit splits a string into a vector of strings';
+INDICES = [15 25 30];
+
+for i=1:NB_LOOPS 
+  r = strsplit(STR,INDICES);
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 610ad1d..773fe53 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test strsubst\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "strsubst";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 0;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = strsubst('SCI/demos/scicos','SCI','.');\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test strsubst
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "strsubst";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 0;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = strsubst('SCI/demos/scicos','SCI','.');
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index e4080d8..15f26d2 100644 (file)
@@ -1,23 +1,23 @@
-//======================================\r
-// test tokens\r
-// memory leak\r
-// A.C INRIA 2007\r
-//======================================\r
-clear;\r
-FUNCTION_TO_TEST = "tokens";\r
-NB_LOOPS = 1000000;\r
-REF_4_1_2 = 180;\r
-[BEFORE_FREE,BEFORE_TOTAL] = getmemory();\r
-\r
-for i=1:NB_LOOPS \r
-  r = tokens('y=a+b*2',['=','+','*']);\r
-  clear r;\r
-end  \r
-\r
-[AFTER_FREE,AFTER_TOTAL] = getmemory();\r
-BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;\r
-AFTER_USED = AFTER_TOTAL - AFTER_FREE;\r
-if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then\r
-  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );\r
-end  \r
-//====================================\r
+//======================================
+// test tokens
+// memory leak
+// A.C INRIA 2007
+//======================================
+clear;
+FUNCTION_TO_TEST = "tokens";
+NB_LOOPS = 1000000;
+REF_4_1_2 = 180;
+[BEFORE_FREE,BEFORE_TOTAL] = getmemory();
+
+for i=1:NB_LOOPS 
+  r = tokens('y=a+b*2',['=','+','*']);
+  clear r;
+end  
+
+[AFTER_FREE,AFTER_TOTAL] = getmemory();
+BEFORE_USED = BEFORE_TOTAL - BEFORE_FREE;
+AFTER_USED = AFTER_TOTAL - AFTER_FREE;
+if (abs(BEFORE_USED - AFTER_USED) > REF_4_1_2 ) then
+  warning(FUNCTION_TO_TEST+" MEMORY LEAK : "+string(abs(BEFORE_USED - AFTER_USED))+ ' ko' );
+end  
+//====================================
index 9e7264a..6f0d7a1 100644 (file)
@@ -1,26 +1,26 @@
-//===============================\r
-// unit tests strcmp\r
-// INRIA 2007\r
-//===============================\r
-TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];\r
-TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];\r
-TXT = 'Scilab';\r
-//===============================\r
-if strcmp(TXT1,TXT2) <> [ 1 , -1 ; -1 , -1 ] then bugmes();quit;end\r
-//===============================\r
-if strcmp(TXT1,TXT2,'s') <> [ 1 , -1 ; -1 , -1 ] then bugmes();quit;end\r
-//===============================\r
-if strcmp(TXT1,TXT2,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end\r
-//===============================\r
- if strcmp(TXT1,TXT1,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end\r
- //===============================\r
- if strcmp(TXT2,TXT2,'s') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end\r
- //===============================\r
- if strcmp(TXT1,TXT,'s') <> [ 1 , -1 ; 1 , -1 ] then bugmes();quit;end\r
- //===============================\r
- if strcmp(TXT1,TXT,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end\r
- //===============================\r
- if strcmp('','','i') <> 0 then bugmes();quit;end\r
- //===============================\r
- if strcmp('','','s') <> 0 then bugmes();quit;end\r
- //===============================\r
+//===============================
+// unit tests strcmp
+// INRIA 2007
+//===============================
+TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];
+TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];
+TXT = 'Scilab';
+//===============================
+if strcmp(TXT1,TXT2) <> [ 1 , -1 ; -1 , -1 ] then bugmes();quit;end
+//===============================
+if strcmp(TXT1,TXT2,'s') <> [ 1 , -1 ; -1 , -1 ] then bugmes();quit;end
+//===============================
+if strcmp(TXT1,TXT2,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end
+//===============================
+ if strcmp(TXT1,TXT1,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end
+ //===============================
+ if strcmp(TXT2,TXT2,'s') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end
+ //===============================
+ if strcmp(TXT1,TXT,'s') <> [ 1 , -1 ; 1 , -1 ] then bugmes();quit;end
+ //===============================
+ if strcmp(TXT1,TXT,'i') <> [ 0 , 0 ; 0 , 0 ] then bugmes();quit;end
+ //===============================
+ if strcmp('','','i') <> 0 then bugmes();quit;end
+ //===============================
+ if strcmp('','','s') <> 0 then bugmes();quit;end
+ //===============================
index d6a390f..50e4356 100644 (file)
@@ -1,27 +1,27 @@
-//===============================\r
-// unit tests strcmp\r
-// INRIA 2007\r
-//===============================\r
-TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];\r
-TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];\r
-TXT = 'Scilab';\r
-//===============================\r
-if strcmp(TXT1,TXT2) <> [ 1 , -1 ; -1 , -1 ] then pause,end\r
-//===============================\r
-if strcmp(TXT1,TXT2,'s') <> [ 1 , -1 ; -1 , -1 ] then pause,end\r
-//===============================\r
-if strcmp(TXT1,TXT2,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end\r
-//===============================\r
- if strcmp(TXT1,TXT1,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end\r
- //===============================\r
- if strcmp(TXT2,TXT2,'s') <> [ 0 , 0 ; 0 , 0 ] then pause,end\r
- //===============================\r
- if strcmp(TXT1,TXT,'s') <> [ 1 , -1 ; 1 , -1 ] then pause,end\r
- //===============================\r
- if strcmp(TXT1,TXT,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end\r
- //===============================\r
- if strcmp('','','i') <> 0 then pause,end\r
- //===============================\r
- if strcmp('','','s') <> 0 then pause,end\r
- //===============================\r
+//===============================
+// unit tests strcmp
+// INRIA 2007
+//===============================
+TXT1 = ['scilab','SciLab';'Strcmp','STRcmp'];
+TXT2 = ['ScIlAb','sciLab';'sTrCmP','StrCMP'];
+TXT = 'Scilab';
+//===============================
+if strcmp(TXT1,TXT2) <> [ 1 , -1 ; -1 , -1 ] then pause,end
+//===============================
+if strcmp(TXT1,TXT2,'s') <> [ 1 , -1 ; -1 , -1 ] then pause,end
+//===============================
+if strcmp(TXT1,TXT2,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end
+//===============================
+ if strcmp(TXT1,TXT1,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end
+ //===============================
+ if strcmp(TXT2,TXT2,'s') <> [ 0 , 0 ; 0 , 0 ] then pause,end
+ //===============================
+ if strcmp(TXT1,TXT,'s') <> [ 1 , -1 ; 1 , -1 ] then pause,end
+ //===============================
+ if strcmp(TXT1,TXT,'i') <> [ 0 , 0 ; 0 , 0 ] then pause,end
+ //===============================
+ if strcmp('','','i') <> 0 then pause,end
+ //===============================
+ if strcmp('','','s') <> 0 then pause,end
+ //===============================
  
\ No newline at end of file
index c2b4e9b..cc575ee 100644 (file)
@@ -1,19 +1,19 @@
-/*-----------------------------------------------------------------------------------*/ \r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*-----------------------------------------------------------------------------------*/ \r
-#ifndef __freeArrayOfString_H__\r
-#define __freeArrayOfString_H__\r
-\r
-#include "BOOL.h"\r
-\r
-/**\r
-* Free Array of String (char **)\r
-* @param[in] ptr on char **\r
-* @param[in] dimension of ptr on char **\r
-* @return TRUE if free\r
-*/\r
-BOOL freeArrayOfString(char **Str,int dim);\r
-\r
-#endif\r
-/*-----------------------------------------------------------------------------------*/ \r
+/*-----------------------------------------------------------------------------------*/ 
+/* Allan CORNET */
+/* INRIA 2007 */
+/*-----------------------------------------------------------------------------------*/ 
+#ifndef __freeArrayOfString_H__
+#define __freeArrayOfString_H__
+
+#include "BOOL.h"
+
+/**
+* Free Array of String (char **)
+* @param[in] ptr on char **
+* @param[in] dimension of ptr on char **
+* @return TRUE if free
+*/
+BOOL freeArrayOfString(char **Str,int dim);
+
+#endif
+/*-----------------------------------------------------------------------------------*/ 
index c7c3fcb..b37004f 100644 (file)
@@ -1,33 +1,33 @@
-/*-----------------------------------------------------------------------------------*/ \r
-/* Allan CORNET */\r
-/* INRIA 2007 */\r
-/*-----------------------------------------------------------------------------------*/ \r
-#include "freeArrayOfString.h"\r
-#include "MALLOC.h"\r
-/*-----------------------------------------------------------------------------------*/ \r
-BOOL freeArrayOfString(char **Str,int dim)\r
-{\r
-       BOOL bRet = TRUE;\r
-\r
-       if (Str)\r
-       {\r
-               int i = 0;\r
-               for (i = 0;i < dim; i++)\r
-               {\r
-                       if (Str[i])\r
-                       {\r
-                               FREE(Str[i]);\r
-                               Str[i] = NULL;\r
-                       }\r
-                       else bRet = FALSE;\r
-               }\r
-               FREE(Str);\r
-               Str = NULL;\r
-       }\r
-       else\r
-       {\r
-               bRet = FALSE;\r
-       }\r
-       return bRet;\r
-}\r
-/*-----------------------------------------------------------------------------------*/ \r
+/*-----------------------------------------------------------------------------------*/ 
+/* Allan CORNET */
+/* INRIA 2007 */
+/*-----------------------------------------------------------------------------------*/ 
+#include "freeArrayOfString.h"
+#include "MALLOC.h"
+/*-----------------------------------------------------------------------------------*/ 
+BOOL freeArrayOfString(char **Str,int dim)
+{
+       BOOL bRet = TRUE;
+
+       if (Str)
+       {
+               int i = 0;
+               for (i = 0;i < dim; i++)
+               {
+                       if (Str[i])
+                       {
+                               FREE(Str[i]);
+                               Str[i] = NULL;
+                       }
+                       else bRet = FALSE;
+               }
+               FREE(Str);
+               Str = NULL;
+       }
+       else
+       {
+               bRet = FALSE;
+       }
+       return bRet;
+}
+/*-----------------------------------------------------------------------------------*/ 
index b423475..a242528 100644 (file)
@@ -1,13 +1,13 @@
-LIBRARY    scigui.dll\r
-\r
-\r
-EXPORTS\r
-;--------------------------\r
-; GUI\r
-;--------------------------\r
-InitUIMenu\r
-setMenuCallback\r
-setMenuParent\r
-get_label_property\r
-set_label_property\r
+LIBRARY    scigui.dll
+
+
+EXPORTS
+;--------------------------
+; GUI
+;--------------------------
+InitUIMenu
+setMenuCallback
+setMenuParent
+get_label_property
+set_label_property
 ;
\ No newline at end of file
index 8043502..9ab875f 100644 (file)
@@ -1,25 +1,25 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2006 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#include <windows.h> \r
-/*--------------------------------------------------------------------------*/ \r
-#pragma comment(lib,"../../../../bin/intl.lib")\r
-/*--------------------------------------------------------------------------*/ \r
-int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)\r
-{\r
-  switch (reason) \r
-    {\r
-    case DLL_PROCESS_ATTACH:\r
-      break;\r
-    case DLL_PROCESS_DETACH:\r
-      break;\r
-    case DLL_THREAD_ATTACH:\r
-      break;\r
-    case DLL_THREAD_DETACH:\r
-      break;\r
-    }\r
-  return 1;\r
-}\r
-/*--------------------------------------------------------------------------*/ \r
-\r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2006 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#include <windows.h> 
+/*--------------------------------------------------------------------------*/ 
+#pragma comment(lib,"../../../../bin/intl.lib")
+/*--------------------------------------------------------------------------*/ 
+int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
+{
+  switch (reason) 
+    {
+    case DLL_PROCESS_ATTACH:
+      break;
+    case DLL_PROCESS_DETACH:
+      break;
+    case DLL_THREAD_ATTACH:
+      break;
+    case DLL_THREAD_DETACH:
+      break;
+    }
+  return 1;
+}
+/*--------------------------------------------------------------------------*/ 
+
index 1566cf3..ed4eb34 100644 (file)
@@ -1,7 +1,7 @@
-       LIBRARY    string.dll\r
-\r
-\r
-EXPORTS\r
-       cvstr_\r
-       \r
+       LIBRARY    string.dll
+
+
+EXPORTS
+       cvstr_
+       
        
\ No newline at end of file
index f0e0a2f..9663d4d 100644 (file)
@@ -1,13 +1,13 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#ifndef __INITIALIZESTRING_H__\r
-#define __INITIALIZESTRING_H__\r
-\r
-#include "BOOL.h"\r
-\r
-BOOL InitializeString(void);\r
-\r
-#endif /* __INITIALIZESTRING_H__ */\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#ifndef __INITIALIZESTRING_H__
+#define __INITIALIZESTRING_H__
+
+#include "BOOL.h"
+
+BOOL InitializeString(void);
+
+#endif /* __INITIALIZESTRING_H__ */
+/*--------------------------------------------------------------------------*/ 
index 1408f6e..fcc3edb 100644 (file)
@@ -1,13 +1,13 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#include "InitializeString.h"\r
-#include "setScilabCharactersCodes.h"\r
-/*--------------------------------------------------------------------------*/ \r
-BOOL InitializeString(void)\r
-{\r
-       setScilabCharactersCodes();\r
-       return TRUE;\r
-}\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#include "InitializeString.h"
+#include "setScilabCharactersCodes.h"
+/*--------------------------------------------------------------------------*/ 
+BOOL InitializeString(void)
+{
+       setScilabCharactersCodes();
+       return TRUE;
+}
+/*--------------------------------------------------------------------------*/ 
index 9277382..012433e 100644 (file)
@@ -1,34 +1,34 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#include "setScilabCharactersCodes.h"\r
-#include "stack-def.h"\r
-/*--------------------------------------------------------------------------*/ \r
-void setScilabCharactersCodes(void)\r
-{\r
-       static char alpha[csiz+1] ={ \r
-               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"\r
-               "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"\r
-               "k" "l" "m" "n" "o" "p" "q" "r" "s" "t"\r
-               "u" "v" "w" "x" "y" "z" "_" "#" "!" "$"\r
-               " " "(" ")" ";" ":" "+" "-" "*" "/" "\\"\r
-               "=" "." "," "'" "[" "]" "%" "|" "&" "<"\r
-               ">" "~" "^"};\r
-       static char alphb[csiz+1] ={ \r
-               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"\r
-               "A" "B" "C" "D" "E" "F" "G" "H" "I" "J"\r
-               "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T"\r
-               "U" "V" "W"     "X" "Y" "Z" "0" "0" "?" "0"\r
-               "\t" "0" "0" "0" "0" "0" "0" "0" "0" "$"\r
-               "0" "0" "0" "\"" "{" "}" "0" "0" "0" "`"\r
-               "0" "@" "0"};\r
-\r
-       int i = 0;\r
-       for (i = 0; i < csiz; i++) \r
-       {\r
-               *(unsigned char *)&C2F(cha1).alfa[i] = *(unsigned char *)&alpha[i];\r
-               *(unsigned char *)&C2F(cha1).alfb[i] = *(unsigned char *)&alphb[i];\r
-       }\r
-}\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#include "setScilabCharactersCodes.h"
+#include "stack-def.h"
+/*--------------------------------------------------------------------------*/ 
+void setScilabCharactersCodes(void)
+{
+       static char alpha[csiz+1] ={ 
+               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
+               "a" "b" "c" "d" "e" "f" "g" "h" "i" "j"
+               "k" "l" "m" "n" "o" "p" "q" "r" "s" "t"
+               "u" "v" "w" "x" "y" "z" "_" "#" "!" "$"
+               " " "(" ")" ";" ":" "+" "-" "*" "/" "\\"
+               "=" "." "," "'" "[" "]" "%" "|" "&" "<"
+               ">" "~" "^"};
+       static char alphb[csiz+1] ={ 
+               "0" "1" "2" "3" "4" "5" "6" "7" "8" "9"
+               "A" "B" "C" "D" "E" "F" "G" "H" "I" "J"
+               "K" "L" "M" "N" "O" "P" "Q" "R" "S" "T"
+               "U" "V" "W"     "X" "Y" "Z" "0" "0" "?" "0"
+               "\t" "0" "0" "0" "0" "0" "0" "0" "0" "$"
+               "0" "0" "0" "\"" "{" "}" "0" "0" "0" "`"
+               "0" "@" "0"};
+
+       int i = 0;
+       for (i = 0; i < csiz; i++) 
+       {
+               *(unsigned char *)&C2F(cha1).alfa[i] = *(unsigned char *)&alpha[i];
+               *(unsigned char *)&C2F(cha1).alfb[i] = *(unsigned char *)&alphb[i];
+       }
+}
+/*--------------------------------------------------------------------------*/ 
index 9b25c95..7719e2b 100644 (file)
@@ -1,49 +1,49 @@
-/*--------------------------------------------------------------------------*/\r
-/* INRIA 2007 */\r
-/* Allan CORNET */\r
-/*--------------------------------------------------------------------------*/ \r
-#ifndef __SETSCILABCHARACTERSCODES_H__\r
-#define __SETSCILABCHARACTERSCODES_H__\r
-\r
-#include "BOOL.h" /* BOOL */\r
-\r
-/** ASCII printable characters\r
-*  http://en.wikipedia.org/wiki/ASCII\r
-*/\r
-\r
-/**\r
-* Scilab codes for known characters\r
-* In Scilab, chars are first converted as integers (positives and some\r
-* negatives) and we have :\r
-*\r
-*        code | 0  1 .... 9 | 10  11 ...  35 | 36  37  38  39 | 40\r
-*        -----+-------------+----------------+----------------+------\r
-*        char | 0  1 .... 9 |  a   b ...   z |  _   #   !   $ | blank\r
-*        ============================================================\r
-*        char |             |  A   B ...   Z |          ?     | tab\r
-*        -------------------+----------------+----------------+------\r
-*        code |             |-10 -11 ... -35 |         -38    ! -40\r
-*\r
-*       In fact (for the mapping code -> char), code = -1 \r
-*       to -9 correspond also to chars 1 to 9 and code = -36,-37,-39 \r
-*       to the char 0\r
-*\r
-*       So if c is a scilab coded char then :\r
-*\r
-*           abs(c) <= 9  => c is a digit\r
-*           abs(c) < 40  => c is an alphanum Scilab char (which\r
-*                           comprise _ but also # ! $ ?). Moreover\r
-*                           Scilab names may begin with % \r
-*           abs(c) == 40 => c is a blank "like" (blank or tab) char  \r
-*      The upper-case characters and some equivalents are coded by the lower-case code with a sign\r
-*      change.\r
-*   ref : Guide for Developers (Scilab Internals)\r
-*/\r
-\r
-/**\r
-* Set Scilab Characters Codes in C2F(cha1)\r
-*/\r
-void setScilabCharactersCodes(void);\r
-\r
-#endif /* __SETSCILABCHARACTERSCODES_H__ */\r
-/*--------------------------------------------------------------------------*/ \r
+/*--------------------------------------------------------------------------*/
+/* INRIA 2007 */
+/* Allan CORNET */
+/*--------------------------------------------------------------------------*/ 
+#ifndef __SETSCILABCHARACTERSCODES_H__
+#define __SETSCILABCHARACTERSCODES_H__
+
+#include "BOOL.h" /* BOOL */
+
+/** ASCII printable characters
+*  http://en.wikipedia.org/wiki/ASCII
+*/
+
+/**
+* Scilab codes for known characters
+* In Scilab, chars are first converted as integers (positives and some
+* negatives) and we have :
+*
+*        code | 0  1 .... 9 | 10  11 ...  35 | 36  37  38  39 | 40
+*        -----+-------------+----------------+----------------+------
+*        char | 0  1 .... 9 |  a   b ...   z |  _   #   !   $ | blank
+*        ============================================================
+*        char |             |  A   B ...   Z |          ?     | tab
+*        -------------------+----------------+----------------+------
+*        code |             |-10 -11 ... -35 |         -38    ! -40
+*
+*       In fact (for the mapping code -> char), code = -1 
+*       to -9 correspond also to chars 1 to 9 and code = -36,-37,-39 
+*       to the char 0
+*
+*       So if c is a scilab coded char then :
+*
+*           abs(c) <= 9  => c is a digit
+*           abs(c) < 40  => c is an alphanum Scilab char (which
+*                           comprise _ but also # ! $ ?). Moreover
+*                           Scilab names may begin with % 
+*           abs(c) == 40 => c is a blank "like" (blank or tab) char  
+*      The upper-case characters and some equivalents are coded by the lower-case code with a sign
+*      change.
+*   ref : Guide for Developers (Scilab Internals)
+*/
+
+/**
+* Set Scilab Characters Codes in C2F(cha1)
+*/
+void setScilabCharactersCodes(void);
+
+#endif /* __SETSCILABCHARACTERSCODES_H__ */
+/*--------------------------------------------------------------------------*/