1FFI::Platypus::TypeParsUesre:r:VCeornstiroinb0u(t3e)d PeFrFlI:D:oPcluamteynptuast:i:oTnypeParser::Version0(3)
2
3
4

NAME

6       FFI::Platypus::TypeParser::Version0 - FFI Type Parser Version Zero
7

VERSION

9       version 1.10
10

SYNOPSIS

12        use FFI::Platypus;
13        my $ffi = FFI::Platypus->new( api => 0 );
14        $ffi->type('record(Foo::Bar)' => 'foo_bar_t');
15        $ffi->type('opaque' => 'baz_t');
16        $ffi->type('opaque*' => 'baz_ptr');
17

DESCRIPTION

19       This documents the original FFI::Platypus type parser.  It was the
20       default and only type parser used by FFI::Platypus starting with
21       version 0.02.  Starting with version 1.00 FFI::Platypus comes with a
22       new type parser with design fixes that are not backward compatibility.
23
24   Interface differences
25       Pass-by-value records are not allowed
26           Originally FFI::Platypus only supported passing records as a
27           pointer.  The type "record(Foo::Bar)" actually passes a pointer to
28           the record.  In the version 1.00 parser allows "record(Foo::Bar)"
29           which is pass-by-value (the contents of the record is copied onto
30           the stack) and "record(Foo::Bar)*" which is pass-by-reference or
31           pointer (a pointer to the record is passed to the callee so that it
32           can make modifications to the record).
33
34           TL;DR "record(Foo::Bar)" in version 0 is equivalent to
35           "record(Foo::Bar)*" in the version 1 API.  There is no equivalent
36           to "record(Foo::Bar)*" in the version 0 API.
37
38       decorate aliases of basic types
39           This is not allowed in the version 0 API:
40
41            $ffi->type('opaque' => 'foo_t');    # ok!
42            $ffi->type('foo_t*' => 'foo_ptr');  # not ok! in version 0, ok! in version 1
43
44           Instead you need to use the basic type in the second type
45           definition:
46
47            $ffi->type('opaque' => 'foo_t');    # ok!
48            $ffi->type('opaque*' => 'foo_ptr'); # ok!
49
50       object types are not allowed
51            $ffi->type('object(Foo::Bar)');   # not ok! in version 0, ok! in version 1
52

SEE ALSO

54       FFI::Platypus
55           The core FFI::Platypus documentation.
56
57       FFI::Platypus::TypeParser::Version1
58           The API 1.00 type parser.
59

AUTHOR

61       Author: Graham Ollis <plicease@cpan.org>
62
63       Contributors:
64
65       Bakkiaraj Murugesan (bakkiaraj)
66
67       Dylan Cali (calid)
68
69       pipcet
70
71       Zaki Mughal (zmughal)
72
73       Fitz Elliott (felliott)
74
75       Vickenty Fesunov (vyf)
76
77       Gregor Herrmann (gregoa)
78
79       Shlomi Fish (shlomif)
80
81       Damyan Ivanov
82
83       Ilya Pavlov (Ilya33)
84
85       Petr Pisar (ppisar)
86
87       Mohammad S Anwar (MANWAR)
88
89       Håkon Hægland (hakonhagland, HAKONH)
90
91       Meredith (merrilymeredith, MHOWARD)
92
93       Diab Jerius (DJERIUS)
94
96       This software is copyright (c) 2015,2016,2017,2018,2019 by Graham
97       Ollis.
98
99       This is free software; you can redistribute it and/or modify it under
100       the same terms as the Perl 5 programming language system itself.
101
102
103
104perl v5.30.1                      2020-02F-F0I6::Platypus::TypeParser::Version0(3)
Impressum