FFI::Platypus::Type::StringPointer - Convert a pointer to a string and back
version 0.36
In your C code:
void string_pointer_argument(const char **string) { ... } const char ** string_pointer_return(void) { ... }
In your Platypus::FFI code:
use FFI::Platypus::Declare 'void', [ '::StringPointer' => 'string_pointer' ]; attach string_pointer_argument => [string_pointer] => void; attach string_pointer_return => [] => string_pointer; my $string = "foo"; string_pointer_argument(\$string); # $string may be modified $ref = string_pointer_return(); print $$ref; # print the string pointed to by $ref
This module provides a FFI::Platypus custom type for pointers to strings.
Main Platypus documentation.
Declarative interface for Platypus.
Platypus types documentation.
Author: Graham Ollis <plicease@cpan.org>
Contributors:
Bakkiaraj Murugesan (bakkiaraj)
Dylan Cali (calid)
pipcet
Zaki Mughal (zmughal)
Fitz Elliott (felliott)
This software is copyright (c) 2015 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.
To install FFI::Platypus, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI::Platypus
CPAN shell
perl -MCPAN -e shell install FFI::Platypus
For more information on module installation, please visit the detailed CPAN module installation guide.