David Mertens
and 1 contributors


Alien::FFCall - Alien library for FFCall


I would encourage you to look at FFI if you want a Perl-level wrapper to FFCall. And generally you should be using FFI::Platypus or FFI::Raw rather than FFI. That said, you're reading this document. So here goes.

If you want to write your own XS-based interface to FFCall, your 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,

Your module (.pm) file should look like this:

 package My::FFCall::Wrapper;
 use strict;
 use warnings;
 our $VERSION = '0.01';
 require XSLoader;
 ... 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>
 ... normal XS stuff goes here, making use of the FFCall API ...


Alien::FFCall provides a CPAN distribution for the FFCall library. In other words, it installs FFCall's library in a non-system folder and provides you with the details necessary to include in and link to your C/XS code.

For documentation on the FFCall's API, see http://www.haible.de/bruno/packages-ffcall.html.


David Mertens, <dcmertens.perl at gmail.com>


The best place to report bugs or get help for this module is to file Issues on github:


Note that FFCall is no longer maintained and has been superseeded by libffi. Bear in mind, then, that I am the maintainer of this module, not FFCall itself.


Copyright 2012 Northwestern University

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.