diff options
author | David Mitchell <davem@iabyn.com> | 2017-01-18 12:35:50 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2017-01-21 10:04:44 +0000 |
commit | 1e85b6586ab5aca2ff20296114f8e70b45956a92 (patch) | |
tree | a9e404be66ca10a1189d38a66705702e15c4111d /proto.h | |
parent | f5294d12c0aa55a61680444556e53554d881d9b0 (diff) | |
download | perl-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.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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) |