/tags/ttn-post-libtool-1-4-3-upgrade/SWIG/Examples/java/pointer/example.i
Swig | 24 lines | 8 code | 10 blank | 6 comment | 0 complexity | d87537725ae0d9d66b08ec73e4885701 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/* 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%include cpointer.i
10%pointer_functions(int, intp);
11
12/* Next we'll use some typemaps */
13
14%include typemaps.i
15extern void sub(int *INPUT, int *INPUT, int *OUTPUT);
16
17/* Next we'll use typemaps and the %apply directive */
18
19%apply int *OUTPUT { int *r };
20extern int divide(int n, int d, int *r);
21
22
23
24