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:
Dave Beazley 2003-08-07 16:16:00 +00:00
commit 8564ddabf0

View file

@ -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 & {
void *temp;
if (SWIG_ConvertPtr($input, (void **) &temp, $1_descriptor,0) < 0) {
@ -325,6 +335,9 @@
%typemap(varin) char [ANY]
"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
"$1 = ($1_type) SvIV($input);";