3
<!-- @(#) $Revision: 4.5 $ $Source: /cvsroot/judy/doc/ext/JudyL_funcs_3.htm,v $ --->
4
<TITLE>JudyL_funcs(3)</TITLE>
7
<TABLE border=0 width="100%"><TR>
8
<TD width="40%" align="left">JudyL_funcs(3)</TD>
9
<TD width="10%" align="center"> </TD>
10
<TD width="40%" align="right">JudyL_funcs(3)</TD>
18
C library for creating and accessing a dynamic array of words, using
19
any value of a word as an index
22
<DT><B>SYNOPSIS</B></DT>
25
PPvoid_t <A href="#JudyLIns" >JudyLIns</A>( PPvoid_t PPJLArray, Word_t Index, PJError_t PJError);
26
int <A href="#JudyLDel" >JudyLDel</A>( PPvoid_t PPJLArray, Word_t Index, PJError_t PJError);
27
PPvoid_t <A href="#JudyLGet" >JudyLGet</A>( Pcvoid_t PJLArray, Word_t Index, PJError_t PJError);
28
Word_t <A href="#JudyLCount" >JudyLCount</A>( Pcvoid_t PJLArray, Word_t Index1, Word_t Index2, PJError_t PJError);
29
PPvoid_t <A href="#JudyLByCount" >JudyLByCount</A>( Pcvoid_t PJLArray, Word_t Nth, Word_t * PIndex, PJError_t PJError);
30
Word_t <A href="#JudyLFreeArray ">JudyLFreeArray</A>( PPvoid_t PPJLArray, PJError_t PJError);
31
Word_t <A href="#JudyLMemUsed" >JudyLMemUsed</A>( Pcvoid_t PJLArray);
32
PPvoid_t <A href="#JudyLFirst" >JudyLFirst</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
33
PPvoid_t <A href="#JudyLNext" >JudyLNext</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
34
PPvoid_t <A href="#JudyLLast" >JudyLLast</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
35
PPvoid_t <A href="#JudyLPrev" >JudyLPrev</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
36
int <A href="#JudyLFirstEmpty">JudyLFirstEmpty</A>(Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
37
int <A href="#JudyLNextEmpty" >JudyLNextEmpty</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
38
int <A href="#JudyLLastEmpty" >JudyLLastEmpty</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
39
int <A href="#JudyLPrevEmpty" >JudyLPrevEmpty</A>( Pcvoid_t PJLArray, Word_t * PIndex, PJError_t PJError);
43
<DT><B>DESCRIPTION</B></DT>
45
A macro equivalent exists for each function call.
46
Because the macro forms are sometimes faster and have a simpler error
47
handling interface than the equivalent functions,
48
they are the preferred way of calling the JudyL functions.
49
See <A href="JudyL_3.htm">JudyL(3)</A>
51
The function call definitions are included here for completeness.
53
One of the difficulties in using the JudyL function calls lies in
54
determining whether to pass a pointer or the address of a pointer.
55
Since the functions that modify the JudyL array must also modify the
56
pointer to the JudyL array, you must pass the address of the pointer
57
rather than the pointer itself.
58
This often leads to hard-to-debug programmatic errors.
59
In practice, the macros allow the compiler to catch programming
60
errors when pointers instead of addresses of pointers are passed.
62
The JudyL function calls have an additional parameter beyond
63
those specified in the macro calls. This parameter is either a
64
pointer to an error structure, or <B>NULL</B> (in which case the
65
detailed error information is not returned).
67
In the following descriptions, the functions are described in
68
terms of how the macros use them (only in the case of
69
<B>#define JUDYERROR_NOTEST 1</B>). This is the suggested use
70
of the macros after your program has been fully debugged.
71
When the <B>JUDYERROR_NOTEST</B> macro is not specified,
72
an error structure is declared to store error information
73
returned from the JudyL functions when an error occurs.
75
Notice the placement of the <B>&</B> in the different functions.
78
<DT><A name="JudyLIns"><B>JudyLIns(&PJLArray, Index, &JError)</B></A></DT>
81
#define JLI(PValue, PJLArray, Index) \
82
PValue = JudyLIns(&PJLArray, Index, PJE0)
86
<DT><A name="JudyLDel"><B>JudyLDel(&PJLArray, Index, &JError)</B></A></DT>
89
#define JLD(Rc_int, PJLArray, Index) \
90
Rc_int = JudyLDel(&PJLArray, Index, PJE0)
94
<DT><A name="JudyLGet"><B>JudyLGet(PJLArray, Index, &JError)</B></A></DT>
97
#define JLG(PValue, PJLArray, Index) \
98
PValue = JudyLGet(PJLArray, Index, PJE0)
102
<DT><A name="JudyLCount"><B>JudyLCount(PJLArray, Index1, Index2, &JError)</B></A></DT>
105
#define JLC(Rc_word, PJLArray, Index1, Index2) \
106
Rc_word = JudyLCount(PJLArray, Index1, Index2, PJE0)
110
<DT><A name="JudyLByCount"><B>JudyLByCount(PJLArray, Nth, &Index, &JError)</B></A></DT>
113
#define JLBC(PValue, PJLArray, Nth, Index) \
114
PValue = JudyLByCount(PJLArray, Nth, &Index, PJE0)
118
<DT><A name="JudyLFreeArray"><B>JudyLFreeArray(&PJLArray, &JError)</B></A></DT>
121
#define JLFA(Rc_word, PJLArray) \
122
Rc_word = JudyLFreeArray(&PJLArray, PJE0)
126
<DT><A name="JudyLMemUsed"><B>JudyLMemUsed(PJLArray)</B></A></DT>
129
#define JLMU(Rc_word, PJLArray) \
130
Rc_word = JudyLMemUsed(PJLArray)
134
<DT><A name="JudyLFirst"><B>JudyLFirst(PJLArray, &Index, &JError)</B></A></DT>
137
#define JLF(PValue, PJLArray, Index) \
138
PValue = JudyLFirst(PJLArray, &Index, PJEO)
142
<DT><A name="JudyLNext"><B>JudyLNext(PJLArray, &Index, &JError)</B></A></DT>
145
#define JLN(PValue, PJLArray, Index) \
146
PValue = JudyLNext(PJLArray, &Index, PJEO)
150
<DT><A name="JudyLLast"><B>JudyLLast(PJLArray, &Index, &JError)</B></A></DT>
153
#define JLL(PValue, PJLArray, Index) \
154
PValue = JudyLLast(PJLArray, &Index, PJEO)
158
<DT><A name="JudyLPrev"><B>JudyLPrev(PJLArray, &Index, &JError)</B></A></DT>
161
#define JLP(PValue, PJLArray, Index) \
162
PValue = JudyLPrev(PJLArray, &Index, PJEO)
166
<DT><A name="JudyLFirstEmpty"><B>JudyLFirstEmpty(PJLArray, &Index, &JError)</B></A></DT>
169
#define JLFE(Rc_int, PJLArray, Index) \
170
Rc_int = JudyLFirstEmpty(PJLArray, &Index, PJEO)
174
<DT><A name="JudyLNextEmpty"><B>JudyLNextEmpty(PJLArray, &Index, &JError)</B></A></DT>
177
#define JLNE(Rc_int, PJLArray, Index) \
178
Rc_int = JudyLNextEmpty(PJLArray, &Index, PJEO)
182
<DT><A name="JudyLLastEmpty"><B>JudyLLastEmpty(PJLArray, &Index, &JError)</B></A></DT>
185
#define JLLE(Rc_int, PJLArray, Index) \
186
Rc_int = JudyLLastEmpty(PJLArray, &Index, PJEO)
190
<DT><A name="JudyLPrevEmpty"><B>JudyLPrevEmpty(PJLArray, &Index, &JError)</B></A></DT>
193
#define JLPE(Rc_int, PJLArray, Index) \
194
Rc_int = JudyLPrevEmpty(PJLArray, &Index, PJEO)
199
Definitions for all the Judy functions, the types
214
are provided in the <B>Judy.h</B> header file
215
(/usr/include/Judy.h).
216
<B>Note</B>: Callers should define JudyL arrays as type <B>Pvoid_t</B>,
217
which can be passed by value to functions that take
218
<B>Pcvoid_t</B> (constant <B>Pvoid_t</B>),
219
and also by address to functions that take <B>PPvoid_t</B>.
221
The return type from most <B>JudyL</B> functions is <B>PPvoid_t</B> so
222
that the values stored in the array can be pointers to other objects,
223
which is a typical usage, or cast to a <B>Word_t *</B> when a pointer
224
to a <B>Value</B> is required instead of a pointer to a pointer.
227
<DT><B>AUTHOR</B></DT>
229
Judy was invented by Doug Baskins and implemented by Hewlett-Packard.
232
<DT><B>SEE ALSO</B></DT>
234
<A href="Judy_3.htm">Judy(3)</A>,
235
<A href="Judy1_3.htm">Judy1(3)</A>,
236
<A href="JudyL_3.htm">JudyL(3)</A>,
237
<A href="JudySL_3.htm">JudySL(3)</A>,
238
<A href="JudyHS_3.htm">JudyHS(3)</A>,
243
<A href="http://judy.sourceforge.net">
244
http://judy.sourceforge.net</A>,
245
for more information and Application Notes.