perlxs and perlxstut leave something to be desired in terms of
documentation of writing the routines after the MODULE statement
in a .xs file.
I want to add some carp and croak calls into existing XSUBs,
particularly
' or carp ("message")'
for C routines that return 0 to indicate failure. These XSUBS return
the boolean to the calling Perl script, though perlxs calls this 'non-
Perlish'.
My intent it to have some record of a problem if the caller ignores the
boolean return value. Particularly, it the caller happens to be running
under Apache2 and mod_perl2 (including me using my own module),
I would like the message to go into Apache's error_log. Like "undefined
value in concatenation" which historically was the commonest error
in my error_log as I learned to use mod_perl.
Q1: how do I add a carp call to an XSUB that currently has no
'KEYWORD:' sections, e.g., to
int
acceptable(arg)
SV *arg
Q2: In which of the various 'KEYWORD:' sections does such a carp
or croak call make sense? I'm pretty sure the answer includes 'CODE:'
and 'PPCODE:' but a complete answer would be much appreciated.
Thanks,
craig
www.animalhead.com