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