strict;
use warnings;
package YAMLScript;
use FFI::CheckLib ();
use FFI::Platypus;
use Cpanel::JSON::XS ();
our $VERSION = '0.2.7';
our $libys_version = $VERSION;
#-----------------------------
sub load;
# "load" method wrapper for FFI.
# It calls the libys load_ys_to_json function.
$ffi->attach(
[load_ys_to_json => 'load'] =>
['sint64', 'string'] => 'string' =>
sub {
my
($xsub, $self, $ys) = @_;
$self->{error} = undef;
my $resp = Cpanel::JSON::XS::decode_json(
$xsub->(${$self->{isolatethread}}, $ys)
);
return $resp->{dat