Programming with Judy
Using Judy
Using Judy1
Chapter 330
* JError_t * PJError (OUT)
* Judy Error struct used to return Judy error.
* Returns:
* !JERR if successful
* JERR if an error occurs
* If the error is a caller error (invalid Operation or no PPDest)
* then the PJError error code will be JU_ERRNO_NONE.
*/
int Judy1Op (PPvoid_t PPDest, Pvoid_t PSet1, Pvoid_t PSet2,
ulong_t Operation, JError_t * PJError)
{
Pvoid_t PnewJArray = 0; // empty Judy array
ulong_t Index1 = 0L;
ulong_t Index2 = 0L;
int Judy_rv;
if (!PPDest) return JERR;
switch (Operation)
{
case JUDY1OP_AND:
// step through each array looking for index matches
Judy_rv = Judy1First(PSet1, &Index1, PJError);
Judy_rv += Judy1First(PSet2, &Index2, PJError);
while(Judy_rv == 2)
{
if (Index1 < Index2)
{
Index1 = Index2;
Judy_rv = Judy1First(PSet1, &Index1, PJError);
}
else