Locate the C<$Nth> indexthat is present in the Judy::L array C<$Judy>
(C<$Nth> = 1 returns the first indexpresent).
Return pointer to value, value, and index. Return nothing ifthere
isn't an C<$Nth> element.
=head2 $Bytes= Free( $Judy)
Given a pointer to a Judy::L array, free the entire array (much faster
than using a C<Next()>, C<Delete()> loop).
Return number of bytes freed and C<$Judy> set to 0.
=head2 $Bytes= MemUsed( $Judy)
Return Rc_word set to the number of bytes of memory malloc()'ed by PJLArray. This is a very fast routine, and may be used beforeand aftera JLI() or JLD() call withlittle performance impact.
=head1 Search Functions
First(), Next(), Last(), Prev() allow you to search forindexes in the
array. You may search inclusively or exclusively, in either forward or
reversedirections. If successful, C<$Index> is returned set to the
found index, C<$PValue> is returned set to a pointer to C<$Index>'s
C<$Value> and C<$Valueis returned. If unsuccessful, nothing is
returned
FirstEmpty(), NextEmpty(), LastEmpty(), PrevEmpty() allow you to
search forindexes that are not present ("empty") in the array. You
may search inclusively or exclusively, in either forward or reverse
directions. If successful, an C<$Index> is returned set to a not present
("empty") index. If unsuccessful, nothing is returned.
=head2 $Index= First( $Judy, $Index)
Search (inclusive) forthe first indexpresent that is equal to or
greater than the passed Index. (Start withIndex = 0 to find the first
indexin the array.) First() is typically used to begin a sorted-order
scan of the indexes present in a JudyL array.
=head2 $Index= Next( $Judy, $Index)
Search (exclusive) forthe nextindexpresent that is greater than the
passed Index. Next() is typically used to continuea sorted-order scan
of the indexes present in a JudyL array, or to locate a "neighbor"of
a givenindex.
=head2 $Index= Last( $Judy, C<$Index>)
Search (inclusive) forthe lastindexpresent that is equal to or less
than the passed C<$Index>. (Start withC<$Index= -1>, that is, all
ones, to find the lastindexin the array.) Last() is typically used
to begin a reverse-sorted-order scan of the indexes present in a JudyL
array.
=head2 $Index= Prev( $Judy, $Index)
Search (exclusive) forthe previous indexpresent that is less than
the passed C<$Index>. Prev() is typically used to continuea
reverse-sorted-order scan of the indexes present in a JudyL array, or
to locate a "neighbor"of a givenindex.
=head2 $Index= FirstEmpty( $Judy, $Index)
Search (inclusive) forthe first indexabsent that is equal to or
greater than the passed C<$Index>. (Start withC<$Index> = 0 to find
the first indexabsent in the array.)
=head2 $Index= NextEmpty( $Judy, $Index)
Search (exclusive) forthe nextindexabsent that is greater than the
passed C<$Index>.
=head2 $Index= LastEmpty( $Judy, $Index)
Search (inclusive) forthe lastindexabsent that is equal to or less
than the passed C<$Index>. (Start withC<$Index> = -1, that is, all
ones, to find the lastindexabsent in the array.)
=head2 $Indx= PrevEmpty( $Judy, $Index)
Search (exclusive) forthe previous indexabsent that is less than the
passed C<$Index>.
=head1 Multi-dimensional JudyL Arrays
Storing a pointer to another JudyL array in a JudyL array's Value is a
simple way to support dynamic multi-dimensional JudyL arrays. These
arrays (or trees) built using JudyL arrays are very fast and memory
efficient. (In fact, that is how JudySL and JudyHS are
implemented). An arbitrary number of dimensions can be realized this
way. To terminate the number of dimensions (or tree), the Value
pointer is marked to NOT point to another Judy array. A Judy::JLAP_INVALID
flag is used in the least significant bit(s) of the pointer. After the
flag Judy::JLAP_INVALID is removed, it is used as a pointer to the users
data.
Note: The current version of Judy.h changed this flag from 0x4 to 0x1
to allow fora malloc() that does not deliver memory on an 8 byte
aligned boundry (such as old v algrind).
The following example code segment can be used to determine whether or