hi

The idea is to allow one xsub module to call another xsub module's C 
routines in a platform independent manor. There is an ExtUtils::Depend 
which looks like it does a similar thing but with a couple exceptions. 
First, my module looks more machine independent though I can't really 
say since I haven't tried the other one. I pass functions pointers 
though a perl hash which should work accross pretty much everything. 
 Second assuming the "parent" module was compiled to export it's 
functions via ExtUtils::XSLink, any dependent modules don't require 
accces the "praent's" source when they are being built.

Any way my primary question is naming the second being are there any 
other  modules that do this? Also any changes for my interface (I'll put 
a simple example below)?

Jason Adams

Example for 2 modules Foo and Foo::Bar:

Foo's Makefile.PL
=============
....
use ExtUtils::XSLink;
....
export_c_interface("Foo","linkdata");    #this function needs a name change
....

Foo's linkdata
===========
{
    'export' => {
          'my_sqrt' =>{
              'type' => 'double',
              'args' => 'double',
          }
    }
}

Foo's Foo.xs
=========
....
double
my_sqrt(double){.....}
...
#include "linker.h"

BOOT:
    XSLink_link();

Foo::Bar's Makefile.PL
=================
....
use ExtUtils::XSLink;
....
export_c_interface("Foo::Bar","linkdata");    #this is why it needs a 
name change
....

Foo::Bar's linkdata
==============
{
    'import' => {
          'Foo' =>[
                'my_sqrt'
          ]
    }
}

Foo::Bar's Bar.xs
=============
....
#include"linker.h"
....
BOOT:
    XSLink_link();
....
      a=my_sqrt(b);
.....


Reply via email to