File: typemap_namespace.i

package info (click to toggle)
renderdoc 1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 79,584 kB
  • sloc: cpp: 491,671; ansic: 285,823; python: 12,617; java: 11,345; cs: 7,181; makefile: 6,703; yacc: 5,682; ruby: 4,648; perl: 3,461; php: 2,119; sh: 2,068; lisp: 1,835; tcl: 1,068; ml: 747; xml: 137
file content (59 lines) | stat: -rw-r--r-- 1,308 bytes parent folder | download | duplicates (13)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
%module typemap_namespace

/* Secret typedefs */
%{
namespace Foo {
   typedef char    Str1;
   typedef char    Str2;
}
%}

namespace Foo {
    struct Str1;
    struct Str2;

#ifdef SWIGCSHARP
    %typemap(ctype) Str1 * = char *;
    %typemap(imtype) Str1 * = char *;
    %typemap(cstype) Str1 * = char *;
    %typemap(csin) Str1 * = char *;
    %typemap(csout) Str1 * = char *;
#endif
#ifdef SWIGJAVA
    %typemap(jni) Str1 * = char *;
    %typemap(jtype) Str1 * = char *;
    %typemap(jstype) Str1 * = char *;
    %typemap(javain) Str1 * = char *;
    %typemap(javaout) Str1 * = char *;
#endif
#ifdef SWIGGO
    %typemap(gotype) Str1 * = char *;
#endif
#ifdef SWIGD
    %typemap(ctype) Str1 * = char *;
    %typemap(imtype) Str1 * = char *;
    %typemap(dtype) Str1 * = char *;
    %typemap(din) Str1 * = char *;
    %typemap(dout) Str1 * = char *;
#endif
    %typemap(in) Str1 * = char *;
#if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGMZSCHEME) || defined(SWIGOCAML) || defined(SWIGGO) || defined(SWIGD))
    %typemap(freearg) Str1 * = char *;
#endif
    %typemap(typecheck) Str1 * = char *;
    %apply char * { Str2 * };
}

%inline %{
namespace Foo {
    char *test1(Str1 *s) {
          return s;
    }
    char *test2(Str2 *s) {
          return s;
    }
}
%}