Alt-FFI-Raw-Platypus
view release on metacpan or search on metacpan
lib/FFI/Raw.pm
lib/FFI/Raw/Callback.pm
lib/FFI/Raw/MemPtr.pm
lib/FFI/Raw/Ptr.pm
maint/cip-before-install
t/00_diag.t
t/01_use.t
t/alt_ffi_raw_platypus.t
t/ffi/absolute-path.c
t/ffi/argless.c
t/ffi/callbacks.c
t/ffi/null.c
t/ffi/opaque.c
t/ffi/overload.c
t/ffi/pointers.c
t/ffi/simple-args.c
t/ffi/simple-returns.c
t/ffi/struct.c
t/ffi/test.fbx
t/ffi_raw.t
t/ffi_raw__bigint.t
lib/FFI/Raw/Callback.pm view on Meta::CPAN
=head2 new
my $callback = FFI::Raw::Callback->new( $coderef, $ret_type, @arg_types );
Create a C<FFI::Raw::Callback> using the code reference C<$coderef> as body. The
signature (return and arguments types) must also be passed.
=head1 CAVEATS
For callbacks with a C<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 C<FFI::Raw::ptr> type and return a L<FFI::Raw::MemPtr> object.
=head1 AUTHOR
Graham Ollis <plicease@cpan.org>
=head1 COPYRIGHT AND LICENSE
t/ffi_raw_callback.t view on Meta::CPAN
use Test2::V0 -no_srand => 1;
use Test2::Tools::FFI;
use lib 't/lib';
use FFI::Raw;
my($shared) = ffi->test->lib;
subtest 'callbacks' => sub {
my $take_one_int_callback = FFI::Raw->new(
$shared, 'take_one_int_callback',
FFI::Raw::void, FFI::Raw::ptr
);
my $func1 = sub {
my $num = shift;
is($num, 42);
};
xt/author/pod_spelling_system.t view on Meta::CPAN
Ollis
Mojolicious
plicease
CPAN
reinstall
TODO
filename
filenames
login
callback
callbacks
standalone
VMS
hostname
hostnames
TCP
UDP
IP
API
MSWin32
OpenBSD
( run in 0.332 second using v1.01-cache-2.11-cpan-9b1e4054eb1 )