scilab: support typed constants (U UL L) in scilabconst(1)
This commit is contained in:
parent
6791e3ac7a
commit
20fc167624
4 changed files with 70 additions and 26 deletions
|
|
@ -174,15 +174,33 @@
|
|||
/* %scilabconstcode() feature typemaps */
|
||||
/* ---------------------------------------------------------------------------*/
|
||||
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) double
|
||||
%{
|
||||
if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
return SWIG_ERROR;
|
||||
%}
|
||||
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) int
|
||||
%{
|
||||
if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
return SWIG_ERROR;
|
||||
%}
|
||||
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(double)) double
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned int
|
||||
%{
|
||||
if (SWIG_CreateScilabVariable_double(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
return SWIG_ERROR;
|
||||
%}
|
||||
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(int)) long
|
||||
%{
|
||||
if (SWIG_CreateScilabVariable_int(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
return SWIG_ERROR;
|
||||
%}
|
||||
|
||||
%typemap(scilabconstcode, fragment=SWIG_CreateScilabVariable_frag(uint)) unsigned long
|
||||
%{
|
||||
if (SWIG_CreateScilabVariable_uint(pvApiCtx, "$result", $value) != SWIG_OK)
|
||||
return SWIG_ERROR;
|
||||
%}
|
||||
|
||||
|
|
|
|||
|
|
@ -189,3 +189,16 @@ SWIG_SciDouble_FromUnsignedIntArrayAndSize(void *pvApiCtx, int iVarOut, int iRow
|
|||
}
|
||||
}
|
||||
|
||||
%fragment(SWIG_CreateScilabVariable_frag(uint), "wrapper") {
|
||||
SWIGINTERN int
|
||||
SWIG_CreateScilabVariable_dec(uint)(void *pvApiCtx, const char* psVariableName, const unsigned int uiVariableValue) {
|
||||
SciErr sciErr;
|
||||
sciErr = createNamedMatrixOfUnsignedInteger32(pvApiCtx, psVariableName, 1, 1, &uiVariableValue);
|
||||
if (sciErr.iErr) {
|
||||
printError(&sciErr, 0);
|
||||
return SWIG_ERROR;
|
||||
}
|
||||
return SWIG_OK;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue