Alien-FFCall
view release on metacpan or search on metacpan
lib/Alien/FFCall.pm view on Meta::CPAN
package Alien::FFCall;
use strict;
use warnings;
our $VERSION = "0.03";
$VERSION = eval $VERSION;
use parent 'Alien::Base';
1;
__END__
=head1 NAME
Alien::FFCall - Alien library for FFCall
=head1 SYNOPSIS
I would encourage you to look at L<FFI> if you want a Perl-level wrapper to
FFCall. And generally you should be using L<FFI::Platypus> or L<FFI::Raw>
rather than L<FFI>. That said, you're reading this document. So here goes.
If you want to write your own XS-based interface to FFCall, your F<Build.PL>
file should say:
use strict;
use warnings;
use Module::Build;
use Alien::FFCall;
# Retrieve the Alien::FFCall configuration:
my $alien = Alien::FFCall->new;
# Create the build script:
my $builder = Module::Build->new(
module_name => 'My::FFCall::Wrapper',
extra_compiler_flags => $alien->cflags(),
extra_linker_flags => $alien->libs(),
configure_requires => {
'Alien::FFCall' => 0,
},
);
$builder->create_build_script;
Your module (.pm) file should look like this:
package My::FFCall::Wrapper;
use strict;
use warnings;
our $VERSION = '0.01';
require XSLoader;
XSLoader::load('My::FFCall::Wrapper');
... perl-level code goes here ...
Your XS file should look like this:
#include "EXTERN.h"
#include "perl.h"
#include "XSUB.h"
#include <avcall.h>
#include <callback.h>
( run in 0.480 second using v1.01-cache-2.11-cpan-3d66aa2751a )