PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/octave/variables/example.i

#
Swig | 53 lines | 39 code | 10 blank | 4 comment | 0 complexity | 18eb27bba08ec70416d45e025ab0332c MD5 | raw file
 1/* File : example.i */
 2%module example
 3%{
 4#include "example.h"
 5%}
 6
 7#pragma SWIG nowarn=SWIGWARN_TYPEMAP_SWIGTYPELEAK
 8
 9/* Some global variable declarations */
10%inline %{
11  extern "C" {
12    extern int              ivar;
13    extern short            svar;
14    extern long             lvar;
15    extern unsigned int     uivar;
16    extern unsigned short   usvar;
17    extern unsigned long    ulvar;
18    extern signed char      scvar;
19    extern unsigned char    ucvar;
20    extern char             cvar;
21    extern float            fvar;
22    extern double           dvar;
23    extern char            *strvar;
24    //    extern const char       cstrvar[];
25    extern int             *iptrvar;
26    extern char             name[256];
27
28    extern Point           *ptptr;
29    extern Point            pt;
30  }
31%}
32
33
34/* Some read-only variables */
35
36%immutable;
37
38%inline %{
39extern int  status;
40extern char path[256];
41%}
42
43%mutable;
44
45/* Some helper functions to make it easier to test */
46%inline %{
47extern void  print_vars();
48extern int  *new_int(int value);
49extern Point *new_Point(int x, int y);
50extern char  *Point_print(Point *p);
51extern void  pt_print();
52%}
53