~ubuntu-branches/ubuntu/oneiric/swig1.3/oneiric

« back to all changes in this revision

Viewing changes to Examples/octave/variables/example.i

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2008-06-20 18:33:37 UTC
  • mfrom: (1.2.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080620183337-hockvwcewu29409c
Tags: 1.3.35-4ubuntu1
* Merge from debian unstable, remaining changes:
  - Drop support for pike.
  - Use python2.5 instead of python2.4.
  - use php5
  - Clean Runtime/ as well.
  - Force a few environment variables.
  - debian/Rules (clean): Remove Lib/ocaml/swigp4.ml.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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 %{
 
39
extern int  status;
 
40
extern char path[256];
 
41
%}
 
42
 
 
43
%mutable;
 
44
 
 
45
/* Some helper functions to make it easier to test */
 
46
%inline %{
 
47
extern void  print_vars();
 
48
extern int  *new_int(int value);
 
49
extern Point *new_Point(int x, int y);
 
50
extern char  *Point_print(Point *p);
 
51
extern void  pt_print();
 
52
%}
 
53