Scilab typemap fixes for C89
This commit is contained in:
parent
9402f14393
commit
0236435c48
7 changed files with 16 additions and 32 deletions
|
|
@ -25,10 +25,8 @@
|
||||||
|
|
||||||
// in (bool *IN, int IN_SIZE)
|
// in (bool *IN, int IN_SIZE)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE)
|
%typemap(in, noblock=1, fragment="SWIG_SciBoolean_AsBoolArrayAndSize") (bool *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||||
$2 = rowCount * colCount;
|
$2 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
@ -39,10 +37,8 @@
|
||||||
|
|
||||||
// in (int IN_SIZE, bool *IN)
|
// in (int IN_SIZE, bool *IN)
|
||||||
|
|
||||||
%typemap(in, noblock=1) (int IN_SIZE, bool *IN)
|
%typemap(in, noblock=1) (int IN_SIZE, bool *IN) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
if (SWIG_SciBoolean_AsBoolArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||||
$1 = rowCount * colCount;
|
$1 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -18,17 +18,15 @@
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN)
|
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_ROWCOUNT, int IN_COLCOUNT, char **IN)
|
||||||
{
|
{
|
||||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK {
|
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &$1, &$2, &$3, fname) != SWIG_OK) {
|
||||||
return SWIG_ERROR;
|
return SWIG_ERROR;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// in (char **IN, int IN_SIZE)
|
// in (char **IN, int IN_SIZE)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE)
|
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (char **IN, int IN_SIZE) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||||
$2 = rowCount * colCount;
|
$2 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
@ -39,10 +37,8 @@
|
||||||
|
|
||||||
// in (int IN_SIZE, char **IN)
|
// in (int IN_SIZE, char **IN)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN)
|
%typemap(in, noblock=1, fragment="SWIG_SciString_AsCharPtrArrayAndSize") (int IN_SIZE, char **IN) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
if (SWIG_SciString_AsCharPtrArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||||
$1 = rowCount * colCount;
|
$1 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,8 @@
|
||||||
|
|
||||||
// in (double *IN, int IN_SIZE)
|
// in (double *IN, int IN_SIZE)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE)
|
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (double *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||||
$2 = rowCount * colCount;
|
$2 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
@ -39,10 +37,8 @@
|
||||||
|
|
||||||
// in (int IN_SIZE, double *IN)
|
// in (int IN_SIZE, double *IN)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN)
|
%typemap(in, noblock=1, fragment="SWIG_SciDouble_AsDoubleArrayAndSize") (int IN_SIZE, double *IN) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
if (SWIG_SciDouble_AsDoubleArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||||
$1 = rowCount * colCount;
|
$1 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,8 @@
|
||||||
|
|
||||||
// in (int *IN, int IN_SIZE)
|
// in (int *IN, int IN_SIZE)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE)
|
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int *IN, int IN_SIZE) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$1, fname) == SWIG_OK) {
|
||||||
$2 = rowCount * colCount;
|
$2 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
@ -42,10 +40,8 @@
|
||||||
|
|
||||||
// in (int IN_SIZE, int *IN)
|
// in (int IN_SIZE, int *IN)
|
||||||
|
|
||||||
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN)
|
%typemap(in, noblock=1, fragment="SWIG_SciDoubleOrInt32_AsIntArrayAndSize") (int IN_SIZE, int *IN) (int rowCount, int colCount)
|
||||||
{
|
{
|
||||||
int rowCount;
|
|
||||||
int colCount;
|
|
||||||
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
if (SWIG_SciDoubleOrInt32_AsIntArrayAndSize(pvApiCtx, $input, &rowCount, &colCount, &$2, fname) == SWIG_OK) {
|
||||||
$1 = rowCount * colCount;
|
$1 = rowCount * colCount;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -249,7 +249,7 @@ SWIG_Scilab_Error(int code, const char *msg)
|
||||||
|
|
||||||
#define SWIG_fail return SWIG_ERROR;
|
#define SWIG_fail return SWIG_ERROR;
|
||||||
|
|
||||||
SWIGRUNTIME int
|
SWIGRUNTIME void
|
||||||
SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) {
|
SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descriptor) {
|
||||||
if (type) {
|
if (type) {
|
||||||
if (obj)
|
if (obj)
|
||||||
|
|
@ -259,7 +259,7 @@ SWIG_Scilab_Raise_Ex(const char *obj, const char *type, swig_type_info *descript
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SWIGRUNTIME int
|
SWIGRUNTIME void
|
||||||
SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) {
|
SWIG_Scilab_Raise(const int obj, const char *type, swig_type_info *descriptor) {
|
||||||
Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occured.\n", type);
|
Scierror(SWIG_SCILAB_ERROR, "SWIG/Scilab: Exception (%s) occured.\n", type);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,10 +5,10 @@
|
||||||
|
|
||||||
// INPUT typemaps
|
// INPUT typemaps
|
||||||
%define %scilab_input_typemap(Type)
|
%define %scilab_input_typemap(Type)
|
||||||
%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp), Type &INPUT(Type temp) {
|
%typemap(in, noblock=1, fragment=SWIG_AsVal_frag(Type)) Type *INPUT(Type temp)(int ecode), Type &INPUT(Type temp)(int ecode) {
|
||||||
int ecode$argnum = SWIG_AsVal_dec(Type)($input, &temp);
|
ecode = SWIG_AsVal_dec(Type)($input, &temp);
|
||||||
if (!SWIG_IsOK(ecode$argnum)) {
|
if (!SWIG_IsOK(ecode)) {
|
||||||
%argument_fail(ecode$argnum, "$type", $symname, $argnum);
|
%argument_fail(ecode, "$type", $symname, $argnum);
|
||||||
}
|
}
|
||||||
$1 = &temp;
|
$1 = &temp;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -300,7 +300,7 @@
|
||||||
|
|
||||||
/* varout */
|
/* varout */
|
||||||
|
|
||||||
%typemap(varout,noblock=1,fragment=#SWIG_CharBufLen)
|
%typemap(varout,fragment=#SWIG_CharBufLen)
|
||||||
Char [ANY], const Char [ANY] {
|
Char [ANY], const Char [ANY] {
|
||||||
%#ifndef SWIG_PRESERVE_CARRAY_SIZE
|
%#ifndef SWIG_PRESERVE_CARRAY_SIZE
|
||||||
size_t size = SWIG_CharBufLen($1, $1_dim0);
|
size_t size = SWIG_CharBufLen($1, $1_dim0);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue