summaryrefslogtreecommitdiff
path: root/cv.h
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-03 14:53:16 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-10 17:25:15 -0700
commitd908838680ec40ea0e85f59ee66f5f56a225f9b4 (patch)
treebe5eafa5cf981949a4e4bc308be6797443882229 /cv.h
parentb98b62bccdcb420ec5430eb831023e3d91ab2fa0 (diff)
downloadperl-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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cv.h b/cv.h
index 7979a05c80..e6f5cba9c6 100644
--- a/cv.h
+++ b/cv.h
@@ -192,6 +192,8 @@ should print 123:
=cut
*/
+typedef OP *(*Perl_call_checker)(pTHX_ OP *, GV *, SV *);
+
/*
* Local variables:
* c-indentation-style: bsd