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:
* Foo::Bar objectes can be stored in a Foo::Bar::Store.
Right now i have the following structure:
or is it better to put everything into Foo/Bar.xs like
<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>
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>
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: XS Modules: Dependencies
by diotalevi (Canon) on Aug 22, 2005 at 17:41 UTC | |
by esskar (Deacon) on Aug 22, 2005 at 22:19 UTC | |
by diotalevi (Canon) on Aug 23, 2005 at 13:32 UTC | |
by esskar (Deacon) on Aug 23, 2005 at 18:08 UTC | |
Re: XS Modules: Dependencies
by chromatic (Archbishop) on Aug 22, 2005 at 17:32 UTC |
Back to
Seekers of Perl Wisdom