Added setter for global arrays.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4831 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
693edf6836
commit
dfcf44cba5
1 changed files with 12 additions and 0 deletions
|
|
@ -300,6 +300,18 @@
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%typemap(varin) SWIGTYPE [ANY] {
|
||||||
|
void *temp;
|
||||||
|
int ii;
|
||||||
|
$1_basetype *b = 0;
|
||||||
|
if ((SWIG_ConvertPtr($input,(void **) &temp, $1_descriptor, SWIG_POINTER_EXCEPTION)) == -1) {
|
||||||
|
PyErr_SetString(PyExc_TypeError, "C variable '$name ($1_ltype)'");
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
b = ($1_basetype *) $1;
|
||||||
|
for (ii = 0; ii < $1_size; ii++) b[ii] = *(($1_basetype *) temp + ii);
|
||||||
|
}
|
||||||
|
|
||||||
/* Special case for string array variables */
|
/* Special case for string array variables */
|
||||||
%typemap(varin) char [ANY] {
|
%typemap(varin) char [ANY] {
|
||||||
char *temp = (char *) PyString_AsString($input);
|
char *temp = (char *) PyString_AsString($input);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue