FFI-Platypus
view release on metacpan or search on metacpan
lib/FFI/Platypus/Type/WideString.pm view on Meta::CPAN
use FFI::Platypus;
use FFI::Platypus::Memory qw( memcpy );
use FFI::Platypus::Buffer qw( buffer_to_scalar scalar_to_pointer scalar_to_buffer );
use Encode qw( decode encode find_encoding );
use Carp ();
# ABSTRACT: Platypus custom type for Unicode "wide" strings
our $VERSION = '2.11'; # VERSION
my @stack; # To keep buffer alive.
sub _compute_wide_string_encoding
{
foreach my $need (qw( wcslen wcsnlen ))
{
die "This type plugin needs $need from libc, and cannot find it"
unless FFI::Platypus::Memory->can("_$need");
}
my $ffi = FFI::Platypus->new( api => 2, lib => [undef] );
( run in 0.951 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )