/tags/rel-1-3-25/SWIG/Examples/test-suite/unions.i
Swig | 34 lines | 22 code | 7 blank | 5 comment | 0 complexity | 88d30859b858653d7efd689f644c9cc4 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- /*
- This testcase checks that unions can be set and read.
- */
- %module unions
- %inline %{
- typedef struct SmallStruct {
- short jill;
- } SmallStruct;
- typedef struct BigStruct {
- int jack;
- SmallStruct smallstruct;
- } BigStruct;
- /* This union is just to check the parser */
- typedef union {
- BigStruct bs;
- SmallStruct ss;
- } UnionTest;
- /* This union checks the parser and will be used in a runtime test */
- typedef struct {
- union
- {
- BigStruct big;
- SmallStruct small;
- } uni;
- int number;
- } EmbeddedUnionTest;
- %}