Add some generic function pointer support
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10266 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b67e0a28a3
commit
f858eca260
2 changed files with 35 additions and 0 deletions
|
|
@ -495,6 +495,38 @@ int SwigType_isqualifier(SwigType *t) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Function Pointers
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
int SwigType_isfunctionpointer(SwigType *t) {
|
||||
char *c;
|
||||
if (!t)
|
||||
return 0;
|
||||
c = Char(t);
|
||||
if (strncmp(c, "p.f(", 4) == 0) {
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* SwigType_functionpointer_decompose
|
||||
*
|
||||
* Decompose the function pointer into the parameter list and the return type
|
||||
* t - input and on completion contains the return type
|
||||
* returns the function's parameters
|
||||
* ----------------------------------------------------------------------------- */
|
||||
|
||||
SwigType *SwigType_functionpointer_decompose(SwigType *t) {
|
||||
String *p;
|
||||
assert(SwigType_isfunctionpointer(t));
|
||||
p = SwigType_pop(t);
|
||||
Delete(p);
|
||||
p = SwigType_pop(t);
|
||||
return p;
|
||||
}
|
||||
|
||||
/* -----------------------------------------------------------------------------
|
||||
* Member Pointers
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue