PageRenderTime 50ms CodeModel.GetById 46ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 27 lines | 23 code | 4 blank | 0 comment | 0 complexity | b400bd2c0bfe1d1c03f246ab8e0a697d MD5 | raw file
 1%module nested_structs
 2
 3// bug #491476
 4%inline %{
 5struct Outer {
 6  struct {
 7    int val;
 8  } inner1, inner2, *inner3, inner4[1];
 9  struct Named {
10    int val;
11  } inside1, inside2, *inside3, inside4[1];
12} outer;
13
14void setValues(struct Outer *outer, int val) {
15  outer->inner1.val = val;
16  outer->inner2.val = val * 2;
17  outer->inner3 = &outer->inner2;
18  outer->inner4[0].val = val * 4;
19
20  val = val * 10;
21  outer->inside1.val = val;
22  outer->inside2.val = val * 2;
23  outer->inside3 = &outer->inside2;
24  outer->inside4[0].val = val * 4;
25}
26%}
27