test %apply char *, char[], char[ANY] unsigned char pointer/arrays
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9463 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1247cd7cc5
commit
4e8fddcea2
1 changed files with 25 additions and 0 deletions
|
|
@ -33,6 +33,29 @@
|
||||||
CCharPtr CCharFunction(CCharPtr buffer) { return buffer; }
|
CCharPtr CCharFunction(CCharPtr buffer) { return buffer; }
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
// unsigned char* as strings
|
||||||
|
#if !defined(SWIGUTL)
|
||||||
|
%apply char [ANY] {TAscii[ANY]}
|
||||||
|
%apply char [] {TAscii []}
|
||||||
|
%apply char * {TAscii *}
|
||||||
|
#else
|
||||||
|
#warning "UTL needs fixing for these typemaps"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
typedef unsigned char TAscii;
|
||||||
|
typedef struct {
|
||||||
|
TAscii DigitsMemberA[20];
|
||||||
|
TAscii *DigitsMemberB;
|
||||||
|
TAscii DigitsMemberC[];
|
||||||
|
} TNumber;
|
||||||
|
|
||||||
|
TAscii DigitsGlobalA[20];
|
||||||
|
TAscii DigitsGlobalB[] = {(unsigned char)'A', (unsigned char)'B', 0};
|
||||||
|
TAscii *DigitsGlobalC;
|
||||||
|
|
||||||
|
%}
|
||||||
|
|
||||||
// Director test
|
// Director test
|
||||||
%feature("director");
|
%feature("director");
|
||||||
|
|
||||||
|
|
@ -47,3 +70,5 @@
|
||||||
virtual ~DirectorTest() {}
|
virtual ~DirectorTest() {}
|
||||||
};
|
};
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue