From: Vincent Pit Date: Fri, 17 Feb 2012 18:46:50 +0000 (+0100) Subject: Decorate the magic callbacks section X-Git-Tag: v0.48~1 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a15fd15a4532b5623e02c3e99cd2f3952c662ed0;p=perl%2Fmodules%2FVariable-Magic.git Decorate the magic callbacks section --- diff --git a/Magic.xs b/Magic.xs index 9bb6c7b..8aee17b 100644 --- a/Magic.xs +++ b/Magic.xs @@ -1014,7 +1014,7 @@ STATIC SV *vmg_op_info(pTHX_ unsigned int opinfo) { return &PL_sv_undef; } -/* ... svt callbacks ....................................................... */ +/* --- svt callbacks ------------------------------------------------------- */ #define VMG_CB_CALL_ARGS_MASK 15 #define VMG_CB_CALL_ARGS_SHIFT 4 @@ -1076,6 +1076,8 @@ STATIC int vmg_svt_default_noop(pTHX_ SV *sv, MAGIC *mg) { return 0; } +/* ... get magic ........................................................... */ + STATIC int vmg_svt_get(pTHX_ SV *sv, MAGIC *mg) { const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg); @@ -1084,6 +1086,8 @@ STATIC int vmg_svt_get(pTHX_ SV *sv, MAGIC *mg) { #define vmg_svt_get_noop vmg_svt_default_noop +/* ... set magic ........................................................... */ + STATIC int vmg_svt_set(pTHX_ SV *sv, MAGIC *mg) { const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg); @@ -1092,6 +1096,8 @@ STATIC int vmg_svt_set(pTHX_ SV *sv, MAGIC *mg) { #define vmg_svt_set_noop vmg_svt_default_noop +/* ... len magic ........................................................... */ + STATIC U32 vmg_sv_len(pTHX_ SV *sv) { #define vmg_sv_len(S) vmg_sv_len(aTHX_ (S)) STRLEN len; @@ -1162,6 +1168,8 @@ STATIC U32 vmg_svt_len_noop(pTHX_ SV *sv, MAGIC *mg) { return len; } +/* ... clear magic ......................................................... */ + STATIC int vmg_svt_clear(pTHX_ SV *sv, MAGIC *mg) { const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg); @@ -1170,6 +1178,8 @@ STATIC int vmg_svt_clear(pTHX_ SV *sv, MAGIC *mg) { #define vmg_svt_clear_noop vmg_svt_default_noop +/* ... free magic .......................................................... */ + STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) { const vmg_wizard *w; int ret = 0; @@ -1233,6 +1243,8 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) { # define VMG_SVT_COPY_KEYLEN_TYPE int #endif +/* ... copy magic .......................................................... */ + STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, VMG_SVT_COPY_KEYLEN_TYPE keylen) { const vmg_wizard *w = vmg_wizard_from_mg_nocheck(mg); SV *keysv; @@ -1257,6 +1269,8 @@ STATIC int vmg_svt_copy_noop(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key, return 0; } +/* ... dup magic ........................................................... */ + #if 0 STATIC int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) { return 0; @@ -1264,6 +1278,8 @@ STATIC int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) { #define vmg_svt_dup_noop vmg_svt_dup #endif +/* ... local magic ......................................................... */ + #if MGf_LOCAL STATIC int vmg_svt_local(pTHX_ SV *nsv, MAGIC *mg) { @@ -1276,6 +1292,8 @@ STATIC int vmg_svt_local(pTHX_ SV *nsv, MAGIC *mg) { #endif /* MGf_LOCAL */ +/* ... uvar magic .......................................................... */ + #if VMG_UVAR STATIC OP *vmg_pp_resetuvar(pTHX) { SvRMAGICAL_on(cSVOP_sv);