In perl special tokens like __PACKAGE__
, __SUB__
, __FILE__
, __LINE__
exists and available from script.
I may get
The C equivalent to __FILE__
is __FILE__
.
The C equivalent to __LINE__
is __LINE__
.
The C99 equivalent to __SUB__
is __func__
. There wasn't anything standard before.
There's no C equivalent to __PACKAGE__
because C doesn't have namespaces.
That said, I don't think you want information about the current line of execution; I think you want information about the XS sub's caller. That means you're actually asking for the XS equivalent of caller.
The XS equivalent of caller is caller_cx. Looking at Perl_cx_dump
in scope.c
should give an idea how to use the returned PERL_CONTEXT
structure.