Permalink
Browse files

scilab: fix naming in scichar.swg (SwigScilabString... => SWIG_SciStr…

…ing...)
  • Loading branch information...
1 parent 32a4952 commit 7b8becda001d2abfa0ed17404d813f8871edb8c7 @smarchetto smarchetto committed Feb 21, 2014
Showing with 65 additions and 52 deletions.
  1. +46 −33 Lib/scilab/scichar.swg
  2. +8 −8 Lib/scilab/scimatrixchar.swg
  3. +7 −7 Lib/scilab/scisequencestring.swg
  4. +4 −4 Lib/scilab/std_string.i
View
@@ -1,17 +1,17 @@
/*
- * C-type: char
+ * C-type: char or char*
* Scilab type: string
*/
/*
* CHAR
-*/
-%fragment(SWIG_AsVal_frag(char), "header", fragment="SwigScilabStringToChar") {
-#define SWIG_AsVal_char(scilabValue, valuePointer) SwigScilabStringToChar(pvApiCtx, scilabValue, valuePointer, fname)
+ */
+%fragment(SWIG_AsVal_frag(char), "header", fragment="SWIG_SciString_AsChar") {
+#define SWIG_AsVal_char(scilabValue, valuePointer) SWIG_SciString_AsChar(pvApiCtx, scilabValue, valuePointer, fname)
}
-%fragment("SwigScilabStringToChar", "header") {
+%fragment("SWIG_SciString_AsChar", "header") {
SWIGINTERN int
-SwigScilabStringToChar(void *_pvApiCtx, int _iVar, char *_pcValue, char *_fname) {
+SWIG_SciString_AsChar(void *_pvApiCtx, int _iVar, char *_pcValue, char *_fname) {
SciErr sciErr;
int iType = 0;
int iRows = 0;
@@ -54,12 +54,12 @@ SwigScilabStringToChar(void *_pvApiCtx, int _iVar, char *_pcValue, char *_fname)
}
}
-%fragment(SWIG_From_frag(char), "header", fragment="SwigScilabStringFromChar") {
-#define SWIG_From_char(value) SwigScilabStringFromChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value)
+%fragment(SWIG_From_frag(char), "header", fragment="SWIG_SciString_FromChar") {
+#define SWIG_From_char(value) SWIG_SciString_FromChar(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value)
}
-%fragment("SwigScilabStringFromChar", "header") {
+%fragment("SWIG_SciString_FromChar", "header") {
SWIGINTERN int
-SwigScilabStringFromChar(void *_pvApiCtx, int _iVarOut, char _chValue) {
+SWIG_SciString_FromChar(void *_pvApiCtx, int _iVarOut, char _chValue) {
char *pchValue = (char*)malloc(sizeof(char) * 2);
pchValue[0] = _chValue;
pchValue[1] = '\0';
@@ -75,22 +75,15 @@ SwigScilabStringFromChar(void *_pvApiCtx, int _iVarOut, char _chValue) {
/*
* CHAR *
*/
-%fragment("SWIG_AsCharArray", "header", fragment = "SwigScilabStringToCharPtr") {
-#define SWIG_AsCharArray(scilabValue, charPtrPointer, charPtrLength) SwigScilabStringToCharPtr(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, fname)
-}
-%fragment("SWIG_AsCharPtrAndSize", "header", fragment = "SwigScilabStringToCharPtrAndSize") {
-#define SWIG_AsCharPtrAndSize(scilabValue, charPtrPointer, charPtrLength, allocMemory) SwigScilabStringToCharPtrAndSize(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, allocMemory, fname)
-}
-%fragment("SWIG_FromCharPtr", "header", fragment = "SwigScilabStringFromCharPtr") {
-#define SWIG_FromCharPtr(charPtr) SwigScilabStringFromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr)
-}
-%fragment("SWIG_FromCharPtrAndSize", "header", fragment = "SwigScilabStringFromCharPtr") {
-#define SWIG_FromCharPtrAndSize(charPtr, charPtrLength) SwigScilabStringFromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr)
-}
-%fragment("SwigScilabStringToCharPtr", "header") {
+
+
+%fragment("SWIG_AsCharArray", "header", fragment = "SWIG_SciString_AsCharPtr") {
+#define SWIG_AsCharArray(scilabValue, charPtrPointer, charPtrLength) SWIG_SciString_AsCharPtr(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, fname)
+}
+%fragment("SWIG_SciString_AsCharPtr", "header") {
SWIGINTERN int
-SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLength, char *_fname) {
+SWIG_SciString_AsCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLength, char *_fname) {
SciErr sciErr;
int *piAddrVar = NULL;
char* pcTmpValue = NULL;
@@ -116,9 +109,13 @@ SwigScilabStringToCharPtr(void *_pvApiCtx, int _iVar, char *_pcValue, int _iLeng
return SWIG_OK;
}
}
-%fragment("SwigScilabStringToCharPtrAndSize", "header") {
+
+%fragment("SWIG_AsCharPtrAndSize", "header", fragment = "SWIG_SciString_AsCharPtrAndSize") {
+#define SWIG_AsCharPtrAndSize(scilabValue, charPtrPointer, charPtrLength, allocMemory) SWIG_SciString_AsCharPtrAndSize(pvApiCtx, scilabValue, charPtrPointer, charPtrLength, allocMemory, fname)
+}
+%fragment("SWIG_SciString_AsCharPtrAndSize", "header") {
SWIGINTERN int
-SwigScilabStringToCharPtrAndSize(void *_pvApiCtx, int _iVar, char **_pcValue, size_t *_piLength, int *alloc, char *_fname) {
+SWIG_SciString_AsCharPtrAndSize(void *_pvApiCtx, int _iVar, char **_pcValue, size_t *_piLength, int *alloc, char *_fname) {
SciErr sciErr;
int *piAddrVar = NULL;
int iRet;
@@ -152,9 +149,13 @@ SwigScilabStringToCharPtrAndSize(void *_pvApiCtx, int _iVar, char **_pcValue, si
return SWIG_OK;
}
}
-%fragment("SwigScilabStringFromCharPtr", "header") {
+
+%fragment("SWIG_FromCharPtr", "header", fragment = "SWIG_SciString_FromCharPtr") {
+#define SWIG_FromCharPtr(charPtr) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr)
+}
+%fragment("SWIG_SciString_FromCharPtr", "header") {
SWIGINTERN int
-SwigScilabStringFromCharPtr(void *_pvApiCtx, int _iVarOut, const char *_pchValue) {
+SWIG_SciString_FromCharPtr(void *_pvApiCtx, int _iVarOut, const char *_pchValue) {
SciErr sciErr;
char **pstData = NULL;
@@ -175,10 +176,10 @@ SwigScilabStringFromCharPtr(void *_pvApiCtx, int _iVarOut, const char *_pchValue
/*
* CHAR * ARRAY
-*/
-%fragment("SwigScilabStringToCharPtrArrayAndSize", "header") {
+ */
+%fragment("SWIG_SciString_AsCharPtrArrayAndSize", "header") {
SWIGINTERN int
-SwigScilabStringToCharPtrArrayAndSize(void *_pvApiCtx, int _iVar, char ***_charPtrArray, int* _charPtrArraySize, char *_fname) {
+SWIG_SciString_AsCharPtrArrayAndSize(void *_pvApiCtx, int _iVar, char ***_charPtrArray, int* _charPtrArraySize, char *_fname) {
SciErr sciErr;
int i = 0;
int *piAddrVar = NULL;
@@ -228,9 +229,10 @@ SwigScilabStringToCharPtrArrayAndSize(void *_pvApiCtx, int _iVar, char ***_charP
return SWIG_OK;
}
}
-%fragment("SwigScilabStringFromCharPtrArray", "header") {
+
+%fragment("SWIG_SciString_FromCharPtrArray", "header") {
SWIGINTERN int
-SwigScilabStringFromCharPtrArray(void *_pvApiCtx, int _iVarOut, char **_charPtrArray, int _charPtrArraySize) {
+SWIG_SciString_FromCharPtrArray(void *_pvApiCtx, int _iVarOut, char **_charPtrArray, int _charPtrArraySize) {
SciErr sciErr;
if (_charPtrArray == NULL) {
@@ -246,6 +248,16 @@ SwigScilabStringFromCharPtrArray(void *_pvApiCtx, int _iVarOut, char **_charPtrA
return SWIG_OK;
}
}
+
+%fragment("SWIG_FromCharPtrAndSize", "header", fragment = "SWIG_SciString_FromCharPtr") {
+#define SWIG_FromCharPtrAndSize(charPtr, charPtrLength) SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), charPtr)
+}
+
+
+/*
+ * Char* Scilab variable
+ */
+
%fragment(SWIG_CreateScilabVariable_frag(char), "wrapper") {
SWIGINTERN int
SWIG_CreateScilabVariable_dec(char)(void *_pvApiCtx, const char* _psVariableName, const char _cVariableValue) {
@@ -265,6 +277,7 @@ SWIG_CreateScilabVariable_dec(char)(void *_pvApiCtx, const char* _psVariableName
return SWIG_OK;
}
}
+
%fragment(SWIG_CreateScilabVariable_frag(charptr), "wrapper") {
SWIGINTERN int
SWIG_CreateScilabVariable_dec(charptr)(void *_pvApiCtx, const char* _psVariableName, const char* _psVariableValue) {
@@ -7,9 +7,9 @@
// in (char** vectorIn, int vectorInSize)
-%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") (char** vectorIn, int vectorInSize)
+%typemap(in, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char** vectorIn, int vectorInSize)
{
- if (SwigScilabStringToCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, fname) == SWIG_ERROR)
+ if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, fname) == SWIG_ERROR)
{
return SWIG_ERROR;
}
@@ -35,9 +35,9 @@
free($2);
}
-%typemap(argout, fragment="SwigScilabStringFromCharPtrArray") (char*** vectorOut, int* vectorOutSize)
+%typemap(argout, fragment="SWIG_SciString_FromCharPtrArray") (char*** vectorOut, int* vectorOutSize)
{
- if (SwigScilabStringFromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2) != SWIG_ERROR)
+ if (SWIG_SciString_FromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$1, *$2) != SWIG_ERROR)
{
SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition());
}
@@ -49,9 +49,9 @@
// in (int vectorInSize, char** vectorIn)
-%typemap(in, fragment="SwigScilabStringToCharPtrArrayAndSize") (int vectorInSize, char** vectorIn)
+%typemap(in, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int vectorInSize, char** vectorIn)
{
- if (SwigScilabStringToCharPtrArrayAndSize(pvApiCtx, $input, &$2, &$1, fname) == SWIG_ERROR)
+ if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$2, &$1, fname) == SWIG_ERROR)
{
return SWIG_ERROR;
}
@@ -69,9 +69,9 @@
$2 = (char***) malloc(sizeof(char**));
}
-%typemap(argout, fragment="SwigScilabStringFromCharPtrArray") (int* vectorOutSize, char*** vectorOut)
+%typemap(argout, fragment="SWIG_SciString_FromCharPtrArray") (int* vectorOutSize, char*** vectorOut)
{
- if (SwigScilabStringFromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$1) != SWIG_ERROR)
+ if (SWIG_SciString_FromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), *$2, *$1) != SWIG_ERROR)
{
SWIG_Scilab_SetOutput(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition());
}
@@ -7,7 +7,7 @@
%include <scichar.swg>
%fragment(SWIG_AsCheck_Sequence_frag(std::string), "header",
- fragment="SwigScilabStringToCharPtrArrayAndSize") {
+ fragment="SWIG_SciString_AsCharPtrArrayAndSize") {
SWIGINTERN int
SWIG_AsCheck_Sequence_dec(std::string)(SwigSciObject _obj) {
@@ -33,22 +33,22 @@ SWIG_AsCheck_Sequence_dec(std::string)(SwigSciObject _obj) {
}
%fragment(SWIG_AsGet_Sequence_frag(std::string), "header",
- fragment="SwigScilabStringToCharPtrArrayAndSize") {
+ fragment="SWIG_SciString_AsCharPtrArrayAndSize") {
SWIGINTERN int
SWIG_AsGet_Sequence_dec(std::string)(SwigSciObject _obj, char ***_pSequence) {
int iSize;
- return (SwigScilabStringToCharPtrArrayAndSize(pvApiCtx, _obj, _pSequence, &iSize, SWIG_Scilab_GetFname()));
+ return (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, _obj, _pSequence, &iSize, SWIG_Scilab_GetFname()));
}
}
%fragment(SWIG_AsSize_Sequence_frag(std::string), "header",
- fragment="SwigScilabStringToCharPtrArrayAndSize") {
+ fragment="SWIG_SciString_AsCharPtrArrayAndSize") {
SWIGINTERN int
SWIG_AsSize_Sequence_dec(std::string)(SwigSciObject _obj, int *_piSize) {
char **pstMatrix;
- if (SwigScilabStringToCharPtrArrayAndSize(pvApiCtx, _obj, &pstMatrix, _piSize, SWIG_Scilab_GetFname()) == SWIG_OK) {
+ if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, _obj, &pstMatrix, _piSize, SWIG_Scilab_GetFname()) == SWIG_OK) {
return SWIG_OK;
}
return SWIG_ERROR;
@@ -65,11 +65,11 @@ SWIG_FromCreate_Sequence_dec(std::string)(int _size, char ***_sequence) {
}
%fragment(SWIG_FromSet_Sequence_frag(std::string), "header",
- fragment="SwigScilabStringFromCharPtrArray") {
+ fragment="SWIG_SciString_FromCharPtrArray") {
SWIGINTERN SwigSciObject
SWIG_FromSet_Sequence_dec(std::string)(int _size, char **_sequence) {
- SwigSciObject obj = SwigScilabStringFromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _sequence, _size);
+ SwigSciObject obj = SWIG_SciString_FromCharPtrArray(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _sequence, _size);
delete (char **)_sequence;
return obj;
}
View
@@ -1,14 +1,14 @@
/*
* POINTER
*/
-%fragment(SWIG_AsPtr_frag(std::string), "header", fragment="SwigScilabStringToCharPtrAndSize") {
+%fragment(SWIG_AsPtr_frag(std::string), "header", fragment="SWIG_SciString_AsCharPtrAndSize") {
SWIGINTERN int
SWIG_AsPtr_dec(std::string)(int _iVar, std::string **_pstValue) {
char* buf = 0;
size_t size = 0;
int alloc = SWIG_OLDOBJ;
- if (SWIG_IsOK((SwigScilabStringToCharPtrAndSize(pvApiCtx, _iVar, &buf, &size, &alloc, SWIG_Scilab_GetFname())))) {
+ if (SWIG_IsOK((SWIG_SciString_AsCharPtrAndSize(pvApiCtx, _iVar, &buf, &size, &alloc, SWIG_Scilab_GetFname())))) {
if (buf) {
if (_pstValue) {
*_pstValue = new std::string(buf, size);
@@ -29,10 +29,10 @@ SWIG_AsPtr_dec(std::string)(int _iVar, std::string **_pstValue) {
}
}
-%fragment(SWIG_From_frag(std::string), "header", fragment="SwigScilabStringFromCharPtr") {
+%fragment(SWIG_From_frag(std::string), "header", fragment="SWIG_SciString_FromCharPtr") {
SWIGINTERN int
SWIG_From_dec(std::string)(std::string _pstValue) {
- return SwigScilabStringFromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _pstValue.c_str());
+ return SWIG_SciString_FromCharPtr(pvApiCtx, SWIG_Scilab_GetOutputPosition(), _pstValue.c_str());
}
}

0 comments on commit 7b8becd

Please sign in to comment.