summaryrefslogtreecommitdiff
path: root/proto.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2017-01-18 12:35:50 +0000
committerDavid Mitchell <davem@iabyn.com>2017-01-21 10:04:44 +0000
commit1e85b6586ab5aca2ff20296114f8e70b45956a92 (patch)
treea9e404be66ca10a1189d38a66705702e15c4111d /proto.h
parentf5294d12c0aa55a61680444556e53554d881d9b0 (diff)
downloadperl-1e85b6586ab5aca2ff20296114f8e70b45956a92.tar.gz
add Perl_op_class(o) API function
Given an op, this function determines what type of struct it has been allocated as. Returns one of the OPclass enums, such as OPclass_LISTOP. Originally this was a static function in B.xs, but it has wider applicability; indeed several XS modules on CPAN have cut and pasted it. It adds the OPclass enum to op.h. In B.xs there was a similar enum, but with names like OPc_LISTOP. I've renamed them to OPclass_LISTOP etc. so as not to clash with the cut+paste code already on CPAN.
Diffstat (limited to 'proto.h')
-rw-r--r--proto.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/proto.h b/proto.h
index 2fd8a51580..e3c04dc94c 100644
--- a/proto.h
+++ b/proto.h
@@ -2343,6 +2343,7 @@ PERL_CALLCONV OP* Perl_oopsHV(pTHX_ OP* o)
PERL_CALLCONV OP* Perl_op_append_elem(pTHX_ I32 optype, OP* first, OP* last);
PERL_CALLCONV OP* Perl_op_append_list(pTHX_ I32 optype, OP* first, OP* last);
+PERL_CALLCONV OPclass Perl_op_class(pTHX_ const OP *o);
PERL_CALLCONV void Perl_op_clear(pTHX_ OP* o);
#define PERL_ARGS_ASSERT_OP_CLEAR \
assert(o)