%apply tests for char*, unsigned char*, signed char*
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9066 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
337ca33568
commit
d8e30d9067
1 changed files with 22 additions and 0 deletions
22
Examples/test-suite/apply_strings.i
Normal file
22
Examples/test-suite/apply_strings.i
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
/* Test %apply for char *, signed char *, unsigned char * */
|
||||
|
||||
%module apply_strings
|
||||
|
||||
%apply char * {UCharPtr};
|
||||
%apply char * {SCharPtr};
|
||||
|
||||
%inline %{
|
||||
typedef unsigned char* UCharPtr;
|
||||
typedef signed char* SCharPtr;
|
||||
|
||||
UCharPtr UCharFunction(UCharPtr str) { return str; }
|
||||
SCharPtr SCharFunction(SCharPtr str) { return str; }
|
||||
%}
|
||||
|
||||
%apply SWIGTYPE* {CharPtr};
|
||||
|
||||
%inline %{
|
||||
typedef char* CharPtr;
|
||||
|
||||
CharPtr CharFunction(CharPtr buf) { return buf; }
|
||||
%}
|
||||
Loading…
Add table
Add a link
Reference in a new issue