PageRenderTime 40ms CodeModel.GetById 14ms RepoModel.GetById 0ms app.codeStats 0ms

/tags/Root-branch-php-utl/SWIG/Examples/tcl/pointer/example.i

#
Swig | 31 lines | 13 code | 12 blank | 6 comment | 0 complexity | 7c8ba7846c336a71eaf55d7f0ed8c2e0 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. %{
  4. extern void add(int *, int *, int *);
  5. extern void sub(int *, int *, int *);
  6. extern int divide(int, int, int *);
  7. %}
  8. /* This example illustrates a couple of different techniques
  9. for manipulating C pointers */
  10. /* First we'll use the pointer library */
  11. extern void add(int *x, int *y, int *result);
  12. %include cpointer.i
  13. %pointer_functions(int, intp);
  14. /* Next we'll use some typemaps */
  15. %include typemaps.i
  16. extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
  17. /* Next we'll use typemaps and the %apply directive */
  18. %apply int *OUTPUT { int *r };
  19. extern int divide(int n, int d, int *r);