Hi All,
Sablotron looks extremely promising, and as a command line utility it's
already useful, but I'm having some problems getting it to work under apache
with mod_perl.
The problem is it gets a segfault when it runs, I think it's related to the
SablotFree(foo); routine.
I'm not a native C coder, but I did find something interesting.
This doesn't crash under mod_perl, but it doesn't work either. :-( The
fprintf(stderr,"Result: %s\n",result); line prints something completely
different (in the apache error log file) under mod_perl then it does under
regular perl.
It prints some kind of binary data, leading me to believe it's a memory
allocation mix-up of some kind, particular to mod_perl.
Any idea on whats happening?
Thanks
Jamie
----------| Sablotron.xs |-------------------
int
SablotProcessStrings(sheet,input,result)
char * sheet
char * input
char * result
PREINIT:
char anything; // ???
char *foo = &anything;
CODE:
RETVAL = SablotProcessStrings(sheet, input, &foo);
perror("We're here");
result = foo;
OUTPUT:
result
RETVAL
CLEANUP:
perror("Just before cleanup");
fprintf(stderr,"Result: %s\n",result);
SablotFree(foo);
perror("We're After cleanup");