On Tue, Mar 11, 2003 at 08:58:35AM +0000 Steve Hay wrote:

> Just a quick question:
> 
> Is there a "preferred way" to return a Boolean value from an XSUB?
> 
> I could have an SV* function returning &PL_sv_yes/&PL_sv_no (or 
> &PL_sv_undef?), or a bool function returning TRUE/FALSE, or even just an 
> int function returning 1/0.

You can use the XSRETURN_YES and XSRETURN_NO macros for returning
booleans. They follow the conventions what Perl considers to be a true
or false value. Likewise, XSRETURN_UNDEF is a quick way to return undef
to the caller.

Tassilo
-- 
$_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({
pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#;
$_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval

Reply via email to