January 20th, 2005, 02:39 PM
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:
in some python code I want to do:
// 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;
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.