PageRenderTime 36ms CodeModel.GetById 11ms RepoModel.GetById 0ms app.codeStats 0ms

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

#
Swig | 76 lines | 68 code | 8 blank | 0 comment | 0 complexity | 73020efd0f981c539b8b30c87bbb826a MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. %module typemap_qualifier_strip
  2. %typemap(in) int *ptr {
  3. int temp = 1234;
  4. $1 = &temp;
  5. }
  6. %typemap(in) int *const ptrConst {
  7. int temp = 5678;
  8. $1 = &temp;
  9. }
  10. %typemap(in) int const* constPtr {
  11. int temp = 3456;
  12. $1 = &temp;
  13. }
  14. %inline %{
  15. int *create_int(int newval) {
  16. static int val = 0;
  17. val = newval;
  18. return &val;
  19. }
  20. int testA1(int const*const ptr) {
  21. return *ptr;
  22. }
  23. int testA2(int const* ptr) {
  24. return *ptr;
  25. }
  26. int testA3(int *const ptr) {
  27. return *ptr;
  28. }
  29. int testA4(int * ptr) {
  30. return *ptr;
  31. }
  32. int testB1(int const*const p) {
  33. return *p;
  34. }
  35. int testB2(int const* p) {
  36. return *p;
  37. }
  38. int testB3(int *const p) {
  39. return *p;
  40. }
  41. int testB4(int * p) {
  42. return *p;
  43. }
  44. int testC1(int const*const ptrConst) {
  45. return *ptrConst;
  46. }
  47. int testC2(int const* ptrConst) {
  48. return *ptrConst;
  49. }
  50. int testC3(int *const ptrConst) {
  51. return *ptrConst;
  52. }
  53. int testC4(int * ptrConst) {
  54. return *ptrConst;
  55. }
  56. int testD1(int const*const constPtr) {
  57. return *constPtr;
  58. }
  59. int testD2(int const* constPtr) {
  60. return *constPtr;
  61. }
  62. int testD3(int *const constPtr) {
  63. return *constPtr;
  64. }
  65. int testD4(int * constPtr) {
  66. return *constPtr;
  67. }
  68. %}