PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/trunk/Examples/tcl/pointer/example.i

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