/trunk/Examples/test-suite/li_carrays.i
# · Swig · 28 lines · 20 code · 8 blank · 0 comment · 0 complexity · f8f324d24f1d929c6d0e94ebded1e22f MD5 · raw file
- %module li_carrays
- %warnfilter(SWIGWARN_RUBY_WRONG_NAME) doubleArray; /* Ruby, wrong class name */
- %include <carrays.i>
- %array_functions(int,intArray);
- %array_class(double, doubleArray);
- %inline %{
- typedef struct {
- int x;
- int y;
- } XY;
- XY globalXYArray[3];
- typedef struct {
- int a;
- int b;
- } AB;
- AB globalABArray[3];
- %}
- // Note that struct XY { ... }; gives compiler error for C when using %array_class or %array_functions, but is okay in C++
- %array_class(XY, XYArray)
- %array_functions(AB, ABArray)