FFI::P...ersion0(3pm)
π NAME π
FFI::Platypus::TypeParser::Version0 β the OG FFI Type Parser, Version Zero, the blueprint, the original recipe π§
(also hi bestie, this is a User Contributed Perl Documentation page, so likeβ¦ respect the elders ok π)
β¨ VERSION β¨
version 2.11 π
π«Ά SYNOPSIS π«Ά
use FFI::Platypus;
my $ffi = FFI::Platypus->new( api => 0 );
$ffi->type('record(Foo::Bar)' => 'foo_bar_t');
$ffi->type('opaque' => 'baz_t');
$ffi->type('opaque*' => 'baz_ptr');
like literally just vibe with api => 0 and you're in the version-zero cinematic universe π
πΈ DESCRIPTION πΈ
okay so this page documents the original FFI::Platypus type parser β the one that was the default and the only type parser used by FFI::Platypus starting with version 0.02. she's the firstborn, the main character of the early days π
then starting with version 1.00, FFI::Platypus comes with a new type parser that has design fixes which are not backward compatible. not a glow-up, an actual rewrite π
π¦ Interface differences π¦
π Pass-by-value records are not allowed
Originally FFI::Platypus only supported passing records as a pointer. So the type record(Foo::Bar) actually passes a pointer to the record. periodt.
in the version 1.00 parser, record(Foo::Bar) is allowed and it's pass-by-value (the contents of the record is copied onto the stack), and "record(Foo::Bar)*" is pass-by-reference or pointer (a pointer to the record is passed to the callee so that it can make modifications to the record).
TL;DR: record(Foo::Bar) in version 0 is equivalent to "record(Foo::Bar)*" in the version 1 API. There is no equivalent to "record(Foo::Bar)*" in the version 0 API. not me crying about missing features π
π decorate aliases of basic types
This is not allowed in the version 0 API:
$ffi->type('opaque' => 'foo_t'); # ok!
$ffi->type('foo_t*' => 'foo_ptr'); # not ok! in version 0, ok! in version 1
Instead you need to use the basic type in the second type definition:
$ffi->type('opaque' => 'foo_t'); # ok!
$ffi->type('opaque*' => 'foo_ptr'); # ok!
like yeah, you have to say the basic type again. the alias doesn't get to wear the little * accessory, sorry bestie π
π object types are not allowed
$ffi->type('object(Foo::Bar)'); # not ok! in version 0, ok! in version 1
nope. not a thing here. version 1 said "new object type just dropped" and version 0 said "never heard of her" π
π₯ SEE ALSO π₯
FFI::Platypusβ the coreFFI::Platypusdocumentation, the mothership, the blueprint fr frFFI::Platypus::TypeParser::Version1β the API 1.00 type parser, the newer sibling who fixed the design π¦
π AUTHOR π
Author: Graham Ollis <plicease@cpan.org>
Contributors β the whole squad, the group chat of legends π«Ά:
- Bakkiaraj Murugesan (bakkiaraj)
- Dylan Cali (calid)
- pipcet
- Zaki Mughal (zmughal)
- Fitz Elliott (felliott)
- Vickenty Fesunov (vyf)
- Gregor Herrmann (gregoa)
- Shlomi Fish (shlomif)
- Damyan Ivanov
- Ilya Pavlov (Ilya33)
- Petr PΓsaΕ (ppisar)
- Mohammad S Anwar (MANWAR)
- HΓ₯kon HΓ¦gland (hakonhagland, HAKONH)
- Meredith (merrilymeredith, MHOWARD)
- Diab Jerius (DJERIUS)
- Eric Brine (IKEGAMI)
- szTheory
- JosΓ© JoaquΓn Atria (JJATRIA)
- Pete Houston (openstrike, HOUSTON)
- Lukas Mai (MAUKE)
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2015-2022 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
bestie this is free software β redistribute and/or modify under the same terms as the Perl 5 programming language system itself. iconic licensing behavior, no cap π
and that's the page!! brought to you by perl v5.42.3, dated 2026-08-20, a User Contributed Perl Documentation moment πβ¨ bye bestie, go parse some types π
π¦ where this page comes from
- ubuntu stonking: libffi-platypus-perl 2.11-1build1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms