« corpus/ffi_build_plugin/lib2/FFI/Build/Plugin/Foo1.pm
↑ Summary
corpus/ffi_build_mm/lb1/hello.fbx »
| 1 | package FFI::Platypus::Type::PointerSizeBuffer; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 1 | ▶ | use 5.008004; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 1 | ▶ | use FFI::Platypus; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 1 | ▶ | use FFI::Platypus::API qw( | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | arguments_set_pointer | ||||||||||
| 9 | arguments_set_uint32 | ||||||||||
| 10 | arguments_set_uint64 | ||||||||||
| 11 | 1 | ); | |||||||||
| 12 | 1 | ▶ | use FFI::Platypus::Buffer qw( scalar_to_buffer ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 13 | 1 | ▶ | use FFI::Platypus::Buffer qw( buffer_to_scalar ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | |||||||||||
| 15 | # ABSTRACT: Convert string scalar to a buffer as a pointer / size_t combination | ||||||||||
| 16 | 1 | our $VERSION = '2.12'; # VERSION | |||||||||
| 17 | |||||||||||
| 18 | |||||||||||
| 19 | 1 | my @stack; | |||||||||
| 20 | |||||||||||
| 21 | 1 | ▶ | *arguments_set_size_t | ||||||||
|
Branch: 1 branch
| |||||||||||
| 22 | = FFI::Platypus->new( api => 2 )->sizeof('size_t') == 4 | ||||||||||
| 23 | ? \&arguments_set_uint32 | ||||||||||
| 24 | : \&arguments_set_uint64; | ||||||||||
| 25 | |||||||||||
| 26 | sub perl_to_native | ||||||||||
| 27 | 6 | ▶ | { | ||||||||
|
Subroutine
perl_to_native: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 28 | 6 | my($pointer, $size) = scalar_to_buffer($_[0]); | |||||||||
| 29 | 6 | push @stack, [ $pointer, $size ]; | |||||||||
| 30 | 6 | arguments_set_pointer $_[1], $pointer; | |||||||||
| 31 | 6 | arguments_set_size_t($_[1]+1, $size); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | sub perl_to_native_post | ||||||||||
| 35 | 6 | ▶ | { | ||||||||
|
Subroutine
perl_to_native_post: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 36 | 6 | my($pointer, $size) = @{ pop @stack }; | |||||||||
| 37 | 6 | $_[0] = buffer_to_scalar($pointer, $size); | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub ffi_custom_type_api_1 | ||||||||||
| 41 | 2 | ▶ | { | ||||||||
|
Subroutine
ffi_custom_type_api_1: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 42 | { | ||||||||||
| 43 | 2 | native_type => 'opaque', | |||||||||
| 44 | perl_to_native => \&perl_to_native, | ||||||||||
| 45 | perl_to_native_post => \&perl_to_native_post, | ||||||||||
| 46 | argument_count => 2, | ||||||||||
| 47 | } | ||||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 1 | 1; | |||||||||
| 51 | |||||||||||
| 52 | __END__ | ||||||||||