~ubuntu-branches/ubuntu/edgy/swig1.3/edgy

« back to all changes in this revision

Viewing changes to Lib/python/pyswigtype.swg

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-12-05 01:16:04 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051205011604-ygx904it6413k3go
Tags: 1.3.27-1ubuntu1
Resynchronise with Debian again, for the new subversion packages.

Show diffs side-by-side

added added

removed removed

Lines of Context:
84
84
{
85
85
  $&ltype resultptr;
86
86
  resultptr = ($&ltype) 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);
89
89
}
90
90
#endif
281
281
 * --- Director typemaps --- *
282
282
 * ----------------------------------------------------------------------------- */
283
283
 
284
 
/* director in not needed, see python.cxx */
 
284
/* directorin */
 
285
 
 
286
%typemap(directorin) SWIGTYPE* {
 
287
  $input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast($1_name, $1_ltype), void*), $descriptor, 0);
 
288
}
 
289
 
 
290
%typemap(directorin) SWIGTYPE {
 
291
  $input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast(&$1_name, $&1_ltype), void*), $&descriptor, 0);
 
292
}
 
293
 
 
294
%typemap(directorin) SWIGTYPE& {
 
295
  $input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_static_cast(&$1_name, $1_ltype), void*), $descriptor, 0);
 
296
}
 
297
 
 
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);
 
301
}
 
302
 
 
303
%typemap(directorin) SWIGTYPE const* {
 
304
  $input = SWIG_NewPointerObj(SWIG_static_cast(SWIG_const_cast($1_name, $1_ltype), void*), $descriptor, 0);
 
305
}
 
306
 
285
307
 
286
308
/* directorout */
287
309
 
288
310
%typemap(directorout) SWIGTYPE ($&ltype 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;";
293
315
 
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.\");";
298
320
 
299
321
 
300
322
/* ------------------------------------------------------------
346
368
    PyErr_SetObject((PyObject *) ($&descriptor->clientdata), SWIG_NewPointerObj(temp,$&descriptor,1));
347
369
  } else {
348
370
    PyErr_SetString(PyExc_RuntimeError,"$type");
349
 
    /*
350
 
      PyErr_SetObject(PyExc_RuntimeError, SWIG_NewPointerObj(temp,$&descriptor,1));
351
 
    */
352
371
  }
353
372
  SWIG_fail;
354
373
}