Skip to content

Commit

Permalink
fix extern declarations
Browse files Browse the repository at this point in the history
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7321 626c5289-ae23-0410-ae9c-e8d60b6d4f22
  • Loading branch information
wsfulton committed Jun 28, 2005
1 parent c838d83 commit c47c930
Show file tree
Hide file tree
Showing 50 changed files with 232 additions and 20 deletions.
10 changes: 10 additions & 0 deletions Examples/chicken/multimap/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* File : example.i */
%module example

%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
extern int count(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
%}

%include exception.i
%include typemaps.i

Expand Down
5 changes: 4 additions & 1 deletion Examples/chicken/simple/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

%include typemaps.i

%rename(mod) my_mod;

%inline %{
extern double My_variable;
extern int fact(int);
%rename(mod) my_mod;
extern int my_mod(int n, int m);
extern char *get_time();
%}
2 changes: 2 additions & 0 deletions Examples/contract/simple_c/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@ ensure:
Circle >= 0;
}

%inline %{
extern int Circle (int x, int y, int radius);
%}
2 changes: 2 additions & 0 deletions Examples/csharp/funcptr/example.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ extern int add(int,int);
extern int sub(int,int);
extern int mul(int,int);

extern int (*funcvar)(int,int);

2 changes: 2 additions & 0 deletions Examples/csharp/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
8 changes: 8 additions & 0 deletions Examples/csharp/variables/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
%}

/* Some global variable declarations */
%inline %{
extern int ivar;
extern short svar;
extern long lvar;
Expand All @@ -23,19 +24,26 @@ extern char name[256];

extern Point *ptptr;
extern Point pt;
%}


/* Some read-only variables */

%immutable;

%inline %{
extern int status;
extern char path[256];
%}

%mutable;

/* Some helper functions to make it easier to test */
%inline %{
extern void print_vars();
extern int *new_int(int value);
extern Point *new_Point(int x, int y);
extern char *Point_print(Point *p);
extern void pt_print();
%}

10 changes: 10 additions & 0 deletions Examples/guile/multimap/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* File : example.i */
%module example

%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
extern int count(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
%}

%include exception.i
%include typemaps.i

Expand Down
2 changes: 2 additions & 0 deletions Examples/guile/simple/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@
/* Put headers and other declarations here */
%}

%inline %{
extern double My_variable;
extern int fact(int);
extern int mod(int n, int m);
extern char *get_time();
%}

%include guile/guilemain.i
2 changes: 2 additions & 0 deletions Examples/java/funcptr/example.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ extern int add(int,int);
extern int sub(int,int);
extern int mul(int,int);

extern int (*funcvar)(int,int);

9 changes: 9 additions & 0 deletions Examples/java/multimap/example.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
/* File : example.i */
%module example

%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
extern int count(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
%}

extern int gcd(int x, int y);

%typemap(jni) (int argc, char *argv[]) "jobjectArray"
Expand Down
6 changes: 6 additions & 0 deletions Examples/java/pointer/example.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* File : example.i */
%module example

%{
extern void add(int *, int *, int *);
extern void sub(int *, int *, int *);
extern int divide(int, int, int *);
%}

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

Expand Down
2 changes: 2 additions & 0 deletions Examples/java/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
11 changes: 8 additions & 3 deletions Examples/java/variables/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
%}

/* Some global variable declarations */
%inline %{
extern int ivar;
extern short svar;
extern long lvar;
Expand All @@ -23,22 +24,26 @@ extern char name[256];

extern Point *ptptr;
extern Point pt;
%}


/* Some read-only variables */

%immutable;

%inline %{
extern int status;
extern char path[256];
%}

%mutable;

/* Some helper functions to make it easier to test */
%inline %{
extern void print_vars();
extern int *new_int(int value);
extern Point *new_Point(int x, int y);
extern char *Point_print(Point *p);
extern void pt_print();



%}

2 changes: 2 additions & 0 deletions Examples/modula3/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module Example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
10 changes: 10 additions & 0 deletions Examples/mzscheme/multimap/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* File : example.i */
%module example

%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
extern int count(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
%}

%include exception.i
%include typemaps.i

Expand Down
5 changes: 4 additions & 1 deletion Examples/mzscheme/simple/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@

%include typemaps.i

%rename(mod) my_mod;

%inline %{
extern double My_variable;
extern int fact(int);
%name(mod) extern int my_mod(int n, int m);
extern int my_mod(int n, int m);
extern char *get_time();
%}
2 changes: 2 additions & 0 deletions Examples/ocaml/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
2 changes: 2 additions & 0 deletions Examples/perl5/funcptr/example.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ extern int add(int,int);
extern int sub(int,int);
extern int mul(int,int);

extern int (*funcvar)(int,int);

10 changes: 10 additions & 0 deletions Examples/perl5/multimap/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
/* File : example.i */
%module example

%{
extern int gcd(int x, int y);
extern int gcdmain(int argc, char *argv[]);
extern int count(char *bytes, int len, char c);
extern void capitalize (char *str, int len);
extern void circle (double cx, double cy);
extern int squareCubed (int n, int *OUTPUT);
%}

%include exception.i
%include typemaps.i

Expand Down
6 changes: 6 additions & 0 deletions Examples/perl5/pointer/example.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* File : example.i */
%module example

%{
extern void add(int *, int *, int *);
extern void sub(int *, int *, int *);
extern int divide(int, int, int *);
%}

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

Expand Down
2 changes: 2 additions & 0 deletions Examples/perl5/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
2 changes: 2 additions & 0 deletions Examples/perl5/value/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
%}

/* Some functions that manipulate Vectors by value */
%inline %{
extern double dot_product(Vector a, Vector b);
extern Vector vector_add(Vector a, Vector b);
%}

/* Include this because the vector_add() function will leak memory */
void free(void *);
Expand Down
11 changes: 8 additions & 3 deletions Examples/perl5/variables/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
%}

/* Some global variable declarations */
%inline %{
extern int ivar;
extern short svar;
extern long lvar;
Expand All @@ -23,22 +24,26 @@ extern char name[256];

extern Point *ptptr;
extern Point pt;
%}


/* Some read-only variables */

%immutable;

%inline %{
extern int status;
extern char path[256];
%}

%mutable;

/* Some helper functions to make it easier to test */
%inline %{
extern void print_vars();
extern int *new_int(int value);
extern Point *new_Point(int x, int y);
extern char *Point_print(Point *p);
extern void pt_print();



%}

2 changes: 2 additions & 0 deletions Examples/php4/funcptr/example.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@ extern int add(int,int);
extern int sub(int,int);
extern int mul(int,int);

extern int (*funcvar)(int,int);

6 changes: 6 additions & 0 deletions Examples/php4/pointer/example.i
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
/* File : example.i */
%module example

%{
extern void add(int *, int *, int *);
extern void sub(int *, int *, int *);
extern int divide(int, int, int *);
%}

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

Expand Down
2 changes: 2 additions & 0 deletions Examples/php4/simple/example.i
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* File : example.i */
%module example

%inline %{
extern int gcd(int x, int y);
extern double Foo;
%}
2 changes: 2 additions & 0 deletions Examples/php4/value/example.i
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
%}

/* Some functions that manipulate Vectors by value */
%inline %{
extern double dot_product(Vector a, Vector b);
extern Vector vector_add(Vector a, Vector b);
%}

/* Include this because the vector_add() function will leak memory */
void free(void *);
Expand Down
Loading

0 comments on commit c47c930

Please sign in to comment.