File: example.i

package info (click to toggle)
cableswig 0.1.0%2Bcvs20060311-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 16,044 kB
  • ctags: 10,703
  • sloc: cpp: 33,966; ansic: 32,676; yacc: 3,999; makefile: 3,822; python: 2,387; ruby: 2,063; lisp: 1,841; java: 1,817; tcl: 1,097; php: 908; ml: 804; perl: 686; cs: 206; sh: 161
file content (24 lines) | stat: -rw-r--r-- 519 bytes parent folder | download | duplicates (24)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* File : example.i */
%module example

/* This example illustrates a couple of different techniques
   for manipulating C pointers */

/* First we'll use the pointer library */
extern void add(int *x, int *y, int *result);
%include cpointer.i
%pointer_functions(int, intp);

/* Next we'll use some typemaps */

%include typemaps.i
extern void sub(int *INPUT, int *INPUT, int *OUTPUT);

/* Next we'll use typemaps and the %apply directive */

%apply int *OUTPUT { int *r };
extern int divide(int n, int d, int *r);