PageRenderTime 35ms CodeModel.GetById 22ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/tags/rel-1.3.35/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%{
 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