Update tests & examples after Scilab API modifications
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2012-scilab@13526 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
62dbc87460
commit
53b2b4405d
5 changed files with 23 additions and 25 deletions
|
|
@ -43,7 +43,7 @@ int sci_sumitems(char *fname,unsigned long fname_len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
AssignOutputVariable(1) = nbInputArgument + 1;
|
||||
AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ int sci_getValues(char *fname,unsigned long fname_len)
|
|||
return 0;
|
||||
}
|
||||
|
||||
AssignOutputVariable(1) = nbInputArgument + 1;
|
||||
AssignOutputVariable(pvApiCtx, 1) = nbInputArgument(pvApiCtx) + 1;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,32 +19,30 @@
|
|||
|
||||
%typemap(arginit) (double** matrixAsArgOutput,int* rows, int* cols)
|
||||
{
|
||||
$1=(double**)malloc(16*sizeof(double*));
|
||||
$2=(int*)malloc(sizeof(int));
|
||||
$3=(int*)malloc(sizeof(int));
|
||||
$1=(double**)malloc(16*sizeof(double*));
|
||||
$2=(int*)malloc(sizeof(int));
|
||||
$3=(int*)malloc(sizeof(int));
|
||||
}
|
||||
|
||||
%typemap(freearg) (double** matrixAsArgOutput,int* rows, int* cols)
|
||||
{
|
||||
free(*$1);
|
||||
free($1);
|
||||
free($2);
|
||||
free($3);
|
||||
free(*$1);
|
||||
free($1);
|
||||
free($2);
|
||||
free($3);
|
||||
}
|
||||
|
||||
%typemap(argout) (double** matrixAsArgOutput,int* rows, int* cols)
|
||||
{
|
||||
sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, *$2, *$3, (double *)*$1);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return 0;
|
||||
}
|
||||
printError(&sciErr, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
AssignOutputVariable(iOutNum) = iVarOut;
|
||||
iOutNum++;
|
||||
iVarOut++;
|
||||
AssignOutputVariable(pvApiCtx, iOutNum) = iVarOut;
|
||||
iOutNum++;
|
||||
iVarOut++;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ SwigScilabInt32FromEnum(void *_pvApiCtx, int _iVarOut, int _enumValue) {
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
AssignOutputVariable(_iVarOut) = nbInputArgument + _iVarOut;
|
||||
AssignOutputVariable(pvApiCtx, _iVarOut) = nbInputArgument(pvApiCtx) + _iVarOut;
|
||||
|
||||
return SWIG_OK;
|
||||
|
||||
|
|
|
|||
|
|
@ -168,12 +168,12 @@ SWIG_Scilab_NewMemberObj(void *_pvApiCtx, int _iVarOut, void *_ptr, int _sz, swi
|
|||
}
|
||||
|
||||
SWIGRUNTIME int
|
||||
SWIG_Scilab_SetOutput(SciObject _output) {
|
||||
SWIG_Scilab_SetOutput(void *_pvApiCtx, SciObject _output) {
|
||||
int outputPosition = SWIG_Scilab_GetOutputPositionAndReset();
|
||||
if (outputPosition < 0 || _output < 0) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
AssignOutputVariable(outputPosition) = _output;
|
||||
AssignOutputVariable(_pvApiCtx, outputPosition) = _output;
|
||||
return SWIG_OK;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,12 +10,12 @@
|
|||
// In Scilab, returning void is ignored (no typemap associated)
|
||||
//#define VOID_Object ScilabObject
|
||||
|
||||
#define %append_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(obj))) return SWIG_ERROR
|
||||
#define %set_constant(name, obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(obj))) return SWIG_ERROR // Name is managed by the the function name
|
||||
#define %append_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR
|
||||
#define %set_constant(name, obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR // Name is managed by the the function name
|
||||
#define %raise(obj, type, desc) SwigScilabRaise(obj, type, desc)
|
||||
#define %set_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(obj))) return SWIG_ERROR
|
||||
#define %set_varoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(obj))) return SWIG_ERROR
|
||||
#define %set_argoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(obj))) return SWIG_ERROR
|
||||
#define %set_output(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR
|
||||
#define %set_varoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR
|
||||
#define %set_argoutput(obj) if (!SWIG_IsOK(SWIG_Scilab_SetOutput(pvApiCtx, obj))) return SWIG_ERROR
|
||||
|
||||
// Include the unified typemap library
|
||||
%include <typemaps/swigtypemaps.swg>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue