/trunk/Examples/php/cpointer/example.i
Swig | 26 lines | 8 code | 12 blank | 6 comment | 0 complexity | 7c4bd177069a5a1799201df72484686b MD5 | raw file
1/* File : example.i */ 2%module example 3 4/* This example illustrates a couple of different techniques 5 for manipulating C pointers */ 6 7/* First we'll use the pointer library */ 8extern void add(int *x, int *y, int *result); 9 10%include cpointer.i 11%pointer_functions(int, intp); 12 13/* Next we'll use some typemaps */ 14 15%include typemaps.i 16extern void sub(int *INPUT, int *INPUT, int *OUTPUT); 17 18/* Next we'll use typemaps and the %apply directive */ 19 20//%apply int *OUTPUT { int *r }; 21//extern int divide(int n, int d, int *r); 22 23 24 25 26