summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--scilab/CHANGES_5.2.X15
-rw-r--r--scilab/modules/api_scilab/LibScilab_Import.def2
-rw-r--r--scilab/modules/api_scilab/api_scilab_export.def1
-rw-r--r--scilab/modules/api_scilab/includes/api_common.h8
-rw-r--r--scilab/modules/api_scilab/includes/api_error.h14
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_boolean.cpp33
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp42
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_common.cpp86
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_double.cpp51
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_error.cpp54
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_int.cpp68
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_list.cpp293
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_pointer.cpp23
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_poly.cpp33
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_sparse.cpp26
-rw-r--r--scilab/modules/api_scilab/src/cpp/api_string.cpp49
-rwxr-xr-x[-rw-r--r--]scilab/modules/atoms/macros/atoms_internals/atomsIsCompatible.sci7
-rw-r--r--scilab/modules/optimization/help/en_US/neldermead/neldermead.xml43
-rw-r--r--scilab/modules/optimization/macros/neldermead/fminsearch.sci58
-rw-r--r--scilab/modules/optimization/macros/neldermead/neldermead_configure.sci9
-rw-r--r--scilab/modules/optimization/macros/neldermead/neldermead_search.sci2
-rw-r--r--scilab/modules/optimization/macros/neldermead/optimplotfval.sci64
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/fminsearch.tst69
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_mymethod.dia.ref324
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_myterminate.dia.ref82
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_myterminate.tst115
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_outputcmd.dia.ref2
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_restart.dia.ref84
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_restart.tst2
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_rosensuzuki.dia.ref250
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/neldermead_rosensuzuki.tst42
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/optimget.dia.ref7
-rw-r--r--scilab/modules/optimization/tests/unit_tests/neldermead/optimset.dia.ref65
-rw-r--r--scilab/modules/optimization/tests/unit_tests/optimbase/optimbase_newdestroy.dia.ref29
-rw-r--r--scilab/modules/output_stream/includes/do_error_number.h5
-rw-r--r--scilab/modules/output_stream/src/c/error.c6
-rw-r--r--scilab/modules/output_stream/src/c/output_stream_export.def1
-rw-r--r--scilab/modules/xpad/src/java/org/scilab/modules/xpad/Xpad.java30
-rw-r--r--scilab/modules/xpad/src/java/org/scilab/modules/xpad/actions/FindAction.java225
-rw-r--r--scilab/modules/xpad/src/java/org/scilab/modules/xpad/actions/OpenAction.java19
-rw-r--r--scilab/modules/xpad/src/java/org/scilab/modules/xpad/style/ScilabStyleDocument.java78
-rw-r--r--scilab/modules/xpad/tests/nonreg_tests/bug_4863.tst20
-rw-r--r--scilab_doc/neldermead/acknowledgments.tex5
43 files changed, 1581 insertions, 860 deletions
diff --git a/scilab/CHANGES_5.2.X b/scilab/CHANGES_5.2.X
index 69f338f..d00be95 100644
--- a/scilab/CHANGES_5.2.X
+++ b/scilab/CHANGES_5.2.X
@@ -7,6 +7,7 @@ Xcos:
7 7
8TODO: add an explanation about xscos 8TODO: add an explanation about xscos
9 9
10
10ATOMS: 11ATOMS:
11====== 12======
12 13
@@ -21,6 +22,9 @@ TODO: add an explanation about xpad
21Introduction of new binaries: 22Introduction of new binaries:
22============================= 23=============================
23 24
25The goal of these changes is to improve the capabilities to use Scilab
26in different environnements and use cases.
27
24* Scilab 5.2 introduces new binaries in the distribution: 28* Scilab 5.2 introduces new binaries in the distribution:
25 29
26 - classical - The GUI application (equivalent to Scilab Standard Mode). 30 - classical - The GUI application (equivalent to Scilab Standard Mode).
@@ -60,17 +64,20 @@ TODO: write an introduction about all that
60 - manages all Scilab data types 64 - manages all Scilab data types
61 - consistency over all data types 65 - consistency over all data types
62 - will be maintained over future versions of Scilab 66 - will be maintained over future versions of Scilab
67 - error management
63 - fully documented 68 - fully documented
64 - fully tested by unitary tests 69 - fully tested by unitary tests
65 70
66 Note that all other Scilab API (straight access to the Scilab stack, stack1, 71 Note that all other Scilab API (straight access to the Scilab stack, stack1,
67 stack2 and stack3) will be maintained in the Scilab 5.X familly but most of 72 stack2 and stack3) will be maintained in the Scilab 5.X family but most of
68 them will be dropped in the 6 family. 73 them will be dropped in the 6 family.
69 74
70* In the enum sci_types which list all Scilab datatypes, the type 75* In the enum sci_types which list all Scilab datatypes, the type
71 "sci_lufact_pointer" has been renamed to "sci_pointer". 76 "sci_lufact_pointer" has been renamed to "sci_pointer".
72 A define of "sci_lufact_pointer" on "sci_pointer" has been added to backward 77 A define of "sci_lufact_pointer" on "sci_pointer" has been added to backward
73 compatibilities. 78 compatibilities.
79 The rational is to improve the use in special case of the pointer datatype
80 to avoid memory duplication.
74 81
75TODO: talk about call scilab based on api_scilab 82TODO: talk about call scilab based on api_scilab
76 83
@@ -113,6 +120,9 @@ libs/MALLOC/Makefile.am and launch autoreconf.
113toolbox_skeleton: 120toolbox_skeleton:
114================= 121=================
115 122
123The toolbox skeleton is an example of standard toolbox which shows most of the
124use cases.
125
116* examples of gateways functions (c_sum, f_sum, cpp_find) rewritten with new API. 126* examples of gateways functions (c_sum, f_sum, cpp_find) rewritten with new API.
117 127
118* cleaner added 128* cleaner added
@@ -474,7 +484,8 @@ Bug fixes:
474 484
475* bug 4586 fixed - Function fieldnames added for getting tlist, mlist and struct field names (see SEP#28) 485* bug 4586 fixed - Function fieldnames added for getting tlist, mlist and struct field names (see SEP#28)
476 486
477* bug 4604 fixed - rmdir(<dir>,"s") doesn't work if it contains a hidden file (starting with a dot). 487* bug 4604 fixed - rmdir(<dir>,"s") doesn't work if it contains a hidden file
488 (starting with a dot).
478 489
479* bug 4605 fixed - basename('') returns a error. 490* bug 4605 fixed - basename('') returns a error.
480 491
diff --git a/scilab/modules/api_scilab/LibScilab_Import.def b/scilab/modules/api_scilab/LibScilab_Import.def
index 047bf6a..3440a5e 100644
--- a/scilab/modules/api_scilab/LibScilab_Import.def
+++ b/scilab/modules/api_scilab/LibScilab_Import.def
@@ -16,3 +16,5 @@ str2name_
16cvnamel_ 16cvnamel_
17freeArrayOfString 17freeArrayOfString
18getExecMode 18getExecMode
19getIntermediateMemoryNeeded
20getstackinfo_ \ No newline at end of file
diff --git a/scilab/modules/api_scilab/api_scilab_export.def b/scilab/modules/api_scilab/api_scilab_export.def
index c367e5d..410821d 100644
--- a/scilab/modules/api_scilab/api_scilab_export.def
+++ b/scilab/modules/api_scilab/api_scilab_export.def
@@ -44,6 +44,7 @@ pvApiCtx DATA
44 createNamedComplexZMatrixOfDouble 44 createNamedComplexZMatrixOfDouble
45 readNamedMatrixOfDouble 45 readNamedMatrixOfDouble
46 readNamedComplexMatrixOfDouble 46 readNamedComplexMatrixOfDouble
47 addStackSizeError
47 addErrorMessage 48 addErrorMessage
48 printError 49 printError
49 getErrorMessage 50 getErrorMessage
diff --git a/scilab/modules/api_scilab/includes/api_common.h b/scilab/modules/api_scilab/includes/api_common.h
index 8b9458b..487b808 100644
--- a/scilab/modules/api_scilab/includes/api_common.h
+++ b/scilab/modules/api_scilab/includes/api_common.h
@@ -91,14 +91,14 @@ StrErr getNamedVarType(void* _pvCtx, char* _pstName, int* _piType);
91 * @param[in] _piAddress variable address 91 * @param[in] _piAddress variable address
92 * @return if complex 1 otherwise 0 92 * @return if complex 1 otherwise 0
93 */ 93 */
94 int isVarComplex(void* _pvCtx, int* _piAddress); 94int isVarComplex(void* _pvCtx, int* _piAddress);
95 95
96/** 96/**
97* Get named complex information 97* Get named complex information
98* @param[in] _pstName variable name 98* @param[in] _pstName variable name
99* @return if complex 1 otherwise 0 99* @return if complex 1 otherwise 0
100*/ 100*/
101 int isNamedVarComplex(void* _pvCtx, char *_pstName); 101int isNamedVarComplex(void* _pvCtx, char *_pstName);
102 102
103/** 103/**
104 * Get variable dimension 104 * Get variable dimension
@@ -123,14 +123,14 @@ StrErr getNamedVarDimension(void* _pvCtx, char *_pstName, int* _piRows, int* _pi
123 * @param[in] _piAddress variable address 123 * @param[in] _piAddress variable address
124 * @return if matrix form type variable 1 otherwise 0 124 * @return if matrix form type variable 1 otherwise 0
125 */ 125 */
126 int isVarMatrixType(void* _pvCtx, int* _piAddress); 126int isVarMatrixType(void* _pvCtx, int* _piAddress);
127 127
128/** 128/**
129* check if a named variable is a matrix form ( row x col ) 129* check if a named variable is a matrix form ( row x col )
130* @param[in] _pstName variable name 130* @param[in] _pstName variable name
131* @return if matrix form type variable 1 otherwise 0 131* @return if matrix form type variable 1 otherwise 0
132*/ 132*/
133 int isNamedVarMatrixType(char *_pstName); 133int isNamedVarMatrixType(char *_pstName);
134 134
135/** 135/**
136 * get process mode from input variable 136 * get process mode from input variable
diff --git a/scilab/modules/api_scilab/includes/api_error.h b/scilab/modules/api_scilab/includes/api_error.h
index 89383d9..a4c8e53 100644
--- a/scilab/modules/api_scilab/includes/api_error.h
+++ b/scilab/modules/api_scilab/includes/api_error.h
@@ -22,15 +22,10 @@ extern "C" {
22#define API_ERROR_INVALID_POINTER 1 22#define API_ERROR_INVALID_POINTER 1
23#define API_ERROR_INVALID_TYPE 2 23#define API_ERROR_INVALID_TYPE 2
24#define API_ERROR_NOT_MATRIX_TYPE 3 24#define API_ERROR_NOT_MATRIX_TYPE 3
25#define API_ERROR_GET_VARTPE 4
26#define API_ERROR_VARDIM 5
27#define API_ERROR_GET_PROCESSMODE 6 25#define API_ERROR_GET_PROCESSMODE 6
28#define API_ERROR_INVALID_POSITION 7 26#define API_ERROR_INVALID_POSITION 7
29#define API_ERROR_INVALID_COMPLEXITY 8 27#define API_ERROR_INVALID_COMPLEXITY 8
30#define API_ERROR_GET_DIMFROMVAR 9 28#define API_ERROR_GET_DIMFROMVAR 9
31#define API_ERROR_GET_VAR_ADDRESS 10
32#define API_ERROR_GET_VAR_NAME 11
33#define API_ERROR_NO_MORE_MEMORY 12
34 29
35#define API_ERROR_INVALID_NAME 50 30#define API_ERROR_INVALID_NAME 50
36#define API_ERROR_NAMED_TYPE 51 31#define API_ERROR_NAMED_TYPE 51
@@ -53,7 +48,6 @@ extern "C" {
53#define API_ERROR_CREATE_POLY 203 48#define API_ERROR_CREATE_POLY 203
54#define API_ERROR_TOO_LONG_VAR 204 49#define API_ERROR_TOO_LONG_VAR 204
55#define API_ERROR_INVALID_VAR_POINTER 205 50#define API_ERROR_INVALID_VAR_POINTER 205
56#define API_ERROR_FILL_POLY 206
57#define API_ERROR_CREATE_NAMED_POLY 207 51#define API_ERROR_CREATE_NAMED_POLY 207
58#define API_ERROR_READ_NAMED_POLY 208 52#define API_ERROR_READ_NAMED_POLY 208
59 53
@@ -67,7 +61,6 @@ extern "C" {
67 /*sparse errors 501 - 599*/ 61 /*sparse errors 501 - 599*/
68#define API_ERROR_GET_SPARSE 501 62#define API_ERROR_GET_SPARSE 501
69#define API_ERROR_ALLOC_SPARSE 502 63#define API_ERROR_ALLOC_SPARSE 502
70#define API_ERROR_FILL_SPARSE 503
71#define API_ERROR_CREATE_SPARSE 504 64#define API_ERROR_CREATE_SPARSE 504
72#define API_ERROR_CREATE_NAMED_SPARSE 505 65#define API_ERROR_CREATE_NAMED_SPARSE 505
73#define API_ERROR_READ_NAMED_SPARSE 506 66#define API_ERROR_READ_NAMED_SPARSE 506
@@ -83,7 +76,6 @@ extern "C" {
83 /*matlab sparse errors 701 - 799*/ 76 /*matlab sparse errors 701 - 799*/
84 77
85 /*ints errors 801 - 899*/ 78 /*ints errors 801 - 899*/
86#define API_ERROR_GET_INT_PRECISION 802
87#define API_ERROR_GET_INT 802 79#define API_ERROR_GET_INT 802
88#define API_ERROR_CREATE_INT 803 80#define API_ERROR_CREATE_INT 803
89#define API_ERROR_ALLOC_INT 804 81#define API_ERROR_ALLOC_INT 804
@@ -94,7 +86,6 @@ extern "C" {
94#define API_ERROR_GET_STRING 1001 86#define API_ERROR_GET_STRING 1001
95#define API_ERROR_INVALID_SUBSTRING_POINTER 1002 87#define API_ERROR_INVALID_SUBSTRING_POINTER 1002
96#define API_ERROR_CREATE_STRING 1003 88#define API_ERROR_CREATE_STRING 1003
97#define API_ERROR_FILL_STRING 1004
98#define API_ERROR_CREATE_NAMED_STRING 1005 89#define API_ERROR_CREATE_NAMED_STRING 1005
99#define API_ERROR_READ_NAMED_STRING 1006 90#define API_ERROR_READ_NAMED_STRING 1006
100#define API_ERROR_GET_WIDE_STRING 1007 91#define API_ERROR_GET_WIDE_STRING 1007
@@ -120,7 +111,6 @@ extern "C" {
120 /*double in list*/ 111 /*double in list*/
121#define API_ERROR_GET_DOUBLE_IN_LIST 1520 112#define API_ERROR_GET_DOUBLE_IN_LIST 1520
122#define API_ERROR_ALLOC_DOUBLE_IN_LIST 1521 113#define API_ERROR_ALLOC_DOUBLE_IN_LIST 1521
123#define API_ERROR_FILL_DOUBLE_IN_LIST 1522
124#define API_ERROR_CREATE_ZDOUBLE_IN_LIST 1523 114#define API_ERROR_CREATE_ZDOUBLE_IN_LIST 1523
125#define API_ERROR_CREATE_DOUBLE_IN_LIST 1524 115#define API_ERROR_CREATE_DOUBLE_IN_LIST 1524
126#define API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST 1525 116#define API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST 1525
@@ -179,12 +169,12 @@ extern "C" {
179 169
180/*pointer errors 12801 - 12899*/ 170/*pointer errors 12801 - 12899*/
181#define API_ERROR_GET_POINTER 12801 171#define API_ERROR_GET_POINTER 12801
182#define API_ERROR_FILL_POINTER 12802
183#define API_ERROR_ALLOC_POINTER 12803 172#define API_ERROR_ALLOC_POINTER 12803
184#define API_ERROR_CREATE_POINTER 12804 173#define API_ERROR_CREATE_POINTER 12804
185 174
186/* error functions*/ 175/* error functions*/
187int addErrorMessage(StrErr* _pstrErr, int _iErr, char* _pstMsg, ...); 176int addStackSizeError(StrErr* _pstrErr, char* _pstCaller, int iNeeded);
177int addErrorMessage(StrErr* _pstrErr, int _iErr, const char* _pstMsg, ...);
188int printError(StrErr* _pstrErr, int _iLastMsg); 178int printError(StrErr* _pstrErr, int _iLastMsg);
189char* getErrorMessage(StrErr _strErr); 179char* getErrorMessage(StrErr _strErr);
190 180
diff --git a/scilab/modules/api_scilab/src/cpp/api_boolean.cpp b/scilab/modules/api_scilab/src/cpp/api_boolean.cpp
index 99fd7b0..8319767 100644
--- a/scilab/modules/api_scilab/src/cpp/api_boolean.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_boolean.cpp
@@ -35,22 +35,21 @@ StrErr getMatrixOfBoolean(void* _pvCtx, int* _piAddress, int* _piRows, int* _piC
35 35
36 if( _piAddress == NULL) 36 if( _piAddress == NULL)
37 { 37 {
38 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 38 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getMatrixOfBoolean");
39 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN, _("API_ERROR_GET_BOOLEAN"));
40 return strErr; 39 return strErr;
41 } 40 }
42 41
43 strErr = getVarType(_pvCtx, _piAddress, &iType); 42 strErr = getVarType(_pvCtx, _piAddress, &iType);
44 if(strErr.iErr || iType != sci_boolean) 43 if(strErr.iErr || iType != sci_boolean)
45 { 44 {
46 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 45 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getMatrixOfBoolean", _("boolean matrix"));
47 return strErr; 46 return strErr;
48 } 47 }
49 48
50 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 49 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
51 if(strErr.iErr) 50 if(strErr.iErr)
52 { 51 {
53 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN, _("API_ERROR_GET_BOOLEAN")); 52 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN, _("%s: Unable to get argument #%d"), "getMatrixOfBoolean", getRhsFromAddress(_pvCtx, _piAddress));
54 return strErr; 53 return strErr;
55 } 54 }
56 55
@@ -68,12 +67,11 @@ StrErr allocMatrixOfBoolean(void* _pvCtx, int _iVar, int _iRows, int _iCols, int
68 int iNewPos = Top - Rhs + _iVar; 67 int iNewPos = Top - Rhs + _iVar;
69 int iAddr = *Lstk(iNewPos); 68 int iAddr = *Lstk(iNewPos);
70 69
71 int iSize = _iRows * _iCols; 70 int iMemSize = (int)(((double)(_iRows * _iCols) / 2) + 2);
72 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr) + 3); 71 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr));
73 if (iSize > iFreeSpace) 72 if (iMemSize > iFreeSpace)
74 { 73 {
75 addErrorMessage(&strErr, API_ERROR_NO_MORE_MEMORY, _("API_ERROR_NO_MORE_MEMORY")); 74 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
76 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN, _("API_ERROR_GET_BOOLEAN"));
77 return strErr; 75 return strErr;
78 } 76 }
79 77
@@ -105,7 +103,7 @@ StrErr createMatrixOfBoolean(void* _pvCtx, int _iVar, int _iRows, int _iCols, in
105 strErr = allocMatrixOfBoolean(_pvCtx, _iVar, _iRows, _iCols, &piBool); 103 strErr = allocMatrixOfBoolean(_pvCtx, _iVar, _iRows, _iCols, &piBool);
106 if(strErr.iErr) 104 if(strErr.iErr)
107 { 105 {
108 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN, _("API_ERROR_CREATE_BOOLEAN")); 106 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfBoolean");
109 return strErr; 107 return strErr;
110 } 108 }
111 109
@@ -125,12 +123,11 @@ StrErr createNamedMatrixOfBoolean(void* _pvCtx, char* _pstName, int _iRows, int
125 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName)); 123 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName));
126 Top = Top + Nbvars + 1; 124 Top = Top + Nbvars + 1;
127 125
128 int iSize = _iRows * _iCols; 126 int iMemSize = (int)(((double)(_iRows * _iCols) / 2) + 2);
129 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(*Lstk(Top)) + 3); 127 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(*Lstk(Top)));
130 if (iSize > iFreeSpace) 128 if (iMemSize > iFreeSpace)
131 { 129 {
132 addErrorMessage(&strErr, API_ERROR_NO_MORE_MEMORY, _("API_ERROR_NO_MORE_MEMORY")); 130 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
133 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN, _("API_ERROR_CREATE_NAMED_BOOLEAN"));
134 return strErr; 131 return strErr;
135 } 132 }
136 133
@@ -140,7 +137,7 @@ StrErr createNamedMatrixOfBoolean(void* _pvCtx, char* _pstName, int _iRows, int
140 strErr = fillMatrixOfBoolean(_pvCtx, piAddr, _iRows, _iCols, &piBool); 137 strErr = fillMatrixOfBoolean(_pvCtx, piAddr, _iRows, _iCols, &piBool);
141 if(strErr.iErr) 138 if(strErr.iErr)
142 { 139 {
143 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN, _("API_ERROR_CREATE_NAMED_BOOLEAN")); 140 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN, _("%s: Unable to create %s named \"%s\""), "createNamedMatrixOfBoolean", _("matrix of boolean"), _pstName);
144 return strErr; 141 return strErr;
145 } 142 }
146 143
@@ -167,14 +164,14 @@ StrErr readNamedMatrixOfBoolean(void* _pvCtx, char* _pstName, int* _piRows, int*
167 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 164 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
168 if(strErr.iErr) 165 if(strErr.iErr)
169 { 166 {
170 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN, _("API_ERROR_READ_BOOLEAN")); 167 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN, _("%s: Unable to get variable \"%s\""), "readNamedMatrixOfBoolean", _pstName);
171 return strErr; 168 return strErr;
172 } 169 }
173 170
174 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, &piBool); 171 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, &piBool);
175 if(strErr.iErr) 172 if(strErr.iErr)
176 { 173 {
177 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN, _("API_ERROR_READ_BOOLEAN")); 174 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN, _("%s: Unable to get variable \"%s\""), "readNamedMatrixOfBoolean", _pstName);
178 return strErr; 175 return strErr;
179 } 176 }
180 177
diff --git a/scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp b/scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp
index 07e755a..2e62408 100644
--- a/scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_boolean_sparse.cpp
@@ -31,22 +31,21 @@ StrErr getBooleanSparseMatrix(void* _pvCtx, int* _piAddress, int* _piRows, int*
31 31
32 if( _piAddress == NULL) 32 if( _piAddress == NULL)
33 { 33 {
34 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 34 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getBooleanSparseMatrix");
35 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE, _("API_ERROR_GET_BOOLEAN_SPARSE"));
36 return strErr; 35 return strErr;
37 } 36 }
38 37
39 strErr = getVarType(_pvCtx, _piAddress, &iType); 38 strErr = getVarType(_pvCtx, _piAddress, &iType);
40 if(strErr.iErr || iType != sci_boolean_sparse) 39 if(strErr.iErr || iType != sci_boolean_sparse)
41 { 40 {
42 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE, _("API_ERROR_GET_BOOLEAN_SPARSE")); 41 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE, _("%s: Unable to get argument #%d"), "getBooleanSparseMatrix", getRhsFromAddress(_pvCtx, _piAddress));
43 return strErr; 42 return strErr;
44 } 43 }
45 44
46 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 45 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
47 if(strErr.iErr) 46 if(strErr.iErr)
48 { 47 {
49 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE, _("API_ERROR_GET_BOOLEAN_SPARSE")); 48 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE, _("%s: Unable to get argument #%d"), "getBooleanSparseMatrix", getRhsFromAddress(_pvCtx, _piAddress));
50 return strErr; 49 return strErr;
51 } 50 }
52 51
@@ -72,15 +71,14 @@ StrErr allocBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols,
72 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 71 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
73 int iNewPos = Top - Rhs + _iVar; 72 int iNewPos = Top - Rhs + _iVar;
74 int iAddr = *Lstk(iNewPos); 73 int iAddr = *Lstk(iNewPos);
75 int iPos = 0; 74 int iPos = 5 + _iRows + _iNbItem;
76 int* piAddr = NULL; 75 int* piAddr = NULL;
77 76
78 int iSize = _iNbItem; 77 int iMemSize = (int)( ( (double)iPos / 2 ) + 0.5);
79 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr) + 5 + _iRows); 78 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr));
80 if (iSize > iFreeSpace) 79 if (iMemSize > iFreeSpace)
81 { 80 {
82 addErrorMessage(&strErr, API_ERROR_NO_MORE_MEMORY, _("API_ERROR_NO_MORE_MEMORY")); 81 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
83 addErrorMessage(&strErr, API_ERROR_ALLOC_BOOLEAN_SPARSE, _("API_ERROR_ALLOC_BOOLEAN_SPARSE"));
84 return strErr; 82 return strErr;
85 } 83 }
86 84
@@ -88,13 +86,11 @@ StrErr allocBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols,
88 strErr = fillBooleanSparseMatrix(_pvCtx, piAddr, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos); 86 strErr = fillBooleanSparseMatrix(_pvCtx, piAddr, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos);
89 if(strErr.iErr) 87 if(strErr.iErr)
90 { 88 {
91 addErrorMessage(&strErr, API_ERROR_ALLOC_BOOLEAN_SPARSE, _("API_ERROR_ALLOC_BOOLEAN_SPARSE")); 89 addErrorMessage(&strErr, API_ERROR_ALLOC_BOOLEAN_SPARSE, _("%s: Unable to create variable in Scilab memory"), "allocBooleanSparseMatrix");
92 return strErr; 90 return strErr;
93 } 91 }
94 92
95 iPos = iAddr + 5;//4 for header + 1 for NbItem 93 iPos += iAddr;
96 iPos += _iRows + _iNbItem;
97
98 updateInterSCI(_iVar, '$', iAddr, iPos); 94 updateInterSCI(_iVar, '$', iAddr, iPos);
99 updateLstk(iNewPos, iPos, 0); 95 updateLstk(iNewPos, iPos, 0);
100 return strErr; 96 return strErr;
@@ -106,8 +102,7 @@ StrErr fillBooleanSparseMatrix(void* _pvCtx, int *_piAddress, int _iRows, int _i
106 102
107 if(_piAddress == NULL) 103 if(_piAddress == NULL)
108 { 104 {
109 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 105 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "fillBooleanSparseMatrix");
110 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE, _("API_ERROR_FILL_BOOLEAN_SPARSE"));
111 return strErr; 106 return strErr;
112 } 107 }
113 108
@@ -132,7 +127,7 @@ StrErr createBooleanSparseMatrix(void* _pvCtx, int _iVar, int _iRows, int _iCols
132 strErr = allocBooleanSparseMatrix(_pvCtx, _iVar, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos); 127 strErr = allocBooleanSparseMatrix(_pvCtx, _iVar, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos);
133 if(strErr.iErr) 128 if(strErr.iErr)
134 { 129 {
135 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE, _("API_ERROR_CREATE_BOOLEAN_SPARSE")); 130 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE, _("%s: Unable to create variable in Scilab memory"), "createBooleanSparseMatrix");
136 return strErr; 131 return strErr;
137 } 132 }
138 133
@@ -156,12 +151,11 @@ StrErr createNamedBooleanSparseMatrix(void* _pvCtx, char* _pstName, int _iRows,
156 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName)); 151 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName));
157 Top = Top + Nbvars + 1; 152 Top = Top + Nbvars + 1;
158 153
159 int iSize = _iNbItem; 154 int iMemSize = (int)( ( (double)iPos / 2) + 0.5);
160 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(Top) + 5 + _iRows); 155 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(Top));
161 if (iSize > iFreeSpace) 156 if (iMemSize > iFreeSpace)
162 { 157 {
163 addErrorMessage(&strErr, API_ERROR_NO_MORE_MEMORY, _("API_ERROR_NO_MORE_MEMORY")); 158 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
164 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE, _("API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE"));
165 return strErr; 159 return strErr;
166 } 160 }
167 161
@@ -169,7 +163,7 @@ StrErr createNamedBooleanSparseMatrix(void* _pvCtx, char* _pstName, int _iRows,
169 strErr = fillBooleanSparseMatrix(_pvCtx, piAddr, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos); 163 strErr = fillBooleanSparseMatrix(_pvCtx, piAddr, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos);
170 if(strErr.iErr) 164 if(strErr.iErr)
171 { 165 {
172 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE, _("API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE")); 166 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_BOOLEAN_SPARSE, _("%s: Unable to create %s named \"%s\""), "createNamedBooleanSparseMatrix", _("boolean sparse matrix"), _pstName);
173 return strErr; 167 return strErr;
174 } 168 }
175 169
@@ -202,7 +196,7 @@ StrErr readNamedBooleanSparseMatrix(void* _pvCtx, char* _pstName, int* _piRows,
202 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 196 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
203 if(strErr.iErr) 197 if(strErr.iErr)
204 { 198 {
205 addErrorMessage(&strErr, API_ERROR_READ_NAMED_BOOLEAN_SPARSE, _("API_ERROR_READ_NAMED_BOOLEAN_SPARSE")); 199 addErrorMessage(&strErr, API_ERROR_READ_NAMED_BOOLEAN_SPARSE, _("%s: Unable to get variable \"%s\""), "readNamedBooleanSparseMatrix", _pstName);
206 return strErr; 200 return strErr;
207 } 201 }
208 202
diff --git a/scilab/modules/api_scilab/src/cpp/api_common.cpp b/scilab/modules/api_scilab/src/cpp/api_common.cpp
index f7f91f1..52685b00 100644
--- a/scilab/modules/api_scilab/src/cpp/api_common.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_common.cpp
@@ -61,11 +61,11 @@ StrErr getVarDimension(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCols
61 *_piCols = 0; 61 *_piCols = 0;
62 if(_piAddress == NULL) 62 if(_piAddress == NULL)
63 { 63 {
64 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 64 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getVarDimension");
65 } 65 }
66 else 66 else
67 { 67 {
68 addErrorMessage(&strErr, API_ERROR_NOT_MATRIX_TYPE, _("API_ERROR_NOT_MATRIX_TYPE")); 68 addErrorMessage(&strErr, API_ERROR_NOT_MATRIX_TYPE, _("%s: matrix argument excepted"), "getVarDimension");
69 } 69 }
70 } 70 }
71 return strErr; 71 return strErr;
@@ -79,14 +79,14 @@ StrErr getNamedVarDimension(void* _pvCtx, char *_pstName, int* _piRows, int* _pi
79 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 79 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
80 if(strErr.iErr) 80 if(strErr.iErr)
81 { 81 {
82 addErrorMessage(&strErr, API_ERROR_NAMED_VARDIM, _("API_ERROR_NAMED_VARDIM")); 82 addErrorMessage(&strErr, API_ERROR_NAMED_VARDIM, _("%s: Unable to get dimension of variable \"%s\""), "getNamedVarDimension", _pstName);
83 return strErr; 83 return strErr;
84 } 84 }
85 85
86 strErr = getVarDimension(_pvCtx, piAddr, _piRows, _piCols); 86 strErr = getVarDimension(_pvCtx, piAddr, _piRows, _piCols);
87 if(strErr.iErr) 87 if(strErr.iErr)
88 { 88 {
89 addErrorMessage(&strErr, API_ERROR_NAMED_VARDIM, _("API_ERROR_NAMED_VARDIM")); 89 addErrorMessage(&strErr, API_ERROR_NAMED_VARDIM, _("%s: Unable to get dimension of variable \"%s\""), "getNamedVarDimension", _pstName);
90 return strErr; 90 return strErr;
91 } 91 }
92 92
@@ -98,10 +98,10 @@ StrErr getVarAddressFromPosition(void* _pvCtx, int _iVar, int** _piAddress)
98 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 98 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
99 int iAddr = 0; 99 int iAddr = 0;
100 int iValType = 0; 100 int iValType = 0;
101 if(_iVar > Rhs) 101 /* we accept a call to getVarAddressFromPosition after a create... call */
102 if(_iVar > Rhs && _iVar > Nbvars)
102 { 103 {
103 addErrorMessage(&strErr, API_ERROR_INVALID_POSITION, _("API_ERROR_INVALID_POSITION")); 104 addErrorMessage(&strErr, API_ERROR_INVALID_POSITION, _("%s: bad call to %s! (1rst argument).\n"), ((StrCtx*)_pvCtx)->pstName, "getVarAddressFromPosition");
104 addErrorMessage(&strErr, API_ERROR_GET_VAR_ADDRESS, _("API_ERROR_GET_VAR_ADDRESS"));
105 return strErr; 105 return strErr;
106 } 106 }
107 107
@@ -125,8 +125,7 @@ StrErr getVarNameFromPosition(void* _pvCtx, int _iVar, char* _pstName)
125 CvNameL(&vstk_.idstk[(_iVar - 1) * 6], _pstName, &iJob1, &iNameLen); 125 CvNameL(&vstk_.idstk[(_iVar - 1) * 6], _pstName, &iJob1, &iNameLen);
126 if(iNameLen == 0) 126 if(iNameLen == 0)
127 { 127 {
128 addErrorMessage(&strErr, API_ERROR_INVALID_NAME, _("API_ERROR_INVALID_NAME")); 128 addErrorMessage(&strErr, API_ERROR_INVALID_NAME, _("%s: Unable to get name of argument #%d"), "getVarNameFromPosition", _iVar);
129 addErrorMessage(&strErr, API_ERROR_GET_VAR_NAME, _("API_ERROR_GET_VAR_NAME"));
130 return strErr; 129 return strErr;
131 } 130 }
132 131
@@ -157,7 +156,7 @@ StrErr getVarAddressFromName(void* _pvCtx, char* _pstName, int** _piAddress)
157 156
158 if (Err > 0 || Fin == 0) 157 if (Err > 0 || Fin == 0)
159 { 158 {
160 addErrorMessage(&strErr, API_ERROR_INVALID_NAME, _("API_ERROR_INVALID_NAME")); 159 addErrorMessage(&strErr, API_ERROR_INVALID_NAME, _("%s: Unable to get address of variable \"%s\""), "getVarAddressFromName", _pstName);
161 return strErr; 160 return strErr;
162 } 161 }
163 162
@@ -166,7 +165,6 @@ StrErr getVarAddressFromName(void* _pvCtx, char* _pstName, int** _piAddress)
166 Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1); 165 Fin = *istk(iadr(*Lstk(Fin )) + 1 + 1);
167 166
168 //get variable address 167 //get variable address
169 //WARNING check in VarType can be negative
170 getNewVarAddressFromPosition(_pvCtx, Fin, &piAddr); 168 getNewVarAddressFromPosition(_pvCtx, Fin, &piAddr);
171 169
172 *_piAddress = piAddr; 170 *_piAddress = piAddr;
@@ -178,8 +176,7 @@ StrErr getVarType(void* _pvCtx, int* _piAddress, int* _piType)
178 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 176 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
179 if(_piAddress == NULL) 177 if(_piAddress == NULL)
180 { 178 {
181 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 179 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getVarType");
182 addErrorMessage(&strErr, API_ERROR_GET_VARTPE, _("API_ERROR_GET_VARTPE"));
183 return strErr; 180 return strErr;
184 } 181 }
185 182
@@ -196,14 +193,14 @@ StrErr getNamedVarType(void* _pvCtx, char* _pstName, int* _piType)
196 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 193 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
197 if(strErr.iErr) 194 if(strErr.iErr)
198 { 195 {
199 addErrorMessage(&strErr, API_ERROR_NAMED_TYPE, _("API_ERROR_NAMED_TYPE")); 196 addErrorMessage(&strErr, API_ERROR_NAMED_TYPE, _("%s: Unable to get type of variable \"%s\""), "getNamedVarType", _pstName);
200 return strErr; 197 return strErr;
201 } 198 }
202 199
203 strErr = getVarType(_pvCtx, piAddr, _piType); 200 strErr = getVarType(_pvCtx, piAddr, _piType);
204 if(strErr.iErr) 201 if(strErr.iErr)
205 { 202 {
206 addErrorMessage(&strErr, API_ERROR_NAMED_TYPE, _("API_ERROR_NAMED_TYPE")); 203 addErrorMessage(&strErr, API_ERROR_NAMED_TYPE, _("%s: Unable to get type of variable \"%s\""), "getNamedVarType", _pstName);
207 return strErr; 204 return strErr;
208 } 205 }
209 return strErr; 206 return strErr;
@@ -323,21 +320,21 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
323 strErr = getVarDimension(_pvCtx, _piAddRef, &iRows1, &iCols1); 320 strErr = getVarDimension(_pvCtx, _piAddRef, &iRows1, &iCols1);
324 if(strErr.iErr) 321 if(strErr.iErr)
325 { 322 {
326 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 323 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument dimension"), "getProcessMode");
327 return strErr; 324 return strErr;
328 } 325 }
329 326
330 strErr = getVarAddressFromPosition(_pvCtx, _iPos, &piAddr2); 327 strErr = getVarAddressFromPosition(_pvCtx, _iPos, &piAddr2);
331 if(strErr.iErr) 328 if(strErr.iErr)
332 { 329 {
333 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 330 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get variable address"), "getProcessMode");
334 return strErr; 331 return strErr;
335 } 332 }
336 333
337 strErr = getVarType(_pvCtx, piAddr2, &iType2); 334 strErr = getVarType(_pvCtx, piAddr2, &iType2);
338 if(strErr.iErr) 335 if(strErr.iErr)
339 { 336 {
340 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 337 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument type"), "getProcessMode");
341 return strErr; 338 return strErr;
342 } 339 }
343 340
@@ -347,14 +344,13 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
347 strErr = getMatrixOfDouble(_pvCtx, piAddr2, &iRows2, &iCols2, &pdblReal2); 344 strErr = getMatrixOfDouble(_pvCtx, piAddr2, &iRows2, &iCols2, &pdblReal2);
348 if(strErr.iErr) 345 if(strErr.iErr)
349 { 346 {
350 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 347 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument data"), "getProcessMode");
351 return strErr; 348 return strErr;
352 } 349 }
353 350
354 if(iRows2 != 1 || iCols2 != 1) 351 if(iRows2 != 1 || iCols2 != 1)
355 { 352 {
356 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("Wrong size for argument %d.\n"), _iPos); 353 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Wrong size for argument %d: (%d,%d) expected.\n"), "getProcessMode", _iPos, 1, 1);
357 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE"));
358 return strErr; 354 return strErr;
359 } 355 }
360 356
@@ -368,21 +364,20 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
368 strErr = getVarDimension(_pvCtx, piAddr2, &iRows2, &iCols2); 364 strErr = getVarDimension(_pvCtx, piAddr2, &iRows2, &iCols2);
369 if(strErr.iErr) 365 if(strErr.iErr)
370 { 366 {
371 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 367 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument dimension"), "getProcessMode");
372 return strErr; 368 return strErr;
373 } 369 }
374 370
375 if(iRows2 != 1 || iCols2 != 1) 371 if(iRows2 != 1 || iCols2 != 1)
376 { 372 {
377 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("Wrong size for argument %d.\n"), _iPos); 373 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Wrong size for argument %d: (%d,%d) expected.\n"), "getProcessMode", _iPos, 1, 1);
378 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE"));
379 return strErr; 374 return strErr;
380 } 375 }
381 376
382 strErr = getMatrixOfString(_pvCtx, piAddr2, &iRows2, &iCols2, &iLen, NULL); 377 strErr = getMatrixOfString(_pvCtx, piAddr2, &iRows2, &iCols2, &iLen, NULL);
383 if(strErr.iErr) 378 if(strErr.iErr)
384 { 379 {
385 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 380 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument data"), "getProcessMode");
386 return strErr; 381 return strErr;
387 } 382 }
388 383
@@ -390,7 +385,7 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
390 strErr = getMatrixOfString(_pvCtx, piAddr2, &iRows2, &iCols2, &iLen, pstMode); 385 strErr = getMatrixOfString(_pvCtx, piAddr2, &iRows2, &iCols2, &iLen, pstMode);
391 if(strErr.iErr) 386 if(strErr.iErr)
392 { 387 {
393 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE")); 388 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Unable to get argument data"), "getProcessMode");
394 return strErr; 389 return strErr;
395 } 390 }
396 391
@@ -398,8 +393,7 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
398 } 393 }
399 else 394 else
400 { 395 {
401 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("Wrong argument %d.\n"), _iPos); 396 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Wrong type for input argument #%d: A string or a scalar expected.\n"), "getProcessMode", _iPos);
402 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE"));
403 return strErr; 397 return strErr;
404 } 398 }
405 399
@@ -419,8 +413,7 @@ StrErr getProcessMode(void* _pvCtx, int _iPos, int* _piAddRef, int *_piMode)
419 } 413 }
420 else 414 else
421 { 415 {
422 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("Wrong argument %d.\n"), _iPos); 416 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("%s: Wrong value for input argument #%d: ''%s'' or ''%s'' expected.\n"), "getProcessMode", _iPos, "'*', 'r', 'c', 'm', '0', '1', '2'", "-1");
423 addErrorMessage(&strErr, API_ERROR_GET_PROCESSMODE, _("API_ERROR_GET_PROCESSMODE"));
424 return strErr; 417 return strErr;
425 } 418 }
426 return strErr; 419 return strErr;
@@ -437,7 +430,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
437 strErr = getVarType(_pvCtx, _piAddress, &iType); 430 strErr = getVarType(_pvCtx, _piAddress, &iType);
438 if(strErr.iErr) 431 if(strErr.iErr)
439 { 432 {
440 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 433 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument type"), "getDimFromVar");
441 return strErr; 434 return strErr;
442 } 435 }
443 436
@@ -445,15 +438,14 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
445 { 438 {
446 if(isVarComplex(_pvCtx, _piAddress)) 439 if(isVarComplex(_pvCtx, _piAddress))
447 { 440 {
448 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("Wrong size for argument %d.\n"), getRhsFromAddress(_pvCtx, _piAddress)); 441 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Wrong type for argument %d: Real matrix expected.\n"), "getDimFromVar", getRhsFromAddress(_pvCtx, _piAddress));
449 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR"));
450 return strErr; 442 return strErr;
451 } 443 }
452 444
453 strErr = getMatrixOfDouble(_pvCtx, _piAddress, &iRows, &iCols, &pdblReal); 445 strErr = getMatrixOfDouble(_pvCtx, _piAddress, &iRows, &iCols, &pdblReal);
454 if(strErr.iErr) 446 if(strErr.iErr)
455 { 447 {
456 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 448 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
457 return strErr; 449 return strErr;
458 } 450 }
459 451
@@ -469,21 +461,20 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
469 strErr = getVarDimension(_pvCtx, _piAddress, &iRows, &iCols); 461 strErr = getVarDimension(_pvCtx, _piAddress, &iRows, &iCols);
470 if(strErr.iErr) 462 if(strErr.iErr)
471 { 463 {
472 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 464 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument dimension"), "getDimFromVar");
473 return strErr; 465 return strErr;
474 } 466 }
475 467
476 if(iRows != 1 || iCols != 1) 468 if(iRows != 1 || iCols != 1)
477 { 469 {
478 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("Wrong size for argument %d.\n"), getRhsFromAddress(_pvCtx, _piAddress)); 470 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Wrong size for argument %d: (%d,%d) expected.\n"), "getProcessMode", getRhsFromAddress(_pvCtx, _piAddress), 1, 1);
479 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR"));
480 return strErr; 471 return strErr;
481 } 472 }
482 473
483 strErr = getMatrixOfIntegerPrecision(_pvCtx, _piAddress, &iPrec); 474 strErr = getMatrixOfIntegerPrecision(_pvCtx, _piAddress, &iPrec);
484 if(strErr.iErr) 475 if(strErr.iErr)
485 { 476 {
486 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 477 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument precision"), "getDimFromVar");
487 return strErr; 478 return strErr;
488 } 479 }
489 480
@@ -495,7 +486,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
495 strErr = getMatrixOfInteger8(_pvCtx, _piAddress, &iRows, &iCols, &pcData); 486 strErr = getMatrixOfInteger8(_pvCtx, _piAddress, &iRows, &iCols, &pcData);
496 if(strErr.iErr) 487 if(strErr.iErr)
497 { 488 {
498 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 489 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
499 return strErr; 490 return strErr;
500 } 491 }
501 *_piVal = pcData[0]; 492 *_piVal = pcData[0];
@@ -507,7 +498,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
507 strErr = getMatrixOfUnsignedInteger8(_pvCtx, _piAddress, &iRows, &iCols, &pucData); 498 strErr = getMatrixOfUnsignedInteger8(_pvCtx, _piAddress, &iRows, &iCols, &pucData);
508 if(strErr.iErr) 499 if(strErr.iErr)
509 { 500 {
510 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 501 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
511 return strErr; 502 return strErr;
512 } 503 }
513 *_piVal = pucData[0]; 504 *_piVal = pucData[0];
@@ -519,7 +510,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
519 strErr = getMatrixOfInteger16(_pvCtx, _piAddress, &iRows, &iCols, &psData); 510 strErr = getMatrixOfInteger16(_pvCtx, _piAddress, &iRows, &iCols, &psData);
520 if(strErr.iErr) 511 if(strErr.iErr)
521 { 512 {
522 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 513 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
523 return strErr; 514 return strErr;
524 } 515 }
525 *_piVal = psData[0]; 516 *_piVal = psData[0];
@@ -531,7 +522,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
531 strErr = getMatrixOfUnsignedInteger16(_pvCtx, _piAddress, &iRows, &iCols, &pusData); 522 strErr = getMatrixOfUnsignedInteger16(_pvCtx, _piAddress, &iRows, &iCols, &pusData);
532 if(strErr.iErr) 523 if(strErr.iErr)
533 { 524 {
534 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 525 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
535 return strErr; 526 return strErr;
536 } 527 }
537 *_piVal = pusData[0]; 528 *_piVal = pusData[0];
@@ -543,7 +534,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
543 strErr = getMatrixOfInteger32(_pvCtx, _piAddress, &iRows, &iCols, &piData); 534 strErr = getMatrixOfInteger32(_pvCtx, _piAddress, &iRows, &iCols, &piData);
544 if(strErr.iErr) 535 if(strErr.iErr)
545 { 536 {
546 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 537 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
547 return strErr; 538 return strErr;
548 } 539 }
549 *_piVal = piData[0]; 540 *_piVal = piData[0];
@@ -555,7 +546,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
555 strErr = getMatrixOfUnsignedInteger32(_pvCtx, _piAddress, &iRows, &iCols, &puiData); 546 strErr = getMatrixOfUnsignedInteger32(_pvCtx, _piAddress, &iRows, &iCols, &puiData);
556 if(strErr.iErr) 547 if(strErr.iErr)
557 { 548 {
558 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR")); 549 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Unable to get argument data"), "getDimFromVar");
559 return strErr; 550 return strErr;
560 } 551 }
561 *_piVal = puiData[0]; 552 *_piVal = puiData[0];
@@ -565,8 +556,7 @@ StrErr getDimFromVar(void* _pvCtx, int* _piAddress, int* _piVal)
565 } 556 }
566 else 557 else
567 { 558 {
568 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("Wrong size for argument %d.\n"), getRhsFromAddress(_pvCtx, _piAddress)); 559 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("%s: Wrong type for input argument #%d: A real scalar or a integer scalar expected.\n"), "getDimFromVar", getRhsFromAddress(_pvCtx, _piAddress));
569 addErrorMessage(&strErr, API_ERROR_GET_DIMFROMVAR, _("API_ERROR_GET_DIMFROMVAR"));
570 return strErr; 560 return strErr;
571 } 561 }
572 return strErr; 562 return strErr;
@@ -580,14 +570,14 @@ StrErr getDimFromNamedVar(void* _pvCtx, char* _pstName, int* _piVal)
580 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 570 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
581 if(strErr.iErr) 571 if(strErr.iErr)
582 { 572 {
583 addErrorMessage(&strErr, API_ERROR_GET_NAMED_DIMFROMVAR, _("API_ERROR_GET_NAMED_DIMFROMVAR")); 573 addErrorMessage(&strErr, API_ERROR_GET_NAMED_DIMFROMVAR, _("%s: Unable to get dimension from variable \"%s\""), "getDimFromNamedVar", _pstName);
584 return strErr; 574 return strErr;
585 } 575 }
586 576
587 strErr = getDimFromVar(_pvCtx, piAddr, _piVal); 577 strErr = getDimFromVar(_pvCtx, piAddr, _piVal);
588 if(strErr.iErr) 578 if(strErr.iErr)
589 { 579 {
590 addErrorMessage(&strErr, API_ERROR_GET_NAMED_DIMFROMVAR, _("API_ERROR_GET_NAMED_DIMFROMVAR")); 580 addErrorMessage(&strErr, API_ERROR_GET_NAMED_DIMFROMVAR, _("%s: Unable to get dimension from variable \"%s\""), "getDimFromNamedVar", _pstName);
591 return strErr; 581 return strErr;
592 } 582 }
593 583
diff --git a/scilab/modules/api_scilab/src/cpp/api_double.cpp b/scilab/modules/api_scilab/src/cpp/api_double.cpp
index 56163cf..4814612 100644
--- a/scilab/modules/api_scilab/src/cpp/api_double.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_double.cpp
@@ -46,7 +46,7 @@ StrErr getComplexZMatrixOfDouble(void* _pvCtx, int* _piAddress, int* _piRows, in
46 strErr = getCommonMatrixOfDouble(_pvCtx, _piAddress, isVarComplex(_pvCtx, _piAddress), _piRows, _piCols, &pdblReal, &pdblImg); 46 strErr = getCommonMatrixOfDouble(_pvCtx, _piAddress, isVarComplex(_pvCtx, _piAddress), _piRows, _piCols, &pdblReal, &pdblImg);
47 if(strErr.iErr) 47 if(strErr.iErr)
48 { 48 {
49 addErrorMessage(&strErr, API_ERROR_GET_ZDOUBLE, _("API_ERROR_GET_ZDOUBLE")); 49 addErrorMessage(&strErr, API_ERROR_GET_ZDOUBLE, _("%s: Unable to get argument #%d"), "getComplexZMatrixOfDouble", getRhsFromAddress(_pvCtx, _piAddress));
50 return strErr; 50 return strErr;
51 } 51 }
52 52
@@ -60,36 +60,27 @@ StrErr getCommonMatrixOfDouble(void* _pvCtx, int* _piAddress, int _iComplex, int
60 int iType = 0; 60 int iType = 0;
61 if( _piAddress == NULL) 61 if( _piAddress == NULL)
62 { 62 {
63 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 63 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), _iComplex ? "getComplexMatrixOfDouble" : "getMatrixOfDouble");
64 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("API_ERROR_GET_DOUBLE"));
65 return strErr; 64 return strErr;
66 } 65 }
67 66
68 strErr = getVarType(_pvCtx, _piAddress, &iType); 67 strErr = getVarType(_pvCtx, _piAddress, &iType);
69 if(strErr.iErr) 68 if(strErr.iErr || iType != sci_matrix)
70 { 69 {
71 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("API_ERROR_GET_DOUBLE")); 70 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), _iComplex ? "getComplexMatrixOfDouble" : "getMatrixOfDouble", _("double matrix"));
72 return strErr;
73 }
74
75 if(iType != sci_matrix)
76 {
77 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE"));
78 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("API_ERROR_GET_DOUBLE"));
79 return strErr; 71 return strErr;
80 } 72 }
81 73
82 if(isVarComplex(_pvCtx, _piAddress) != _iComplex) 74 if(isVarComplex(_pvCtx, _piAddress) != _iComplex)
83 { 75 {
84 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("API_ERROR_INVALID_COMPLEXITY")); 76 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("%s: Bad call to get a non complex matrix"), "getComplexMatrixOfDouble");
85 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("API_ERROR_GET_DOUBLE"));
86 return strErr; 77 return strErr;
87 } 78 }
88 79
89 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 80 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
90 if(strErr.iErr) 81 if(strErr.iErr)
91 { 82 {
92 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("API_ERROR_GET_DOUBLE")); 83 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE, _("%s: Unable to get argument #%d"), _iComplex ? "getComplexMatrixOfDouble" : "getMatrixOfDouble", getRhsFromAddress(_pvCtx, _piAddress));
93 return strErr; 84 return strErr;
94 } 85 }
95 86
@@ -112,7 +103,7 @@ StrErr allocMatrixOfDouble(void* _pvCtx, int _iVar, int _iRows, int _iCols, doub
112 strErr = allocCommonMatrixOfDouble(_pvCtx, _iVar, 0, _iRows, _iCols, &pdblReal, NULL); 103 strErr = allocCommonMatrixOfDouble(_pvCtx, _iVar, 0, _iRows, _iCols, &pdblReal, NULL);
113 if(strErr.iErr) 104 if(strErr.iErr)
114 { 105 {
115 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE, _("API_ERROR_ALLOC_DOUBLE")); 106 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfDouble");
116 return strErr; 107 return strErr;
117 } 108 }
118 109
@@ -130,7 +121,7 @@ StrErr allocComplexMatrixOfDouble(void* _pvCtx, int _iVar, int _iRows, int _iCol
130 strErr = allocCommonMatrixOfDouble(_pvCtx, _iVar, 1, _iRows, _iCols, &pdblReal, &pdblImg); 121 strErr = allocCommonMatrixOfDouble(_pvCtx, _iVar, 1, _iRows, _iCols, &pdblReal, &pdblImg);
131 if(strErr.iErr) 122 if(strErr.iErr)
132 { 123 {
133 addErrorMessage(&strErr, API_ERROR_ALLOC_COMPLEX_DOUBLE, _("API_ERROR_ALLOC_COMPLEX_DOUBLE")); 124 addErrorMessage(&strErr, API_ERROR_ALLOC_COMPLEX_DOUBLE, _("%s: Unable to create variable in Scilab memory"), "allocComplexMatrixOfDouble");
134 return strErr; 125 return strErr;
135 } 126 }
136 127
@@ -146,6 +137,14 @@ StrErr allocCommonMatrixOfDouble(void* _pvCtx, int _iVar, int _iComplex, int _iR
146 int iAddr = *Lstk(iNewPos); 137 int iAddr = *Lstk(iNewPos);
147 int* piAddr = NULL; 138 int* piAddr = NULL;
148 139
140 int iMemSize = _iRows * _iCols * (_iComplex + 1) + 2;
141 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr));
142 if (iMemSize > iFreeSpace)
143 {
144 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
145 return strErr;
146 }
147
149 getNewVarAddressFromPosition(_pvCtx, iNewPos, &piAddr); 148 getNewVarAddressFromPosition(_pvCtx, iNewPos, &piAddr);
150 fillCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg); 149 fillCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg);
151 updateInterSCI(_iVar, '$', iAddr, sadr(iadr(iAddr) + 4)); 150 updateInterSCI(_iVar, '$', iAddr, sadr(iadr(iAddr) + 4));
@@ -186,7 +185,7 @@ StrErr createMatrixOfDouble(void* _pvCtx, int _iVar, int _iRows, int _iCols, dou
186 strErr = allocMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal); 185 strErr = allocMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal);
187 if(strErr.iErr) 186 if(strErr.iErr)
188 { 187 {
189 addErrorMessage(&strErr, API_ERROR_ALLOC_COMPLEX_DOUBLE, _("API_ERROR_ALLOC_COMPLEX_DOUBLE")); 188 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE, _("%s: Unable to create variable in Scilab memory"), "allocComplexMatrixOfDouble");
190 return strErr; 189 return strErr;
191 } 190 }
192 191
@@ -206,7 +205,7 @@ StrErr createComplexMatrixOfDouble(void* _pvCtx, int _iVar, int _iRows, int _iCo
206 strErr = allocComplexMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal, &pdblImg); 205 strErr = allocComplexMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal, &pdblImg);
207 if(strErr.iErr) 206 if(strErr.iErr)
208 { 207 {
209 addErrorMessage(&strErr, API_ERROR_CREATE_COMPLEX_DOUBLE, _("API_ERROR_CREATE_COMPLEX_DOUBLE")); 208 addErrorMessage(&strErr, API_ERROR_CREATE_COMPLEX_DOUBLE, _("%s: Unable to create variable in Scilab memory"), "allocComplexMatrixOfDouble");
210 return strErr; 209 return strErr;
211 } 210 }
212 211
@@ -225,7 +224,7 @@ StrErr createComplexZMatrixOfDouble(void* _pvCtx, int _iVar, int _iRows, int _iC
225 strErr = allocComplexMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal, &pdblImg); 224 strErr = allocComplexMatrixOfDouble(_pvCtx, _iVar, _iRows, _iCols, &pdblReal, &pdblImg);
226 if(strErr.iErr) 225 if(strErr.iErr)
227 { 226 {
228 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE, _("API_ERROR_CREATE_ZDOUBLE")); 227 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE, _("%s: Unable to create variable in Scilab memory"), "allocComplexMatrixOfDouble");
229 return strErr; 228 return strErr;
230 } 229 }
231 230
@@ -291,6 +290,14 @@ StrErr createCommunNamedMatrixOfDouble(void* _pvCtx, char* _pstName, int _iCompl
291 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName)); 290 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName));
292 Top = Top + Nbvars + 1; 291 Top = Top + Nbvars + 1;
293 292
293 int iMemSize = _iRows * _iCols * (_iComplex + 1) + 2;
294 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(Top));
295 if (iMemSize > iFreeSpace)
296 {
297 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
298 return strErr;
299 }
300
294 getNewVarAddressFromPosition(_pvCtx, Top, &piAddr); 301 getNewVarAddressFromPosition(_pvCtx, Top, &piAddr);
295 302
296 //write matrix information 303 //write matrix information
@@ -336,14 +343,14 @@ StrErr readCommonNamedMatrixOfDouble(void* _pvCtx, char* _pstName, int _iComplex
336 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 343 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
337 if(strErr.iErr) 344 if(strErr.iErr)
338 { 345 {
339 addErrorMessage(&strErr, API_ERROR_READ_NAMED_DOUBLE, _("API_ERROR_READ_NAMED_DOUBLE")); 346 addErrorMessage(&strErr, API_ERROR_READ_NAMED_DOUBLE, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexMatrixOfDouble" : "readNamedMatrixOfDouble", _pstName);
340 return strErr; 347 return strErr;
341 } 348 }
342 349
343 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, &pdblReal, &pdblImg); 350 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, &pdblReal, &pdblImg);
344 if(strErr.iErr) 351 if(strErr.iErr)
345 { 352 {
346 addErrorMessage(&strErr, API_ERROR_READ_NAMED_DOUBLE, _("API_ERROR_READ_NAMED_DOUBLE")); 353 addErrorMessage(&strErr, API_ERROR_READ_NAMED_DOUBLE, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexMatrixOfDouble" : "readNamedMatrixOfDouble", _pstName);
347 return strErr; 354 return strErr;
348 } 355 }
349 356
diff --git a/scilab/modules/api_scilab/src/cpp/api_error.cpp b/scilab/modules/api_scilab/src/cpp/api_error.cpp
index 4dc4c84..7c704c1 100644
--- a/scilab/modules/api_scilab/src/cpp/api_error.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_error.cpp
@@ -23,13 +23,48 @@
23#include "strdup_windows.h" 23#include "strdup_windows.h"
24#endif 24#endif
25#include "localization.h" 25#include "localization.h"
26
27extern "C" 26extern "C"
28{ 27{
28 #include "stackinfo.h"
29 #include "mode_exec.h" 29 #include "mode_exec.h"
30} 30}
31 31
32int addErrorMessage(StrErr* _pstrErr, int _iErr, char* _pstMsg, ...) 32int addStackSizeError(StrErr* _pstrErr, char* _pstCaller, int _iNeeded)
33{
34 char pstMsg1[bsiz];
35 char pstMsg2[bsiz];
36 char pstMsg3[bsiz];
37 char pstMsg4[bsiz];
38 char pstMsg5[bsiz];
39
40 int Memory_used_for_variables = 0;
41 int Total_Memory_available = 0;
42
43 C2F(getstackinfo)(&Total_Memory_available,&Memory_used_for_variables);
44
45#ifdef _MSC_VER
46 sprintf_s(pstMsg1, bsiz, "%s\n%s", _pstCaller, _("stack size exceeded!\n"));
47 sprintf_s(pstMsg2, bsiz, _("Use stacksize function to increase it.\n"));
48 sprintf_s(pstMsg3, bsiz, _("Memory used for variables: %d\n"),Memory_used_for_variables);
49 sprintf_s(pstMsg4, bsiz, _("Intermediate memory needed: %d\n"),_iNeeded);
50 sprintf_s(pstMsg5, bsiz, _("Total memory available: %d\n"),Total_Memory_available);
51#else
52 sprintf(pstMsg1, _("stack size exceeded!\n"));
53 sprintf(pstMsg2, _("Use stacksize function to increase it.\n"));
54 sprintf(pstMsg3, _("Memory used for variables: %d\n"),Memory_used_for_variables);
55 sprintf(pstMsg4, _("Intermediate memory needed: %d\n"),_iNeeded);
56 sprintf(pstMsg5, _("Total memory available: %d\n"),Total_Memory_available);
57#endif
58
59 strcat(pstMsg1, pstMsg2);
60 strcat(pstMsg1, pstMsg3);
61 strcat(pstMsg1, pstMsg4);
62 strcat(pstMsg1, pstMsg5);
63
64 return addErrorMessage(_pstrErr, 17, pstMsg1);
65}
66
67int addErrorMessage(StrErr* _pstrErr, int _iErr, const char* _pstMsg, ...)
33{ 68{
34 int iRet = 0; 69 int iRet = 0;
35 char pstMsg[bsiz]; 70 char pstMsg[bsiz];
@@ -64,7 +99,7 @@ int printError(StrErr* _pstrErr, int _iLastMsg)
64 return 0; 99 return 0;
65 } 100 }
66 101
67 SciError(_pstrErr->iErr); 102 SciStoreError(_pstrErr->iErr);
68 103
69 if(iMode == SILENT_EXEC_MODE) 104 if(iMode == SILENT_EXEC_MODE)
70 { 105 {
@@ -73,15 +108,19 @@ int printError(StrErr* _pstrErr, int _iLastMsg)
73 108
74 if(_iLastMsg) 109 if(_iLastMsg)
75 { 110 {
76 sciprint(_("API error: %s"), _pstrErr->pstMsg[0]); 111 sciprint(_("API Error:\n"));
112 sciprint(_("\tin %s\n"), _pstrErr->pstMsg[0]);
77 } 113 }
78 else 114 else
79 { 115 {
80 for(int i = _pstrErr->iMsgCount - 1; i >= 0 ;i--) 116 sciprint(_("API Error:\n"));
117
118 // for(int i = 0 ; i < _pstrErr->iMsgCount ;i++)
119 for(int i = _pstrErr->iMsgCount - 1 ; i >= 0 ; i--)
81 { 120 {
82 sciprint(_("API error: %s"), _pstrErr->pstMsg[i]); 121// if(i == 0)
122 sciprint(_("\tin %s\n"), _pstrErr->pstMsg[i]);
83 } 123 }
84 sciprint("\n");
85 } 124 }
86 return 0; 125 return 0;
87} 126}
@@ -95,3 +134,4 @@ char* getErrorMessage(StrErr _strErr)
95 134
96 return _strErr.pstMsg[0]; 135 return _strErr.pstMsg[0];
97} 136}
137
diff --git a/scilab/modules/api_scilab/src/cpp/api_int.cpp b/scilab/modules/api_scilab/src/cpp/api_int.cpp
index bd073e1..4beeb6b 100644
--- a/scilab/modules/api_scilab/src/cpp/api_int.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_int.cpp
@@ -27,15 +27,13 @@ StrErr getMatrixOfIntegerPrecision(void* _pvCtx, int* _piAddress, int* _piPrecis
27 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 27 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
28 if(_piAddress == NULL) 28 if(_piAddress == NULL)
29 { 29 {
30 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 30 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getMatrixOfIntegerPrecision");
31 addErrorMessage(&strErr, API_ERROR_GET_INT_PRECISION, _("API_ERROR_GET_INT_PRECISION"));
32 return strErr; 31 return strErr;
33 } 32 }
34 33
35 if(_piAddress[0] != sci_ints) 34 if(_piAddress[0] != sci_ints)
36 { 35 {
37 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 36 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getMatrixOfIntegerPrecision", _("int matrix"));
38 addErrorMessage(&strErr, API_ERROR_GET_INT_PRECISION, _("API_ERROR_GET_INT_PRECISION"));
39 return strErr; 37 return strErr;
40 } 38 }
41 39
@@ -80,22 +78,20 @@ StrErr getCommonMatrixOfInteger(void* _pvCtx, int* _piAddress, int _iPrecision,
80 78
81 if(_piAddress == NULL) 79 if(_piAddress == NULL)
82 { 80 {
83 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 81 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getMatrixOfInteger");
84 addErrorMessage(&strErr, API_ERROR_GET_INT, _("API_ERROR_GET_INT"));
85 return strErr; 82 return strErr;
86 } 83 }
87 84
88 strErr = getMatrixOfIntegerPrecision(_pvCtx, _piAddress, &iPrec); 85 strErr = getMatrixOfIntegerPrecision(_pvCtx, _piAddress, &iPrec);
89 if(strErr.iErr) 86 if(strErr.iErr)
90 { 87 {
91 addErrorMessage(&strErr, API_ERROR_GET_INT, _("API_ERROR_GET_INT")); 88 addErrorMessage(&strErr, API_ERROR_GET_INT, _("%s: Unable to get argument #%d"), "getMatrixOfInteger", getRhsFromAddress(_pvCtx, _piAddress));
92 return strErr; 89 return strErr;
93 } 90 }
94 91
95 if(iPrec != _iPrecision) 92 if(iPrec != _iPrecision)
96 { 93 {
97 addErrorMessage(&strErr, API_ERROR_GET_INT, _("API_ERROR_GET_INT")); 94 addErrorMessage(&strErr, API_ERROR_GET_INT, _("%s: Unable to get argument #%d"), "getMatrixOfInteger", getRhsFromAddress(_pvCtx, _piAddress));
98 addErrorMessage(&strErr, API_ERROR_GET_INT_PRECISION, _("API_ERROR_GET_INT_PRECISION"));
99 return strErr; 95 return strErr;
100 } 96 }
101 97
@@ -115,7 +111,7 @@ StrErr createMatrixOfUnsignedInteger8(void* _pvCtx, int _iVar, int _iRows, int _
115 strErr = allocMatrixOfUnsignedInteger8(_pvCtx, _iVar, _iRows, _iCols, &pucData8); 111 strErr = allocMatrixOfUnsignedInteger8(_pvCtx, _iVar, _iRows, _iCols, &pucData8);
116 if(strErr.iErr) 112 if(strErr.iErr)
117 { 113 {
118 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 114 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfUnsignedInteger8");
119 return strErr; 115 return strErr;
120 } 116 }
121 117
@@ -132,7 +128,7 @@ StrErr createMatrixOfUnsignedInteger16(void* _pvCtx, int _iVar, int _iRows, int
132 strErr = allocMatrixOfUnsignedInteger16(_pvCtx, _iVar, _iRows, _iCols, &psData16); 128 strErr = allocMatrixOfUnsignedInteger16(_pvCtx, _iVar, _iRows, _iCols, &psData16);
133 if(strErr.iErr) 129 if(strErr.iErr)
134 { 130 {
135 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 131 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfUnsignedInteger16");
136 return strErr; 132 return strErr;
137 } 133 }
138 134
@@ -149,7 +145,7 @@ StrErr createMatrixOfUnsignedInteger32(void* _pvCtx, int _iVar, int _iRows, int
149 strErr = allocMatrixOfUnsignedInteger32(_pvCtx, _iVar, _iRows, _iCols, &piData32); 145 strErr = allocMatrixOfUnsignedInteger32(_pvCtx, _iVar, _iRows, _iCols, &piData32);
150 if(strErr.iErr) 146 if(strErr.iErr)
151 { 147 {
152 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 148 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfUnsignedInteger32");
153 return strErr; 149 return strErr;
154 } 150 }
155 151
@@ -166,7 +162,7 @@ StrErr createMatrixOfInteger8(void* _pvCtx, int _iVar, int _iRows, int _iCols, c
166 strErr = allocMatrixOfInteger8(_pvCtx, _iVar, _iRows, _iCols, &pcData8); 162 strErr = allocMatrixOfInteger8(_pvCtx, _iVar, _iRows, _iCols, &pcData8);
167 if(strErr.iErr) 163 if(strErr.iErr)
168 { 164 {
169 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 165 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfInteger8");
170 return strErr; 166 return strErr;
171 } 167 }
172 168
@@ -183,7 +179,7 @@ StrErr createMatrixOfInteger16(void* _pvCtx, int _iVar, int _iRows, int _iCols,
183 strErr = allocMatrixOfInteger16(_pvCtx, _iVar, _iRows, _iCols, &psData16); 179 strErr = allocMatrixOfInteger16(_pvCtx, _iVar, _iRows, _iCols, &psData16);
184 if(strErr.iErr) 180 if(strErr.iErr)
185 { 181 {
186 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 182 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfInteger16");
187 return strErr; 183 return strErr;
188 } 184 }
189 185
@@ -200,7 +196,7 @@ StrErr createMatrixOfInteger32(void* _pvCtx, int _iVar, int _iRows, int _iCols,
200 strErr = allocMatrixOfInteger32(_pvCtx, _iVar, _iRows, _iCols, &piData32); 196 strErr = allocMatrixOfInteger32(_pvCtx, _iVar, _iRows, _iCols, &piData32);
201 if(strErr.iErr) 197 if(strErr.iErr)
202 { 198 {
203 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 199 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfInteger32");
204 return strErr; 200 return strErr;
205 } 201 }
206 202
@@ -218,7 +214,7 @@ StrErr createMatrixOfInteger64(void* _pvCtx, int _iVar, int _iRows, int _iCols,
218 strErr = allocMatrixOfInteger64(_iVar, _iRows, _iCols, &pllData64); 214 strErr = allocMatrixOfInteger64(_iVar, _iRows, _iCols, &pllData64);
219 if(strErr.iErr) 215 if(strErr.iErr)
220 { 216 {
221 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("API_ERROR_CREATE_INT")); 217 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfInteger64");
222 return strErr; 218 return strErr;
223 } 219 }
224 220
@@ -239,7 +235,7 @@ StrErr allocMatrixOfInteger8(void* _pvCtx, int _iVar, int _iRows, int _iCols, ch
239 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT8, _iRows, _iCols, (void**)&pcData8); 235 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT8, _iRows, _iCols, (void**)&pcData8);
240 if(strErr.iErr) 236 if(strErr.iErr)
241 { 237 {
242 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 238 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfInteger8");
243 return strErr; 239 return strErr;
244 } 240 }
245 241
@@ -259,7 +255,7 @@ StrErr allocMatrixOfInteger16(void* _pvCtx, int _iVar, int _iRows, int _iCols, s
259 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT16, _iRows, _iCols, (void**)&psData16); 255 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT16, _iRows, _iCols, (void**)&psData16);
260 if(strErr.iErr) 256 if(strErr.iErr)
261 { 257 {
262 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 258 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfInteger16");
263 return strErr; 259 return strErr;
264 } 260 }
265 261
@@ -279,7 +275,7 @@ StrErr allocMatrixOfInteger32(void* _pvCtx, int _iVar, int _iRows, int _iCols, i
279 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&piData32); 275 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&piData32);
280 if(strErr.iErr) 276 if(strErr.iErr)
281 { 277 {
282 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 278 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfInteger32");
283 return strErr; 279 return strErr;
284 } 280 }
285 281
@@ -300,7 +296,7 @@ StrErr allocMatrixOfInteger64(void* _pvCtx, int _iVar, int _iRows, int _iCols, l
300 strErr = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT64, _iRows, _iCols, (void**)&piData32); 296 strErr = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_INT64, _iRows, _iCols, (void**)&piData32);
301 if(strErr.iErr) 297 if(strErr.iErr)
302 { 298 {
303 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 299 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfInteger64");
304 return strErr; 300 return strErr;
305 } 301 }
306 302
@@ -321,7 +317,7 @@ StrErr allocMatrixOfUnsignedInteger8(void* _pvCtx, int _iVar, int _iRows, int _i
321 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_UINT8, _iRows, _iCols, (void**)&pucData8); 317 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_UINT8, _iRows, _iCols, (void**)&pucData8);
322 if(strErr.iErr) 318 if(strErr.iErr)
323 { 319 {
324 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 320 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfUnsignedInteger8");
325 return strErr; 321 return strErr;
326 } 322 }
327 323
@@ -341,7 +337,7 @@ StrErr allocMatrixOfUnsignedInteger16(void* _pvCtx, int _iVar, int _iRows, int _
341 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_UINT16, _iRows, _iCols, (void**)&pusData16); 337 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_UINT16, _iRows, _iCols, (void**)&pusData16);
342 if(strErr.iErr) 338 if(strErr.iErr)
343 { 339 {
344 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 340 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfUnsignedInteger16");
345 return strErr; 341 return strErr;
346 } 342 }
347 343
@@ -361,7 +357,7 @@ StrErr allocMatrixOfUnsignedInteger32(void* _pvCtx, int _iVar, int _iRows, int _
361 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&puiData32); 357 strErr = allocCommonMatrixOfInteger(_pvCtx, _iVar, piAddr, SCI_INT32, _iRows, _iCols, (void**)&puiData32);
362 if(strErr.iErr) 358 if(strErr.iErr)
363 { 359 {
364 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 360 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfUnsignedInteger32");
365 return strErr; 361 return strErr;
366 } 362 }
367 363
@@ -382,7 +378,7 @@ StrErr allocMatrixOfUnsignedInteger64(void* _pvCtx, int _iVar, int _iRows, int _
382 strErr = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT64, _iRows, _iCols, (void**)&puiData32); 378 strErr = allocCommonMatrixOfInteger(_iVar, piAddr, SCI_UINT64, _iRows, _iCols, (void**)&puiData32);
383 if(strErr.iErr) 379 if(strErr.iErr)
384 { 380 {
385 addErrorMessage(&strErr, API_ERROR_ALLOC_INT, _("API_ERROR_ALLOC_INT")); 381 addErrorMessage(&strErr, API_ERROR_CREATE_INT, _("%s: Unable to create variable in Scilab memory"), "allocMatrixOfUnsignedInteger64");
386 return strErr; 382 return strErr;
387 } 383 }
388 384
@@ -403,6 +399,13 @@ StrErr allocCommonMatrixOfInteger(void* _pvCtx, int _iVar, int *_piAddress, int
403 int iMod = (iSize % iRate) == 0 ? 0 : 1; 399 int iMod = (iSize % iRate) == 0 ? 0 : 1;
404 int iTotalSize = iDouble + iMod; 400 int iTotalSize = iDouble + iMod;
405 401
402 int iMemSize = iTotalSize + 2;
403 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr));
404 if (iMemSize > iFreeSpace)
405 {
406 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
407 return strErr;
408 }
406 409
407 fillCommonMatrixOfInteger(_pvCtx, _piAddress, _iPrecision, _iRows, _iCols, pvData); 410 fillCommonMatrixOfInteger(_pvCtx, _piAddress, _iPrecision, _iRows, _iCols, pvData);
408 updateInterSCI(_iVar, '$', iAddr, iAddr + 4); 411 updateInterSCI(_iVar, '$', iAddr, iAddr + 4);
@@ -479,6 +482,14 @@ StrErr createCommonNamedMatrixOfInteger(void* _pvCtx, char* _pstName, int _iPrec
479 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName)); 482 C2F(str2name)(_pstName, iVarID, (int)strlen(_pstName));
480 Top = Top + Nbvars + 1; 483 Top = Top + Nbvars + 1;
481 484
485 int iMemSize = iTotalSize + 2;
486 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(Top));
487 if (iMemSize > iFreeSpace)
488 {
489 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
490 return strErr;
491 }
492
482 getNewVarAddressFromPosition(_pvCtx, Top, &piAddr); 493 getNewVarAddressFromPosition(_pvCtx, Top, &piAddr);
483 494
484 //write matrix information 495 //write matrix information
@@ -507,15 +518,14 @@ StrErr getNamedMatrixOfIntegerPrecision(void* _pvCtx, char* _pstName, int* _piPr
507 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 518 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
508 if(strErr.iErr) 519 if(strErr.iErr)
509 { 520 {
510 addErrorMessage(&strErr, API_ERROR_GET_NAMED_INT_PRECISION, _("API_ERROR_GET_NAMED_INT_PRECISION")); 521 addErrorMessage(&strErr, API_ERROR_GET_NAMED_INT_PRECISION, _("%s: Unable to get precision of variable \"%s\""), "getNamedMatrixOfIntegerPrecision", _pstName);
511 return strErr; 522 return strErr;
512 } 523 }
513 524
514 //check variable type 525 //check variable type
515 if(piAddr[0] != sci_ints) 526 if(piAddr[0] != sci_ints)
516 { 527 {
517 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 528 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getNamedMatrixOfIntegerPrecision", _("int matrix"));
518 addErrorMessage(&strErr, API_ERROR_GET_NAMED_INT_PRECISION, _("API_ERROR_GET_NAMED_INT_PRECISION"));
519 return strErr; 529 return strErr;
520 } 530 }
521 531
@@ -570,14 +580,14 @@ StrErr readCommonNamedMatrixOfInteger(void* _pvCtx, char* _pstName, int _iPrecis
570 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 580 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
571 if(strErr.iErr) 581 if(strErr.iErr)
572 { 582 {
573 addErrorMessage(&strErr, API_ERROR_READ_NAMED_INT, _("API_ERROR_READ_NAMED_INT")); 583 addErrorMessage(&strErr, API_ERROR_READ_NAMED_INT, _("%s: Unable to get variable \"%s\""), "readNamedMatrixOfInteger", _pstName);
574 return strErr; 584 return strErr;
575 } 585 }
576 586
577 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, &pvData); 587 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, &pvData);
578 if(strErr.iErr) 588 if(strErr.iErr)
579 { 589 {
580 addErrorMessage(&strErr, API_ERROR_READ_NAMED_INT, _("API_ERROR_READ_NAMED_INT")); 590 addErrorMessage(&strErr, API_ERROR_READ_NAMED_INT, _("%s: Unable to get variable \"%s\""), "readNamedMatrixOfInteger", _pstName);
581 return strErr; 591 return strErr;
582 } 592 }
583 iSize = *_piRows * *_piCols; 593 iSize = *_piRows * *_piCols;
diff --git a/scilab/modules/api_scilab/src/cpp/api_list.cpp b/scilab/modules/api_scilab/src/cpp/api_list.cpp
index f44a501..2aedc72 100644
--- a/scilab/modules/api_scilab/src/cpp/api_list.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_list.cpp
@@ -59,7 +59,7 @@ static StrErr createCommomMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName
59static StrErr readCommonMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, double* _pdblReal, double* _pdblImg); 59static StrErr readCommonMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, double* _pdblReal, double* _pdblImg);
60static StrErr allocCommonItemInList(void* _pvCtx, int* _piParent, int _iItemPos, int** _piChildAddr); 60static StrErr allocCommonItemInList(void* _pvCtx, int* _piParent, int _iItemPos, int** _piChildAddr);
61static StrErr fillMatrixOfBoolInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int** _piBool); 61static StrErr fillMatrixOfBoolInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, int** _piBool);
62static StrErr getCommonxMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg); 62static StrErr getCommonMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
63static StrErr createCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg); 63static StrErr createCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg);
64static StrErr fillCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen); 64static StrErr fillCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, char* _pstVarName, int _iComplex, int _iRows, int _iCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg, int* _piTotalLen);
65static StrErr fillCommonMatrixOfStringInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pstStrings, int* _piTotalLen); 65static StrErr fillCommonMatrixOfStringInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iRows, int _iCols, char** _pstStrings, int* _piTotalLen);
@@ -67,6 +67,24 @@ static StrErr readCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, in
67static StrErr createCommonSparseMatrixInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, int _iNbItem, int* _piNbItemRow, int* _piColPos, double* _pdblReal, double* _pdblImg); 67static StrErr createCommonSparseMatrixInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, int _iNbItem, int* _piNbItemRow, int* _piColPos, double* _pdblReal, double* _pdblImg);
68static StrErr createCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, int _iNbItem, int* _piNbItemRow, int* _piColPos, double* _pdblReal, double* _pdblImg); 68static StrErr createCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int _iItemPos, int _iComplex, int _iRows, int _iCols, int _iNbItem, int* _piNbItemRow, int* _piColPos, double* _pdblReal, double* _pdblImg);
69 69
70char* getListTypeName(int _iType)
71{
72 switch(_iType)
73 {
74 case sci_list :
75 return "list";
76 break;
77 case sci_tlist :
78 return "tlist";
79 break;
80 case sci_mlist :
81 return "mlist";
82 break;
83 default:
84 break;
85 }
86 return "";
87}
70StrErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem) 88StrErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem)
71{ 89{
72 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 90 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
@@ -75,7 +93,7 @@ StrErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem)
75 strErr = getVarType(_pvCtx, _piAddress, &iType); 93 strErr = getVarType(_pvCtx, _piAddress, &iType);
76 if(strErr.iErr) 94 if(strErr.iErr)
77 { 95 {
78 addErrorMessage(&strErr, API_ERROR_LIST_ITEM_NUMBER, _("API_ERROR_LIST_ITEM_NUMBER")); 96 addErrorMessage(&strErr, API_ERROR_LIST_ITEM_NUMBER, _("%s: Unable to get item number of list"), "getListItemNumber");
79 return strErr; 97 return strErr;
80 } 98 }
81 switch(iType) 99 switch(iType)
@@ -86,8 +104,7 @@ StrErr getListItemNumber(void* _pvCtx, int* _piAddress, int* _piNbItem)
86 *_piNbItem = _piAddress[1]; 104 *_piNbItem = _piAddress[1];
87 break; 105 break;
88 default : 106 default :
89 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("API_ERROR_INVALID_LIST_TYPE")); 107 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("%s: Invalid argument type, %s excepted"), "getListItemNumber", _("list"));
90 addErrorMessage(&strErr, API_ERROR_LIST_ITEM_NUMBER, _("API_ERROR_LIST_ITEM_NUMBER"));
91 return strErr; 108 return strErr;
92 } 109 }
93 return strErr; 110 return strErr;
@@ -104,7 +121,13 @@ StrErr getListItemAddress(void* _pvCtx, int* _piAddress, int _iItemNum, int** _p
104 strErr = getListItemNumber(_pvCtx, _piAddress, &iItem); 121 strErr = getListItemNumber(_pvCtx, _piAddress, &iItem);
105 if(strErr.iErr) 122 if(strErr.iErr)
106 { 123 {
107 addErrorMessage(&strErr, API_ERROR_GET_ITEM_ADDRESS, _("API_ERROR_GET_ITEM_ADDRESS")); 124 addErrorMessage(&strErr, API_ERROR_GET_ITEM_ADDRESS, _("%s: Unable to get address of item #%d in argument #%d"), "getListItemAddress", _iItemNum + 1, getRhsFromAddress(_pvCtx, _piAddress));
125 return strErr;
126 }
127
128 if(_iItemNum > iItem)
129 {
130 addErrorMessage(&strErr, API_ERROR_GET_ITEM_ADDRESS, _("%s: Unable to get address of item #%d in argument #%d"), "getListItemAddress", _iItemNum + 1, getRhsFromAddress(_pvCtx, _piAddress));
108 return strErr; 131 return strErr;
109 } 132 }
110 133
@@ -162,7 +185,7 @@ static StrErr createCommonNamedList(void* _pvCtx, char* _pstName, int _iListType
162 strErr = fillCommonList(_pvCtx, piAddr, _iListType, _iNbItem); 185 strErr = fillCommonList(_pvCtx, piAddr, _iListType, _iNbItem);
163 if(strErr.iErr) 186 if(strErr.iErr)
164 { 187 {
165 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_LIST, _("API_ERROR_CREATE_NAMED_LIST")); 188 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_LIST,_("%s: Unable to create %s named \"%s\""), "createNamedList", getListTypeName(_iListType), _pstName);
166 return strErr; 189 return strErr;
167 } 190 }
168 191
@@ -196,7 +219,7 @@ static StrErr createCommonList(void* _pvCtx, int _iVar, int _iListType, int _iNb
196 strErr = fillCommonList(_pvCtx, piAddr, _iListType, _iNbItem); 219 strErr = fillCommonList(_pvCtx, piAddr, _iListType, _iNbItem);
197 if(strErr.iErr) 220 if(strErr.iErr)
198 { 221 {
199 addErrorMessage(&strErr, API_ERROR_CREATE_LIST, _("API_ERROR_CREATE_LIST")); 222 addErrorMessage(&strErr, API_ERROR_CREATE_LIST, _("%s: Unable to create variable in Scilab memory"), "createList");
200 return strErr; 223 return strErr;
201 } 224 }
202 225
@@ -249,21 +272,20 @@ static StrErr readCommonNamedList(void* _pvCtx, char* _pstName, int _iListType,
249 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 272 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
250 if(strErr.iErr) 273 if(strErr.iErr)
251 { 274 {
252 addErrorMessage(&strErr, API_ERROR_READ_NAMED_LIST, _("API_ERROR_READ_NAMED_LIST")); 275 addErrorMessage(&strErr, API_ERROR_READ_NAMED_LIST, _("%s: Unable to get variable \"%s\""), "readNamedList", _pstName);
253 return strErr; 276 return strErr;
254 } 277 }
255 278
256 if(piAddr[0] != _iListType) 279 if(piAddr[0] != _iListType)
257 { 280 {
258 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("API_ERROR_INVALID_LIST_TYPE")); 281 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("%s: Invalid argument type, %s excepted"), "readNamedList", getListTypeName(_iListType));
259 addErrorMessage(&strErr, API_ERROR_READ_NAMED_LIST, _("API_ERROR_READ_NAMED_LIST"));
260 return strErr; 282 return strErr;
261 } 283 }
262 284
263 strErr = getListItemNumber(_pvCtx, piAddr, &iNbItem); 285 strErr = getListItemNumber(_pvCtx, piAddr, &iNbItem);
264 if(strErr.iErr) 286 if(strErr.iErr)
265 { 287 {
266 addErrorMessage(&strErr, API_ERROR_READ_NAMED_LIST, _("API_ERROR_READ_NAMED_LIST")); 288 addErrorMessage(&strErr, API_ERROR_READ_NAMED_LIST, _("%s: Unable to get variable \"%s\""), "readNamedList", _pstName);
267 return strErr; 289 return strErr;
268 } 290 }
269 291
@@ -295,14 +317,13 @@ StrErr getCommonListInList(void* _pvCtx, int* _piParent, int _iItemPos, int _iLi
295 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, _piAddress); 317 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, _piAddress);
296 if(strErr.iErr) 318 if(strErr.iErr)
297 { 319 {
298 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_LIST, _("API_ERROR_GET_LIST_IN_LIST")); 320 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getListInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
299 return strErr; 321 return strErr;
300 } 322 }
301 323
302 if((*_piAddress)[0] != _iListType) 324 if((*_piAddress)[0] != _iListType)
303 { 325 {
304 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("API_ERROR_INVALID_LIST_TYPE")); 326 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("%s: Invalid argument type, %s excepted"), "getListInList", getListTypeName(_iListType));
305 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_LIST, _("API_ERROR_GET_LIST_IN_LIST"));
306 return strErr; 327 return strErr;
307 } 328 }
308 return strErr; 329 return strErr;
@@ -331,14 +352,13 @@ StrErr getCommomListInNamedList(void* _pvCtx, char* _pstName, int* _piParent, in
331 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 352 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
332 if(strErr.iErr) 353 if(strErr.iErr)
333 { 354 {
334 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_NAMED_LIST, _("API_ERROR_GET_LIST_IN_NAMED_LIST")); 355 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "getListInNamedList", _iItemPos + 1, _pstName);
335 return strErr; 356 return strErr;
336 } 357 }
337 358
338 if(piAddr[0] != _iListType) 359 if(piAddr[0] != _iListType)
339 { 360 {
340 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("API_ERROR_INVALID_LIST_TYPE")); 361 addErrorMessage(&strErr, API_ERROR_INVALID_LIST_TYPE, _("%s: Invalid argument type, %s excepted"), "getListInNamedList", getListTypeName(_iListType));
341 addErrorMessage(&strErr, API_ERROR_GET_LIST_IN_NAMED_LIST, _("API_ERROR_GET_LIST_IN_NAMED_LIST"));
342 return strErr; 362 return strErr;
343 } 363 }
344 364
@@ -373,22 +393,21 @@ static StrErr createCommonListInList(void* _pvCtx, int _iVar, int* _piParent, in
373 393
374 if(iNbItem < _iItemPos) 394 if(iNbItem < _iItemPos)
375 { 395 {
376 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 396 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
377 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_LIST, _("API_ERROR_CREATE_LIST_IN_LIST"));
378 return strErr; 397 return strErr;
379 } 398 }
380 399
381 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 400 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
382 if(strErr.iErr) 401 if(strErr.iErr)
383 { 402 {
384 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_LIST, _("API_ERROR_CREATE_LIST_IN_LIST")); 403 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
385 return strErr; 404 return strErr;
386 } 405 }
387 406
388 strErr = fillCommonList(_pvCtx, piChildAddr, _iListType, _iNbItem); 407 strErr = fillCommonList(_pvCtx, piChildAddr, _iListType, _iNbItem);
389 if(strErr.iErr) 408 if(strErr.iErr)
390 { 409 {
391 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_LIST, _("API_ERROR_CREATE_LIST_IN_LIST")); 410 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
392 return strErr; 411 return strErr;
393 } 412 }
394 413
@@ -448,7 +467,7 @@ StrErr createCommonListInNamedList(void* _pvCtx, char* _pstName, int* _piParent,
448 strErr = createCommonListInList(_pvCtx, Top, _piParent, _iItemPos, _iListType, _iNbItem, _piAddress, 1); 467 strErr = createCommonListInList(_pvCtx, Top, _piParent, _iItemPos, _iListType, _iNbItem, _piAddress, 1);
449 if(strErr.iErr) 468 if(strErr.iErr)
450 { 469 {
451 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_NAMED_LIST, _("API_ERROR_CREATE_LIST_IN_NAMED_LIST")); 470 addErrorMessage(&strErr, API_ERROR_CREATE_LIST_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createListInList", _iItemPos + 1, _pstName);
452 return strErr; 471 return strErr;
453 } 472 }
454 473
@@ -472,15 +491,14 @@ StrErr allocCommonItemInList(void* _pvCtx, int* _piParent, int _iItemPos, int**
472 piOffset = _piParent + 2; 491 piOffset = _piParent + 2;
473 if(piOffset[_iItemPos - 1] == -1) 492 if(piOffset[_iItemPos - 1] == -1)
474 {//Previous items wasn't inserted 493 {//Previous items wasn't inserted
475 addErrorMessage(&strErr, API_ERROR_NON_ORDERED_INSERTION, _("API_ERROR_NON_ORDERED_INSERTION")); 494 addErrorMessage(&strErr, API_ERROR_NON_ORDERED_INSERTION, _("%s: Items must be inserted in order"), "allocItemInList");
476 addErrorMessage(&strErr, API_ERROR_ALLOC_IN_LIST, _("API_ERROR_ALLOC_IN_LIST"));
477 return strErr; 495 return strErr;
478 } 496 }
479 497
480 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, _piChildAddr); 498 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, _piChildAddr);
481 if(strErr.iErr) 499 if(strErr.iErr)
482 { 500 {
483 addErrorMessage(&strErr, API_ERROR_ALLOC_IN_LIST, _("API_ERROR_ALLOC_IN_LIST")); 501 addErrorMessage(&strErr, API_ERROR_ALLOC_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "allocItemInList", _iItemPos + 1);
484 return strErr; 502 return strErr;
485 } 503 }
486 504
@@ -509,14 +527,14 @@ static StrErr getCommonMatrixOfDoubleInList(void* _pvCtx, int* _piParent, int _i
509 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 527 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
510 if(strErr.iErr) 528 if(strErr.iErr)
511 { 529 {
512 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE_IN_LIST, _("API_ERROR_GET_DOUBLE_IN_LIST")); 530 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "getComplexMatrixOfDoubleInList" : "getMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
513 return strErr; 531 return strErr;
514 } 532 }
515 533
516 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _pdblReal, _pdblImg); 534 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _pdblReal, _pdblImg);
517 if(strErr.iErr) 535 if(strErr.iErr)
518 { 536 {
519 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE_IN_LIST, _("API_ERROR_GET_DOUBLE_IN_LIST")); 537 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "getComplexMatrixOfDoubleInList" : "getMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
520 return strErr; 538 return strErr;
521 } 539 }
522 return strErr; 540 return strErr;
@@ -541,7 +559,7 @@ static StrErr allocCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piP
541 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg); 559 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg);
542 if(strErr.iErr) 560 if(strErr.iErr)
543 { 561 {
544 addErrorMessage(&strErr, API_ERROR_GET_DOUBLE_IN_LIST, _("API_ERROR_GET_DOUBLE_IN_LIST")); 562 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
545 return strErr; 563 return strErr;
546 } 564 }
547 565
@@ -567,14 +585,13 @@ static StrErr fillCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piPa
567 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 585 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
568 if(strErr.iErr) 586 if(strErr.iErr)
569 { 587 {
570 addErrorMessage(&strErr, API_ERROR_FILL_DOUBLE_IN_LIST, _("API_ERROR_FILL_DOUBLE_IN_LIST")); 588 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
571 return strErr; 589 return strErr;
572 } 590 }
573 591
574 if(iNbItem < _iItemPos) 592 if(iNbItem < _iItemPos)
575 { 593 {
576 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 594 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfDoubleInList" : "createMatrixOfDoubleInList", _iItemPos + 1);
577 addErrorMessage(&strErr, API_ERROR_FILL_DOUBLE_IN_LIST, _("API_ERROR_FILL_DOUBLE_IN_LIST"));
578 return strErr; 595 return strErr;
579 } 596 }
580 597
@@ -582,14 +599,14 @@ static StrErr fillCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piPa
582 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 599 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
583 if(strErr.iErr) 600 if(strErr.iErr)
584 { 601 {
585 addErrorMessage(&strErr, API_ERROR_FILL_DOUBLE_IN_LIST, _("API_ERROR_FILL_DOUBLE_IN_LIST")); 602 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
586 return strErr; 603 return strErr;
587 } 604 }
588 605
589 strErr = fillCommonMatrixOfDouble(_pvCtx, piChildAddr, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg); 606 strErr = fillCommonMatrixOfDouble(_pvCtx, piChildAddr, _iComplex, _iRows, _iCols, _pdblReal, _pdblImg);
590 if(strErr.iErr) 607 if(strErr.iErr)
591 { 608 {
592 addErrorMessage(&strErr, API_ERROR_FILL_DOUBLE_IN_LIST, _("API_ERROR_FILL_DOUBLE_IN_LIST")); 609 addErrorMessage(&strErr, API_ERROR_ALLOC_DOUBLE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "allocComplexMatrixOfDoubleInList" : "allocMatrixOfDoubleInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
593 return strErr; 610 return strErr;
594 } 611 }
595 612
@@ -618,7 +635,7 @@ StrErr createComplexZMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piParen
618 strErr = allocCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, 1, _iRows, _iCols, &pdblReal, &pdblImg); 635 strErr = allocCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, 1, _iRows, _iCols, &pdblReal, &pdblImg);
619 if(strErr.iErr) 636 if(strErr.iErr)
620 { 637 {
621 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE_IN_LIST, _("API_ERROR_CREATE_ZDOUBLE_IN_LIST")); 638 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createComplexZMatrixOfDoubleInList", _iItemPos + 1);
622 return strErr; 639 return strErr;
623 } 640 }
624 641
@@ -636,7 +653,7 @@ StrErr createCommonMatrixOfDoubleInList(void* _pvCtx, int _iVar, int* _piParent,
636 strErr = allocCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, &pdblReal, &pdblImg); 653 strErr = allocCommonMatrixOfDoubleInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, &pdblReal, &pdblImg);
637 if(strErr.iErr) 654 if(strErr.iErr)
638 { 655 {
639 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_LIST, _("API_ERROR_CREATE_DOUBLE_IN_LIST")); 656 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfDoubleInList" : "createMatrixOfDoubleInList", _iItemPos + 1);
640 return strErr; 657 return strErr;
641 } 658 }
642 659
@@ -682,7 +699,7 @@ StrErr createComplexZMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int
682 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, Top, _piParent, _iItemPos, 1, _iRows, _iCols, &pdblReal, &pdblImg); 699 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, Top, _piParent, _iItemPos, 1, _iRows, _iCols, &pdblReal, &pdblImg);
683 if(strErr.iErr) 700 if(strErr.iErr)
684 { 701 {
685 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST, _("API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST")); 702 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createComplexZMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
686 return strErr; 703 return strErr;
687 } 704 }
688 705
@@ -691,7 +708,7 @@ StrErr createComplexZMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int
691 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 708 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
692 if(strErr.iErr) 709 if(strErr.iErr)
693 { 710 {
694 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST, _("API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST")); 711 addErrorMessage(&strErr, API_ERROR_CREATE_ZDOUBLE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createComplexZMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
695 return strErr; 712 return strErr;
696 } 713 }
697 714
@@ -730,7 +747,7 @@ StrErr createCommomMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int*
730 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, Top, _piParent, _iItemPos, _iComplex, _iRows, _iCols, &pdblReal, &pdblImg); 747 strErr = fillCommonMatrixOfDoubleInList(_pvCtx, Top, _piParent, _iItemPos, _iComplex, _iRows, _iCols, &pdblReal, &pdblImg);
731 if(strErr.iErr) 748 if(strErr.iErr)
732 { 749 {
733 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST, _("API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST")); 750 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexMatrixOfDoubleInNamedList" : "createMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
734 return strErr; 751 return strErr;
735 } 752 }
736 753
@@ -743,7 +760,7 @@ StrErr createCommomMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName, int*
743 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 760 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
744 if(strErr.iErr) 761 if(strErr.iErr)
745 { 762 {
746 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST, _("API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST")); 763 addErrorMessage(&strErr, API_ERROR_CREATE_DOUBLE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexMatrixOfDoubleInNamedList" : "createMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
747 return strErr; 764 return strErr;
748 } 765 }
749 766
@@ -786,7 +803,7 @@ static StrErr readCommonMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName,
786 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 803 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
787 if(strErr.iErr) 804 if(strErr.iErr)
788 { 805 {
789 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("API_ERROR_READ_DOUBLE_IN_NAMED_LIST")); 806 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""),_iComplex ? "readComplexMatrixOfDoubleInNamedList" : "readMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
790 return strErr; 807 return strErr;
791 } 808 }
792 809
@@ -799,14 +816,14 @@ static StrErr readCommonMatrixOfDoubleInNamedList(void* _pvCtx, char* _pstName,
799 816
800 if(strErr.iErr) 817 if(strErr.iErr)
801 { 818 {
802 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("API_ERROR_READ_DOUBLE_IN_NAMED_LIST")); 819 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""),_iComplex ? "readComplexMatrixOfDoubleInNamedList" : "readMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
803 return strErr; 820 return strErr;
804 } 821 }
805 822
806 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, &pdblReal, &pdblImg); 823 strErr = getCommonMatrixOfDouble(_pvCtx, piAddr, _iComplex, _piRows, _piCols, &pdblReal, &pdblImg);
807 if(strErr.iErr) 824 if(strErr.iErr)
808 { 825 {
809 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("API_ERROR_READ_DOUBLE_IN_NAMED_LIST")); 826 addErrorMessage(&strErr, API_ERROR_READ_DOUBLE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""),_iComplex ? "readComplexMatrixOfDoubleInNamedList" : "readMatrixOfDoubleInNamedList", _iItemPos + 1, _pstName);
810 return strErr; 827 return strErr;
811 } 828 }
812 829
@@ -837,14 +854,14 @@ StrErr getMatrixOfStringInList(void* _pvCtx, int* _piParent, int _iItemPos, int*
837 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 854 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
838 if(strErr.iErr) 855 if(strErr.iErr)
839 { 856 {
840 addErrorMessage(&strErr, API_ERROR_GET_STRING_IN_LIST, _("API_ERROR_GET_STRING_IN_LIST")); 857 addErrorMessage(&strErr, API_ERROR_GET_STRING_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfStringInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
841 return strErr; 858 return strErr;
842 } 859 }
843 860
844 strErr = getMatrixOfString(_pvCtx, piAddr, _piRows, _piCols, _piLength, _pstStrings); 861 strErr = getMatrixOfString(_pvCtx, piAddr, _piRows, _piCols, _piLength, _pstStrings);
845 if(strErr.iErr) 862 if(strErr.iErr)
846 { 863 {
847 addErrorMessage(&strErr, API_ERROR_GET_STRING_IN_LIST, _("API_ERROR_GET_STRING_IN_LIST")); 864 addErrorMessage(&strErr, API_ERROR_GET_STRING_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfStringInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
848 return strErr; 865 return strErr;
849 } 866 }
850 867
@@ -865,28 +882,27 @@ StrErr createMatrixOfStringInList(void* _pvCtx, int _iVar, int* _piParent, int _
865 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 882 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
866 if(strErr.iErr) 883 if(strErr.iErr)
867 { 884 {
868 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("API_ERROR_CREATE_STRING_IN_LIST")); 885 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfStringInList", _iItemPos + 1);
869 return strErr; 886 return strErr;
870 } 887 }
871 888
872 if(iNbItem < _iItemPos) 889 if(iNbItem < _iItemPos)
873 { 890 {
874 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 891 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfStringInList", _iItemPos + 1);
875 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("API_ERROR_CREATE_STRING_IN_LIST"));
876 return strErr; 892 return strErr;
877 } 893 }
878 894
879 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr); 895 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr);
880 if(strErr.iErr) 896 if(strErr.iErr)
881 { 897 {
882 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("API_ERROR_CREATE_STRING_IN_LIST")); 898 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfStringInList", _iItemPos + 1);
883 return strErr; 899 return strErr;
884 } 900 }
885 901
886 strErr = fillCommonMatrixOfStringInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _pstStrings, &iTotalLen); 902 strErr = fillCommonMatrixOfStringInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _pstStrings, &iTotalLen);
887 if(strErr.iErr) 903 if(strErr.iErr)
888 { 904 {
889 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("API_ERROR_CREATE_STRING_IN_LIST")); 905 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfStringInList", _iItemPos + 1);
890 return strErr; 906 return strErr;
891 } 907 }
892 908
@@ -913,22 +929,21 @@ StrErr fillCommonMatrixOfStringInList(void* _pvCtx, int _iVar, int* _piParent, i
913 getListItemNumber(_pvCtx, _piParent, &iNbItem); 929 getListItemNumber(_pvCtx, _piParent, &iNbItem);
914 if(iNbItem < _iItemPos) 930 if(iNbItem < _iItemPos)
915 { 931 {
916 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 932 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfStringInList", _iItemPos + 1);
917 addErrorMessage(&strErr, API_ERROR_FILL_STRING_IN_LIST, _("API_ERROR_FILL_STRING_IN_LIST"));
918 return strErr; 933 return strErr;
919 } 934 }
920 935
921 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piAddr); 936 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piAddr);
922 if(strErr.iErr) 937 if(strErr.iErr)
923 { 938 {
924 addErrorMessage(&strErr, API_ERROR_FILL_STRING_IN_LIST, _("API_ERROR_FILL_STRING_IN_LIST")); 939 addErrorMessage(&strErr, API_ERROR_FILL_STRING_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "fillMatrixOfStringInList", _iItemPos + 1);
925 return strErr; 940 return strErr;
926 } 941 }
927 942
928 strErr = fillMatrixOfString(_pvCtx, piAddr, _iRows, _iCols, _pstStrings, _piTotalLen); 943 strErr = fillMatrixOfString(_pvCtx, piAddr, _iRows, _iCols, _pstStrings, _piTotalLen);
929 if(strErr.iErr) 944 if(strErr.iErr)
930 { 945 {
931 addErrorMessage(&strErr, API_ERROR_FILL_STRING_IN_LIST, _("API_ERROR_FILL_STRING_IN_LIST")); 946 addErrorMessage(&strErr, API_ERROR_FILL_STRING_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "fillMatrixOfStringInList", _iItemPos + 1);
932 return strErr; 947 return strErr;
933 } 948 }
934 949
@@ -955,14 +970,14 @@ StrErr createMatrixOfStringInNamedList(void* _pvCtx, char* _pstName, int* _piPar
955 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr); 970 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr);
956 if(strErr.iErr) 971 if(strErr.iErr)
957 { 972 {
958 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_NAMED_LIST, _("API_ERROR_CREATE_STRING_IN_NAMED_LIST")); 973 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfStringInNamedList", _iItemPos + 1, _pstName);
959 return strErr; 974 return strErr;
960 } 975 }
961 976
962 strErr = fillCommonMatrixOfStringInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, _pstStrings, &iTotalLen); 977 strErr = fillCommonMatrixOfStringInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, _pstStrings, &iTotalLen);
963 if(strErr.iErr) 978 if(strErr.iErr)
964 { 979 {
965 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_NAMED_LIST, _("API_ERROR_CREATE_STRING_IN_NAMED_LIST")); 980 addErrorMessage(&strErr, API_ERROR_CREATE_STRING_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfStringInNamedList", _iItemPos + 1, _pstName);
966 return strErr; 981 return strErr;
967 } 982 }
968 983
@@ -994,7 +1009,7 @@ StrErr readMatrixOfStringInNamedList(void* _pvCtx, char* _pstName, int* _piParen
994 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 1009 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
995 if(strErr.iErr) 1010 if(strErr.iErr)
996 { 1011 {
997 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("API_ERROR_READ_STRING_IN_NAMED_LIST")); 1012 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfStringInNamedList", _iItemPos + 1, _pstName);
998 return strErr; 1013 return strErr;
999 } 1014 }
1000 1015
@@ -1007,14 +1022,14 @@ StrErr readMatrixOfStringInNamedList(void* _pvCtx, char* _pstName, int* _piParen
1007 1022
1008 if(strErr.iErr) 1023 if(strErr.iErr)
1009 { 1024 {
1010 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("API_ERROR_READ_STRING_IN_NAMED_LIST")); 1025 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfStringInNamedList", _iItemPos + 1, _pstName);
1011 return strErr; 1026 return strErr;
1012 } 1027 }
1013 1028
1014 strErr = getMatrixOfString(_pvCtx, piAddr, _piRows, _piCols, _piLength, _pstStrings); 1029 strErr = getMatrixOfString(_pvCtx, piAddr, _piRows, _piCols, _piLength, _pstStrings);
1015 if(strErr.iErr) 1030 if(strErr.iErr)
1016 { 1031 {
1017 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("API_ERROR_READ_STRING_IN_NAMED_LIST")); 1032 addErrorMessage(&strErr, API_ERROR_READ_STRING_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfStringInNamedList", _iItemPos + 1, _pstName);
1018 return strErr; 1033 return strErr;
1019 } 1034 }
1020 1035
@@ -1033,14 +1048,14 @@ StrErr getMatrixOfBooleanInList(void* _pvCtx, int* _piParent, int _iItemPos, int
1033 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 1048 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
1034 if(strErr.iErr) 1049 if(strErr.iErr)
1035 { 1050 {
1036 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_IN_LIST, _("API_ERROR_GET_BOOLEAN_IN_LIST")); 1051 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfBooleanInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
1037 return strErr; 1052 return strErr;
1038 } 1053 }
1039 1054
1040 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, _piBool); 1055 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, _piBool);
1041 if(strErr.iErr) 1056 if(strErr.iErr)
1042 { 1057 {
1043 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_IN_LIST, _("API_ERROR_GET_BOOLEAN_IN_LIST")); 1058 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfBooleanInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
1044 return strErr; 1059 return strErr;
1045 } 1060 }
1046 1061
@@ -1055,7 +1070,7 @@ StrErr createMatrixOfBooleanInList(void* _pvCtx, int _iVar, int* _piParent, int
1055 strErr = allocMatrixOfBooleanInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, &piBool); 1070 strErr = allocMatrixOfBooleanInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, &piBool);
1056 if(strErr.iErr) 1071 if(strErr.iErr)
1057 { 1072 {
1058 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_LIST, _("API_ERROR_CREATE_BOOLEAN_IN_LIST")); 1073 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfBooleanInList", _iItemPos + 1);
1059 return strErr; 1074 return strErr;
1060 } 1075 }
1061 1076
@@ -1075,7 +1090,7 @@ StrErr allocMatrixOfBooleanInList(void* _pvCtx, int _iVar, int* _piParent, int _
1075 strErr = fillMatrixOfBoolInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _piBool); 1090 strErr = fillMatrixOfBoolInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _piBool);
1076 if(strErr.iErr) 1091 if(strErr.iErr)
1077 { 1092 {
1078 addErrorMessage(&strErr, API_ERROR_ALLOC_BOOLEAN_IN_LIST, _("API_ERROR_ALLOC_BOOLEAN_IN_LIST")); 1093 addErrorMessage(&strErr, API_ERROR_ALLOC_BOOLEAN_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "allocMatrixOfBooleanInList", _iItemPos + 1);
1079 return strErr; 1094 return strErr;
1080 } 1095 }
1081 1096
@@ -1100,14 +1115,13 @@ static StrErr fillMatrixOfBoolInList(void* _pvCtx, int _iVar, int* _piParent, in
1100 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 1115 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
1101 if(strErr.iErr) 1116 if(strErr.iErr)
1102 { 1117 {
1103 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("API_ERROR_FILL_BOOLEAN_IN_LIST")); 1118 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfBoolInList", _iItemPos + 1);
1104 return strErr; 1119 return strErr;
1105 } 1120 }
1106 1121
1107 if(iNbItem < _iItemPos) 1122 if(iNbItem < _iItemPos)
1108 { 1123 {
1109 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 1124 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfBooleanInList", _iItemPos + 1);
1110 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("API_ERROR_FILL_BOOLEAN_IN_LIST"));
1111 return strErr; 1125 return strErr;
1112 } 1126 }
1113 1127
@@ -1115,14 +1129,14 @@ static StrErr fillMatrixOfBoolInList(void* _pvCtx, int _iVar, int* _piParent, in
1115 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1129 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1116 if(strErr.iErr) 1130 if(strErr.iErr)
1117 { 1131 {
1118 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("API_ERROR_FILL_BOOLEAN_IN_LIST")); 1132 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfBoolInList", _iItemPos + 1);
1119 return strErr; 1133 return strErr;
1120 } 1134 }
1121 1135
1122 strErr = fillMatrixOfBoolean(_pvCtx, piChildAddr, _iRows, _iCols, _piBool); 1136 strErr = fillMatrixOfBoolean(_pvCtx, piChildAddr, _iRows, _iCols, _piBool);
1123 if(strErr.iErr) 1137 if(strErr.iErr)
1124 { 1138 {
1125 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("API_ERROR_FILL_BOOLEAN_IN_LIST")); 1139 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfBoolInList", _iItemPos + 1);
1126 return strErr; 1140 return strErr;
1127 } 1141 }
1128 1142
@@ -1151,7 +1165,7 @@ StrErr createMatrixOfBooleanInNamedList(void* _pvCtx, char* _pstName, int* _piPa
1151 strErr = fillMatrixOfBoolInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, &piBool); 1165 strErr = fillMatrixOfBoolInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, &piBool);
1152 if(strErr.iErr) 1166 if(strErr.iErr)
1153 { 1167 {
1154 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST, _("API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST")); 1168 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfBooleanInNamedList", _iItemPos + 1, _pstName);
1155 return strErr; 1169 return strErr;
1156 } 1170 }
1157 1171
@@ -1160,7 +1174,7 @@ StrErr createMatrixOfBooleanInNamedList(void* _pvCtx, char* _pstName, int* _piPa
1160 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1174 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1161 if(strErr.iErr) 1175 if(strErr.iErr)
1162 { 1176 {
1163 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST, _("API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST")); 1177 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfBooleanInNamedList", _iItemPos + 1, _pstName);
1164 return strErr; 1178 return strErr;
1165 } 1179 }
1166 1180
@@ -1193,7 +1207,7 @@ StrErr readMatrixOfBooleanInNamedList(void* _pvCtx, char* _pstName, int* _piPare
1193 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 1207 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
1194 if(strErr.iErr) 1208 if(strErr.iErr)
1195 { 1209 {
1196 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_IN_NAMED_LIST")); 1210 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfBooleanInNamedList", _iItemPos + 1, _pstName);
1197 return strErr; 1211 return strErr;
1198 } 1212 }
1199 1213
@@ -1206,14 +1220,14 @@ StrErr readMatrixOfBooleanInNamedList(void* _pvCtx, char* _pstName, int* _piPare
1206 1220
1207 if(strErr.iErr) 1221 if(strErr.iErr)
1208 { 1222 {
1209 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_IN_NAMED_LIST")); 1223 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfBooleanInNamedList", _iItemPos + 1, _pstName);
1210 return strErr; 1224 return strErr;
1211 } 1225 }
1212 1226
1213 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, &piBool); 1227 strErr = getMatrixOfBoolean(_pvCtx, piAddr, _piRows, _piCols, &piBool);
1214 if(strErr.iErr) 1228 if(strErr.iErr)
1215 { 1229 {
1216 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_IN_NAMED_LIST")); 1230 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfBooleanInNamedList", _iItemPos + 1, _pstName);
1217 return strErr; 1231 return strErr;
1218 } 1232 }
1219 1233
@@ -1233,15 +1247,15 @@ StrErr readMatrixOfBooleanInNamedList(void* _pvCtx, char* _pstName, int* _piPare
1233 1247
1234StrErr getMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal) 1248StrErr getMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal)
1235{ 1249{
1236 return getCommonxMatrixOfPolyInList(_pvCtx, _piParent, _iItemPos, 0, _piRows, _piCols, _piNbCoef, _pdblReal, NULL); 1250 return getCommonMatrixOfPolyInList(_pvCtx, _piParent, _iItemPos, 0, _piRows, _piCols, _piNbCoef, _pdblReal, NULL);
1237} 1251}
1238 1252
1239StrErr getComplexMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg) 1253StrErr getComplexMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
1240{ 1254{
1241 return getCommonxMatrixOfPolyInList(_pvCtx, _piParent, _iItemPos, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg); 1255 return getCommonMatrixOfPolyInList(_pvCtx, _piParent, _iItemPos, 1, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
1242} 1256}
1243 1257
1244StrErr getCommonxMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg) 1258StrErr getCommonMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos, int _iComplex, int* _piRows, int* _piCols, int* _piNbCoef, double** _pdblReal, double** _pdblImg)
1245{ 1259{
1246 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 1260 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
1247 int* piAddr = NULL; 1261 int* piAddr = NULL;
@@ -1249,7 +1263,7 @@ StrErr getCommonxMatrixOfPolyInList(void* _pvCtx, int* _piParent, int _iItemPos,
1249 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 1263 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
1250 if(strErr.iErr) 1264 if(strErr.iErr)
1251 { 1265 {
1252 addErrorMessage(&strErr, API_ERROR_GET_POLY_IN_LIST, _("API_ERROR_GET_POLY_IN_LIST")); 1266 addErrorMessage(&strErr, API_ERROR_GET_POLY_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "getComplexMatrixOfPolyInList" : "getMatrixOfPolyInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
1253 return strErr; 1267 return strErr;
1254 } 1268 }
1255 1269
@@ -1284,14 +1298,14 @@ StrErr createCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piParent, i
1284 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr); 1298 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piItemAddr);
1285 if(strErr.iErr) 1299 if(strErr.iErr)
1286 { 1300 {
1287 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_LIST, _("API_ERROR_CREATE_POLY_IN_LIST")); 1301 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1288 return strErr; 1302 return strErr;
1289 } 1303 }
1290 1304
1291 strErr = fillCommonMatrixOfPolyInList(_pvCtx, _iVar, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen); 1305 strErr = fillCommonMatrixOfPolyInList(_pvCtx, _iVar, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
1292 if(strErr.iErr) 1306 if(strErr.iErr)
1293 { 1307 {
1294 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_LIST, _("API_ERROR_CREATE_POLY_IN_LIST")); 1308 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1295 return strErr; 1309 return strErr;
1296 } 1310 }
1297 1311
@@ -1322,28 +1336,27 @@ static StrErr fillCommonMatrixOfPolyInList(void* _pvCtx, int _iVar, int* _piPare
1322 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 1336 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
1323 if(strErr.iErr) 1337 if(strErr.iErr)
1324 { 1338 {
1325 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("API_ERROR_FILL_POLY_IN_LIST")); 1339 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1326 return strErr; 1340 return strErr;
1327 } 1341 }
1328 1342
1329 if(iNbItem < _iItemPos) 1343 if(iNbItem < _iItemPos)
1330 { 1344 {
1331 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 1345 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1332 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("API_ERROR_FILL_POLY_IN_LIST"));
1333 return strErr; 1346 return strErr;
1334 } 1347 }
1335 1348
1336 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1349 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1337 if(strErr.iErr) 1350 if(strErr.iErr)
1338 { 1351 {
1339 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("API_ERROR_FILL_POLY_IN_LIST")); 1352 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1340 return strErr; 1353 return strErr;
1341 } 1354 }
1342 1355
1343 strErr = fillCommonMatrixOfPoly(_pvCtx, piChildAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen); 1356 strErr = fillCommonMatrixOfPoly(_pvCtx, piChildAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
1344 if(strErr.iErr) 1357 if(strErr.iErr)
1345 { 1358 {
1346 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("API_ERROR_FILL_POLY_IN_LIST")); 1359 addErrorMessage(&strErr, API_ERROR_FILL_POLY_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexMatrixOfPolyInList" : "createMatrixOfPolyInList", _iItemPos + 1);
1347 return strErr; 1360 return strErr;
1348 } 1361 }
1349 1362
@@ -1388,7 +1401,7 @@ StrErr createCommonMatrixOfPolyInNamedList(void* _pvCtx, char* _pstName, int* _p
1388 strErr = fillCommonMatrixOfPolyInList(_pvCtx, Top, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen); 1401 strErr = fillCommonMatrixOfPolyInList(_pvCtx, Top, _piParent, _iItemPos, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
1389 if(strErr.iErr) 1402 if(strErr.iErr)
1390 { 1403 {
1391 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_NAMED_LIST, _("API_ERROR_CREATE_POLY_IN_NAMED_LIST")); 1404 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexMatrixOfPolyInNamedList" : "createMatrixOfPolyInNamedList", _iItemPos + 1, _pstName);
1392 return strErr; 1405 return strErr;
1393 } 1406 }
1394 1407
@@ -1398,7 +1411,7 @@ StrErr createCommonMatrixOfPolyInNamedList(void* _pvCtx, char* _pstName, int* _p
1398 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1411 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1399 if(strErr.iErr) 1412 if(strErr.iErr)
1400 { 1413 {
1401 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_NAMED_LIST, _("API_ERROR_CREATE_POLY_IN_NAMED_LIST")); 1414 addErrorMessage(&strErr, API_ERROR_CREATE_POLY_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexMatrixOfPolyInNamedList" : "createMatrixOfPolyInNamedList", _iItemPos + 1, _pstName);
1402 return strErr; 1415 return strErr;
1403 } 1416 }
1404 1417
@@ -1440,7 +1453,7 @@ StrErr readCommonMatrixOfPolyInNamedList(void* _pvCtx, char* _pstName, int* _piP
1440 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 1453 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
1441 if(strErr.iErr) 1454 if(strErr.iErr)
1442 { 1455 {
1443 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("API_ERROR_READ_POLY_IN_NAMED_LIST")); 1456 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexMatrixOfPolyInNamedList" : "readMatrixOfPolyInNamedList", _iItemPos + 1, _pstName);
1444 return strErr; 1457 return strErr;
1445 } 1458 }
1446 1459
@@ -1453,14 +1466,14 @@ StrErr readCommonMatrixOfPolyInNamedList(void* _pvCtx, char* _pstName, int* _piP
1453 1466
1454 if(strErr.iErr) 1467 if(strErr.iErr)
1455 { 1468 {
1456 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("API_ERROR_READ_POLY_IN_NAMED_LIST")); 1469 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexMatrixOfPolyInNamedList" : "readMatrixOfPolyInNamedList", _iItemPos + 1, _pstName);
1457 return strErr; 1470 return strErr;
1458 } 1471 }
1459 1472
1460 strErr = getCommonMatrixOfPoly(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg); 1473 strErr = getCommonMatrixOfPoly(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbCoef, _pdblReal, _pdblImg);
1461 if(strErr.iErr) 1474 if(strErr.iErr)
1462 { 1475 {
1463 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("API_ERROR_READ_POLY_IN_NAMED_LIST")); 1476 addErrorMessage(&strErr, API_ERROR_READ_POLY_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexMatrixOfPolyInNamedList" : "readMatrixOfPolyInNamedList", _iItemPos + 1, _pstName);
1464 return strErr; 1477 return strErr;
1465 } 1478 }
1466 1479
@@ -1482,14 +1495,13 @@ static StrErr fillCommonMatrixOfIntegerInList(void* _pvCtx, int _iVar, int* _piP
1482 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 1495 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
1483 if(strErr.iErr) 1496 if(strErr.iErr)
1484 { 1497 {
1485 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("API_ERROR_FILL_INT_IN_LIST")); 1498 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfIntegerInList", _iItemPos + 1);
1486 return strErr; 1499 return strErr;
1487 } 1500 }
1488 1501
1489 if(iNbItem < _iItemPos) 1502 if(iNbItem < _iItemPos)
1490 { 1503 {
1491 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 1504 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfIntegerInList", _iItemPos + 1);
1492 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("API_ERROR_FILL_INT_IN_LIST"));
1493 return strErr; 1505 return strErr;
1494 } 1506 }
1495 1507
@@ -1497,14 +1509,14 @@ static StrErr fillCommonMatrixOfIntegerInList(void* _pvCtx, int _iVar, int* _piP
1497 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1509 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1498 if(strErr.iErr) 1510 if(strErr.iErr)
1499 { 1511 {
1500 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("API_ERROR_FILL_INT_IN_LIST")); 1512 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfIntegerInList", _iItemPos + 1);
1501 return strErr; 1513 return strErr;
1502 } 1514 }
1503 1515
1504 strErr = fillCommonMatrixOfInteger(_pvCtx, piChildAddr, _iPrecision, _iRows, _iCols, _pvData); 1516 strErr = fillCommonMatrixOfInteger(_pvCtx, piChildAddr, _iPrecision, _iRows, _iCols, _pvData);
1505 if(strErr.iErr) 1517 if(strErr.iErr)
1506 { 1518 {
1507 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("API_ERROR_FILL_INT_IN_LIST")); 1519 addErrorMessage(&strErr, API_ERROR_FILL_INT_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfIntegerInList", _iItemPos + 1);
1508 return strErr; 1520 return strErr;
1509 } 1521 }
1510 1522
@@ -1533,7 +1545,7 @@ static StrErr allocCommonMatrixOfIntegerInList(void* _pvCtx, int _iVar, int* _pi
1533 strErr = fillCommonMatrixOfIntegerInList(_pvCtx, _iVar, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, _pvData); 1545 strErr = fillCommonMatrixOfIntegerInList(_pvCtx, _iVar, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, _pvData);
1534 if(strErr.iErr) 1546 if(strErr.iErr)
1535 { 1547 {
1536 addErrorMessage(&strErr, API_ERROR_ALLOC_INT_IN_LIST, _("API_ERROR_ALLOC_INT_IN_LIST")); 1548 addErrorMessage(&strErr, API_ERROR_ALLOC_INT_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "allocMatrixOfIntegerInList", _iItemPos + 1);
1537 return strErr; 1549 return strErr;
1538 } 1550 }
1539 1551
@@ -1585,7 +1597,7 @@ static StrErr createCommomMatrixOfIntegerInList(void* _pvCtx, int _iVar, int* _p
1585 strErr = allocCommonMatrixOfIntegerInList(_pvCtx, _iVar, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, &pvData); 1597 strErr = allocCommonMatrixOfIntegerInList(_pvCtx, _iVar, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, &pvData);
1586 if(strErr.iErr) 1598 if(strErr.iErr)
1587 { 1599 {
1588 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_LIST, _("API_ERROR_CREATE_INT_IN_LIST")); 1600 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_LIST,_("%s: Unable to create list item #%d in Scilab memory"), "createMatrixOfIntegerInList", _iItemPos + 1);
1589 return strErr; 1601 return strErr;
1590 } 1602 }
1591 1603
@@ -1634,14 +1646,14 @@ static StrErr getCommonMatrixOfIntegerInList(void* _pvCtx, int* _piParent, int _
1634 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 1646 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
1635 if(strErr.iErr) 1647 if(strErr.iErr)
1636 { 1648 {
1637 addErrorMessage(&strErr, API_ERROR_GET_INT_IN_LIST, _("API_ERROR_GET_INT_IN_LIST")); 1649 addErrorMessage(&strErr, API_ERROR_GET_INT_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfIntegerInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
1638 return strErr; 1650 return strErr;
1639 } 1651 }
1640 1652
1641 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, _pvData); 1653 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, _pvData);
1642 if(strErr.iErr) 1654 if(strErr.iErr)
1643 { 1655 {
1644 addErrorMessage(&strErr, API_ERROR_GET_INT_IN_LIST, _("API_ERROR_GET_INT_IN_LIST")); 1656 addErrorMessage(&strErr, API_ERROR_GET_INT_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getMatrixOfIntegerInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
1645 return strErr; 1657 return strErr;
1646 } 1658 }
1647 1659
@@ -1696,14 +1708,14 @@ static StrErr createCommonMatrixOfIntegerInNamedList(void* _pvCtx, char* _pstNam
1696 strErr = createCommomMatrixOfIntegerInList(_pvCtx, Top, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, _pvData); 1708 strErr = createCommomMatrixOfIntegerInList(_pvCtx, Top, _piParent, _iItemPos, _iPrecision, _iRows, _iCols, _pvData);
1697 if(strErr.iErr) 1709 if(strErr.iErr)
1698 { 1710 {
1699 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_NAMED_LIST, _("API_ERROR_CREATE_INT_IN_NAMED_LIST")); 1711 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_NAMED_LIST,_("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfIntegerInNamedList", _iItemPos + 1, _pstName);
1700 return strErr; 1712 return strErr;
1701 } 1713 }
1702 1714
1703 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1715 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1704 if(strErr.iErr) 1716 if(strErr.iErr)
1705 { 1717 {
1706 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_NAMED_LIST, _("API_ERROR_CREATE_INT_IN_NAMED_LIST")); 1718 addErrorMessage(&strErr, API_ERROR_CREATE_INT_IN_NAMED_LIST,_("%s: Unable to create list item #%d in variable \"%s\""), "createMatrixOfIntegerInNamedList", _iItemPos + 1, _pstName);
1707 return strErr; 1719 return strErr;
1708 } 1720 }
1709 1721
@@ -1769,7 +1781,7 @@ static StrErr readCommonMatrixOfIntgerInNamedList(void* _pvCtx, char* _pstName,
1769 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 1781 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
1770 if(strErr.iErr) 1782 if(strErr.iErr)
1771 { 1783 {
1772 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("API_ERROR_READ_INT_IN_NAMED_LIST")); 1784 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfIntgerInNamedList", _iItemPos + 1, _pstName);
1773 return strErr; 1785 return strErr;
1774 } 1786 }
1775 1787
@@ -1782,14 +1794,14 @@ static StrErr readCommonMatrixOfIntgerInNamedList(void* _pvCtx, char* _pstName,
1782 1794
1783 if(strErr.iErr) 1795 if(strErr.iErr)
1784 { 1796 {
1785 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("API_ERROR_READ_INT_IN_NAMED_LIST")); 1797 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfIntgerInNamedList", _iItemPos + 1, _pstName);
1786 return strErr; 1798 return strErr;
1787 } 1799 }
1788 1800
1789 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, &pvData); 1801 strErr = getCommonMatrixOfInteger(_pvCtx, piAddr, _iPrecision, _piRows, _piCols, &pvData);
1790 if(strErr.iErr) 1802 if(strErr.iErr)
1791 { 1803 {
1792 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("API_ERROR_READ_INT_IN_NAMED_LIST")); 1804 addErrorMessage(&strErr, API_ERROR_READ_INT_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readMatrixOfIntgerInNamedList", _iItemPos + 1, _pstName);
1793 return strErr; 1805 return strErr;
1794 } 1806 }
1795 1807
@@ -1854,28 +1866,27 @@ static StrErr fillCommonSparseMatrixInList(void* _pvCtx, int _iVar, int* _piPare
1854 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 1866 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
1855 if(strErr.iErr) 1867 if(strErr.iErr)
1856 { 1868 {
1857 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("API_ERROR_FILL_SPARSE_IN_LIST")); 1869 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createComplexSparseMatrixInList", _iItemPos + 1);
1858 return strErr; 1870 return strErr;
1859 } 1871 }
1860 1872
1861 if(iNbItem < _iItemPos) 1873 if(iNbItem < _iItemPos)
1862 { 1874 {
1863 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 1875 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createSparseMatrixInNamedList", _iItemPos + 1);
1864 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("API_ERROR_FILL_SPARSE_IN_LIST"));
1865 return strErr; 1876 return strErr;
1866 } 1877 }
1867 1878
1868 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1879 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1869 if(strErr.iErr) 1880 if(strErr.iErr)
1870 { 1881 {
1871 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("API_ERROR_FILL_SPARSE_IN_LIST")); 1882 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createComplexSparseMatrixInList", _iItemPos + 1);
1872 return strErr; 1883 return strErr;
1873 } 1884 }
1874 1885
1875 strErr = fillCommonSparseMatrix(_pvCtx, piChildAddr, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg, &iTotalLen); 1886 strErr = fillCommonSparseMatrix(_pvCtx, piChildAddr, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg, &iTotalLen);
1876 if(strErr.iErr) 1887 if(strErr.iErr)
1877 { 1888 {
1878 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("API_ERROR_FILL_SPARSE_IN_LIST")); 1889 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createComplexSparseMatrixInList", _iItemPos + 1);
1879 return strErr; 1890 return strErr;
1880 } 1891 }
1881 1892
@@ -1909,14 +1920,14 @@ static StrErr createCommonSparseMatrixInList(void* _pvCtx, int _iVar, int* _piPa
1909 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 1920 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
1910 if(strErr.iErr) 1921 if(strErr.iErr)
1911 { 1922 {
1912 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_LIST, _("API_ERROR_CREATE_SPARSE_IN_LIST")); 1923 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createComplexSparseMatrixInList", _iItemPos + 1);
1913 return strErr; 1924 return strErr;
1914 } 1925 }
1915 1926
1916 strErr = fillCommonSparseMatrixInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg, &iTotalLen); 1927 strErr = fillCommonSparseMatrixInList(_pvCtx, _iVar, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg, &iTotalLen);
1917 if(strErr.iErr) 1928 if(strErr.iErr)
1918 { 1929 {
1919 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_LIST, _("API_ERROR_CREATE_SPARSE_IN_LIST")); 1930 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), _iComplex ? "createComplexSparseMatrixInList" : "createComplexSparseMatrixInList", _iItemPos + 1);
1920 return strErr; 1931 return strErr;
1921 } 1932 }
1922 1933
@@ -1962,14 +1973,14 @@ StrErr createCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _p
1962 strErr = createCommonSparseMatrixInList(_pvCtx, Top, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg); 1973 strErr = createCommonSparseMatrixInList(_pvCtx, Top, _piParent, _iItemPos, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg);
1963 if(strErr.iErr) 1974 if(strErr.iErr)
1964 { 1975 {
1965 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_NAMED_LIST, _("API_ERROR_CREATE_SPARSE_IN_NAMED_LIST")); 1976 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexSparseMatrixInNamedList" : "createSparseMatrixInNamedList", _iItemPos + 1, _pstName);
1966 return strErr; 1977 return strErr;
1967 } 1978 }
1968 1979
1969 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 1980 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
1970 if(strErr.iErr) 1981 if(strErr.iErr)
1971 { 1982 {
1972 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_NAMED_LIST, _("API_ERROR_CREATE_SPARSE_IN_NAMED_LIST")); 1983 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), _iComplex ? "createComplexSparseMatrixInNamedList" : "createSparseMatrixInNamedList", _iItemPos + 1, _pstName);
1973 return strErr; 1984 return strErr;
1974 } 1985 }
1975 1986
@@ -2008,14 +2019,14 @@ static StrErr getCommonSparseMatrixInList(void* _pvCtx, int* _piParent, int _iIt
2008 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 2019 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
2009 if(strErr.iErr) 2020 if(strErr.iErr)
2010 { 2021 {
2011 addErrorMessage(&strErr, API_ERROR_GET_SPARSE_IN_LIST, _("API_ERROR_GET_SPARSE_IN_LIST")); 2022 addErrorMessage(&strErr, API_ERROR_GET_SPARSE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "getComplexSparseMatrixInList" : "getSparseMatrixInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2012 return strErr; 2023 return strErr;
2013 } 2024 }
2014 2025
2015 strErr = getCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg); 2026 strErr = getCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg);
2016 if(strErr.iErr) 2027 if(strErr.iErr)
2017 { 2028 {
2018 addErrorMessage(&strErr, API_ERROR_GET_SPARSE_IN_LIST, _("API_ERROR_GET_SPARSE_IN_LIST")); 2029 addErrorMessage(&strErr, API_ERROR_GET_SPARSE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), _iComplex ? "getComplexSparseMatrixInList" : "getSparseMatrixInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2019 return strErr; 2030 return strErr;
2020 } 2031 }
2021 2032
@@ -2048,7 +2059,7 @@ static StrErr readCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, in
2048 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 2059 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
2049 if(strErr.iErr) 2060 if(strErr.iErr)
2050 { 2061 {
2051 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_SPARSE_IN_NAMED_LIST")); 2062 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST,_("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexSparseMatrixInNamedList" : "readSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2052 return strErr; 2063 return strErr;
2053 } 2064 }
2054 2065
@@ -2061,14 +2072,14 @@ static StrErr readCommonSparseMatrixInNamedList(void* _pvCtx, char* _pstName, in
2061 2072
2062 if(strErr.iErr) 2073 if(strErr.iErr)
2063 { 2074 {
2064 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_SPARSE_IN_NAMED_LIST")); 2075 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST,_("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexSparseMatrixInNamedList" : "readSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2065 return strErr; 2076 return strErr;
2066 } 2077 }
2067 2078
2068 strErr = getCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg); 2079 strErr = getCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _piRows, _piCols, _piNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg);
2069 if(strErr.iErr) 2080 if(strErr.iErr)
2070 { 2081 {
2071 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_SPARSE_IN_NAMED_LIST")); 2082 addErrorMessage(&strErr, API_ERROR_READ_SPARSE_IN_NAMED_LIST,_("%s: Unable to get address of item #%d in variable \"%s\""), _iComplex ? "readComplexSparseMatrixInNamedList" : "readSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2072 return strErr; 2083 return strErr;
2073 } 2084 }
2074 2085
@@ -2126,28 +2137,27 @@ static StrErr fillBooleanSparseMatrixInList(void* _pvCtx, int _iVar, int* _piPar
2126 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 2137 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
2127 if(strErr.iErr) 2138 if(strErr.iErr)
2128 { 2139 {
2129 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST")); 2140 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2130 return strErr; 2141 return strErr;
2131 } 2142 }
2132 2143
2133 if(iNbItem < _iItemPos) 2144 if(iNbItem < _iItemPos)
2134 { 2145 {
2135 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 2146 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2136 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST"));
2137 return strErr; 2147 return strErr;
2138 } 2148 }
2139 2149
2140 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 2150 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
2141 if(strErr.iErr) 2151 if(strErr.iErr)
2142 { 2152 {
2143 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST")); 2153 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2144 return strErr; 2154 return strErr;
2145 } 2155 }
2146 2156
2147 strErr = fillBooleanSparseMatrix(_pvCtx, piChildAddr, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos); 2157 strErr = fillBooleanSparseMatrix(_pvCtx, piChildAddr, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos);
2148 if(strErr.iErr) 2158 if(strErr.iErr)
2149 { 2159 {
2150 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST")); 2160 addErrorMessage(&strErr, API_ERROR_FILL_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2151 return strErr; 2161 return strErr;
2152 } 2162 }
2153 2163
@@ -2172,14 +2182,14 @@ StrErr createBooleanSparseMatrixInList(void* _pvCtx, int _iVar, int* _piParent,
2172 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 2182 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
2173 if(strErr.iErr) 2183 if(strErr.iErr)
2174 { 2184 {
2175 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST")); 2185 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2176 return strErr; 2186 return strErr;
2177 } 2187 }
2178 2188
2179 strErr = fillBooleanSparseMatrixInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos); 2189 strErr = fillBooleanSparseMatrixInList(_pvCtx, _iVar, _piParent, _iItemPos, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos);
2180 if(strErr.iErr) 2190 if(strErr.iErr)
2181 { 2191 {
2182 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST")); 2192 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createBooleanSparseMatrixInList", _iItemPos + 1);
2183 return strErr; 2193 return strErr;
2184 } 2194 }
2185 2195
@@ -2214,14 +2224,14 @@ StrErr createBooleanSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _
2214 strErr = createBooleanSparseMatrixInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos); 2224 strErr = createBooleanSparseMatrixInList(_pvCtx, Top, _piParent, _iItemPos, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos);
2215 if(strErr.iErr) 2225 if(strErr.iErr)
2216 { 2226 {
2217 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST, _("API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST")); 2227 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createBooleanSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2218 return strErr; 2228 return strErr;
2219 } 2229 }
2220 2230
2221 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 2231 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
2222 if(strErr.iErr) 2232 if(strErr.iErr)
2223 { 2233 {
2224 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST, _("API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST")); 2234 addErrorMessage(&strErr, API_ERROR_CREATE_BOOLEAN_SPARSE_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createBooleanSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2225 return strErr; 2235 return strErr;
2226 } 2236 }
2227 2237
@@ -2249,14 +2259,14 @@ StrErr getBooleanSparseMatrixInList(void* _pvCtx, int* _piParent, int _iItemPos,
2249 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 2259 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
2250 if(strErr.iErr) 2260 if(strErr.iErr)
2251 { 2261 {
2252 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST")); 2262 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getBooleanSparseMatrixInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2253 return strErr; 2263 return strErr;
2254 } 2264 }
2255 2265
2256 strErr = getBooleanSparseMatrix(_pvCtx, piAddr, _piRows, _piCols, _piNbItem, _piNbItemRow, _piColPos); 2266 strErr = getBooleanSparseMatrix(_pvCtx, piAddr, _piRows, _piCols, _piNbItem, _piNbItemRow, _piColPos);
2257 if(strErr.iErr) 2267 if(strErr.iErr)
2258 { 2268 {
2259 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST, _("API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST")); 2269 addErrorMessage(&strErr, API_ERROR_GET_BOOLEAN_SPARSE_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getBooleanSparseMatrixInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2260 return strErr; 2270 return strErr;
2261 } 2271 }
2262 2272
@@ -2277,7 +2287,7 @@ StrErr readBooleanSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _pi
2277 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 2287 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
2278 if(strErr.iErr) 2288 if(strErr.iErr)
2279 { 2289 {
2280 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST")); 2290 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readBooleanSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2281 return strErr; 2291 return strErr;
2282 } 2292 }
2283 2293
@@ -2290,14 +2300,14 @@ StrErr readBooleanSparseMatrixInNamedList(void* _pvCtx, char* _pstName, int* _pi
2290 2300
2291 if(strErr.iErr) 2301 if(strErr.iErr)
2292 { 2302 {
2293 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST")); 2303 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readBooleanSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2294 return strErr; 2304 return strErr;
2295 } 2305 }
2296 2306
2297 strErr = getBooleanSparseMatrix(_pvCtx, piAddr, _piRows, _piCols, _piNbItem, &piNbItemRow, &piColPos); 2307 strErr = getBooleanSparseMatrix(_pvCtx, piAddr, _piRows, _piCols, _piNbItem, &piNbItemRow, &piColPos);
2298 if(strErr.iErr) 2308 if(strErr.iErr)
2299 { 2309 {
2300 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST")); 2310 addErrorMessage(&strErr, API_ERROR_READ_BOOLEAN_SPARSE_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readBooleanSparseMatrixInNamedList", _iItemPos + 1, _pstName);
2301 return strErr; 2311 return strErr;
2302 } 2312 }
2303 2313
@@ -2327,14 +2337,14 @@ StrErr getPointerInList(void* _pvCtx, int* _piParent, int _iItemPos, void** _pvP
2327 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr); 2337 strErr = getListItemAddress(_pvCtx, _piParent, _iItemPos, &piAddr);
2328 if(strErr.iErr) 2338 if(strErr.iErr)
2329 { 2339 {
2330 addErrorMessage(&strErr, API_ERROR_GET_POINTER_IN_LIST, _("API_ERROR_GET_POINTER_IN_LIST")); 2340 addErrorMessage(&strErr, API_ERROR_GET_POINTER_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getPointerInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2331 return strErr; 2341 return strErr;
2332 } 2342 }
2333 2343
2334 strErr = getPointer(_pvCtx, piAddr, _pvPtr); 2344 strErr = getPointer(_pvCtx, piAddr, _pvPtr);
2335 if(strErr.iErr) 2345 if(strErr.iErr)
2336 { 2346 {
2337 addErrorMessage(&strErr, API_ERROR_GET_POINTER_IN_LIST, _("API_ERROR_GET_POINTER_IN_LIST")); 2347 addErrorMessage(&strErr, API_ERROR_GET_POINTER_IN_LIST, _("%s: Unable to get address of item #%d in argument #%d"), "getPointerInList", _iItemPos + 1, getRhsFromAddress(_pvCtx, _piParent));
2338 return strErr; 2348 return strErr;
2339 } 2349 }
2340 2350
@@ -2355,14 +2365,13 @@ StrErr createPointerInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPo
2355 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem); 2365 strErr = getListItemNumber(_pvCtx, _piParent, &iNbItem);
2356 if(strErr.iErr) 2366 if(strErr.iErr)
2357 { 2367 {
2358 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("API_ERROR_CREATE_POINTER_IN_NAMED_LIST")); 2368 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
2359 return strErr; 2369 return strErr;
2360 } 2370 }
2361 2371
2362 if(iNbItem < _iItemPos) 2372 if(iNbItem < _iItemPos)
2363 { 2373 {
2364 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("API_ERROR_ITEM_LIST_NUMBER")); 2374 addErrorMessage(&strErr, API_ERROR_ITEM_LIST_NUMBER, _("%s: Unable to create list item #%d in Scilab memory"), "createPointerInList", _iItemPos + 1);
2365 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("API_ERROR_CREATE_POINTER_IN_NAMED_LIST"));
2366 return strErr; 2375 return strErr;
2367 } 2376 }
2368 2377
@@ -2370,14 +2379,14 @@ StrErr createPointerInList(void* _pvCtx, int _iVar, int* _piParent, int _iItemPo
2370 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 2379 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
2371 if(strErr.iErr) 2380 if(strErr.iErr)
2372 { 2381 {
2373 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("API_ERROR_CREATE_POINTER_IN_NAMED_LIST")); 2382 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
2374 return strErr; 2383 return strErr;
2375 } 2384 }
2376 2385
2377 strErr = fillPointer(_pvCtx, piChildAddr, &pvPtr); 2386 strErr = fillPointer(_pvCtx, piChildAddr, &pvPtr);
2378 if(strErr.iErr) 2387 if(strErr.iErr)
2379 { 2388 {
2380 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("API_ERROR_CREATE_POINTER_IN_NAMED_LIST")); 2389 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_LIST, _("%s: Unable to create list item #%d in Scilab memory"), "createListInList", _iItemPos + 1);
2381 return strErr; 2390 return strErr;
2382 } 2391 }
2383 2392
@@ -2408,7 +2417,7 @@ StrErr readPointerInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int
2408 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot); 2417 strErr = readNamedList(_pvCtx, _pstName, &iNbItem, &piRoot);
2409 if(strErr.iErr) 2418 if(strErr.iErr)
2410 { 2419 {
2411 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("API_ERROR_READ_POINTER_IN_NAMED_LIST")); 2420 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readPointerInNamedList", _iItemPos + 1, _pstName);
2412 return strErr; 2421 return strErr;
2413 } 2422 }
2414 2423
@@ -2421,14 +2430,14 @@ StrErr readPointerInNamedList(void* _pvCtx, char* _pstName, int* _piParent, int
2421 2430
2422 if(strErr.iErr) 2431 if(strErr.iErr)
2423 { 2432 {
2424 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("API_ERROR_READ_POINTER_IN_NAMED_LIST")); 2433 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readPointerInNamedList", _iItemPos + 1, _pstName);
2425 return strErr; 2434 return strErr;
2426 } 2435 }
2427 2436
2428 strErr = getPointer(_pvCtx, piAddr, _pvPtr); 2437 strErr = getPointer(_pvCtx, piAddr, _pvPtr);
2429 if(strErr.iErr) 2438 if(strErr.iErr)
2430 { 2439 {
2431 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("API_ERROR_READ_POINTER_IN_NAMED_LIST")); 2440 addErrorMessage(&strErr, API_ERROR_READ_POINTER_IN_NAMED_LIST, _("%s: Unable to get address of item #%d in variable \"%s\""), "readPointerInNamedList", _iItemPos + 1, _pstName);
2432 return strErr; 2441 return strErr;
2433 } 2442 }
2434 2443
@@ -2453,14 +2462,14 @@ StrErr createPointerInNamedList(void* _pvCtx, char* _pstName, int* _piParent, in
2453 strErr = createPointerInList(_pvCtx, Top, _piParent, _iItemPos, _pvPtr); 2462 strErr = createPointerInList(_pvCtx, Top, _piParent, _iItemPos, _pvPtr);
2454 if(strErr.iErr) 2463 if(strErr.iErr)
2455 { 2464 {
2456 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_LIST, _("API_ERROR_CREATE_POINTER_IN_LIST")); 2465 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createPointerInNamedList", _iItemPos + 1, _pstName);
2457 return strErr; 2466 return strErr;
2458 } 2467 }
2459 2468
2460 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr); 2469 strErr = allocCommonItemInList(_pvCtx, _piParent, _iItemPos, &piChildAddr);
2461 if(strErr.iErr) 2470 if(strErr.iErr)
2462 { 2471 {
2463 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_LIST, _("API_ERROR_CREATE_POINTER_IN_LIST")); 2472 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER_IN_NAMED_LIST, _("%s: Unable to create list item #%d in variable \"%s\""), "createPointerInNamedList", _iItemPos + 1, _pstName);
2464 return strErr; 2473 return strErr;
2465 } 2474 }
2466 2475
diff --git a/scilab/modules/api_scilab/src/cpp/api_pointer.cpp b/scilab/modules/api_scilab/src/cpp/api_pointer.cpp
index e62aca2..7e966a3 100644
--- a/scilab/modules/api_scilab/src/cpp/api_pointer.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_pointer.cpp
@@ -29,22 +29,20 @@ StrErr getPointer(void* _pvCtx, int* _piAddress, void** _pvPtr)
29 29
30 if( _piAddress == NULL) 30 if( _piAddress == NULL)
31 { 31 {
32 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 32 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getPointer");
33 addErrorMessage(&strErr, API_ERROR_GET_POINTER, _("API_ERROR_GET_POINTER"));
34 return strErr; 33 return strErr;
35 } 34 }
36 35
37 strErr = getVarType(_pvCtx, _piAddress, &iType); 36 strErr = getVarType(_pvCtx, _piAddress, &iType);
38 if(strErr.iErr) 37 if(strErr.iErr)
39 { 38 {
40 addErrorMessage(&strErr, API_ERROR_GET_POINTER, _("API_ERROR_GET_POINTER")); 39 addErrorMessage(&strErr, API_ERROR_GET_POINTER, _("%s: Unable to get argument #%d"), "getPointer", getRhsFromAddress(_pvCtx, _piAddress));
41 return strErr; 40 return strErr;
42 } 41 }
43 42
44 if(iType != sci_pointer) 43 if(iType != sci_pointer)
45 { 44 {
46 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 45 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getPointer", _("pointer"));
47 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE"));
48 return strErr; 46 return strErr;
49 } 47 }
50 48
@@ -59,8 +57,7 @@ StrErr fillPointer(void* _pvCtx, int *_piAddress, void** _pvPtr)
59 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 57 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
60 if(_piAddress == NULL) 58 if(_piAddress == NULL)
61 { 59 {
62 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 60 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "fillPointer");
63 addErrorMessage(&strErr, API_ERROR_FILL_POINTER, _("API_ERROR_FILL_POINTER"));
64 return strErr; 61 return strErr;
65 } 62 }
66 63
@@ -82,12 +79,20 @@ StrErr allocPointer(void* _pvCtx, int _iVar, void** _pvPtr)
82 int* piAddr = NULL; 79 int* piAddr = NULL;
83 void* pvPtr = NULL; 80 void* pvPtr = NULL;
84 81
82 int iMemSize = 2;
83 int iFreeSpace = iadr(*Lstk(Bot)) - (iadr(iAddr));
84 if (iMemSize > iFreeSpace)
85 {
86 addStackSizeError(&strErr, ((StrCtx*)_pvCtx)->pstName, iMemSize);
87 return strErr;
88 }
89
85 getNewVarAddressFromPosition(_pvCtx, iNewPos, &piAddr); 90 getNewVarAddressFromPosition(_pvCtx, iNewPos, &piAddr);
86 91
87 strErr = fillPointer(_pvCtx, piAddr, &pvPtr); 92 strErr = fillPointer(_pvCtx, piAddr, &pvPtr);
88 if(strErr.iErr) 93 if(strErr.iErr)
89 { 94 {
90 addErrorMessage(&strErr, API_ERROR_ALLOC_POINTER, _("API_ERROR_ALLOC_POINTER")); 95 addErrorMessage(&strErr, API_ERROR_ALLOC_POINTER, _("%s: Unable to create variable in Scilab memory"), "allocPointer");;
91 return strErr; 96 return strErr;
92 } 97 }
93 98
@@ -106,7 +111,7 @@ StrErr createPointer(void* _pvCtx, int _iVar, void* _pvPtr)
106 strErr = allocPointer(_pvCtx, _iVar, &pvPtr); 111 strErr = allocPointer(_pvCtx, _iVar, &pvPtr);
107 if(strErr.iErr) 112 if(strErr.iErr)
108 { 113 {
109 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER, _("API_ERROR_CREATE_POINTER")); 114 addErrorMessage(&strErr, API_ERROR_CREATE_POINTER, _("%s: Unable to create variable in Scilab memory"), "createPointer");
110 return strErr; 115 return strErr;
111 } 116 }
112 117
diff --git a/scilab/modules/api_scilab/src/cpp/api_poly.cpp b/scilab/modules/api_scilab/src/cpp/api_poly.cpp
index 26c630e..cf8511a 100644
--- a/scilab/modules/api_scilab/src/cpp/api_poly.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_poly.cpp
@@ -33,15 +33,13 @@ StrErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
33 33
34 if(_piAddress == NULL) 34 if(_piAddress == NULL)
35 { 35 {
36 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 36 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getPolyVariableName");
37 addErrorMessage(&strErr, API_ERROR_GET_POLY_VARNAME, _("API_ERROR_GET_POLY_VARNAME"));
38 return strErr; 37 return strErr;
39 } 38 }
40 39
41 if(_piAddress[0] != sci_poly) 40 if(_piAddress[0] != sci_poly)
42 { 41 {
43 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 42 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getPolyVariableName", _("polynomial matrix"));
44 addErrorMessage(&strErr, API_ERROR_GET_POLY_VARNAME, _("API_ERROR_GET_POLY_VARNAME"));
45 return strErr; 43 return strErr;
46 } 44 }
47 45
@@ -61,8 +59,7 @@ StrErr getPolyVariableName(void* _pvCtx, int* _piAddress, char* _pstVarName, int
61 59
62 if(_pstVarName == NULL) 60 if(_pstVarName == NULL)
63 { 61 {
64 addErrorMessage(&strErr, API_ERROR_INVALID_VAR_POINTER, _("API_ERROR_INVALID_VAR_POINTER")); 62 addErrorMessage(&strErr, API_ERROR_INVALID_VAR_POINTER, _("%s: Unable to get formal variable name"), "getPolyVariableName");
65 addErrorMessage(&strErr, API_ERROR_GET_POLY_VARNAME, _("API_ERROR_GET_POLY_VARNAME"));
66 return strErr; 63 return strErr;
67 } 64 }
68 65
@@ -92,36 +89,33 @@ StrErr getCommonMatrixOfPoly(void* _pvCtx, int* _piAddress, int _iComplex, int*
92 89
93 if(_piAddress == NULL) 90 if(_piAddress == NULL)
94 { 91 {
95 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 92 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), _iComplex ? "getComplexMatrixOfPoly" : "getMatrixOfPoly");
96 addErrorMessage(&strErr, API_ERROR_GET_POLY, _("API_ERROR_GET_POLY"));
97 return strErr; 93 return strErr;
98 } 94 }
99 95
100 strErr = getVarType(_pvCtx, _piAddress, &iType); 96 strErr = getVarType(_pvCtx, _piAddress, &iType);
101 if(strErr.iErr) 97 if(strErr.iErr)
102 { 98 {
103 addErrorMessage(&strErr, API_ERROR_GET_POLY, _("API_ERROR_GET_POLY")); 99 addErrorMessage(&strErr, API_ERROR_GET_POLY, _("%s: Unable to get argument #%d"), _iComplex ? "getComplexMatrixOfPoly" : "getMatrixOfPoly", getRhsFromAddress(_pvCtx, _piAddress));
104 return strErr; 100 return strErr;
105 } 101 }
106 102
107 if(iType != sci_poly) 103 if(iType != sci_poly)
108 { 104 {
109 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 105 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), _iComplex ? "getComplexMatrixOfPoly" : "getMatrixOfPoly", _("polynomial matrix"));
110 addErrorMessage(&strErr, API_ERROR_GET_POLY, _("API_ERROR_GET_POLY"));
111 return strErr; 106 return strErr;
112 } 107 }
113 108
114 if(isVarComplex(_pvCtx, _piAddress) != _iComplex) 109 if(isVarComplex(_pvCtx, _piAddress) != _iComplex)
115 { 110 {
116 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("API_ERROR_INVALID_COMPLEXITY")); 111 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("%s: Bad call to get a non complex matrix"), _iComplex ? "getComplexMatrixOfPoly" : "getMatrixOfPoly");
117 addErrorMessage(&strErr, API_ERROR_GET_POLY_VARNAME, _("API_ERROR_GET_POLY_VARNAME"));
118 return strErr; 112 return strErr;
119 } 113 }
120 114
121 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 115 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
122 if(strErr.iErr) 116 if(strErr.iErr)
123 { 117 {
124 addErrorMessage(&strErr, API_ERROR_GET_POLY_VARNAME, _("API_ERROR_GET_POLY_VARNAME")); 118 addErrorMessage(&strErr, API_ERROR_GET_POLY, _("%s: Unable to get argument #%d"), _iComplex ? "getComplexMatrixOfPoly" : "getMatrixOfPoly", getRhsFromAddress(_pvCtx, _piAddress));
125 return strErr; 119 return strErr;
126 } 120 }
127 121
@@ -183,7 +177,7 @@ StrErr createCommonMatrixOfPoly(void* _pvCtx, int _iVar, int _iComplex, char* _p
183 strErr = fillCommonMatrixOfPoly(_pvCtx, piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen); 177 strErr = fillCommonMatrixOfPoly(_pvCtx, piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
184 if(strErr.iErr) 178 if(strErr.iErr)
185 { 179 {
186 addErrorMessage(&strErr, API_ERROR_CREATE_POLY, _("API_ERROR_CREATE_POLY")); 180 addErrorMessage(&strErr, API_ERROR_CREATE_POLY, _("%s: Unable to create variable in Scilab memory"), _iComplex ? "createComplexMatrixOfPoly" : "createMatrixOfPoly");
187 return strErr; 181 return strErr;
188 } 182 }
189 183
@@ -214,8 +208,7 @@ StrErr fillCommonMatrixOfPoly(void* _pvCtx, int* _piAddress, char* _pstVarName,
214 piVarName = _piAddress + 4;//4 for header 208 piVarName = _piAddress + 4;//4 for header
215 if(strlen(_pstVarName) > 4)//4 characters max 209 if(strlen(_pstVarName) > 4)//4 characters max
216 { 210 {
217 addErrorMessage(&strErr, API_ERROR_TOO_LONG_VAR, _("API_ERROR_TOO_LONG_VAR")); 211 addErrorMessage(&strErr, API_ERROR_TOO_LONG_VAR, _("%s: Formal variable name of polynomial can't exceed 4 characters"));
218 addErrorMessage(&strErr, API_ERROR_FILL_POLY, _("API_ERROR_FILL_POLY"));
219 return strErr; 212 return strErr;
220 } 213 }
221 214
@@ -281,7 +274,7 @@ StrErr createCommonNamedMatrixOfPoly(void* _pvCtx, char* _pstName, char* _pstVar
281 strErr = fillCommonMatrixOfPoly(_pvCtx, piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen); 274 strErr = fillCommonMatrixOfPoly(_pvCtx, piAddr, _pstVarName, _iComplex, _iRows, _iCols, _piNbCoef, _pdblReal, _pdblImg, &iTotalLen);
282 if(strErr.iErr) 275 if(strErr.iErr)
283 { 276 {
284 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_POLY, _("API_ERROR_CREATE_NAMED_POLY")); 277 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_POLY, _("%s: Unable to create %s named \"%s\""), _iComplex ? "createNamedComplexMatrixOfPoly" : "createNamedMatrixOfPoly", _("matrix of double"), _pstName);
285 return strErr; 278 return strErr;
286 } 279 }
287 280
@@ -317,7 +310,7 @@ StrErr readCommonNamedMatrixOfPoly(void* _pvCtx, char* _pstName, int _iComplex,
317 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 310 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
318 if(strErr.iErr) 311 if(strErr.iErr)
319 { 312 {
320 addErrorMessage(&strErr, API_ERROR_READ_NAMED_POLY, _("API_ERROR_READ_NAMED_POLY")); 313 addErrorMessage(&strErr, API_ERROR_READ_NAMED_POLY, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexMatrixOfPoly" :"readNamedMatrixOfPoly", _pstName);
321 return strErr; 314 return strErr;
322 } 315 }
323 316
@@ -332,7 +325,7 @@ StrErr readCommonNamedMatrixOfPoly(void* _pvCtx, char* _pstName, int _iComplex,
332 325
333 if(strErr.iErr) 326 if(strErr.iErr)
334 { 327 {
335 addErrorMessage(&strErr, API_ERROR_READ_NAMED_POLY, _("API_ERROR_READ_NAMED_POLY")); 328 addErrorMessage(&strErr, API_ERROR_READ_NAMED_POLY, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexMatrixOfPoly" :"readNamedMatrixOfPoly", _pstName);
336 return strErr; 329 return strErr;
337 } 330 }
338 331
diff --git a/scilab/modules/api_scilab/src/cpp/api_sparse.cpp b/scilab/modules/api_scilab/src/cpp/api_sparse.cpp
index 71e41e8..3268849 100644
--- a/scilab/modules/api_scilab/src/cpp/api_sparse.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_sparse.cpp
@@ -42,29 +42,26 @@ StrErr getCommonSparseMatrix(void* _pvCtx, int* _piAddress, int _iComplex, int*
42 42
43 if( _piAddress == NULL) 43 if( _piAddress == NULL)
44 { 44 {
45 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 45 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), _iComplex ? "getComplexSparseMatrix" : "getSparseMatrix");
46 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("API_ERROR_GET_SPARSE"));
47 return strErr; 46 return strErr;
48 } 47 }
49 48
50 strErr = getVarType(_pvCtx, _piAddress, &iType); 49 strErr = getVarType(_pvCtx, _piAddress, &iType);
51 if(strErr.iErr) 50 if(strErr.iErr)
52 { 51 {
53 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("API_ERROR_GET_SPARSE")); 52 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("%s: Unable to get argument #%d"), _iComplex ? "getComplexSparseMatrix" : "getSparseMatrix", getRhsFromAddress(_pvCtx, _piAddress));
54 return strErr; 53 return strErr;
55 } 54 }
56 55
57 if(iType != sci_sparse) 56 if(iType != sci_sparse)
58 { 57 {
59 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 58 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), _iComplex ? "getComplexSparseMatrix" : "getSparseMatrix", _("sparse matrix"));
60 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("API_ERROR_GET_SPARSE"));
61 return strErr; 59 return strErr;
62 } 60 }
63 61
64 if(isVarComplex(_pvCtx, _piAddress) != _iComplex) 62 if(isVarComplex(_pvCtx, _piAddress) != _iComplex)
65 { 63 {
66 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("API_ERROR_INVALID_COMPLEXITY")); 64 addErrorMessage(&strErr, API_ERROR_INVALID_COMPLEXITY, _("%s: Bad call to get a non complex matrix"), _iComplex ? "getComplexSparseMatrix" : "getSparseMatrix");
67 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("API_ERROR_GET_SPARSE"));
68 return strErr; 65 return strErr;
69 } 66 }
70 67
@@ -72,7 +69,7 @@ StrErr getCommonSparseMatrix(void* _pvCtx, int* _piAddress, int _iComplex, int*
72 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 69 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
73 if(strErr.iErr) 70 if(strErr.iErr)
74 { 71 {
75 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("API_ERROR_GET_SPARSE")); 72 addErrorMessage(&strErr, API_ERROR_GET_SPARSE, _("%s: Unable to get argument #%d"), _iComplex ? "getComplexSparseMatrix" : "getSparseMatrix", getRhsFromAddress(_pvCtx, _piAddress));
76 return strErr; 73 return strErr;
77 } 74 }
78 75
@@ -128,7 +125,7 @@ StrErr allocCommonSparseMatrix(void* _pvCtx, int _iVar, int _iComplex, int _iRow
128 strErr = fillCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg, &iTotalSize); 125 strErr = fillCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _iNbItem, _piNbItemRow, _piColPos, _pdblReal, _pdblImg, &iTotalSize);
129 if(strErr.iErr) 126 if(strErr.iErr)
130 { 127 {
131 addErrorMessage(&strErr, API_ERROR_ALLOC_SPARSE, _("API_ERROR_ALLOC_SPARSE")); 128 addErrorMessage(&strErr, API_ERROR_ALLOC_SPARSE, _("%s: Unable to create variable in Scilab memory"), _iComplex ? "allocComplexSparseMatrix" : "allocSparseMatrix");
132 return strErr; 129 return strErr;
133 } 130 }
134 131
@@ -145,8 +142,7 @@ StrErr fillCommonSparseMatrix(void* _pvCtx, int *_piAddress, int _iComplex, int
145 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0; 142 StrErr strErr; strErr.iErr = 0; strErr.iMsgCount = 0;
146 if(_piAddress == NULL) 143 if(_piAddress == NULL)
147 { 144 {
148 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 145 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "fillCommonSparseMatrix");
149 addErrorMessage(&strErr, API_ERROR_FILL_SPARSE, _("API_ERROR_FILL_SPARSE"));
150 return strErr; 146 return strErr;
151 } 147 }
152 148
@@ -191,7 +187,7 @@ StrErr createCommonSparseMatrix(void* _pvCtx, int _iVar, int _iComplex, int _iRo
191 strErr = allocCommonSparseMatrix(_pvCtx, _iVar, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg); 187 strErr = allocCommonSparseMatrix(_pvCtx, _iVar, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg);
192 if(strErr.iErr) 188 if(strErr.iErr)
193 { 189 {
194 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE, _("API_ERROR_CREATE_SPARSE")); 190 addErrorMessage(&strErr, API_ERROR_CREATE_SPARSE, _("%s: Unable to create variable in Scilab memory"), _iComplex ? "createComplexSparseMatrix" : "createSparseMatrix");
195 return strErr; 191 return strErr;
196 } 192 }
197 193
@@ -239,7 +235,7 @@ StrErr createCommonNamedSparseMatrix(void* _pvCtx, char* _pstName, int _iComplex
239 strErr = fillCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg, &iTotalSize); 235 strErr = fillCommonSparseMatrix(_pvCtx, piAddr, _iComplex, _iRows, _iCols, _iNbItem, &piNbItemRow, &piColPos, &pdblReal, &pdblImg, &iTotalSize);
240 if(strErr.iErr) 236 if(strErr.iErr)
241 { 237 {
242 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_SPARSE, _("API_ERROR_CREATE_NAMED_SPARSE")); 238 addErrorMessage(&strErr, API_ERROR_CREATE_NAMED_SPARSE, _("%s: Unable to create %s named \"%s\""), _iComplex ? "createNamedComplexSparseMatrix" : "createNamedSparseMatrix", _("sparse matrix"), _pstName);
243 return strErr; 239 return strErr;
244 } 240 }
245 241
@@ -291,7 +287,7 @@ StrErr readCommonNamedSparseMatrix(void* _pvCtx, char* _pstName, int _iComplex,
291 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr); 287 strErr = getVarAddressFromName(_pvCtx, _pstName, &piAddr);
292 if(strErr.iErr) 288 if(strErr.iErr)
293 { 289 {
294 addErrorMessage(&strErr, API_ERROR_READ_NAMED_SPARSE, _("API_ERROR_READ_NAMED_SPARSE")); 290 addErrorMessage(&strErr, API_ERROR_READ_NAMED_SPARSE, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexSparseMatrix" : "readNamedSparseMatrix", _pstName);
295 return strErr; 291 return strErr;
296 } 292 }
297 293
@@ -306,7 +302,7 @@ StrErr readCommonNamedSparseMatrix(void* _pvCtx, char* _pstName, int _iComplex,
306 302
307 if(strErr.iErr) 303 if(strErr.iErr)
308 { 304 {
309 addErrorMessage(&strErr, API_ERROR_READ_NAMED_SPARSE, _("API_ERROR_READ_NAMED_SPARSE")); 305 addErrorMessage(&strErr, API_ERROR_READ_NAMED_SPARSE, _("%s: Unable to get variable \"%s\""), _iComplex ? "readNamedComplexSparseMatrix" : "readNamedSparseMatrix", _pstName);
310 return strErr; 306 return strErr;
311 } 307 }
312 308
diff --git a/scilab/modules/api_scilab/src/cpp/api_string.cpp b/scilab/modules/api_scilab/src/cpp/api_string.cpp
index 0fcd12a..78fa619 100644
--- a/scilab/modules/api_scilab/src/cpp/api_string.cpp
+++ b/scilab/modules/api_scilab/src/cpp/api_string.cpp
@@ -47,29 +47,27 @@ StrErr getMatrixOfString(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCo
47 47
48 if( _piAddress == NULL) 48 if( _piAddress == NULL)
49 { 49 {
50 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 50 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "getMatrixOfString");
51 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("API_ERROR_GET_STRING"));
52 return strErr; 51 return strErr;
53 } 52 }
54 53
55 strErr = getVarType(_pvCtx, _piAddress, &iType); 54 strErr = getVarType(_pvCtx, _piAddress, &iType);
56 if(strErr.iErr) 55 if(strErr.iErr)
57 { 56 {
58 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("API_ERROR_GET_STRING")); 57 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("%s: Unable to get argument #%d"), "getMatrixOfString", getRhsFromAddress(_pvCtx, _piAddress));
59 return strErr; 58 return strErr;
60 } 59 }
61 60
62 if(iType != sci_strings) 61 if(iType != sci_strings)
63 { 62 {
64 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("API_ERROR_INVALID_TYPE")); 63 addErrorMessage(&strErr, API_ERROR_INVALID_TYPE, _("%s: Invalid argument type, %s excepted"), "getMatrixOfString", _("string matrix"));
65 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("API_ERROR_GET_STRING"));
66 return strErr; 64 return strErr;
67 } 65 }
68 66
69 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols); 67 strErr = getVarDimension(_pvCtx, _piAddress, _piRows, _piCols);
70 if(strErr.iErr) 68 if(strErr.iErr)
71 { 69 {
72 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("API_ERROR_GET_STRING")); 70 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("%s: Unable to get argument #%d"), "getMatrixOfString", getRhsFromAddress(_pvCtx, _piAddress));
73 return strErr; 71 return strErr;
74 } 72 }
75 73
@@ -97,8 +95,7 @@ StrErr getMatrixOfString(void* _pvCtx, int* _piAddress, int* _piRows, int* _piCo
97 { 95 {
98 if(_pstStrings[i] == NULL) 96 if(_pstStrings[i] == NULL)
99 { 97 {
100 addErrorMessage(&strErr, API_ERROR_INVALID_SUBSTRING_POINTER, _("API_ERROR_INVALID_SUBSTRING_POINTER")); 98 addErrorMessage(&strErr, API_ERROR_INVALID_SUBSTRING_POINTER, _("%s: Invalid argument address"), "getMatrixOfString");
101 addErrorMessage(&strErr, API_ERROR_GET_STRING, _("API_ERROR_GET_STRING"));
102 return strErr; 99 return strErr;
103 } 100 }
104 code2str(&_pstStrings[i], piData + iArraySum(_piLength, 0, i), _piLength[i]); 101 code2str(&_pstStrings[i], piData + iArraySum(_piLength, 0, i), _piLength[i]);
@@ -120,7 +117,7 @@ StrErr createMatrixOfString(void* _pvCtx, int _iVar, int _iRows, int _iCols, cha
120 strErr = fillMatrixOfString(_pvCtx, piAddr, _iRows, _iCols, _pstStrings, &iTotalLen); 117 strErr = fillMatrixOfString(_pvCtx, piAddr, _iRows, _iCols, _pstStrings, &iTotalLen);
121 if(strErr.iErr) 118 if(strErr.iErr)
122 { 119 {
123 addErrorMessage(&strErr, API_ERROR_CREATE_STRING, _("API_ERROR_CREATE_STRING")); 120 addErrorMessage(&strErr, API_ERROR_CREATE_STRING, _("%s: Unable to create variable in Scilab memory"), "createMatrixOfString");
124 return strErr; 121 return strErr;
125 } 122 }
126 123
@@ -147,8 +144,7 @@ StrErr fillMatrixOfString(void* _pvCtx, int* _piAddress, int _iRows, int _iCols,
147 144
148 if(_pstStrings == NULL) 145 if(_pstStrings == NULL)
149 { 146 {
150 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("API_ERROR_INVALID_POINTER")); 147 addErrorMessage(&strErr, API_ERROR_INVALID_POINTER, _("%s: Invalid argument address"), "fillMatrixOfString");
151 addErrorMessage(&strErr, API_ERROR_FILL_STRING, _("API_ERROR_FILL_STRING"));
152 return strErr; 148 return strErr;
153 } 149 }
154 150
@@ -156,8 +152,7 @@ StrErr fillMatrixOfString(void* _pvCtx, int* _piAddress, int _iRows, int _iCols,
156 { 152 {
157 if(_pstStrings[i] == NULL) 153 if(_pstStrings[i] == NULL)
158 { 154 {
159 addError