PageRenderTime 43ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Examples/xml/gnarly.i

#
Swig | 63 lines | 48 code | 14 blank | 1 comment | 0 complexity | 82e43e237cda2badf35cc2105f0465c8 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* File : check.i */
  2. %module my_check
  3. enum color { RED=10, BLUE, GREEN };
  4. class Foo {
  5. public:
  6. Foo() { }
  7. enum speed { IMPULSE, WARP, LUDICROUS };
  8. void enum_test(speed s);
  9. };
  10. void enum_test(color c, Foo::speed s);
  11. %typemap(out) int * {
  12. WHATEVER MAKES YOU HAPPY AS RESULT
  13. }
  14. %typemap(in) int * {
  15. WHATEVER MAKES YOU HAPPY AS PARAMETER
  16. }
  17. %pragma(xml) DEBUG="false";
  18. extern int * my_gcd(const char * x, int * y[], int * r, int (*op)(int,int)) const;
  19. extern double my_foo;
  20. void my_void();
  21. my_empty();
  22. const double my_dutch = 1.0;
  23. union my_union
  24. {
  25. int my_iii;
  26. char my_ccc;
  27. };
  28. struct my_struct
  29. {
  30. public:
  31. virtual ~my_struct();
  32. int my_foo();
  33. protected:
  34. int my_bar;
  35. double x, y;
  36. virtual double area() = 0;
  37. static int nshapes;
  38. };
  39. class my_class : public my_struct, public my_union
  40. {
  41. public:
  42. my_class( char c );
  43. private:
  44. ~my_class();
  45. virtual const int * my_func( my_class , char * * x, int y[], const int & r) const;
  46. double my_foo[128];
  47. const my_int i;
  48. };
  49. typedef int my_int;