srikanth650 has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,
I had been trying to pass a complex structure as an argument for a C function. I am trying to do it in XSUB. But I am unable to do so. I have read a number of tutorials, perldocs, ebooks but I am unable to find the solution. I tried to go through the C code generated by xsubpp, so that I can make out a way to do it. But I was unable to understand few things mentioned below:
XSprePUSH (i guess, to generated space in stack like EXTEND(sp, n) macro
dVAR (defined as dNOOP)
dXSARGS (I read about it in perldoc, but I feel that we can easily code without using this. so what is the real purpose of this macro? )
dXSTARG
Is it possible to understand the C code generated and write our own C code without using xsubpp/*.xs, so that we can have a in-depth knowledge of the things happening 'under the hood'?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Some guidance required regarding Perl XS
by Corion (Patriarch) on Sep 06, 2015 at 07:05 UTC |