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 0.94
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

SEE ALSO

51       FFI::Platypus
52           The core FFI::Platypus documentation.
53
54       FFI::Platypus::TypeParser::Version1
55           The API 1.00 type parser.
56

AUTHOR

58       Author: Graham Ollis <plicease@cpan.org>
59
60       Contributors:
61
62       Bakkiaraj Murugesan (bakkiaraj)
63
64       Dylan Cali (calid)
65
66       pipcet
67
68       Zaki Mughal (zmughal)
69
70       Fitz Elliott (felliott)
71
72       Vickenty Fesunov (vyf)
73
74       Gregor Herrmann (gregoa)
75
76       Shlomi Fish (shlomif)
77
78       Damyan Ivanov
79
80       Ilya Pavlov (Ilya33)
81
82       Petr Pisar (ppisar)
83
84       Mohammad S Anwar (MANWAR)
85
87       This software is copyright (c) 2015,2016,2017,2018,2019 by Graham
88       Ollis.
89
90       This is free software; you can redistribute it and/or modify it under
91       the same terms as the Perl 5 programming language system itself.
92
93
94
95perl v5.30.0                      2019-07F-F2I6::Platypus::TypeParser::Version0(3)
Impressum