summaryrefslogtreecommitdiff
path: root/dump.c
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 /dump.c
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 'dump.c')
-rw-r--r--dump.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dump.c b/dump.c
index 636bcad583..f7fc0147ec 100644
--- a/dump.c
+++ b/dump.c
@@ -1248,6 +1248,7 @@ static const struct { const char type; const char *name; } magic_names[] = {
{ PERL_MAGIC_tied, "tied(P)" },
{ PERL_MAGIC_sig, "sig(S)" },
{ PERL_MAGIC_uvar, "uvar(U)" },
+ { PERL_MAGIC_checkcall, "checkcall(])" },
{ PERL_MAGIC_overload_elem, "overload_elem(a)" },
{ PERL_MAGIC_overload_table, "overload_table(c)" },
{ PERL_MAGIC_regdatum, "regdatum(d)" },