FFI::Raw::Callback - FFI::Platypus::Legacy::Raw function pointer type
version 0.04
A FFI::Raw::Callback represents a function pointer to a Perl routine. It can be passed to functions taking a FFI::Raw::ptr type.
FFI::Raw::ptr
my $callback = FFI::Raw::Callback->new( $coderef, $ret_type, @arg_types );
Create a FFI::Raw::Callback using the code reference $coderef as body. The signature (return and arguments types) must also be passed.
FFI::Raw::Callback
$coderef
For callbacks with a FFI::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::Raw::ptr type and return a FFI::Raw::MemPtr object.
FFI::Raw::str
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2019 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Alt::FFI::Raw::Platypus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Alt::FFI::Raw::Platypus
CPAN shell
perl -MCPAN -e shell install Alt::FFI::Raw::Platypus
For more information on module installation, please visit the detailed CPAN module installation guide.