- AvFILL
-
Same as av_len(). Deprecated, use av_len() instead.
- av_clear
-
Clears an array, making it empty. Does not free the memory used by the array itself.
- av_delete
-
Deletes the element indexed by key from the array. Returns the deleted
element. flags is currently ignored.
SV* av_delete(AV* ar, I32 key, I32 flags)
|
|
- av_exists
-
Returns true if the element indexed by key has been initialized.
This relies on the fact that uninitialized array elements are set to &PL_sv_undef.
bool av_exists(AV* ar, I32 key)
|
|
- av_extend
-
Pre-extend an array. The key is the index to which the array should be
extended.
void av_extend(AV* ar, I32 key)
|
|
- av_fetch
-
Returns the SV at the specified index in the array. The key is the index.
If lval is set then the fetch will be part of a store. Check that the return
value is non-null before dereferencing it to a SV*.
See perlguts/"Understanding
the Magic of Tied Hashes and Arrays" for more information on how to use this
function on tied arrays.
SV** av_fetch(AV* ar, I32 key, I32 lval)
|
|
- av_fill
-
Ensure than an array has a given number of elements, equivalent to Perl's $#array
= $fill;.
void av_fill(AV* ar, I32 fill)
|
|
- av_len
-
Returns the highest index in the array. Returns -1 if the array is empty.
- av_make
-
Creates a new AV and populates it with a list of SVs. The SVs are copied into the
array, so they may be freed after the call to av_make. The new AV will have a reference
count of 1.
AV* av_make(I32 size, SV** svp)
|
|
- av_pop
-
Pops an SV off the end of the array. Returns &PL_sv_undef if the array
is empty.
- av_push
-
Pushes an SV onto the end of the array. The array will grow automatically to
accommodate the addition.
void av_push(AV* ar, SV* val)
|
|
- av_shift
-
Shifts an SV off the beginning of the array.
- av_store
-
Stores an SV in an array. The array index is specified as key. The return
value will be NULL if the operation failed or if the value did not need to be actually
stored within the array (as in the case of tied arrays). Otherwise it can be dereferenced
to get the original SV*. Note that the caller is responsible for suitably
incrementing the reference count of val before the call, and decrementing it
if the function returned NULL.
See perlguts/"Understanding
the Magic of Tied Hashes and Arrays" for more information on how to use this
function on tied arrays.
SV** av_store(AV* ar, I32 key, SV* val)
|
|
- av_undef
-
Undefines the array. Frees the memory used by the array itself.
- av_unshift
-
Unshift the given number of undef values onto the beginning of the array.
The array will grow automatically to accommodate the addition. You must then use av_store
to assign values to these new elements.
void av_unshift(AV* ar, I32 num)
|
|
- get_av
-
Returns the AV of the specified Perl array. If create is set and the Perl
variable does not exist then it will be created. If create is not set and the
variable does not exist then NULL is returned.
NOTE: the perl_ form of this function is deprecated.
AV* get_av(const char* name, I32 create)
|
|
- newAV
-
Creates a new AV. The reference count is set to 1.
- Nullav
-
Null AV pointer.
- sortsv
-
Sort an array. Here is an example:
sortsv(AvARRAY(av), av_len(av)+1, Perl_sv_cmp_locale);
|
|
See lib/sort.pm for details about controlling the sorting algorithm.
void sortsv(SV ** array, size_t num_elts, SVCOMPARE_t cmp)
|
|