PageRenderTime 7ms CodeModel.GetById 2ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

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

#
Swig | 29 lines | 18 code | 8 blank | 3 comment | 0 complexity | abb104e713df1509a3e6b8f8f909b283 MD5 | raw file
 1/*
 2A test case for testing non null terminated char pointers.
 3*/
 4
 5%module char_binary
 6
 7%apply (char *STRING, size_t LENGTH) { (const char *str, size_t len) }
 8
 9%inline %{
10struct Test {
11  size_t strlen(const char *str, size_t len) {
12    return len;
13  }
14};
15
16typedef char namet[5];
17namet var_namet;
18
19typedef char* pchar;
20pchar var_pchar;
21%}
22
23// Remove string handling typemaps and treat as pointer
24%typemap(freearg) SWIGTYPE * ""
25%apply SWIGTYPE * { char * }
26
27%include "carrays.i"
28%array_functions(char, pchar);
29