scilab: mlists that map pointers can be given a custom type name
This commit is contained in:
parent
d3f7fd965c
commit
0c09b00d6e
3 changed files with 14 additions and 9 deletions
|
|
@ -5,6 +5,9 @@ See the RELEASENOTES file for a summary of changes in each release.
|
||||||
Version 3.0.11 (in progress)
|
Version 3.0.11 (in progress)
|
||||||
============================
|
============================
|
||||||
|
|
||||||
|
2016-09-26: smarchetto
|
||||||
|
[Scilab] mlists that map pointers can be given a custom type name.
|
||||||
|
|
||||||
2016-09-25: wsfulton
|
2016-09-25: wsfulton
|
||||||
Patch #793 from q-p to expand exception handling to include std::bad_cast
|
Patch #793 from q-p to expand exception handling to include std::bad_cast
|
||||||
in std_except.i.
|
in std_except.i.
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment("SWIG_NewPointerObj", "header") {
|
%fragment("SWIG_NewPointerObj", "header") {
|
||||||
#define SWIG_NewPointerObj(pointer, pointerDescriptor, flags) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, flags)
|
#define SWIG_NewPointerObj(pointer, pointerDescriptor, flags) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, flags, NULL)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
%fragment("SWIG_NewFunctionPtrObj", "header") {
|
%fragment("SWIG_NewFunctionPtrObj", "header") {
|
||||||
#define SWIG_NewFunctionPtrObj(pointer, pointerDescriptor) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, 0)
|
#define SWIG_NewFunctionPtrObj(pointer, pointerDescriptor) SwigScilabPtrFromObject(pvApiCtx, SWIG_Scilab_GetOutputPosition(), pointer, pointerDescriptor, 0, NULL)
|
||||||
}
|
}
|
||||||
// No fragment used here, the functions "SwigScilabPtrToObject" and "SwigScilabPtrFromObject" are defined in sciruntime.swg
|
// No fragment used here, the functions "SwigScilabPtrToObject" and "SwigScilabPtrFromObject" are defined in sciruntime.swg
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -142,10 +142,10 @@ SwigScilabCheckPtr(void *pvApiCtx, int iVar, swig_type_info *descriptor, char *f
|
||||||
if (descriptor) {
|
if (descriptor) {
|
||||||
swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info*)pvTypeinfo), descriptor);
|
swig_cast_info *cast = SWIG_TypeCheck(SWIG_TypeName((swig_type_info*)pvTypeinfo), descriptor);
|
||||||
return (cast != NULL);
|
return (cast != NULL);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return (iType == sci_pointer);
|
return (iType == sci_pointer);
|
||||||
|
|
@ -232,12 +232,11 @@ SwigScilabPtrToObject(void *pvApiCtx, int iVar, void **pvObj, swig_type_info *de
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIMEINLINE int
|
SWIGRUNTIMEINLINE int
|
||||||
SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info *descriptor, int flags) {
|
SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info *descriptor, int flags, const char *pstTypeName) {
|
||||||
SciErr sciErr;
|
SciErr sciErr;
|
||||||
|
|
||||||
if (descriptor) {
|
if (descriptor) {
|
||||||
int *piMListAddr = NULL;
|
int *piMListAddr = NULL;
|
||||||
const char *pstString;
|
|
||||||
|
|
||||||
sciErr = createMList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 3, &piMListAddr);
|
sciErr = createMList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, 3, &piMListAddr);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
|
|
@ -245,8 +244,11 @@ SwigScilabPtrFromObject(void *pvApiCtx, int iVarOut, void *pvObj, swig_type_info
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
pstString = SWIG_TypeName(descriptor);
|
if (pstTypeName == NULL) {
|
||||||
sciErr = createMatrixOfStringInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 1, 1, 1, &pstString);
|
pstTypeName = SWIG_TypeName(descriptor);
|
||||||
|
}
|
||||||
|
|
||||||
|
sciErr = createMatrixOfStringInList(pvApiCtx, SWIG_NbInputArgument(pvApiCtx) + iVarOut, piMListAddr, 1, 1, 1, &pstTypeName);
|
||||||
if (sciErr.iErr) {
|
if (sciErr.iErr) {
|
||||||
printError(&sciErr, 0);
|
printError(&sciErr, 0);
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
|
|
@ -451,7 +453,7 @@ int SWIG_ptr(SWIG_GatewayParameters) {
|
||||||
}
|
}
|
||||||
SWIG_Scilab_SetOutputPosition(1);
|
SWIG_Scilab_SetOutputPosition(1);
|
||||||
return SWIG_Scilab_SetOutput(pvApiCtx,
|
return SWIG_Scilab_SetOutput(pvApiCtx,
|
||||||
SwigScilabPtrFromObject(pvApiCtx, 1, (void *) (uintptr_t)dValue, NULL, 0));
|
SwigScilabPtrFromObject(pvApiCtx, 1, (void *) (uintptr_t)dValue, NULL, 0, NULL));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue