GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
FFI::Platypus::TypeParser::Version0(3) User Contributed Perl Documentation FFI::Platypus::TypeParser::Version0(3)

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

version 1.56

 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');

This documents the original FFI::Platypus type parser. It was the default and only type parser used by FFI::Platypus starting with version 0.02. Starting with version 1.00 FFI::Platypus comes with a new type parser with design fixes that are not backward compatibility.

Pass-by-value records are not allowed
Originally FFI::Platypus only supported passing records as a pointer. The type "record(Foo::Bar)" actually passes a pointer to the record. In the version 1.00 parser allows "record(Foo::Bar)" which is pass-by-value (the contents of the record is copied onto the stack) and "record(Foo::Bar)*" which 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.

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!
    
object types are not allowed
 $ffi->type('object(Foo::Bar)');   # not ok! in version 0, ok! in version 1
    

FFI::Platypus
The core FFI::Platypus documentation.
FFI::Platypus::TypeParser::Version1
The API 1.00 type parser.

Author: Graham Ollis <plicease@cpan.org>

Contributors:

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)

This software is copyright (c) 2015,2016,2017,2018,2019,2020 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.

2021-10-28 perl v5.32.1

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.