aboutsummaryrefslogtreecommitdiff
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/python/python.swg12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/python/python.swg b/Lib/python/python.swg
index 7f61ec04a..78ee93ff2 100644
--- a/Lib/python/python.swg
+++ b/Lib/python/python.swg
@@ -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);