Added setter for global arrays.
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@4831 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
fc66bde4c1
commit
e7793fb51c
1 changed files with 12 additions and 0 deletions
|
|
@ -300,6 +300,18 @@
|
|||
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 */
|
||||
%typemap(varin) char [ANY] {
|
||||
char *temp = (char *) PyString_AsString($input);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue