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

# · Swig · 19 lines · 12 code · 6 blank · 1 comment · 0 complexity · e6ee3353ec5b1ddeeb5e874525c84c9e MD5 · raw file

  1. /* Simple test to check SWIG's handling of return by value */
  2. %module ret_by_value
  3. %warnfilter(SWIGWARN_RUBY_WRONG_NAME) test; /* Ruby, wrong class name */
  4. %inline %{
  5. typedef struct {
  6. int myInt;
  7. short myShort;
  8. } test;
  9. test get_test() {
  10. test myTest = {100, 200};
  11. return myTest;
  12. }
  13. %}