Programming with Judy

Using Judy
Using Judy1
Chapter 3 29
Judy1 example You can find the code for this example and others on the Judy web site:
http://devresource.hp.com/judy/
// Judy 1 Example code: bit set operations.
// There should be a header file that defines the bit operation types:
#define JUDY1OP_AND 1L
#define JUDY1OP_OR 2L
#define JUDY1OP_ANDNOT 3L
#include "Judy.h"
/*******************************************************************
* Name: Judy1Op
* Description:
* Logical set operations on Judy1 arrays.
* All of these operations can be done on an unbounded array.
* Parameters:
* PPvoid_t PPDest (OUT)
* Ptr to the Judy destination array.
* Any initial value pointed to by PPDest is ignored.
* Pvoid_t PSet1 (IN)
* First Judy1 set.
* This will be NULL for an empty Judy1 array.
* Pvoid_t PSet2 (IN)
* Second Judy1 set.
* This will be NULL for an empty Judy1 array.
* ulong_t Operation (IN)
* Operation to be performed (ie. PSet1 {Operation} PSet2)
* Valid Operation values are:
* JUDY1OP_AND - intersection of two sets
* JUDY1OP_OR - union of two sets
* JUDY1OP_ANDNOT - set1 with set2 removed