summaryrefslogtreecommitdiff
path: root/embed.fnc
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 /embed.fnc
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 'embed.fnc')
-rw-r--r--embed.fnc8
1 files changed, 8 insertions, 0 deletions
diff --git a/embed.fnc b/embed.fnc
index 5741ef040e..d64b268345 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -728,6 +728,7 @@ Apd |int |mg_copy |NN SV *sv|NN SV *nsv|NULLOK const char *key \
pd |void |mg_localize |NN SV* sv|NN SV* nsv|bool setmagic
ApdR |MAGIC* |mg_find |NULLOK const SV* sv|int type
Apd |int |mg_free |NN SV* sv
+Apd |void |mg_free_type |NN SV* sv|int how
Apd |int |mg_get |NN SV* sv
Apd |U32 |mg_length |NN SV* sv
Apd |void |mg_magical |NN SV* sv
@@ -844,6 +845,12 @@ Apda |OP* |newWHENOP |NULLOK OP* cond|NN OP* block
Apda |OP* |newWHILEOP |I32 flags|I32 debuggable|NULLOK LOOP* loop \
|I32 whileline|NULLOK OP* expr|NULLOK OP* block|NULLOK OP* cont \
|I32 has_my
+Apd |CV* |rv2cv_op_cv |NN OP *cvop|U32 flags
+Apd |OP* |ck_entersub_args_list|NN OP *entersubop
+Apd |OP* |ck_entersub_args_proto|NN OP *entersubop|NN GV *namegv|NN SV *protosv
+Apd |OP* |ck_entersub_args_proto_or_list|NN OP *entersubop|NN GV *namegv|NN SV *protosv
+Apd |void |cv_get_call_checker|NN CV *cv|NN Perl_call_checker *ckfun_p|NN SV **ckobj_p
+Apd |void |cv_set_call_checker|NN CV *cv|NN Perl_call_checker ckfun|NN SV *ckobj
Apa |PERL_SI*|new_stackinfo|I32 stitems|I32 cxitems
Ap |char* |scan_vstring |NN const char *s|NN const char *const e \
|NN SV *sv
@@ -1085,6 +1092,7 @@ s |void |save_pushptri32ptr|NULLOK void *const ptr1|const I32 i \
#endif
: Used in perly.y
p |OP* |sawparens |NULLOK OP* o
+Apd |OP* |op_contextualize|NN OP* o|I32 context
: Used in perly.y
p |OP* |scalar |NULLOK OP* o
#if defined(PERL_IN_OP_C)