PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/test-suite/array_member.i

#
Swig | 74 lines | 49 code | 25 blank | 0 comment | 0 complexity | 0949878828eb63af24529db8eb7cd3fa MD5 | raw file
 1%module array_member
 2
 3%inline %{
 4
 5typedef struct Foo {
 6    char   text[8]; 
 7    int    data[8];
 8} Foo;
 9
10int global_data[8] = { 0,1,2,3,4,5,6,7 };
11
12void set_value(int *x, int i, int v) {
13    x[i] = v;
14}
15
16int 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
57typedef unsigned char BUFF[BUFF_LEN]; 
58
59typedef BUFF MY_BUFF;
60
61typedef struct _m {
62  int i;
63  MY_BUFF x;
64} MyBuff;
65
66
67typedef char SBUFF[BUFF_LEN];
68typedef SBUFF MY_SBUFF;
69typedef struct _sm {
70  int i;
71  MY_SBUFF x;
72} MySBuff;
73
74%}