1.8. cstruct declaration

The cstruct keyword can be used like struct, and has the same effect, except that no struct is actually generated by Felix, instead, the nominated struct is assumed to be defined in embedded C/C++ header code somewhere.
Start felix section to tut/examples/tut_bind150.flx[1 /1 ]
     1: #line 580 "./lpsrc/flx_tut_bind.pak"
     2: #import <flx.flxh>
     3: 
     4: header """
     5: struct X { int a; int b; };
     6: """;
     7: body """
     8: X rev(X x) { X y; y.a=x.b; y.b=x.a; return y; }
     9: """;
    10: 
    11: cstruct X { a: int; b: int; };
    12: fun rev: X -> X = "rev($a)";
    13: val x:X = X(1,2);
    14: print x.a; print " "; print x.b; endl;
    15: val y:X = rev x;
    16: print y.a; print " "; print y.b; endl;
    17: 
End felix section to tut/examples/tut_bind150.flx[1]