1FFI::Platypus::Type::PoUisnetrerCSoinzterBiubfufteerdF(F3PI)e:r:lPlDaotcyupmuesn:t:aTtyipoen::PointerSizeBuffer(3)
2
3
4

NAME

6       FFI::Platypus::Type::PointerSizeBuffer - Convert string scalar to a
7       buffer as a pointer / size_t combination
8

VERSION

10       version 1.56
11

SYNOPSIS

13       In your C code:
14
15        void
16        function_with_buffer(void *pointer, size_t size)
17        {
18          ...
19        }
20
21       In your Platypus::FFI code:
22
23        use FFI::Platypus;
24
25        my $ffi = FFI::Platypus->new( api => 1 );
26        $ffi->load_custom_type('::PointerSizeBuffer' => 'buffer');
27
28        $ffi->attach(function_with_buffer => ['buffer'] => 'void');
29        my $string = "content of buffer";
30        function_with_buffer($string);
31

DESCRIPTION

33       A common pattern in C code is to pass in a region of memory as a
34       buffer, consisting of a pointer and a size of the memory region.  In
35       Perl, string scalars also point to a contiguous series of bytes that
36       has a size, so when interfacing with C libraries it is handy to be able
37       to pass in a string scalar as a pointer / size buffer pair.
38

SEE ALSO

40       FFI::Platypus
41           Main Platypus documentation.
42
43       FFI::Platypus::Type
44           Platypus types documentation.
45

AUTHOR

47       Author: Graham Ollis <plicease@cpan.org>
48
49       Contributors:
50
51       Bakkiaraj Murugesan (bakkiaraj)
52
53       Dylan Cali (calid)
54
55       pipcet
56
57       Zaki Mughal (zmughal)
58
59       Fitz Elliott (felliott)
60
61       Vickenty Fesunov (vyf)
62
63       Gregor Herrmann (gregoa)
64
65       Shlomi Fish (shlomif)
66
67       Damyan Ivanov
68
69       Ilya Pavlov (Ilya33)
70
71       Petr Písař (ppisar)
72
73       Mohammad S Anwar (MANWAR)
74
75       Håkon Hægland (hakonhagland, HAKONH)
76
77       Meredith (merrilymeredith, MHOWARD)
78
79       Diab Jerius (DJERIUS)
80
81       Eric Brine (IKEGAMI)
82
83       szTheory
84
85       José Joaquín Atria (JJATRIA)
86
87       Pete Houston (openstrike, HOUSTON)
88
90       This software is copyright (c) 2015,2016,2017,2018,2019,2020 by Graham
91       Ollis.
92
93       This is free software; you can redistribute it and/or modify it under
94       the same terms as the Perl 5 programming language system itself.
95
96
97
98perl v5.34.0                      2021F-F1I0:-:2P9latypus::Type::PointerSizeBuffer(3)
Impressum