diff options
author | Zefram <zefram@fysh.org> | 2010-10-03 14:53:16 +0100 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-10-10 17:25:15 -0700 |
commit | d908838680ec40ea0e85f59ee66f5f56a225f9b4 (patch) | |
tree | be5eafa5cf981949a4e4bc308be6797443882229 /op.h | |
parent | b98b62bccdcb420ec5430eb831023e3d91ab2fa0 (diff) | |
download | perl-d908838680ec40ea0e85f59ee66f5f56a225f9b4.tar.gz |
plugin mechanism to rewrite calls to a subroutine
New magic type PERL_MAGIC_checkcall attaches a function to a CV, which
will be called as the second half of the op checker for an entersub
op calling that CV. Default state, in the absence of this magic,
is to process the CV's prototype if it has one, or apply list context
to all the arguments if not. New API functions cv_get_call_checker()
and cv_set_call_checker() provide a clean interface to this facility,
hiding the internal use of magic.
Expose in the API the new functions rv2cv_op_cv(),
ck_entersub_args_list(), ck_entersub_args_proto(), and
ck_entersub_args_proto_or_list(), which are meaningful segments of
standard entersub op checking and are likely to be useful in plugged-in
call checker functions.
Expose new API function op_contextualize(), which is a public interface
to the internal scalar()/list()/scalarvoid() functions. This API is
likely to be required in most plugged-in call checker functions.
Incidentally add new function mg_free_type(), in the API, which will
remove magic of one type from an SV. (mg_free() removes all magic,
and there isn't anything else more selective.)
Diffstat (limited to 'op.h')
-rw-r--r-- | op.h | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -741,6 +741,11 @@ preprocessing token; the type of I<arg> depends on I<which>. } \ } STMT_END +/* flags for rv2cv_op_cv */ + +#define RV2CVOPCV_MARK_EARLY 0x00000001 +#define RV2CVOPCV_RETURN_NAME_GV 0x00000002 + #ifdef PERL_MAD # define MAD_NULL 1 # define MAD_PV 2 |