Scilab: fix scilab primitve typemaps
This commit is contained in:
parent
9057101d70
commit
4cf15d9c1e
8 changed files with 202 additions and 156 deletions
|
|
@ -4,6 +4,8 @@ if typeof(returnSignedChar()) <> "int8" then swigtesterror(); end
|
|||
if returnSignedChar() <> int8(42) then swigtesterror(); end
|
||||
if typeof(returnUnsignedChar()) <> "uint8" then swigtesterror(); end
|
||||
if returnUnsignedChar() <> uint8(42) then swigtesterror(); end
|
||||
if typeof(returnChar()) <> "string" then swigtesterror(); end
|
||||
if returnChar() <> "a" then swigtesterror(); end
|
||||
|
||||
if typeof(returnShortAsInt16()) <> "int16" then swigtesterror(); end
|
||||
if returnShortAsInt16() <> int16(42) then swigtesterror(); end
|
||||
|
|
@ -29,14 +31,7 @@ if typeof(returnDouble()) <> "constant" then swigtesterror(); end
|
|||
if returnDouble() <> 42.42 then swigtesterror(); end
|
||||
if typeof(returnFloat()) <> "constant" then swigtesterror(); end
|
||||
if returnFloat() <> 42 then swigtesterror(); end
|
||||
if typeof(returnInt()) <> "constant" then swigtesterror(); end
|
||||
if returnInt() <> 42 then swigtesterror(); end
|
||||
if typeof(returnLong()) <> "constant" then swigtesterror(); end
|
||||
if returnLong() <> 42 then swigtesterror(); end
|
||||
if typeof(returnShort()) <> "constant" then swigtesterror(); end
|
||||
if returnShort() <> 42 then swigtesterror(); end
|
||||
if typeof(returnChar()) <> "string" then swigtesterror(); end
|
||||
if returnChar() <> "a" then swigtesterror(); end
|
||||
|
||||
|
||||
|
||||
exec("swigtest.quit", -1);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,12 @@
|
|||
%module scilab_typemaps
|
||||
|
||||
%inline %{
|
||||
/* Scilab string */
|
||||
char returnChar()
|
||||
{
|
||||
return 'a';
|
||||
}
|
||||
|
||||
/* Scilab [u]int8 */
|
||||
signed char returnSignedChar()
|
||||
{
|
||||
|
|
@ -12,11 +18,11 @@
|
|||
}
|
||||
|
||||
/* Scilab [u]int16 */
|
||||
SCI_INT16_FROM_SHORT returnShortAsInt16()
|
||||
short returnShortAsInt16()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
SCI_INT16_FROM_SIGNED_SHORT returnSignedShortAsInt16()
|
||||
signed short returnSignedShortAsInt16()
|
||||
{
|
||||
return (signed short) 42;
|
||||
}
|
||||
|
|
@ -26,19 +32,19 @@
|
|||
}
|
||||
|
||||
/* Scilab [u]int32 */
|
||||
SCI_INT32_FROM_INT returnIntAsInt32()
|
||||
int returnIntAsInt32()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
SCI_INT32_FROM_LONG returnLongAsInt32()
|
||||
long returnLongAsInt32()
|
||||
{
|
||||
return (long) 42;
|
||||
}
|
||||
SCI_INT32_FROM_SIGNED_INT returnSignedIntAsInt32()
|
||||
signed int returnSignedIntAsInt32()
|
||||
{
|
||||
return (signed int) 42;
|
||||
}
|
||||
SCI_INT32_FROM_SIGNED_LONG returnSignedLongAsInt32()
|
||||
signed long returnSignedLongAsInt32()
|
||||
{
|
||||
return (signed long) 42;
|
||||
}
|
||||
|
|
@ -60,34 +66,5 @@
|
|||
{
|
||||
return (float) 42;
|
||||
}
|
||||
int returnInt()
|
||||
{
|
||||
return 42;
|
||||
}
|
||||
signed int returnSignedInt()
|
||||
{
|
||||
return (signed int) 42;
|
||||
}
|
||||
long returnLong()
|
||||
{
|
||||
return (long) 42;
|
||||
}
|
||||
signed long returnSignedLong()
|
||||
{
|
||||
return (signed long) 42;
|
||||
}
|
||||
char returnChar()
|
||||
{
|
||||
return 'a';
|
||||
}
|
||||
short returnShort()
|
||||
{
|
||||
return (short) 42;
|
||||
}
|
||||
signed short returnSignedShort()
|
||||
{
|
||||
return (signed short) 42;
|
||||
}
|
||||
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,14 @@
|
|||
/*
|
||||
* C-type: int
|
||||
* Scilab type: 32-bit signed integer or double scalar
|
||||
* Scilab type: 32-bit signed integer
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(int), "header") {
|
||||
|
||||
%fragment(SWIG_AsVal_frag(int), "header", fragment="SWIG_SciInt32_AsInt") {
|
||||
#define SWIG_AsVal_int(scilabValue, valuePointer) SWIG_SciInt32_AsInt(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||
}
|
||||
%fragment("SWIG_SciInt32_AsInt", "header") {
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
||||
SWIG_SciInt32_AsInt(void *_pvApiCtx, SwigSciObject _iVar, int *_piValue, char *_fname)
|
||||
{
|
||||
SciErr sciErr;
|
||||
int iRet = 0;
|
||||
|
|
@ -12,14 +16,14 @@ SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
|||
int iPrecision = 0;
|
||||
int iValue;
|
||||
|
||||
sciErr = getVarAddressFromPosition(pvApiCtx, _iVar, &piAddrVar);
|
||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
if (!isScalar(pvApiCtx, piAddrVar))
|
||||
if (!isScalar(_pvApiCtx, piAddrVar))
|
||||
{
|
||||
Scierror(999, _("%s: Wrong size for argument %d: a scalar expected.\n"),
|
||||
SWIG_Scilab_GetFname(),_iVar);
|
||||
|
|
@ -27,10 +31,10 @@ SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
|||
}
|
||||
|
||||
// Accepts double or 32-bit signed integer
|
||||
if (isDoubleType(pvApiCtx, piAddrVar) && !isVarComplex(pvApiCtx, piAddrVar))
|
||||
if (isDoubleType(_pvApiCtx, piAddrVar) && !isVarComplex(_pvApiCtx, piAddrVar))
|
||||
{
|
||||
double dValue = 0.0;
|
||||
iRet = getScalarDouble(pvApiCtx, piAddrVar, &dValue);
|
||||
iRet = getScalarDouble(_pvApiCtx, piAddrVar, &dValue);
|
||||
if (iRet)
|
||||
{
|
||||
return SWIG_ERROR;
|
||||
|
|
@ -40,7 +44,7 @@ SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
|||
}
|
||||
else if (isIntegerType(pvApiCtx, piAddrVar))
|
||||
{
|
||||
sciErr = getMatrixOfIntegerPrecision(pvApiCtx, piAddrVar, &iPrecision);
|
||||
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrecision);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
|
|
@ -49,7 +53,7 @@ SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
|||
|
||||
if (iPrecision == SCI_INT32)
|
||||
{
|
||||
iRet = getScalarInteger32(pvApiCtx, piAddrVar, &iValue);
|
||||
iRet = getScalarInteger32(_pvApiCtx, piAddrVar, &iValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -69,12 +73,44 @@ SWIG_AsVal_dec(int)(SwigSciObject _iVar, int *_piValue)
|
|||
}
|
||||
}
|
||||
}
|
||||
%fragment(SWIG_AsVal_frag(size_t), "header", fragment=SWIG_AsVal_frag(int)) {
|
||||
|
||||
%fragment(SWIG_From_frag(int), "header", fragment="SWIG_SciInt32_FromInt") {
|
||||
#define SWIG_From_int(scilabValue) SWIG_SciInt32_FromInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciInt32_FromInt", "header") {
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(size_t)(SwigSciObject _iVar, size_t *_piValue)
|
||||
SWIG_SciInt32_FromInt(void *_pvApiCtx, int _iVarOut, int _iValue)
|
||||
{
|
||||
SciErr sciErr;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
|
||||
sciErr = createMatrixOfInteger32(_pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut, iRowsOut, iColsOut, &_iValue);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* C-type: size_t
|
||||
* Scilab type: 32-bit signed integer
|
||||
*/
|
||||
|
||||
%fragment(SWIG_AsVal_frag(size_t), "header", fragment="SWIG_SciInt32_AsSize") {
|
||||
#define SWIG_AsVal_size_t(scilabValue, valuePointer) SWIG_SciInt32_AsSize(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||
}
|
||||
%fragment("SWIG_SciInt32_AsSize", "header", fragment="SWIG_SciInt32_AsInt")
|
||||
{
|
||||
SWIGINTERN int
|
||||
SWIG_SciInt32_AsSize(void *_pvApiCtx, SwigSciObject _iVar, size_t *_piValue, char *_fname)
|
||||
{
|
||||
int iValue = 0;
|
||||
if (SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK)
|
||||
if (SWIG_SciInt32_AsInt(_pvApiCtx, _iVar, &iValue, fname) != SWIG_OK)
|
||||
{
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
|
@ -86,34 +122,17 @@ SWIG_AsVal_dec(size_t)(SwigSciObject _iVar, size_t *_piValue)
|
|||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_From_frag(int), "header") {
|
||||
%fragment(SWIG_From_frag(size_t), "header", fragment="SWIG_SciInt32_FromSize") {
|
||||
#define SWIG_From_size_t(scilabValue) SWIG_SciInt32_FromSize(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciInt32_FromSize", "header", fragment="SWIG_SciInt32_FromInt") {
|
||||
SWIGINTERN int
|
||||
SWIG_From_dec(int)(int _iValue)
|
||||
SWIG_SciInt32_FromSize(void *_pvApiCtx, int _iVarOut, size_t _iValue)
|
||||
{
|
||||
SciErr sciErr;
|
||||
double dblDoubleValue = (double) _iValue;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
int iVarOut = SWIG_NbInputArgument(pvApiCtx) + SWIG_Scilab_GetOutputPosition();
|
||||
return SWIG_SciInt32_FromInt(_pvApiCtx, _iVarOut, (int)_iValue);
|
||||
}
|
||||
}
|
||||
|
||||
sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &dblDoubleValue);
|
||||
if (sciErr.iErr)
|
||||
{
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return iVarOut;
|
||||
}
|
||||
}
|
||||
%fragment(SWIG_From_frag(size_t), "header", fragment=SWIG_From_frag(int))
|
||||
{
|
||||
SWIGINTERN int
|
||||
SWIG_From_dec(size_t)(size_t _iValue)
|
||||
{
|
||||
return SWIG_From_dec(int)((int)_iValue);
|
||||
}
|
||||
}
|
||||
/*
|
||||
* C-type: int
|
||||
* Scilab type: 32-bit signed integer matrix
|
||||
|
|
@ -182,6 +201,7 @@ SWIG_SciInt32_AsIntArrayAndSize(void *_pvApiCtx, int _iVar, int *_iRows, int *_i
|
|||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
%fragment("SWIG_SciInt32_FromIntArrayAndSize", "header") {
|
||||
SWIGINTERN int
|
||||
SWIG_SciInt32_FromIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, const int *_piData) {
|
||||
|
|
@ -196,6 +216,7 @@ SWIG_SciInt32_FromIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int
|
|||
return Rhs + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_CreateScilabVariable_frag(int), "wrapper") {
|
||||
SWIGINTERN int
|
||||
SWIG_CreateScilabVariable_dec(int)(void *_pvApiCtx, const char* _psVariableName, const int _iVariableValue) {
|
||||
|
|
|
|||
|
|
@ -1,70 +1,66 @@
|
|||
/*
|
||||
* C-type: long
|
||||
* Scilab type: double scalar
|
||||
* Scilab type: int32
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(long), "header", fragment=SWIG_AsVal_frag(double)) {
|
||||
|
||||
%fragment(SWIG_AsVal_frag(long), "header", fragment="SWIG_SciInt32_AsLong") {
|
||||
#define SWIG_AsVal_long(scilabValue, valuePointer) SWIG_SciInt32_AsLong(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname());
|
||||
}
|
||||
%fragment("SWIG_SciInt32_AsLong", "header", fragment="SWIG_SciInt32_AsInt") {
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(long)(SwigSciObject _iVar, long *_plValue) {
|
||||
double dblValue = 0.0;
|
||||
if(SWIG_AsVal_dec(double)(_iVar, &dblValue) != SWIG_OK) {
|
||||
SWIG_SciInt32_AsLong(void *_pvApiCtx, SwigSciObject _iVar, long *_plValue, char *_fname) {
|
||||
int iValue = 0.0;
|
||||
if(SWIG_SciInt32_AsInt(_pvApiCtx, _iVar, &iValue, _fname) != SWIG_OK) {
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
*_plValue = (long) dblValue;
|
||||
*_plValue = (long) iValue;
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_From_frag(long), "header") {
|
||||
%fragment(SWIG_From_frag(long), "header", fragment="SWIG_SciInt32_FromLong") {
|
||||
#define SWIG_From_long(scilabValue) SWIG_SciInt32_FromLong(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciInt32_FromLong", "header", fragment="SWIG_SciInt32_FromInt") {
|
||||
SWIGINTERN int
|
||||
SWIG_From_dec(long)(long _lValue) {
|
||||
SciErr sciErr;
|
||||
double dblDoubleValue = (double) _lValue;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
int iVarOut = Rhs + SWIG_Scilab_GetOutputPosition();
|
||||
|
||||
sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &dblDoubleValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return iVarOut;
|
||||
SWIG_SciInt32_FromLong(void *_pvApiCtx, int _iVarOut, long _lValue) {
|
||||
return SWIG_SciInt32_FromInt(_pvApiCtx, _iVarOut, (int)_lValue);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* C-type: unsigned long
|
||||
* Scilab type: double scalar
|
||||
* C-type: ptrdiff_t
|
||||
* Scilab type: int32
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(unsigned long), "header", fragment=SWIG_AsVal_frag(double)) {
|
||||
|
||||
%fragment(SWIG_AsVal_frag(ptrdiff_t), "header", fragment="SWIG_SciInt32_AsPtrDiff") {
|
||||
#define SWIG_AsVal_ptrdiff_t(scilabValue, valuePointer) SWIG_SciInt32_AsPtrDiff(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||
}
|
||||
%fragment("SWIG_SciInt32_AsPtrDiff", "header", fragment="SWIG_SciInt32_AsInt")
|
||||
{
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(unsigned long)(SwigSciObject _iVar, unsigned long *_pulValue) {
|
||||
double dblValue = 0.0;
|
||||
if(SWIG_AsVal_dec(double)(_iVar, &dblValue) != SWIG_OK) {
|
||||
SWIG_SciInt32_AsPtrDiff(void *_pvApiCtx, SwigSciObject _iVar, ptrdiff_t *_piValue, char *_fname)
|
||||
{
|
||||
int iValue = 0;
|
||||
if (SWIG_SciInt32_AsInt(_pvApiCtx, _iVar, &iValue, fname) != SWIG_OK)
|
||||
{
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
*_pulValue = (unsigned long) dblValue;
|
||||
if (_piValue)
|
||||
{
|
||||
*_piValue = (ptrdiff_t) iValue;
|
||||
}
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
%fragment(SWIG_From_frag(unsigned long), "header") {
|
||||
%fragment(SWIG_From_frag(ptrdiff_t), "header", fragment="SWIG_SciInt32_FromPtrDiff") {
|
||||
#define SWIG_From_ptrdiff_t(scilabValue) SWIG_SciInt32_FromPtrDiff(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciInt32_FromPtrDiff", "header", fragment="SWIG_SciInt32_FromInt") {
|
||||
SWIGINTERN int
|
||||
SWIG_From_dec(unsigned long)(unsigned long _ulValue) {
|
||||
SciErr sciErr;
|
||||
double dblDoubleValue = (double) _ulValue;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
int iVarOut = Rhs + SWIG_Scilab_GetOutputPosition();
|
||||
|
||||
sciErr = createMatrixOfDouble(pvApiCtx, iVarOut, iRowsOut, iColsOut, &dblDoubleValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return iVarOut;
|
||||
SWIG_SciInt32_FromPtrDiff(void *_pvApiCtx, int _iVarOut, ptrdiff_t _iValue)
|
||||
{
|
||||
return SWIG_SciInt32_FromInt(_pvApiCtx, _iVarOut, (int)_iValue);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
%include <scidouble.swg>
|
||||
%include <scilong.swg>
|
||||
%include <scifloat.swg>
|
||||
|
||||
%include <scilonglong.swg>
|
||||
|
|
@ -7,6 +6,9 @@
|
|||
%include <sciint.swg>
|
||||
%include <sciunsignedint.swg>
|
||||
|
||||
%include <scilong.swg>
|
||||
%include <sciunsignedlong.swg>
|
||||
|
||||
%include <scishort.swg>
|
||||
%include <sciunsignedshort.swg>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,23 +2,78 @@
|
|||
* C-type: short
|
||||
* Scilab type: double scalar
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(short), "header", fragment=SWIG_AsVal_frag(int)) {
|
||||
|
||||
%fragment(SWIG_AsVal_frag(short), "header", fragment="SWIG_SciInt16_AsShort") {
|
||||
#define SWIG_AsVal_short(scilabValue, valuePointer) SWIG_SciInt16_AsShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||
}
|
||||
%fragment("SWIG_SciInt16_AsShort", "header") {
|
||||
SWIGINTERN int
|
||||
SWIG_AsVal_dec(short)(SwigSciObject _iVar, short *_pshValue) {
|
||||
int iValue = 0.0;
|
||||
if(SWIG_AsVal_dec(int)(_iVar, &iValue) != SWIG_OK) {
|
||||
SWIG_SciInt16_AsShort(void *_pvApiCtx, int _iVar, short *_psValue, char *_fname) {
|
||||
SciErr sciErr;
|
||||
int iType = 0;
|
||||
int iRows = 0;
|
||||
int iCols = 0;
|
||||
int iPrec = 0;
|
||||
int *piAddrVar = NULL;
|
||||
short *psData = NULL;
|
||||
|
||||
sciErr = getVarAddressFromPosition(_pvApiCtx, _iVar, &piAddrVar);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
*_pshValue = (short) iValue;
|
||||
|
||||
sciErr = getVarType(_pvApiCtx, piAddrVar, &iType);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
if (iType != sci_ints) {
|
||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer expected.\n"), _fname, _iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getMatrixOfIntegerPrecision(_pvApiCtx, piAddrVar, &iPrec);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
if (iPrec != SCI_INT16) {
|
||||
Scierror(999, _("%s: Wrong type for input argument #%d: A 16-bit signed integer expected.\n"), _fname, _iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
sciErr = getMatrixOfInteger16(_pvApiCtx, piAddrVar, &iRows, &iCols, &psData);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
if (iRows * iCols != 1) {
|
||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit signed integer expected.\n"), _fname, _iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
*_psValue = *psData;
|
||||
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_From_frag(short), "header", fragment=SWIG_From_frag(int)) {
|
||||
%fragment(SWIG_From_frag(short), "header", fragment="SWIG_SciInt16_FromShort") {
|
||||
#define SWIG_From_short(scilabValue) SWIG_SciInt16_FromShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciInt16_FromShort", "header") {
|
||||
SWIGINTERN int
|
||||
SWIG_From_dec(short)(short _shValue) {
|
||||
int iValue = (int) _shValue;
|
||||
return SWIG_From_dec(int)(iValue);
|
||||
SWIG_SciInt16_FromShort(void *_pvApiCtx, int _iVarOut, signed short _usValue) {
|
||||
SciErr sciErr;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
sciErr = createMatrixOfInteger16(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, iRowsOut, iColsOut, &_usValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -78,14 +133,13 @@ SWIG_SciInt16_AsShortArrayAndSize(void *_pvApiCtx, int _iVar, int *_iRows, int *
|
|||
SWIGINTERN int
|
||||
SWIG_SciInt16_FromShortArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, short *_psValue) {
|
||||
SciErr sciErr;
|
||||
|
||||
sciErr = createMatrixOfInteger16(_pvApiCtx, Rhs + _iVarOut, _iRows, _iCols, _psValue);
|
||||
sciErr = createMatrixOfInteger16(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, _psValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return Rhs + _iVarOut;
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
* C-type: unsigned int
|
||||
* Scilab type: uint32 scalar
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(unsigned int), "header", fragment="SwigScilabUint32ToUnsignedInt") {
|
||||
#define SWIG_AsVal_unsigned_SS_int(scilabValue, valuePointer) SwigScilabUint32ToUnsignedInt(pvApiCtx, scilabValue, valuePointer, fname)
|
||||
%fragment(SWIG_AsVal_frag(unsigned int), "header", fragment="SWIG_SciUint32_AsUnsignedInt") {
|
||||
#define SWIG_AsVal_unsigned_SS_int(scilabValue, valuePointer) SWIG_SciUint32_AsUnsignedInt(pvApiCtx, scilabValue, valuePointer, fname)
|
||||
}
|
||||
%fragment("SwigScilabUint32ToUnsignedInt", "header") {
|
||||
%fragment("SWIG_SciUint32_AsUnsignedInt", "header") {
|
||||
SWIGINTERN int
|
||||
SwigScilabUint32ToUnsignedInt(void *_pvApiCtx, int _iVar, unsigned int *_puiValue, char *_fname) {
|
||||
SWIG_SciUint32_AsUnsignedInt(void *_pvApiCtx, int _iVar, unsigned int *_puiValue, char *_fname) {
|
||||
SciErr sciErr;
|
||||
int iType = 0;
|
||||
int iRows = 0;
|
||||
|
|
@ -57,23 +57,24 @@ SwigScilabUint32ToUnsignedInt(void *_pvApiCtx, int _iVar, unsigned int *_puiValu
|
|||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
%fragment(SWIG_From_frag(unsigned int), "header", fragment="SwigScilabUint32FromUnsignedInt") {
|
||||
#define SWIG_From_unsigned_SS_int(value) SwigScilabUint32FromUnsignedInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value)
|
||||
|
||||
%fragment(SWIG_From_frag(unsigned int), "header", fragment="SWIG_SciUint32_FromUnsignedInt") {
|
||||
#define SWIG_From_unsigned_SS_int(scilabValue) SWIG_SciUint32_FromUnsignedInt(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SwigScilabUint32FromUnsignedInt", "header") {
|
||||
%fragment("SWIG_SciUint32_FromUnsignedInt", "header") {
|
||||
SWIGINTERN int
|
||||
SwigScilabUint32FromUnsignedInt(void *_pvApiCtx, int _iVarOut, unsigned int _uiValue) {
|
||||
SWIG_SciUint32_FromUnsignedInt(void *_pvApiCtx, int _iVarOut, unsigned int _uiValue) {
|
||||
SciErr sciErr;
|
||||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
|
||||
sciErr = createMatrixOfUnsignedInteger32(_pvApiCtx, Rhs + _iVarOut, iRowsOut, iColsOut, &_uiValue);
|
||||
sciErr = createMatrixOfUnsignedInteger32(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, iRowsOut, iColsOut, &_uiValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return Rhs + _iVarOut;
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -129,13 +130,13 @@ SWIGINTERN int
|
|||
SWIG_SciUint32_FromUnsignedIntArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, unsigned int *_puiValue) {
|
||||
SciErr sciErr;
|
||||
|
||||
sciErr = createMatrixOfUnsignedInteger32(_pvApiCtx, Rhs + _iVarOut, _iRows, _iCols, _puiValue);
|
||||
sciErr = createMatrixOfUnsignedInteger32(_pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + _iVarOut, _iRows, _iCols, _puiValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return Rhs + _iVarOut;
|
||||
return SWIG_NbInputArgument(pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
* Scilab type: uint16 scalar
|
||||
*/
|
||||
%fragment(SWIG_AsVal_frag(unsigned short), "header", fragment="SWIG_SciUint16_AsUnsignedShort") {
|
||||
#define SWIG_AsVal_unsigned_SS_short(scilabValue, valuePointer) SWIG_SciUint16_AsUnsignedShort(pvApiCtx, scilabValue, valuePointer, fname)
|
||||
#define SWIG_AsVal_unsigned_short(scilabValue, valuePointer) SWIG_SciUint16_AsUnsignedShort(pvApiCtx, scilabValue, valuePointer, SWIG_Scilab_GetFname())
|
||||
}
|
||||
%fragment("SWIG_SciUint16_AsUnsignedShort", "header") {
|
||||
SWIGINTERN int
|
||||
|
|
@ -48,7 +48,7 @@ SWIG_SciUint16_AsUnsignedShort(void *_pvApiCtx, int _iVar, unsigned short *_pusV
|
|||
return SWIG_ERROR;
|
||||
}
|
||||
if (iRows * iCols != 1) {
|
||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 32-bit unsigned integer expected.\n"), _fname, _iVar);
|
||||
Scierror(999, _("%s: Wrong size for input argument #%d: A 16-bit unsigned integer expected.\n"), _fname, _iVar);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +59,7 @@ SWIG_SciUint16_AsUnsignedShort(void *_pvApiCtx, int _iVar, unsigned short *_pusV
|
|||
}
|
||||
|
||||
%fragment(SWIG_From_frag(unsigned short), "header", fragment="SWIG_SciUint16_FromUnsignedShort") {
|
||||
#define SWIG_From_unsigned_SS_short(value) SWIG_SciUint16_FromUnsignedShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), value)
|
||||
#define SWIG_From_unsigned_SS_short(scilabValue) SWIG_SciUint16_FromUnsignedShort(pvApiCtx, SWIG_Scilab_GetOutputPosition(), scilabValue)
|
||||
}
|
||||
%fragment("SWIG_SciUint16_FromUnsignedShort", "header") {
|
||||
SWIGINTERN int
|
||||
|
|
@ -68,13 +68,13 @@ SWIG_SciUint16_FromUnsignedShort(void *_pvApiCtx, int _iVarOut, unsigned short _
|
|||
int iRowsOut = 1;
|
||||
int iColsOut = 1;
|
||||
|
||||
sciErr = createMatrixOfUnsignedInteger16(_pvApiCtx, Rhs + _iVarOut, iRowsOut, iColsOut, &_usValue);
|
||||
sciErr = createMatrixOfUnsignedInteger16(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, iRowsOut, iColsOut, &_usValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return Rhs + _iVarOut;
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -130,12 +130,12 @@ SWIGINTERN int
|
|||
SWIG_SciUint16_FromUnsignedShortArrayAndSize(void *_pvApiCtx, int _iVarOut, int _iRows, int _iCols, unsigned short *_pusValue) {
|
||||
SciErr sciErr;
|
||||
|
||||
sciErr = createMatrixOfUnsignedInteger16(_pvApiCtx, Rhs + _iVarOut, _iRows, _iCols, _pusValue);
|
||||
sciErr = createMatrixOfUnsignedInteger16(_pvApiCtx, SWIG_NbInputArgument(_pvApiCtx) + _iVarOut, _iRows, _iCols, _pusValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
|
||||
return Rhs + _iVarOut;
|
||||
return SWIG_NbInputArgument(_pvApiCtx) + _iVarOut;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue