Programming with Judy
Using Judy
Using JudyL
Chapter 3 35
// or having to predetermine a good hash table size. It also gives you a
// sorted list at the same time. Also notice that JudyLCount is much faster than you
// can sequentially count items in an array.
//
#include <stdio.h>
#include <sys/time.h>
#include <errno.h>
#include "Judy.h"
// Default number of iterations (number of random numbers generated)
// This may be overridden on the command line
#define DEFAULT_ITER 1000000
// The number of buckets the histogram is divided into.
#define DEFAULT_HISTO_BUCKETS 32
// Macro for correction english output for plurals
#define PLURAL(count) ((count == 1) ? "" : "s")
// Generic fatal error handler, pass in JError_t
#define JUDY_ERROR(J) \
fprintf(stderr, "File: '%s', line: %d: Judy error: %d\n", \
__FILE__, __LINE__, JU_ERRNO(&(J))); \
exit(2);
// timing routines