/tags/rel-1-3-29/SWIG/Examples/test-suite/global_vars.i

# · Swig · 31 lines · 22 code · 9 blank · 0 comment · 0 complexity · 54f115c282f58497c74f47ea383067eb MD5 · raw file

  1. %module global_vars
  2. %warnfilter(SWIGWARN_TYPEMAP_SWIGTYPELEAK); /* memory leak when setting a ptr/ref variable */
  3. %include std_string.i
  4. %inline %{
  5. struct A
  6. {
  7. int x;
  8. };
  9. std::string b;
  10. A a;
  11. A *ap;
  12. const A *cap;
  13. A &ar = a;
  14. int x;
  15. int *xp;
  16. int& c = x;
  17. void *vp;
  18. enum Hello { Hi, Hola };
  19. Hello h;
  20. Hello *hp;
  21. Hello &hr = h;
  22. %}