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 /cv.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 'cv.h')
-rw-r--r-- | cv.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -192,6 +192,8 @@ should print 123: =cut */ +typedef OP *(*Perl_call_checker)(pTHX_ OP *, GV *, SV *); + /* * Local variables: * c-indentation-style: bsd |