test %apply pointer to ARRAYSOFCLASSES

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@9655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2007-03-19 21:29:48 +00:00
commit 936b1b25ad
2 changed files with 41 additions and 10 deletions

View file

@ -20,5 +20,29 @@ struct AnotherStruct {
double extract(struct AnotherStruct as[], int index) {
return as[index].simple.double_field;
}
double extract2(struct AnotherStruct as[5], int index) {
return as[index].simple.double_field;
}
%}
// Test %apply to pointers
JAVA_ARRAYSOFCLASSES(struct YetAnotherStruct)
%apply struct YetAnotherStruct[] { struct YetAnotherStruct *yas }
//%apply struct YetAnotherStruct[] { struct YetAnotherStruct * } // Note: Does not work unless this is put after the YetAnotherStruct definition
%inline %{
struct YetAnotherStruct {
SimpleStruct simple;
};
double extract_ptr(struct YetAnotherStruct *yas, int index) {
return yas[index].simple.double_field;
}
%}
%apply ARRAYSOFENUMS[ANY] { toe[ANY] }
%apply ARRAYSOFENUMS[] { toe[] }
%apply ARRAYSOFENUMS[] { toe* }
%inline %{
typedef enum { Big, Little } toe;
void toestest(toe *t, toe tt[], toe ttt[2]) {}
%}