diff options
author | Ben Morrow <ben@morrow.me.uk> | 2010-11-14 16:13:51 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-14 16:44:35 -0800 |
commit | 1830b3d9c87f8b1473b0a80759846f7a5dccae5a (patch) | |
tree | beb18022aed134c48b163e704373a677892a1433 /embedvar.h | |
parent | dd2637fb4f1ec3b64aa66be5b50af8823b480ce4 (diff) | |
download | perl-1830b3d9c87f8b1473b0a80759846f7a5dccae5a.tar.gz |
Improve custom OP support.
Change the custom op registrations from two separate hashes to one hash
holding structure pointers, and add API functions to register ops and
look them up. This will make it easier to add new properties of custom
ops in the future. Copy entries across from the old hashes where
necessary, to preserve compatibility.
Add two new properties, in addition to the already-existing 'name' and
'description': 'class' and 'peep'. 'class' is one of the OA_*OP
constants, and allows B and other introspection mechanisms to work with
custom ops that aren't BASEOPs. 'peep' is a pointer to a function that
will be called for ops of this type from Perl_rpeep.
Adjust B.xs to take account of the new properties, and also to give
custom ops their registered name rather than simply 'custom'.
Diffstat (limited to 'embedvar.h')
-rw-r--r-- | embedvar.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/embedvar.h b/embedvar.h index 290d40262c..65b38f0667 100644 --- a/embedvar.h +++ b/embedvar.h @@ -106,6 +106,7 @@ #define PL_curstname (vTHX->Icurstname) #define PL_custom_op_descs (vTHX->Icustom_op_descs) #define PL_custom_op_names (vTHX->Icustom_op_names) +#define PL_custom_ops (vTHX->Icustom_ops) #define PL_cv_has_eval (vTHX->Icv_has_eval) #define PL_dbargs (vTHX->Idbargs) #define PL_debstash (vTHX->Idebstash) @@ -436,6 +437,7 @@ #define PL_Icurstname PL_curstname #define PL_Icustom_op_descs PL_custom_op_descs #define PL_Icustom_op_names PL_custom_op_names +#define PL_Icustom_ops PL_custom_ops #define PL_Icv_has_eval PL_cv_has_eval #define PL_Idbargs PL_dbargs #define PL_Idebstash PL_debstash |