}
/*
-=for apidoc av_top
+=for apidoc av_top_index
Returns the highest index in the array. The number of elements in the
-array is C<av_top(av) + 1>. Returns -1 if the array is empty.
+array is C<av_top_index(av) + 1>. Returns -1 if the array is empty.
The Perl equivalent for this is C<$#myarray>.
=for apidoc av_len
-Same as L</av_top>. Returns the highest index in the array. Note that the
+Same as L</av_top_index>. Returns the highest index in the array. Note that the
return value is +1 what its name implies it returns; and hence differs in
meaning from what the similarly named L</sv_len> returns.
I32
Perl_av_len(pTHX_ AV *av)
{
- /* If change this, must change identical Perl_av_top() just below */
+ /* If change this, must change identical Perl_av_top_index() just below */
PERL_ARGS_ASSERT_AV_LEN;
assert(SvTYPE(av) == SVt_PVAV);
}
I32
-Perl_av_top(pTHX_ AV *av)
+Perl_av_top_index(pTHX_ AV *av)
{
/* So short, that it is just a duplicate of Perl_av_len(). Must keep them
* in sync */
- PERL_ARGS_ASSERT_AV_TOP;
+ PERL_ARGS_ASSERT_AV_TOP_INDEX;
assert(SvTYPE(av) == SVt_PVAV);
return AvFILL(av);
=head1 Array Manipulation Functions
=for apidoc Am|int|AvFILL|AV* av
-Same as C<av_top()>. Deprecated, use C<av_top()> instead.
+Same as C<av_top_index()>. Deprecated, use C<av_top_index()> instead.
=cut
*/
EXp |void |av_reify |NN AV *av
ApdR |SV* |av_shift |NN AV *av
Apd |SV** |av_store |NN AV *av|I32 key|NULLOK SV *val
-ApdR |I32 |av_top |NN AV *av
+ApdR |I32 |av_top_index |NN AV *av
Apd |void |av_undef |NN AV *av
ApdoxM |SV** |av_create_and_unshift_one|NN AV **const avp|NN SV *const val
Apd |void |av_unshift |NN AV *av|I32 num
#define av_push(a,b) Perl_av_push(aTHX_ a,b)
#define av_shift(a) Perl_av_shift(aTHX_ a)
#define av_store(a,b,c) Perl_av_store(aTHX_ a,b,c)
-#define av_top(a) Perl_av_top(aTHX_ a)
+#define av_top_index(a) Perl_av_top_index(aTHX_ a)
#define av_undef(a) Perl_av_undef(aTHX_ a)
#define av_unshift(a,b) Perl_av_unshift(aTHX_ a,b)
#define block_gimme() Perl_block_gimme(aTHX)
Here are some other functions:
- I32 av_top(AV*);
+ I32 av_top_index(AV*);
SV** av_fetch(AV*, I32 key, I32 lval);
SV** av_store(AV*, I32 key, SV* val);
-The C<av_top> function returns the highest index value in an array (just
+The C<av_top_index> function returns the highest index value in an array (just
like $#array in Perl). If the array is empty, -1 is returned. The
C<av_fetch> function returns the value at index C<key>, but if C<lval>
is non-zero, then C<av_fetch> will store an undef value at that index.
#define PERL_ARGS_ASSERT_AV_STORE \
assert(av)
-PERL_CALLCONV I32 Perl_av_top(pTHX_ AV *av)
+PERL_CALLCONV I32 Perl_av_top_index(pTHX_ AV *av)
__attribute__warn_unused_result__
__attribute__nonnull__(pTHX_1);
-#define PERL_ARGS_ASSERT_AV_TOP \
+#define PERL_ARGS_ASSERT_AV_TOP_INDEX \
assert(av)
PERL_CALLCONV void Perl_av_undef(pTHX_ AV *av)
stack = newAV();
while (RExC_parse < RExC_end) {
- I32 top_index = av_top(stack);
+ I32 top_index = av_top_index(stack);
SV** top_ptr;
SV* current = NULL;
switch (curchar) {
case '?':
- if (av_top(stack) >= 0 /* This makes sure that we can
+ if (av_top_index(stack) >= 0 /* This makes sure that we can
safely subtract 1 from
RExC_parse in the next clause.
If we have something on the
RExC_parse += (UTF) ? UTF8SKIP(RExC_parse) : 1;
}
- if (av_top(stack) < 0 /* Was empty */
+ if (av_top_index(stack) < 0 /* Was empty */
|| ((final = av_pop(stack)) == NULL)
|| ! IS_OPERAND(final)
- || av_top(stack) >= 0) /* More left on stack */
+ || av_top_index(stack) >= 0) /* More left on stack */
{
vFAIL("Incomplete expression within '(?[ ])'");
}