FFI::Raw::Ptr - Base FFI::Raw pointer type
version 0.27
package Foo; use FFI::Raw; use base qw(FFI::Raw::Ptr); *_foo_new = FFI::Raw -> new( $shared, 'foo_new', FFI::Raw::ptr ) -> coderef; sub new { bless shift -> SUPER::new(_foo_new()); } *get_bar = FFI::Raw -> new( $shared, 'foo_get_bar', FFI::Raw::int, FFI::Raw::ptr ) -> coderef; *set_bar = FFI::Raw -> new( $shared, 'foo_set_bar', FFI::Raw::void, FFI::Raw::ptr, FFI::Raw::int ) -> coderef; *DESTROY = FFI::Raw -> new( $shared, 'foo_free', FFI::Raw::void, FFI::Raw::ptr ) -> coderef; 1; package main; my $foo = Foo -> new; $foo -> set_bar(42);
A FFI::Raw::Ptr represents a pointer to memory which can be passed to functions taking a FFI::Raw::ptr argument.
FFI::Raw::ptr
Note that differently from FFI::Raw::MemPtr, FFI::Raw::Ptr pointers are not automatically deallocated once not in use anymore.
FFI::Raw::Ptr
Create a new FFI::Raw::Ptr pointing to $ptr, which can be either a FFI::Raw::MemPtr or a pointer returned by a C function.
$ptr
FFI::Raw::MemPtr
Graham Ollis <plicease@cpan.org>
Alessandro Ghedini <alexbio@cpan.org>
Copyright 2014 Alessandro Ghedini.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install FFI::Raw, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FFI::Raw
CPAN shell
perl -MCPAN -e shell install FFI::Raw
For more information on module installation, please visit the detailed CPAN module installation guide.