Is there a macro or function in the Perl API for getting the actual integer field of a IV*
? I can find tons of information for getting at just about every other kind of value in perlguts
and perlapi
but this one seems to elude me.
From perlguts SvIV(SV*)
should do the trick.
#!/usr/bin/env perl
use strict;
use warnings;
use Inline C => <<'END';
void print_iv (SV* input) {
if (! SvIOK(input))
croak("Not an integer");
printf("Printing integer %d\n", SvIV(input));
}
END
print_iv(3);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With