PL_filemode = 0;
if (!GvAV(gv))
return NULL;
- while (av_len(GvAV(gv)) >= 0) {
+ while (av_tindex(GvAV(gv)) >= 0) {
STRLEN oldlen;
sv = av_shift(GvAV(gv));
SAVEFREESV(sv);
if (AvREIFY(sv)) sv_catpv(d, ",REIFY");
Perl_dump_indent(aTHX_ level, file, " FLAGS = (%s)\n",
SvCUR(d) ? SvPVX_const(d) + 1 : "");
- if (nest < maxnest && av_len(MUTABLE_AV(sv)) >= 0) {
+ if (nest < maxnest && av_tindex(MUTABLE_AV(sv)) >= 0) {
SSize_t count;
- for (count = 0; count <= av_len(MUTABLE_AV(sv)) && count < maxnest; count++) {
+ for (count = 0; count <= av_tindex(MUTABLE_AV(sv)) && count < maxnest; count++) {
SV** const elt = av_fetch(MUTABLE_AV(sv),count,0);
Perl_dump_indent(aTHX_ level + 1, file, "Elt No. %"IVdf"\n", (IV)count);
hv_iterinit(MY_CXT.ob_reg);
while((ent = hv_iternext(MY_CXT.ob_reg)))
av_push(oblist, SvREFCNT_inc(hv_iterkeysv(ent)));
- len = av_len(oblist);
+ len = av_tindex(oblist);
for (i = 0; i <= len; ++i) {
SV* old_id = *av_fetch(oblist, i, 0);
SV* trigger = hv_delete_ent(MY_CXT.ob_reg, old_id, 0, 0);
I32 i;
AV *const new_av = newAV();
- for (i = 0; i <= av_len(cur); i++) {
+ for (i = 0; i <= av_tindex(cur); i++) {
av_store(new_av, i, newSVsv(*av_fetch(cur, i, 0)));
}
else
Perl_croak(aTHX_ "Argument is not an ARRAY reference");
- nitems = av_len(inary) + 1;
+ nitems = av_tindex(inary) + 1;
/* FIXME dunno if supposed to use perl mallocs here */
/* N+1 elements so we know the last one is NULL */
"Inconsistent hierarchy during C3 merge of class '%"HEKf"':\n\t"
"current merge results [\n",
HEKfARG(stashhek));
- for (i = 0; i <= av_len(retval); i++) {
+ for (i = 0; i <= av_tindex(retval); i++) {
SV **elem = av_fetch(retval, i, 0);
sv_catpvf(errmsg, "\t\t%"SVf",\n", SVfARG(*elem));
}
} else {
SV * const repointer = &PL_sv_undef;
av_push(PL_regex_padav, repointer);
- pmop->op_pmoffset = av_len(PL_regex_padav);
+ pmop->op_pmoffset = av_tindex(PL_regex_padav);
PL_regex_pad = AvARRAY(PL_regex_padav);
}
#endif
STMT_START { \
if (PL_blockhooks) { \
SSize_t i; \
- for (i = av_len(PL_blockhooks); i >= 0; i--) { \
+ for (i = av_tindex(PL_blockhooks); i >= 0; i--) { \
SV *sv = AvARRAY(PL_blockhooks)[i]; \
BHK *hk; \
\
if (SvTYPE(sv) != SVt_PVAV)
Perl_croak_nocontext("Not array reference given to mod2fname");
- avlen = av_len((AV*)sv);
+ avlen = av_tindex((AV*)sv);
if (avlen < 0)
Perl_croak_nocontext("Empty array reference given to mod2fname");
#ifdef PERL_IS_MINIPERL
const Size_t extra = 0;
#else
- Size_t extra = av_len(av) + 1;
+ Size_t extra = av_tindex(av) + 1;
#endif
av_unshift(inc, extra + push_basedir);
if (push_basedir)
PERL_ARGS_ASSERT_CALL_LIST;
- while (av_len(paramList) >= 0) {
+ while (av_tindex(paramList) >= 0) {
cv = MUTABLE_CV(av_shift(paramList));
if (PL_savebegin) {
if (paramList == PL_beginav) {
&& idx >= AvFILLp(PL_parser->rsfp_filters))
#define PERL_FILTER_EXISTS(i) \
(PL_parser && PL_parser->rsfp_filters \
- && (i) <= av_len(PL_parser->rsfp_filters))
+ && (i) <= av_tindex(PL_parser->rsfp_filters))
#if defined(_AIX) && !defined(_AIX43)
#if defined(USE_REENTRANT) || defined(_REENTRANT) || defined(_THREAD_SAFE)
IV *iterp = Perl_av_iter_p(aTHX_ array);
const IV current = (*iterp)++;
- if (current > av_len(array)) {
+ if (current > av_tindex(array)) {
*iterp = 0;
if (gimme == G_SCALAR)
RETPUSHUNDEF;
if (gimme == G_SCALAR) {
dTARGET;
- PUSHi(av_len(array) + 1);
+ PUSHi(av_tindex(array) + 1);
}
else if (gimme == G_ARRAY) {
IV n = Perl_av_len(aTHX_ array);
const MAGIC *mg;
bool can_preserve = SvCANEXISTDELETE(av);
- for (i = 0, j = av_len(av); i < j; ++i, --j) {
+ for (i = 0, j = av_tindex(av); i < j; ++i, --j) {
SV *begin, *end;
if (can_preserve) {
SSize_t i; \
SSize_t len; \
assert(SvTYPE(tmpsv) == SVt_PVAV); \
- len = av_len((AV *)tmpsv) + 1; \
+ len = av_tindex((AV *)tmpsv) + 1; \
(void)POPs; /* get rid of the arg */ \
EXTEND(sp, len); \
for (i = 0; i < len; ++i) \
first = SvIV(*av_fetch(lav,0,0));
if ( first > (int)PERL_REVISION /* probably 'use 6.0' */
|| hv_exists(MUTABLE_HV(req), "qv", 2 ) /* qv style */
- || av_len(lav) > 1 /* FP with > 3 digits */
+ || av_tindex(lav) > 1 /* FP with > 3 digits */
|| strstr(SvPVX(pv),".0") /* FP with leading 0 */
) {
DIE(aTHX_ "Perl %"SVf" required--this is only "
SV *hintsv;
I32 second = 0;
- if (av_len(lav)>=1)
+ if (av_tindex(lav)>=1)
second = SvIV(*av_fetch(lav,1,0));
second /= second >= 600 ? 100 : 10;
SSize_t i;
bool andedresults = TRUE;
AV *av = (AV*) SvRV(d);
- const I32 len = av_len(av);
+ const I32 len = av_tindex(av);
DEBUG_M(Perl_deb(aTHX_ " applying rule Array-CodeRef\n"));
if (len == -1)
RETPUSHYES;
}
else if (SvROK(d) && SvTYPE(SvRV(d)) == SVt_PVAV) {
AV * const other_av = MUTABLE_AV(SvRV(d));
- const SSize_t other_len = av_len(other_av) + 1;
+ const SSize_t other_len = av_tindex(other_av) + 1;
SSize_t i;
HV *hv = MUTABLE_HV(SvRV(e));
}
else if (SvROK(d) && SvTYPE(SvRV(d)) == SVt_PVHV) {
AV * const other_av = MUTABLE_AV(SvRV(e));
- const SSize_t other_len = av_len(other_av) + 1;
+ const SSize_t other_len = av_tindex(other_av) + 1;
SSize_t i;
DEBUG_M(Perl_deb(aTHX_ " applying rule Hash-Array\n"));
if (SvROK(d) && SvTYPE(SvRV(d)) == SVt_PVAV) {
AV *other_av = MUTABLE_AV(SvRV(d));
DEBUG_M(Perl_deb(aTHX_ " applying rule Array-Array\n"));
- if (av_len(MUTABLE_AV(SvRV(e))) != av_len(other_av))
+ if (av_tindex(MUTABLE_AV(SvRV(e))) != av_tindex(other_av))
RETPUSHNO;
else {
SSize_t i;
- const SSize_t other_len = av_len(other_av);
+ const SSize_t other_len = av_tindex(other_av);
if (NULL == seen_this) {
seen_this = newHV();
sm_regex_array:
{
PMOP * const matcher = make_matcher((REGEXP*) SvRV(d));
- const SSize_t this_len = av_len(MUTABLE_AV(SvRV(e)));
+ const SSize_t this_len = av_tindex(MUTABLE_AV(SvRV(e)));
SSize_t i;
for(i = 0; i <= this_len; ++i) {
}
else if (!SvOK(d)) {
/* undef ~~ array */
- const SSize_t this_len = av_len(MUTABLE_AV(SvRV(e)));
+ const SSize_t this_len = av_tindex(MUTABLE_AV(SvRV(e)));
SSize_t i;
DEBUG_M(Perl_deb(aTHX_ " applying rule Undef-Array\n"));
sm_any_array:
{
SSize_t i;
- const SSize_t this_len = av_len(MUTABLE_AV(SvRV(e)));
+ const SSize_t this_len = av_tindex(MUTABLE_AV(SvRV(e)));
DEBUG_M(Perl_deb(aTHX_ " applying rule Any-Array\n"));
for (i = 0; i <= this_len; ++i) {
if (IoFLAGS(io) & IOf_ARGV) {
if (IoFLAGS(io) & IOf_START) {
IoLINES(io) = 0;
- if (av_len(GvAVn(PL_last_in_gv)) < 0) {
+ if (av_tindex(GvAVn(PL_last_in_gv)) < 0) {
IoFLAGS(io) &= ~IOf_START;
do_open(PL_last_in_gv,"-",1,FALSE,O_RDONLY,0,NULL);
SvTAINTED_off(GvSVn(PL_last_in_gv)); /* previous tainting irrelevant */
IV len;
if (!defer)
DIE(aTHX_ PL_no_aelem, elem);
- len = av_len(av);
+ len = av_tindex(av);
mPUSHs(newSVavdefelem(av,
/* Resolve a negative index now, unless it points before the
beginning of the array, in which case record it for error
if (!MAXARG && (PL_op->op_flags & OPf_SPECIAL)) { /* eof() */
if (io && !IoIFP(io)) {
- if ((IoFLAGS(io) & IOf_START) && av_len(GvAVn(gv)) < 0) {
+ if ((IoFLAGS(io) & IOf_START) && av_tindex(GvAVn(gv)) < 0) {
IoLINES(io) = 0;
IoFLAGS(io) &= ~IOf_START;
do_open(gv, "-", 1, FALSE, O_RDONLY, 0, NULL);
} else if (flags & RXapif_ONE) {
ret = CALLREG_NAMED_BUFF_ALL(r, (flags | RXapif_REGNAMES));
av = MUTABLE_AV(SvRV(ret));
- length = av_len(av);
+ length = av_tindex(av);
SvREFCNT_dec_NN(ret);
return newSViv(length + 1);
} else {
#endif
/* Look at the longest folds first */
- for (cp_count = av_len(multi_char_matches); cp_count > 0; cp_count--) {
+ for (cp_count = av_tindex(multi_char_matches); cp_count > 0; cp_count--) {
if (av_exists(multi_char_matches, cp_count)) {
AV** this_array_ptr;
{
AV* list = (AV*) *listp;
IV k;
- for (k = 0; k <= av_len(list); k++) {
+ for (k = 0; k <= av_tindex(list); k++) {
SV** c_p = av_fetch(list, k, FALSE);
UV c;
if (c_p == NULL) {
}
else { /* Does participate in folds */
AV* list = (AV*) *listp;
- if (av_len(list) != 1) {
+ if (av_tindex(list) != 1) {
/* If there aren't exactly two folds to this, it is
* outside the scope of this function */
*only_utf8_locale_ptr = NULL;
}
- if (av_len(av) >= 3) {
+ if (av_tindex(av) >= 3) {
invlist = ary[3];
if (SvUV(ary[4])) {
swash_init_flags |= _CORE_SWASH_INIT_USER_DEFINED_PROPERTY;
/* this regexp is also owned by the new PL_reg_curpm, which
will try to free it. */
av_push(PL_regex_padav, repointer);
- PL_reg_curpm->op_pmoffset = av_len(PL_regex_padav);
+ PL_reg_curpm->op_pmoffset = av_tindex(PL_regex_padav);
PL_regex_pad = AvARRAY(PL_regex_padav);
}
#endif
/* Call the ->CLONE method, if it exists, for each of the stashes
identified by sv_dup() above.
*/
- while(av_len(param->stashes) != -1) {
+ while(av_tindex(param->stashes) != -1) {
HV* const stash = MUTABLE_HV(av_shift(param->stashes));
GV* const cloner = gv_fetchmethod_autoload(stash, "CLONE", 0);
if (cloner && GvCV(cloner)) {
AV* const av = PerlIO_get_layers(aTHX_ input ?
IoIFP(io) : IoOFP(io));
SSize_t i;
- const SSize_t last = av_len(av);
+ const SSize_t last = av_tindex(av);
SSize_t nitem = 0;
for (i = last; i >= 0; i -= 3) {
XSRETURN_UNDEF;
av = MUTABLE_AV(SvRV(ret));
- length = av_len(av);
+ length = av_tindex(av);
EXTEND(SP, length+1); /* better extend stack just once */
for (i = 0; i <= length; i++) {
while ((from_list = (AV *) hv_iternextsv(specials_inverse,
&char_to, &to_len)))
{
- if (av_len(from_list) > 0) {
+ if (av_tindex(from_list) > 0) {
SSize_t i;
/* We iterate over all combinations of i,j to place each code
* point on each list */
- for (i = 0; i <= av_len(from_list); i++) {
+ for (i = 0; i <= av_tindex(from_list); i++) {
SSize_t j;
AV* i_list = newAV();
SV** entryp = av_fetch(from_list, i, FALSE);
}
/* For DEBUG_U: UV u = valid_utf8_to_uvchr((U8*) SvPVX(*entryp), 0);*/
- for (j = 0; j <= av_len(from_list); j++) {
+ for (j = 0; j <= av_tindex(from_list); j++) {
entryp = av_fetch(from_list, j, FALSE);
if (entryp == NULL) {
Perl_croak(aTHX_ "panic: av_fetch() unexpectedly failed");
/* Look through list to see if this inverse mapping already is
* listed, or if there is a mapping to itself already */
- for (i = 0; i <= av_len(list); i++) {
+ for (i = 0; i <= av_tindex(list); i++) {
SV** entryp = av_fetch(list, i, FALSE);
SV* entry;
if (entryp == NULL) {
int max_name_len = 39;
AV *in_array = (AV *)SvRV(ST(0));
- num_entries = av_len(in_array);
+ num_entries = av_tindex(in_array);
/* All the names start with PL_. */
strcpy(ultimate_name, "PL_");