FFI::Platypus::Legacy::Raw::Callback - FFI::Platypus::Legacy::Raw function pointer type
FFI::Platypus::Legacy::Raw and friends are a fork of FFI::Raw that uses FFI::Platypus instead of FFI::Raw's own libffi implementation. It is intended for use when migrating from FFI::Raw to FFI::Platypus. The main reason one might have for switching from Raw to Platypus is because Platypus is actively maintained, provides a more powerful interface, can be much faster when functions are "attached", and works on more platforms than Raw. This module should be a drop in replacement for FFI::Raw, simply replace all instances of
FFI::Platypus::Legacy::Raw. See also Alt::FFI::Raw::Platypus for a way to use this module without making any source code changes.
A FFI::Platypus::Legacy::Raw::Callback represents a function pointer to a Perl routine. It can be passed to functions taking a
my $callback = FFI::Platypus::Legacy::Raw::Callback->new( $coderef, $ret_type, @arg_types );
FFI::Platypus::Legacy::Raw::Callback using the code reference
$coderef as body. The signature (return and arguments types) must also be passed.
For callbacks with a
FFI::Platypus::Legacy::Raw::str return type, the string value will be copied to a private field on the callback object. The memory for this value will be freed the next time the callback is called, or when the callback itself is freed. For more exact control over when the return value is freed, you can instead use
FFI::Platypus::Legacy::Raw::ptr type and return a FFI::Platypus::Legacy::Raw::MemPtr object.
Original author: Alessandro Ghedini (ghedo, ALEXBIO)
Current maintainer: Graham Ollis <firstname.lastname@example.org>
Bakkiaraj Murugesan (bakkiaraj)
Dylan Cali (CALID)
Brian Wightman (MidLifeXis, MLX)
David Steinbrunner (dsteinbrunner)
Olivier Mengué (DOLMEN)
This software is copyright (c) 2012 by Alessandro Ghedini.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.