Thanks Nick, and all who replied,

This explanation works perfectly.  I just didn't understand how the .pm
file was working, I thought there was some magic somewhere in how .pm
files were processed to make that C functions be visible to Perl, when
in fact it is just the boot_DynTrans() that was doing that.  I hadn't
looked at the generated code too closely, as it was a bit crazy, however
now that I've done that, it is quite clear what was happening.

I appreciate the help, I have rebuilt my application to call
boot_DynTrans() directly, and now all of my statically linked functions
are available without a .pm file.

Thanks for the tips, you guys are great!

David

-----Original Message-----
From: Nick Ing-Simmons [mailto:[EMAIL PROTECTED] 
Sent: February 20, 2005 9:30 AM
To: Southern, David
Cc: perl-xs@perl.org
Subject: Re: Extending an embedded Perl interpreter without a .pm file


David Southern <[EMAIL PROTECTED]> writes:
>
>So, the question: Is there a way that I can make XSUBs availiable to my

>perl interpreter without having to have the .pm file around at all?

Of course.

If you look at what your DynTrans.pm file does it probably does
something like

use XSLoader qw(load); XSLoader::load 'DynTrans',$VERSION;

And what XSLoader does is load the module and then calls the XSUB
boot_DynTrans()

which does the newXS() to define the other XS subs in the module.

So the easy way is to setup DynTrans to build as a static extension so
that a DynTrans.a gets built.

Then in your embedding program add a call to boot_DynTrans() to your
xs_init()


>_____________________________________________________________________
>This email message, including any attachments, may contain confidential

>and proprietary information for the sole use of the intended recipient.

>If you are not the intended recipient, you are hereby notified that any

>use, copying or dissemination of this message is strictly prohibited.

This is stupid thing to add to mail sent to an open mailing list.

>If you
>received this message in error, please notify Brooks Automation, Inc. 
>immediately by reply email or by calling Brooks US Headquarters at +1 
>978-262- 2400.

Do they fire you ?

>Then delete this message from your system, without making any copy or 
>distribution. Thank you.



_____________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

_____________________________________________________________________
This email message, including any attachments, may contain confidential and 
proprietary information for the sole use of the intended recipient.  If you are 
not the intended recipient, you are hereby notified that any use, copying or 
dissemination of this message is strictly prohibited.  If you received this 
message in error, please notify Brooks Automation, Inc. immediately by reply 
email or by calling Brooks US Headquarters at +1 978-262-2400. Then delete this 
message from your system, without making any copy or distribution.  Thank you.

Reply via email to