86
86
resultptr = ($<ype) malloc(sizeof($type));
87
memmove(resultptr, &$1, sizeof($type));
87
if (resultptr) memcpy(resultptr, &$1, sizeof($type));
88
88
$result = SWIG_NewPointerObj((void *)(resultptr), $&descriptor, 1);
281
281
* --- Director typemaps --- *
282
282
* ----------------------------------------------------------------------------- */
284
/* director in not needed, see python.cxx */
286
%typemap(directorin) SWIGTYPE* {
287
$input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast($1_name, $1_ltype), void*), $descriptor, 0);
290
%typemap(directorin) SWIGTYPE {
291
$input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast(&$1_name, $&1_ltype), void*), $&descriptor, 0);
294
%typemap(directorin) SWIGTYPE& {
295
$input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast(&$1_name, $1_ltype), void*), $descriptor, 0);
298
/* the const cases */
299
%typemap(directorin) SWIGTYPE const& {
300
$input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_const_cast(&$1_name, $1_ltype), void*), $descriptor, 0);
303
%typemap(directorin) SWIGTYPE const* {
304
$input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_const_cast($1_name, $1_ltype), void*), $descriptor, 0);
286
308
/* directorout */
288
310
%typemap(directorout) SWIGTYPE ($<ype argp)
289
"if ((SWIG_ConvertPtr($input, (void **)(&argp),
311
"if (!$input || (SWIG_ConvertPtr($input, (void **)(&argp),
290
312
$&descriptor, SWIG_POINTER_EXCEPTION | $disown)) == -1)
291
throw Swig::DirectorTypeMismatchException(\"Pointer conversion failed.\");
313
Swig::DirectorTypeMismatchException::raise(\"Pointer conversion failed.\");
292
314
$result = *argp;";
294
316
%typemap(directorout) SWIGTYPE *, SWIGTYPE &, SWIGTYPE []
295
"if ((SWIG_ConvertPtr($input,(void **)(&$result),
317
"if (!$input || (SWIG_ConvertPtr($input,(void **)(&$result),
296
318
$descriptor,SWIG_POINTER_EXCEPTION | $disown )) == -1)
297
throw Swig::DirectorTypeMismatchException(\"Pointer conversion failed.\");";
319
Swig::DirectorTypeMismatchException::raise(\"Pointer conversion failed.\");";
300
322
/* ------------------------------------------------------------
346
368
PyErr_SetObject((PyObject *) ($&descriptor->clientdata), SWIG_NewPointerObj(temp,$&descriptor,1));
348
370
PyErr_SetString(PyExc_RuntimeError,"$type");
350
PyErr_SetObject(PyExc_RuntimeError, SWIG_NewPointerObj(temp,$&descriptor,1));