PageRenderTime 14ms CodeModel.GetById 10ms app.highlight 1ms RepoModel.GetById 1ms 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
 1%module typemap_qualifier_strip
 2
 3%typemap(in) int *ptr {
 4  int temp = 1234;
 5  $1 = &temp;
 6}
 7
 8%typemap(in) int *const ptrConst {
 9  int temp = 5678;
10  $1 = &temp;
11}
12
13%typemap(in) int const* constPtr {
14  int temp = 3456;
15  $1 = &temp;
16}
17
18%inline %{
19int *create_int(int newval) {
20  static int val = 0;
21  val = newval;
22  return &val;
23}
24int testA1(int const*const ptr) {
25  return *ptr;
26}
27int testA2(int const* ptr) {
28  return *ptr;
29}
30int testA3(int *const ptr) {
31  return *ptr;
32}
33int testA4(int * ptr) {
34  return *ptr;
35}
36
37int testB1(int const*const p) {
38  return *p;
39}
40int testB2(int const* p) {
41  return *p;
42}
43int testB3(int *const p) {
44  return *p;
45}
46int testB4(int * p) {
47  return *p;
48}
49
50int testC1(int const*const ptrConst) {
51  return *ptrConst;
52}
53int testC2(int const* ptrConst) {
54  return *ptrConst;
55}
56int testC3(int *const ptrConst) {
57  return *ptrConst;
58}
59int testC4(int * ptrConst) {
60  return *ptrConst;
61}
62
63int testD1(int const*const constPtr) {
64  return *constPtr;
65}
66int testD2(int const* constPtr) {
67  return *constPtr;
68}
69int testD3(int *const constPtr) {
70  return *constPtr;
71}
72int testD4(int * constPtr) {
73  return *constPtr;
74}
75%}
76