- or download this
int mult (int x, int y);
void speak (const char* str);
unsigned char* arr (); // returns (0, 1, 2)
- or download this
module-starter \
--module=XS::Wrap \
--author="Steve Bertrand" \
--email=steveb@cpan.org \
--license=perl
- or download this
package XS::Wrap;
...
use strict;
our $VERSION = '0.01';
- or download this
use warnings;
use strict;
...
#include <stdio.h>
#include <xswrap.h>
- or download this
#include "EXTERN.h"
#include "perl.h"
...
MODULE = XS::Wrap PACKAGE = main
PROTOTYPES: DISABLE
- or download this
#include "EXTERN.h"
#include "perl.h"
...
const char* str
unsigned char* arr ()
- or download this
use warnings;
use strict;
...
my @array = arr();
return @array;
}
- or download this
LIBS => ['-lxswrap'],
- or download this
perl Makefile.PL
make
make install
- or download this
use warnings;
use strict;
...
my @arr = my_arr();
say $_ for @arr;
- or download this
25
hello, world!
- or download this
use warnings;
use strict;
...
inline_stack_done;
}
- or download this
#include "EXTERN.h"
#include "perl.h"
...
}
/* must have used dXSARGS; list context implied */
return; /* assume stack size is correct */
- or download this
void _arr (){
unsigned char* c_array = arr();
...
inline_stack_done;
}
- or download this
void
_arr ()
...
XSRETURN_EMPTY;
}
return;
- or download this
#include "EXTERN.h"
#include "perl.h"
...
XSRETURN_EMPTY;
}
return;
- or download this
sub my_arr {
my @array = _arr();
return @array;
}
- or download this
perl example.pl
25
...
0
1
2
- or download this
rm -rf _Inline
perl Makefile.PL
...
make manifest
make install
make dist