PageRenderTime 34ms CodeModel.GetById 13ms RepoModel.GetById 1ms app.codeStats 0ms

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

#
Swig | 28 lines | 20 code | 8 blank | 0 comment | 0 complexity | f8f324d24f1d929c6d0e94ebded1e22f MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module li_carrays
  2. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) doubleArray; /* Ruby, wrong class name */
  3. %include <carrays.i>
  4. %array_functions(int,intArray);
  5. %array_class(double, doubleArray);
  6. %inline %{
  7. typedef struct {
  8. int x;
  9. int y;
  10. } XY;
  11. XY globalXYArray[3];
  12. typedef struct {
  13. int a;
  14. int b;
  15. } AB;
  16. AB globalABArray[3];
  17. %}
  18. // Note that struct XY { ... }; gives compiler error for C when using %array_class or %array_functions, but is okay in C++
  19. %array_class(XY, XYArray)
  20. %array_functions(AB, ABArray)