Hi,
I've hit a brick wall with my XS code returning strings.
I'm mapping to a C Function which looks something like this
void cardmod(char *cardnum,
char *issuer,
char *details
unsigned long *statflag);
the cardnum is fixed, but the rest of the args are set by the function.
So,The XS stub I'm using is
void
cardmod(cardnum,issuer,statflag)
char *cardnum
char *issuer
char *details
unsigned long &statflag
OUTPUT:
issuer
details
statflag
Statflag returns fine, with the value being altered....BUT for some
reason when I run the module using the above code, the returned issuer
and details strings both point to the same string!
[The generated code just retrieves values from SvPV(ST(stack_val),PL_na)and
casts them to char * - and then later uses SetMAGIC to populate the
new values.]
after a bit of thought I added the code '=NO_INIT' to the 2 string defs
I'm interested in - but that just made perl die with a 'run time exception' when I
then tried running the module.
I'am trying to call the f'n from perl like this.....
$cardnum="01234567";
cardmod($cardnum,$details,$issuer,$statflag);
where $details,$issuer,$statflag are all unitialised vars.
Any Ideas - as I'm stumped :-)
Regards,
Ian Dash