[Pyrex] Problems with 'public' C functions in an extension

Stefan Behnel behnel_ml at gkec.informatik.tu-darmstadt.de
Mon Jul 3 09:11:41 UTC 2006


Hi Greg,

Greg Ewing wrote:
> The whole business of public declarations has always
> been rather hairy and not very well developed. It's
> currently more of an intended rather than actual
> feature.

I figured out why it did not work for me in the first place: wrong approach.

Looking around a bit more, I finally managed to stumble over this page:

http://docs.python.org/dev/ext/using-cobjects.html

I actually think /that/ is more of what is intended with a public C function.
Note how the page says quite at the beginning that "you should not rely on
global symbols" in extensions. :)

Maybe the right solution is to drop the current support completely and make
public C functions generate a struct with all public function pointers and the
above header code for external modules.

One of the problems there is the order of functions in the struct for binary
compatibility, though...

Stefan



More information about the Pyrex mailing list