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.
Interfacedifferences
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