The "short" names become macro wrappers, and the Perl_* versions become mathoms.
pox |void |get_db_sub |NULLOK SV **svp|NN CV *cv
Ap |void |gp_free |NULLOK GV* gv
Ap |GP* |gp_ref |NULLOK GP* gp
-Ap |GV* |gv_AVadd |NN GV* gv
-Ap |GV* |gv_HVadd |NN GV* gv
+Ap |GV* |gv_add_by_type |NN GV *gv|svtype type
+Apmb |GV* |gv_AVadd |NN GV *gv
+Apmb |GV* |gv_HVadd |NN GV *gv
Ap |GV* |gv_IOadd |NULLOK GV* gv
ApR |GV* |gv_autoload4 |NULLOK HV* stash|NN const char* name|STRLEN len|I32 method
Ap |void |gv_check |NN const HV* stash
#endif
#ifdef PERL_DONT_CREATE_GVSV
-Ap |GV* |gv_SVadd |NN GV* gv
+Apbm |GV* |gv_SVadd |NN GV *gv
#endif
Apo |bool |ckwarn |U32 w
Apo |bool |ckwarn_d |U32 w
#endif
#define gp_free Perl_gp_free
#define gp_ref Perl_gp_ref
-#define gv_AVadd Perl_gv_AVadd
-#define gv_HVadd Perl_gv_HVadd
+#define gv_add_by_type Perl_gv_add_by_type
#define gv_IOadd Perl_gv_IOadd
#define gv_autoload4 Perl_gv_autoload4
#define gv_check Perl_gv_check
#endif
#endif
#ifdef PERL_DONT_CREATE_GVSV
-#define gv_SVadd Perl_gv_SVadd
#endif
#ifdef PERL_CORE
#define offer_nice_chunk Perl_offer_nice_chunk
#endif
#define gp_free(a) Perl_gp_free(aTHX_ a)
#define gp_ref(a) Perl_gp_ref(aTHX_ a)
-#define gv_AVadd(a) Perl_gv_AVadd(aTHX_ a)
-#define gv_HVadd(a) Perl_gv_HVadd(aTHX_ a)
+#define gv_add_by_type(a,b) Perl_gv_add_by_type(aTHX_ a,b)
#define gv_IOadd(a) Perl_gv_IOadd(aTHX_ a)
#define gv_autoload4(a,b,c,d) Perl_gv_autoload4(aTHX_ a,b,c,d)
#define gv_check(a) Perl_gv_check(aTHX_ a)
#endif
#endif
#ifdef PERL_DONT_CREATE_GVSV
-#define gv_SVadd(a) Perl_gv_SVadd(aTHX_ a)
#endif
#if defined(PERL_CORE) || defined(PERL_EXT)
#endif
Perl_free_tmps
Perl_gp_free
Perl_gp_ref
+Perl_gv_add_by_type
Perl_gv_AVadd
Perl_gv_HVadd
Perl_gv_IOadd
static const char S_autoload[] = "AUTOLOAD";
static const STRLEN S_autolen = sizeof(S_autoload)-1;
-
-#ifdef PERL_DONT_CREATE_GVSV
GV *
-Perl_gv_SVadd(pTHX_ GV *gv)
+Perl_gv_add_by_type(pTHX_ GV *gv, svtype type)
{
- PERL_ARGS_ASSERT_GV_SVADD;
-
- if (!gv || SvTYPE((const SV *)gv) != SVt_PVGV)
- Perl_croak(aTHX_ "Bad symbol for scalar");
- if (!GvSV(gv))
- GvSV(gv) = newSV(0);
- return gv;
-}
-#endif
+ SV **where;
-GV *
-Perl_gv_AVadd(pTHX_ register GV *gv)
-{
- PERL_ARGS_ASSERT_GV_AVADD;
+ PERL_ARGS_ASSERT_GV_ADD_BY_TYPE;
if (!gv || SvTYPE((const SV *)gv) != SVt_PVGV)
- Perl_croak(aTHX_ "Bad symbol for array");
- if (!GvAV(gv))
- GvAV(gv) = newAV();
- return gv;
-}
+ Perl_croak(aTHX_ "Bad symbol for %s", type == SVt_PVAV ? "array" : type == SVt_PVHV ? "hash" : "scalar");
-GV *
-Perl_gv_HVadd(pTHX_ register GV *gv)
-{
- PERL_ARGS_ASSERT_GV_HVADD;
+ if (type == SVt_PVHV) {
+ where = (SV **)&GvHV(gv);
+ } else if (type == SVt_PVAV) {
+ where = (SV **)&GvAV(gv);
+ } else {
+ where = &GvSV(gv);
+ }
- if (!gv || SvTYPE((const SV *)gv) != SVt_PVGV)
- Perl_croak(aTHX_ "Bad symbol for hash");
- if (!GvHV(gv))
- GvHV(gv) = newHV();
+ if (!*where)
+ *where = newSV_type(type);
return gv;
}
#define gv_efullname3(sv,gv,prefix) gv_efullname4(sv,gv,prefix,TRUE)
#define gv_fetchmethod(stash, name) gv_fetchmethod_autoload(stash, name, TRUE)
+#define gv_AVadd(gv) gv_add_by_type((gv), SVt_PVAV)
+#define gv_HVadd(gv) gv_add_by_type((gv), SVt_PVHV)
+#define gv_SVadd(gv) gv_add_by_type((gv), SVt_NULL)
+
/*
* Local variables:
* c-indentation-style: bsd
save_op();
}
+#ifdef PERL_DONT_CREATE_GVSV
+GV *
+Perl_gv_SVadd(pTHX_ GV *gv)
+{
+ PERL_ARGS_ASSERT_GV_SVADD;
+
+ return gv_SVadd(gv);
+}
+#endif
+
+GV *
+Perl_gv_AVadd(pTHX_ GV *gv)
+{
+ PERL_ARGS_ASSERT_GV_AVADD;
+
+ return gv_AVadd(gv);
+}
+
+GV *
+Perl_gv_HVadd(pTHX_ register GV *gv)
+{
+ PERL_ARGS_ASSERT_GV_HVADD;
+
+ return gv_HVadd(gv);
+}
+
#endif /* NO_MATHOMS */
/*
PERL_CALLCONV void Perl_gp_free(pTHX_ GV* gv);
PERL_CALLCONV GP* Perl_gp_ref(pTHX_ GP* gp);
-PERL_CALLCONV GV* Perl_gv_AVadd(pTHX_ GV* gv)
+PERL_CALLCONV GV* Perl_gv_add_by_type(pTHX_ GV *gv, svtype type)
__attribute__nonnull__(pTHX_1);
+#define PERL_ARGS_ASSERT_GV_ADD_BY_TYPE \
+ assert(gv)
+
+/* PERL_CALLCONV GV* Perl_gv_AVadd(pTHX_ GV *gv)
+ __attribute__nonnull__(pTHX_1); */
#define PERL_ARGS_ASSERT_GV_AVADD \
assert(gv)
-PERL_CALLCONV GV* Perl_gv_HVadd(pTHX_ GV* gv)
- __attribute__nonnull__(pTHX_1);
+/* PERL_CALLCONV GV* Perl_gv_HVadd(pTHX_ GV *gv)
+ __attribute__nonnull__(pTHX_1); */
#define PERL_ARGS_ASSERT_GV_HVADD \
assert(gv)
#endif
#ifdef PERL_DONT_CREATE_GVSV
-PERL_CALLCONV GV* Perl_gv_SVadd(pTHX_ GV* gv)
- __attribute__nonnull__(pTHX_1);
+/* PERL_CALLCONV GV* Perl_gv_SVadd(pTHX_ GV *gv)
+ __attribute__nonnull__(pTHX_1); */
#define PERL_ARGS_ASSERT_GV_SVADD \
assert(gv)
Attempt to reload %s aborted. Compilation failed in require
av_reify called on tied array
Bad name after %s%s
-Bad symbol for scalar
+Bad symbol for %s
bad top format reference
Bizarre copy of %s
Bizarre SvTYPE [%d]