File: function.i

package info (click to toggle)
swig 1.1.p883-4
  • links: PTS
  • area: main
  • in suites: woody
  • size: 9,264 kB
  • ctags: 5,129
  • sloc: cpp: 20,856; ansic: 13,627; yacc: 3,314; python: 2,794; makefile: 2,216; perl: 1,970; tcl: 1,583; sh: 716; lisp: 201; objc: 143
file content (69 lines) | stat: -rw-r--r-- 2,500 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// function.i
// SWIG interface file to test basic C function declarations
//
%module function

char           *getenv(char *envvar);
void           hello(void);
int            sum_int(int a, int b);
short          sum_short(short a, short b);
long           sum_long(long a, long b);
unsigned int   sum_uint(unsigned int a, unsigned int b);
unsigned short sum_ushort(unsigned short a, unsigned short b);
unsigned long  sum_ulong(unsigned long a, unsigned long b);
unsigned char  sum_uchar(unsigned char a, unsigned char b);
signed int     sum_sint(signed int a, signed int b);
signed short   sum_sshort(signed short a, signed short b);
signed long    sum_slong(signed long a, signed long b);
signed char    sum_schar(signed char a, signed char b);
float          sum_float(float a, float b);
double         sum_double(double a, double b);

void prints(char *s);
void printc(char c);

/* Now some pointer variables to test */

int              *sum_pint(int *a, int *b);
short            *sum_pshort(short *a, short *b);
long             *sum_plong(long *, long *b);
unsigned int     *sum_puint(unsigned int *a, unsigned int *b);
unsigned short   *sum_pushort(unsigned short *a, unsigned short *b);
unsigned long    *sum_pulong(unsigned long *a, unsigned long *b);
unsigned char    *sum_puchar(unsigned char *a, unsigned char *b);
signed int       *sum_psint(signed int *a, signed int *b);
signed short     *sum_psshort(signed short *a, signed short *b);
signed long      *sum_pslong(signed long *a, signed long *b);
signed char      *sum_pschar(signed char *a, signed char *b);
float            *sum_pfloat(float *a, float *b);
double           *sum_pdouble(double *a, double *b);
void             *incr_ptr(void *a, int incr);

Vector *  new_Vector(double x, double y, double z);
void      print_Vector(Vector *v);
Vector    addv(Vector v1, Vector v2);
int       *new_int(int a);
short     *new_short(short a);
long *new_long(long a);
unsigned int *new_uint(unsigned int a);
unsigned short *new_ushort(unsigned short a);
unsigned long *new_ulong(unsigned long a);
unsigned char *new_uchar(unsigned char a);
signed int *new_sint(signed int a);
signed short *new_sshort(signed short a);
signed long *new_slong(signed long a);
signed char *new_schar(signed char a);

float *new_float(float a);
double *new_double(double a);
void *malloc(int);

// Test some complex datatypes

struct Foo func(struct Foo);
class Bar func1(class Bar *);
union Grok func2(union Grok *);

enum Enum func3(enum Enum2);