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 /embed.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 'embed.h')
-rw-r--r-- | embed.h | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -434,6 +434,7 @@ #define nothreadhook() Perl_nothreadhook(aTHX) #define op_append_elem(a,b,c) Perl_op_append_elem(aTHX_ a,b,c) #define op_append_list(a,b,c) Perl_op_append_list(aTHX_ a,b,c) +#define op_class(a) Perl_op_class(aTHX_ a) #define op_contextualize(a,b) Perl_op_contextualize(aTHX_ a,b) #define op_convert_list(a,b,c) Perl_op_convert_list(aTHX_ a,b,c) #define op_dump(a) Perl_op_dump(aTHX_ a) |