Problems? Is your data what you think it is? | |
PerlMonks |
XS Modules: Dependenciesby esskar (Deacon) |
on Aug 22, 2005 at 15:47 UTC ( [id://485710]=perlquestion: print w/replies, xml ) | Need Help?? |
esskar has asked for the wisdom of the Perl Monks concerning the following question:
Hi.
I'm going to write a couple of XS modules (they will be in the Win32 namespace, but i think that is a general question!). Some of them dependent on others. Example: package Foo::Bar; package Foo::Bar::Builder; package Foo::Bar::Store;* Foo::Bar::Builder creates an Foo::Bar object. * Foo::Bar objectes can be stored in a Foo::Bar::Store. Right now i have the following structure: Foo/Bar.xs Foo/Bar/Builder.xs Foo/Bar/Store.xsHow does Foo::Bar::Builder and Foo::Bar::Store know, that there is a Foo::Bar or better what Foo::Bar is! (Builder has a create function that returns a Foo::Bar object (TYPEMAP Foo::Bar T_PTROBJ)). or is it better to put everything into Foo/Bar.xs like MODULE = Foo::Bar PACKAGE = Foo::Bar MODULE = Foo::Bar PACKAGE = Foo::BarPtr MODULE = Foo::Bar::Store PACKAGE = Foo::Bar::Store MODULE = Foo::Bar::Store PACKAGE = Foo::Bar::StorePtr MODULE = Foo::Bar::Builder PACKAGE = Foo::Bar::Builder MODULE = Foo::Bar::Builder PACKAGE = Foo::Bar::BuilderPtror (like that?) MODULE = Foo::Bar PACKAGE = Foo::Bar MODULE = Foo::Bar PACKAGE = Foo::BarPtr MODULE = Foo::Bar PACKAGE = Foo::Bar::Store MODULE = Foo::Bar PACKAGE = Foo::Bar::StorePtr MODULE = Foo::Bar PACKAGE = Foo::Bar::Builder MODULE = Foo::Bar PACKAGE = Foo::Bar::BuilderPtr <edit1>Typo fixed.</edit1> <edit2>So in general, how do i call the new function of Foo::Bar (defined in Foo/Bar.xs) inside Foo/Bar/Builder.xs?</edit2>
Back to
Seekers of Perl Wisdom
|
|