/tags/rel-1-3-26/SWIG/Examples/lua/pointer/example.i
Swig | 28 lines | 11 code | 11 blank | 6 comment | 0 complexity | b6b01301c0dff5d57425589a832676f7 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%{ 5 #include <stdlib.h> 6%} 7 8/* This example illustrates a couple of different techniques 9 for manipulating C pointers */ 10 11/* First we'll use the pointer library */ 12extern void add(int *x, int *y, int *result); 13%include cpointer.i 14%pointer_functions(int, intp); 15 16/* Next we'll use some typemaps */ 17 18%include typemaps.i 19extern void sub(int *INPUT, int *INPUT, int *OUTPUT); 20 21/* Next we'll use typemaps and the %apply directive */ 22 23%apply int *OUTPUT { int *r }; 24extern int divide(int n, int d, int *r); 25 26 27 28