----- Original Message ----- 
From: "Steffen Mueller" <[EMAIL PROTECTED]>
.
.
>
> Right now, the module works for simple uses only. (No AUTOWRAP and
> stuff.) The code is experimental.
>

I'm just adding AUTOWRAP capability to Inline::C2XS now - probably take a
couple of days before it's finished. (I'm pretty slow.)

For the XS file to be successfully written with AUTOWRAP, it's also
necessary (under certain situations) that the AUTO_INCLUDE, TYPEMAPS and INC
configurations be taken into account - so that's being taken care of, too.
Are there any other configuration values that might be needed to write the
XS file when AUTOWRAP is enabled ?

Inline::C2XS was originally intended to look *only* at a user-supplied C
file that contains *only* the C code from the inline::C script/module. Now
that it's venturing into the AUTOWRAP area it's needing to consider Inline
Config values that are *not* part of that C file (and are therefore
invisible to it). My ultra-simplistic, retro-progressive nature has
therefore decided that those Config values will be supplied by the user
(though I'm not firmly committed at this stage to sticking with that
decision):

-----------------------------
use Inline::C2XS qw(c2xs);

my $module = 'MyMod';
my $package = 'MyMod';
my $build_dir = '.'; # where to create the XS file

my $configs =
{
'AUTOWRAP' => 1,
'AUTO_INCLUDE => 'my_header.h',
'INC' => '-I/home/me/my_includes',
'TYPEMAPS' => '/path/to/my_typemap',
}

# c2xs() expects to find 'MyMod.c' (its C source file) in ./src
c2xs($module, $package, $build_dir, $configs);
---------------------------

If you don't want to use AUTOWRAP and/or AUTO_INCLUDE, then you simply don't
supply a fourth argument to c2xs().

(Aside: I don't think there's any need to pass 'INC' or 'TYPEMAPS' values to
c2xs() unless AUTOWRAP is being used - as they can only be needed to write
the XS file if AUTOWRAP is *enabled*.)

> I'm writing to get a blessing for uploading the distribution to CPAN
> since I'm using a namespace under Inline::.
>

Some of the points raised regarding the proposed naming of Steffen's
'Inline::XS' probably also apply to Inline::C2XS (and the
soon-to-be-released Inline::CPP2XS). I quite like Ken's idea of "InlineX",
though there's nothing wrong with the other suggestions either. If Steffen
ventures outside of the "Inline" namespace, then I guess C2XS.pm and
CPP2XS.pm should probably also go to the *same* namespace (and Inline::C2XS
marked as deprecated).

Cheers,
Rob

Reply via email to