Home > Archive > PERL Miscellaneous > July 2005 > Where are Inline_Stack_Vars, etc. defined?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Where are Inline_Stack_Vars, etc. defined?
|
|
|
|
I'm trying to translate fragments snatched from pp.c into Inline::C
functions. These fragments use stack-manipulation macros such as
PUTBACK and SPAGAIN. I'm having a hard time figuring out how to
translate these macros into code that will play well with Inline's
stack manipulation macros. It would be very helpful for me to see
how the Inline::C macros are defined, but I can't find these
definitions.
Thanks!
kj
--
NOTE: In my address everything before the first period is backwards;
and the last period, and everything after it, should be discarded.
| |
| Sisyphus 2005-07-30, 4:00 am |
|
"kj" <socyl@987jk.com.invalid> wrote in message
news:dcfalv$7l0$1@reader2.panix.com...
>
>
>
> I'm trying to translate fragments snatched from pp.c into Inline::C
> functions. These fragments use stack-manipulation macros such as
> PUTBACK and SPAGAIN. I'm having a hard time figuring out how to
> translate these macros into code that will play well with Inline's
> stack manipulation macros. It would be very helpful for me to see
> how the Inline::C macros are defined, but I can't find these
> definitions.
>
> Thanks!
>
It's all done in Inline.h which gets created whenever you run an Inline::C
script. If you run your Inline::C script with the Config option
CLEAN_AFTER_BUILD => 0 then you'll be able to go into the build directory
and find Inline.h. (Without that option the build directory gets cleaned up
after the script has successfully compiled.)
Anyway, to save you the trouble, here's what Inline.h looks like:
#define Inline_Stack_Vars dXSARGS
#define Inline_Stack_Items items
#define Inline_Stack_Item(x) ST(x)
#define Inline_Stack_Reset sp = mark
#define Inline_Stack_Push(x) XPUSHs(x)
#define Inline_Stack_Done PUTBACK
#define Inline_Stack_Return(x) XSRETURN(x)
#define Inline_Stack_Void XSRETURN(0)
#define INLINE_STACK_VARS Inline_Stack_Vars
#define INLINE_STACK_ITEMS Inline_Stack_Items
#define INLINE_STACK_ITEM(x) Inline_Stack_Item(x)
#define INLINE_STACK_RESET Inline_Stack_Reset
#define INLINE_STACK_PUSH(x) Inline_Stack_Push(x)
#define INLINE_STACK_DONE Inline_Stack_Done
#define INLINE_STACK_RETURN(x) Inline_Stack_Return(x)
#define INLINE_STACK_VOID Inline_Stack_Void
#define inline_stack_vars Inline_Stack_Vars
#define inline_stack_items Inline_Stack_Items
#define inline_stack_item(x) Inline_Stack_Item(x)
#define inline_stack_reset Inline_Stack_Reset
#define inline_stack_push(x) Inline_Stack_Push(x)
#define inline_stack_done Inline_Stack_Done
#define inline_stack_return(x) Inline_Stack_Return(x)
#define inline_stack_void Inline_Stack_Void
I don't exactly know why those macros were created. Seems to me that one
might just as well use 'dXSARGS', 'items', 'ST(x)', 'sp = mark',
'xPUSHs(x)', 'PUTBACK', 'XSRETURN(x), and 'XSRETURN(0)' instead of the
synonyms provided by Inline.h.
Cheers,
Rob
|
|
|
|
|