From: Mark Landriscina <mlandri1@jh...> - 2009-01-26 03:49:37
I've read through the available documentation on callbacks, typemaps, and funct pointers, but I could still use some help if available :)
I'm wrapping the following c function: dissect_tree *foreach_treenode(dissect_tree *in, int (*funct)(dissect_tree *dt));
As one can see, the function 'foreach_treenode' takes a dissect_tree pointer and a function pointer as input params. Here's the catch. I'm wrapping the above function such that it is callable from Python. Hence, I'd like to be able to pass Python defined functions into 'foreach_treenode' as the function pointer parameter. However, I'm not quite sure how to write up the interface file correctly such that this can be accomplished.
Ideally, I'd like to have included a rough idea of how I would try to solve this problem, but I am paddling without oars on this one.