From: Vincent Pit Date: Sat, 2 Jan 2010 00:15:31 +0000 (+0100) Subject: Replace the "sub_op_" prefix by "so_" for private types and symbols X-Git-Tag: v0.01~11 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=fa4378c8262b5f0d476bb0af2d52551dc3fe0cc0;p=perl%2Fmodules%2FSub-Op.git Replace the "sub_op_" prefix by "so_" for private types and symbols --- diff --git a/Op.xs b/Op.xs index 7b35b4a..44c283e 100644 --- a/Op.xs +++ b/Op.xs @@ -98,16 +98,16 @@ STATIC SV *so_clone(pTHX_ SV *sv, tTHX owner) { /* PerlMemShared_free() needs the [ap]PTBLMS_? default values */ #define ptable_store(T, K, V) ptable_store(aPTBLMS_ (T), (K), (V)) -STATIC ptable *sub_op_name = NULL; +STATIC ptable *so_op_name = NULL; #ifdef USE_ITHREADS -STATIC perl_mutex sub_op_name_mutex; +STATIC perl_mutex so_op_name_mutex; #endif typedef struct { STRLEN len; char buf; -} sub_op_name_t; +} so_op_name_t; /* --- Public API ---------------------------------------------------------- */ @@ -138,8 +138,8 @@ void sub_op_register(pTHX_ const sub_op_keyword *k) { /* --- Private helpers ----------------------------------------------------- */ -STATIC IV sub_op_hint(pTHX) { -#define sub_op_hint() sub_op_hint(aTHX) +STATIC IV so_hint(pTHX) { +#define so_hint() so_hint(aTHX) SV *hint; #if SO_HAS_PERL(5, 9, 5) @@ -160,12 +160,12 @@ STATIC IV sub_op_hint(pTHX) { return (SvOK(hint) && SvIOK(hint)) ? SvIVX(hint) : 0; } -STATIC OP *(*sub_op_old_ck_entersub)(pTHX_ OP *) = 0; +STATIC OP *(*so_old_ck_entersub)(pTHX_ OP *) = 0; -STATIC OP *sub_op_ck_entersub(pTHX_ OP *o) { - o = CALL_FPTR(sub_op_old_ck_entersub)(aTHX_ o); +STATIC OP *so_ck_entersub(pTHX_ OP *o) { + o = CALL_FPTR(so_old_ck_entersub)(aTHX_ o); - if (sub_op_hint()) { + if (so_hint()) { OP *ex_list, *rv2cv, *gvop, *last_arg = NULL; GV *gv; @@ -241,16 +241,16 @@ STATIC OP *sub_op_ck_entersub(pTHX_ OP *o) { } { - sub_op_name_t *on = PerlMemShared_malloc(sizeof(*on) + len); + so_op_name_t *on = PerlMemShared_malloc(sizeof(*on) + len); Copy(name, &on->buf, len, char); (&on->buf)[len] = '\0'; on->len = len; #ifdef USE_ITHREADS - MUTEX_LOCK(&sub_op_name_mutex); + MUTEX_LOCK(&so_op_name_mutex); #endif /* USE_ITHREADS */ - ptable_store(sub_op_name, o, on); + ptable_store(so_op_name, o, on); #ifdef USE_ITHREADS - MUTEX_UNLOCK(&sub_op_name_mutex); + MUTEX_UNLOCK(&so_op_name_mutex); #endif /* USE_ITHREADS */ } } @@ -260,12 +260,12 @@ skip: return o; } -STATIC OP *(*sub_op_old_ck_gelem)(pTHX_ OP *) = 0; +STATIC OP *(*so_old_ck_gelem)(pTHX_ OP *) = 0; -STATIC OP *sub_op_ck_gelem(pTHX_ OP *o) { - o = CALL_FPTR(sub_op_old_ck_entersub)(aTHX_ o); +STATIC OP *so_ck_gelem(pTHX_ OP *o) { + o = CALL_FPTR(so_old_ck_entersub)(aTHX_ o); - if (sub_op_hint()) { + if (so_hint()) { OP *rv2gv, *gvop; GV *gv; @@ -307,9 +307,9 @@ PROTOTYPES: ENABLE BOOT: { - sub_op_name = ptable_new(); + so_op_name = ptable_new(); #ifdef USE_ITHREADS - MUTEX_INIT(&sub_op_name_mutex); + MUTEX_INIT(&so_op_name_mutex); #endif MY_CXT_INIT; @@ -319,10 +319,10 @@ BOOT: MY_CXT.owner = aTHX; #endif /* SO_THREADSAFE */ - sub_op_old_ck_entersub = PL_check[OP_ENTERSUB]; - PL_check[OP_ENTERSUB] = sub_op_ck_entersub; - sub_op_old_ck_gelem = PL_check[OP_GELEM]; - PL_check[OP_GELEM] = sub_op_ck_gelem; + so_old_ck_entersub = PL_check[OP_ENTERSUB]; + PL_check[OP_ENTERSUB] = so_ck_entersub; + so_old_ck_gelem = PL_check[OP_GELEM]; + PL_check[OP_GELEM] = so_ck_gelem; } #if SO_THREADSAFE @@ -369,7 +369,7 @@ _custom_name(SV *op) PROTOTYPE: $ PREINIT: OP *o; - sub_op_name_t *on; + so_op_name_t *on; PPCODE: if (!SvROK(op)) XSRETURN_UNDEF; @@ -377,11 +377,11 @@ PPCODE: if (!o || o->op_type != OP_CUSTOM) XSRETURN_UNDEF; #ifdef USE_ITHREADS - MUTEX_LOCK(&sub_op_name_mutex); + MUTEX_LOCK(&so_op_name_mutex); #endif /* USE_ITHREADS */ - on = ptable_fetch(sub_op_name, o); + on = ptable_fetch(so_op_name, o); #ifdef USE_ITHREADS - MUTEX_UNLOCK(&sub_op_name_mutex); + MUTEX_UNLOCK(&so_op_name_mutex); #endif /* USE_ITHREADS */ if (!on) XSRETURN_UNDEF;