add array example
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/branches/gsoc2009-sploving@11478 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8217f59d55
commit
a19aea6b4b
16 changed files with 456 additions and 240 deletions
|
|
@ -1,5 +1,8 @@
|
|||
/* File : example.i */
|
||||
%module example
|
||||
%{
|
||||
#include "example.h"
|
||||
%}
|
||||
|
||||
#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK
|
||||
|
||||
|
|
@ -17,17 +20,33 @@
|
|||
extern float fvar;
|
||||
extern double dvar;
|
||||
extern char *strvar;
|
||||
// extern const char cstrvar[];
|
||||
extern int *iptrvar;
|
||||
extern char name[256];
|
||||
extern double *Foo1;
|
||||
extern double *Foo2;
|
||||
extern int *pivar;
|
||||
extern short *psvar;
|
||||
extern char **foo;
|
||||
|
||||
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();
|
||||
%}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue