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
|
%module typedef_struct
%inline %{
typedef struct {
int numpoints;
} LineObj;
typedef LineObj MultipointObj;
typedef struct {
#ifdef SWIG
%immutable;
#endif
char *filename;
int numfonts;
#ifdef SWIG
%mutable;
#endif
int* fonts;
#ifndef SWIG
void* map;
#endif
} FontSetObj;
#define MS_NOOVERRIDE -1111
%}
%inline %{
typedef struct {
int a;
int b;
} A_t, *B_t;
A_t* make_a() {
return (A_t*)malloc(sizeof(A_t));
}
B_t make_b() {
return make_a();
}
%}
|