January 20th, 2005, 02:39 PM
Join Date: Jul 2004
Location: Vancouver, Canada
Time spent in forums: 5 h 49 m 15 sec
Reputation Power: 10
Python extension and extern
This is what I want to do.
There is some other python module that has some C function pointers in it that I want to use. We'll call it some_module.so.
I built my own Python extension in C (call it my_module.so) that has some lines of code that look like:
// defined in some_module.so
extern int (*global_button_press)(GtkWidget *widget, GdkEventButton *event);
static PyObject* F (PyObject *self,PyObject *args)
global_button_press = my_button_press;
in some python code I want to do:
This would mean that w.r.t. my_module, the external function pointer is define at runtime (when some_module is imported)
Is this possible? or something like this possible? How???
Currently I'm just getting some message like 'global_button_press is undefined' when importing my_module.