Nicholas Clark <[EMAIL PROTECTED]> writes:
> It's possible to manipulate the perl stack from C with Inline's stack
> macros. Is it possible to determine the context (void, scalar or list)
> from an Inline C function?
You probably want GIMME_V from perlguts...
.................................................................
#!/usr/local/bin/perl -w
use strict;
use Inline C => <<'END_C';
void print_context()
{
int ctxt = GIMME_V;
printf("%s context\n",
(ctxt == G_VOID) ? "void" :
(ctxt == G_SCALAR) ? "scalar" :
(ctxt == G_ARRAY) ? "array" :
"UNKNOWN");
}
END_C
print_context;
my $x = print_context;
my @x = print_context;
.................................................................
--
Ariel Scolnicov |http://3w.compugen.co.il/~ariels
Compugen Ltd. |[EMAIL PROTECTED]
72 Pinhas Rosen St. |Tel: +972-3-7658117 "fast, good, and cheap;
Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 pick any two!"