import source from 1.3.40
[external/swig.git] / Examples / test-suite / array_member.i
1 %module array_member
2
3 %inline %{
4
5 typedef struct Foo {
6     char   text[8]; 
7     int    data[8];
8 } Foo;
9
10 int global_data[8] = { 0,1,2,3,4,5,6,7 };
11
12 void set_value(int *x, int i, int v) {
13     x[i] = v;
14 }
15
16 int get_value(int *x, int i) {
17     return x[i];
18 }
19 %}
20
21
22
23
24
25
26 #ifdef __cplusplus
27 %inline 
28 {
29
30   struct Material
31   {
32   };
33
34   class RayPacketData {
35   public:
36     enum {
37       Size = 32
38     };
39     
40     const Material * chitMat[Size];
41     Material hitMat_val[Size];
42     Material *hitMat[Size];
43
44     const Material * chitMat2[Size][Size];
45     Material hitMat_val2[Size][Size];
46     Material *hitMat2[Size][Size];
47   };
48 }
49
50 #endif
51
52
53
54 %inline %{
55 #define BUFF_LEN 12
56
57 typedef unsigned char BUFF[BUFF_LEN]; 
58
59 typedef BUFF MY_BUFF;
60
61 typedef struct _m {
62   int i;
63   MY_BUFF x;
64 } MyBuff;
65
66
67 typedef char SBUFF[BUFF_LEN];
68 typedef SBUFF MY_SBUFF;
69 typedef struct _sm {
70   int i;
71   MY_SBUFF x;
72 } MySBuff;
73
74 %}