import source from 1.3.40
[external/swig.git] / Examples / test-suite / typemap_namespace.i
1 %module typemap_namespace
2
3 /* Secret typedefs */
4 %{
5 namespace Foo {
6    typedef char    Str1;
7    typedef char    Str2;
8 }
9 %}
10
11 namespace Foo {
12     struct Str1;
13     struct Str2;
14
15 #ifdef SWIGCSHARP
16     %typemap(ctype) Str1 * = char *;
17     %typemap(imtype) Str1 * = char *;
18     %typemap(cstype) Str1 * = char *;
19     %typemap(csin) Str1 * = char *;
20     %typemap(csout) Str1 * = char *;
21 #endif
22 #ifdef SWIGJAVA
23     %typemap(jni) Str1 * = char *;
24     %typemap(jtype) Str1 * = char *;
25     %typemap(jstype) Str1 * = char *;
26     %typemap(javain) Str1 * = char *;
27     %typemap(javaout) Str1 * = char *;
28 #endif
29     %typemap(in) Str1 * = char *;
30 #if !(defined(SWIGCSHARP) || defined(SWIGLUA) || defined(SWIGPHP) || defined(SWIGMZSCHEME) || defined(SWIGOCAML))
31     %typemap(freearg) Str1 * = char *;
32 #endif
33     %typemap(typecheck) Str1 * = char *;
34     %apply char * { Str2 * };
35 }
36
37 %inline %{
38 namespace Foo {
39     char *test1(Str1 *s) {
40           return s;
41     }
42     char *test2(Str2 *s) {
43           return s;
44     }
45 }
46 %}
47
48     
49