mohawk2 / nativecall

6 stars 0 forks source link

Possibility to specify FFI::Platypus custom type #6

Open pablrod opened 7 years ago

pablrod commented 7 years ago

NativeCall works very well with FFI::Platypus types, but sometimes is useful to attach custom types. For example: StringArray, StringPointer or char ***.

mohawk2 commented 7 years ago

@plicease Thoughts? :-)

plicease commented 7 years ago

It would be nice I am not exactly sure what the interface should be.

pablrod commented 7 years ago

My proposal is enabling two interfaces:

  1. Global: function register_type in NativeCall.pm (global means subclass level, maybe using a my %custom_types where the key is caller's __PACKAGE__)

  2. Per function declaration: Add an attribute called CustomTypes that tries to attach every type name passed