Multfile C Extensions

Andrew MacIntyre andymac at bullseye.apana.org.au
Sun May 28 18:06:38 EDT 2000


On Sun, 28 May 2000, Pete Shinners wrote:

> i've got a C python extension that has gotten pretty large.
> i'd like to break the file up into smaller components, but
> i'm finding this is actually pretty tricky.
> 
> since all functions/variables must be static (aside from init)
> how can i get the different files to work with each other?

Its ugly, but what I've done for something I'm working on is to have a
master source file for the module that #includes the various other source
files. In my particular case I have a number of modules using a lot of
common code (but only one of the modules can be loaded at any one time),
and so the master file actually has the init routine in it.

Hope this helps.

--
Andrew I MacIntyre                     "These thoughts are mine alone..."
E-mail: andrew.macintyre at aba.gov.au    (work) | Snail: PO Box 370
        andymac at bullseye.apana.org.au  (play) |        Belconnen  ACT  2616
        andymac at pcug.org.au           (play2) |        Australia





More information about the Python-list mailing list