PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/php/cpointer/example.i

#
Swig | 26 lines | 8 code | 12 blank | 6 comment | 0 complexity | 7c4bd177069a5a1799201df72484686b MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : example.i */
  2. %module example
  3. /* This example illustrates a couple of different techniques
  4. for manipulating C pointers */
  5. /* First we'll use the pointer library */
  6. extern void add(int *x, int *y, int *result);
  7. %include cpointer.i
  8. %pointer_functions(int, intp);
  9. /* Next we'll use some typemaps */
  10. %include typemaps.i
  11. extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
  12. /* Next we'll use typemaps and the %apply directive */
  13. //%apply int *OUTPUT { int *r };
  14. //extern int divide(int n, int d, int *r);