Improvements to array handling.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4979 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b723959561
commit
8564ddabf0
1 changed files with 13 additions and 0 deletions
|
|
@ -232,6 +232,16 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%typemap(varin) SWIGTYPE [ANY] {
|
||||||
|
int i;
|
||||||
|
$1_basetype *temp;
|
||||||
|
$1_basetype *b = ($1_basetype *) $1;
|
||||||
|
if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
|
||||||
|
croak("Type error in argument $argnum of $symname. Expected $1_mangle");
|
||||||
|
}
|
||||||
|
for (i = 0; i < $1_size; i++) b[i] = temp[i];
|
||||||
|
}
|
||||||
|
|
||||||
%typemap(varin) SWIGTYPE & {
|
%typemap(varin) SWIGTYPE & {
|
||||||
void *temp;
|
void *temp;
|
||||||
if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
|
if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
|
||||||
|
|
@ -325,6 +335,9 @@
|
||||||
%typemap(varin) char [ANY]
|
%typemap(varin) char [ANY]
|
||||||
"strncpy($1, (char *) SvPV(sv,PL_na), $1_dim0);";
|
"strncpy($1, (char *) SvPV(sv,PL_na), $1_dim0);";
|
||||||
|
|
||||||
|
%typemap(varin,warning="462: Unable to set variable of type char []") char []
|
||||||
|
{ croak("Variable $symname is read-only."); }
|
||||||
|
|
||||||
%typemap(varin) enum SWIGTYPE
|
%typemap(varin) enum SWIGTYPE
|
||||||
"$1 = ($1_type) SvIV($input);";
|
"$1 = ($1_type) SvIV($input);";
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue