Apd |IO* |sv_2io |NN SV *const sv
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
s |bool |glob_2number |NN GV* const gv
-s |char* |glob_2pv |NN GV* const gv|NULLOK STRLEN * const len
#endif
Amb |IV |sv_2iv |NULLOK SV *sv
Apd |IV |sv_2iv_flags |NULLOK SV *const sv|const I32 flags
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define glob_2number S_glob_2number
-#define glob_2pv S_glob_2pv
#endif
#endif
#define sv_2iv_flags Perl_sv_2iv_flags
#if defined(PERL_IN_SV_C) || defined(PERL_DECL_PROT)
#ifdef PERL_CORE
#define glob_2number(a) S_glob_2number(aTHX_ a)
-#define glob_2pv(a,b) S_glob_2pv(aTHX_ a,b)
#endif
#endif
#define sv_2iv_flags(a,b) Perl_sv_2iv_flags(aTHX_ a,b)
#define PERL_ARGS_ASSERT_GLOB_2NUMBER \
assert(gv)
-STATIC char* S_glob_2pv(pTHX_ GV* const gv, STRLEN * const len)
- __attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_GLOB_2PV \
- assert(gv)
-
#endif
/* PERL_CALLCONV IV Perl_sv_2iv(pTHX_ SV *sv); */
PERL_CALLCONV IV Perl_sv_2iv_flags(pTHX_ SV *const sv, const I32 flags);
return TRUE;
}
-STATIC char *
-S_glob_2pv(pTHX_ GV * const gv, STRLEN * const len)
-{
- const U32 wasfake = SvFLAGS(gv) & SVf_FAKE;
- SV *const buffer = sv_newmortal();
-
- PERL_ARGS_ASSERT_GLOB_2PV;
-
- /* FAKE globs can get coerced, so need to turn this off temporarily if it
- is on. */
- SvFAKE_off(gv);
- gv_efullname3(buffer, gv, "*");
- SvFLAGS(gv) |= wasfake;
-
- assert(SvPOK(buffer));
- if (len) {
- *len = SvCUR(buffer);
- }
- return SvPVX(buffer);
-}
-
/* Actually, ISO C leaves conversion of UV to IV undefined, but
until proven guilty, assume that things are not that bad... */
#endif
}
else {
- if (isGV_with_GP(sv))
- return glob_2pv(MUTABLE_GV(sv), lp);
+ if (isGV_with_GP(sv)) {
+ GV *const gv = MUTABLE_GV(sv);
+ const U32 wasfake = SvFLAGS(gv) & SVf_FAKE;
+ SV *const buffer = sv_newmortal();
+
+ /* FAKE globs can get coerced, so need to turn this off temporarily
+ if it is on. */
+ SvFAKE_off(gv);
+ gv_efullname3(buffer, gv, "*");
+ SvFLAGS(gv) |= wasfake;
+
+ assert(SvPOK(buffer));
+ if (lp) {
+ *lp = SvCUR(buffer);
+ }
+ return SvPVX(buffer);
+ }
if (lp)
*lp = 0;