Jamie,

1) In your last message, you asked about a Perl function that would set
the log file. Currently, there's none, even in the C interface. But I
miss it too.
2) Do you really have to initialize foo to 0? SablotFree should not be
called at all when SablotProcessStrings returns an error (i.e. a nonzero
return value)!
3) Getting the error string after processing. In the latest release (not
out yet), you can register a "message handler" to receive all
error/warning/log messages so Sablotron does not report them itself.
Would that help?

Best,
Tom


Jamie wrote:
> 
> I lied, it was 2 lines. ;-)
> 
> In Sablotron.xs:
>         char *foo = 0;
> 
> I think the reason *foo needed to be set to '0' is due to the free call, (and
> setting it to something else, as I had done) resulted in it returning a
> bunch of binary stuff, leading to me thinking it wasn't returning the right
> stuff, when it was really trying to return "I don't have anything, because
> there was a permission denied error on the log file".
> 
> In sablot.cpp:
> 
> void doStart()
> {
>     situation.msgOutputFile("stderr","/tmp/sablot.log");
>     Log1(L_START, situation.timeStr());
> };
> 
> Or, alternatively, chdir() in the mod_perl script someplace, because sablot
> was trying to log to /sablot.log which was causing some problems.
> 
> Anyway, it was that simple. :-)
> 
> If I could make a suggestion, is there a way to get the error string after
> processing? This way, the xs file could call croak() on an error, and possibly
> just return the processed string on success. (Kind of like XML::Parser does)



Reply via email to