PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 1ms

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

#
Swig | 42 lines | 33 code | 9 blank | 0 comment | 0 complexity | b96107080cda75c439828039f3ec5690 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. // Test for %typemap(ignore)
  2. %module ignore_parameter
  3. %typemap(in,numinputs=0) char* a "static const char* hi = \"hello\"; $1 = const_cast<char *>(hi);";
  4. %typemap(in,numinputs=0) int bb "$1 = 101;";
  5. %typemap(in,numinputs=0) double ccc "$1 = 8.8;";
  6. %typemap(freearg) char* a ""; // ensure freearg is not generated (needed for Java at least)
  7. %inline %{
  8. // global function tests
  9. char* jaguar(char* a, int b, double c) { return a; }
  10. int lotus(char* aa, int bb, double cc) { return bb; }
  11. double tvr(char* aaa, int bbb, double ccc) { return ccc; }
  12. int ferrari(int bb) { return bb; }
  13. // member function tests
  14. struct SportsCars {
  15. char* daimler(char* a, int b, double c) { return a; }
  16. int astonmartin(char* aa, int bb, double cc) { return bb; }
  17. double bugatti(char* aaa, int bbb, double ccc) { return ccc; }
  18. int lamborghini(int bb) { return bb; }
  19. };
  20. // constructor tests
  21. struct MiniCooper {
  22. MiniCooper(char* a, int b, double c) {}
  23. };
  24. struct MorrisMinor {
  25. MorrisMinor(char* aa, int bb, double cc) {}
  26. };
  27. struct FordAnglia {
  28. FordAnglia(char* aaa, int bbb, double ccc) {}
  29. };
  30. struct AustinAllegro {
  31. AustinAllegro(int bb) {}
  32. };
  33. %}