*/
/*
-=head1 Handy Values
-
-=for apidoc AmU||Nullav
+=for apidoc ADmnU||Nullav
Null AV pointer.
(deprecated - use C<(AV *)NULL> instead)
-=head1 Array Manipulation Functions
+=for apidoc Am|SSize_t|AvFILL|AV* av
+Same as C<L</av_top_index>> or C<L</av_tindex>>.
+
+=for apidoc Cm|SSize_t|AvFILLp|AV* av
-=for apidoc Am|int|AvFILL|AV* av
-Same as C<av_top_index()>. Deprecated, use C<av_top_index()> instead.
+If the array C<av> is empty, this returns -1; otherwise it returns the maximum
+value of the indices of all the array elements which are currently defined in
+C<av>. It does not handle magic, hence the C<p> private indication in its name.
-=for apidoc Am|int|av_tindex|AV* av
-Same as C<av_top_index()>.
+=for apidoc Am|SV**|AvARRAY|AV* av
+Returns a pointer to the AV's internal SV* array.
+
+This is useful for doing pointer arithmetic on the array.
+If all you need is to look up an array element, then prefer C<av_fetch>.
=cut
*/
#define AvFILL(av) ((SvRMAGICAL((const SV *) (av))) \
? mg_size(MUTABLE_SV(av)) : AvFILLp(av))
-#define av_tindex(av) av_top_index(av)
+#define av_top_index(av) AvFILL(av)
+#define av_tindex(av) av_top_index(av)
-#if defined(PERL_IN_REGCOMP_C) || defined(PERL_IN_REGEXEC_C) || defined(PERL_IN_UTF8_C)
/* Note that it doesn't make sense to do this:
* SvGETMAGIC(av); IV x = av_tindex_nomg(av);
- * This name is controversial, and so is restricted by the #ifdef to the places
- * it already occurs
*/
-# define av_tindex_nomg(av) (__ASSERT_(SvTYPE(av) == SVt_PVAV) AvFILLp(av))
-#endif
+# define av_top_index_skip_len_mg(av) \
+ (__ASSERT_(SvTYPE(av) == SVt_PVAV) AvFILLp(av))
+# define av_tindex_skip_len_mg(av) av_top_index_skip_len_mg(av)
#define NEGATIVE_INDICES_VAR "NEGATIVE_INDICES"