*/
typedef uint64_t xhashidx;
+#define Noxhashidx ((xhashidx) -1)
#define XHASH_ERESIZE 1
#define XHASH_EEXIST 2
+enum xhash_type {
+ INTEGER = 0, /* signed/unsigned integers, pointers, etc */
+ STRING = 1 /* NULL terminated strings */
+ //OBJECT = 2, to be used later with objects
+};
+#define NR_XHASH_TYPES 2
+
struct xhash {
xhashidx size_shift;
xhashidx minsize_shift;
xhashidx used;
xhashidx dummies;
xhashidx defval;
+ enum xhash_type type;
#ifdef PHASH_STATS
xhashidx inserts;
xhashidx deletes;
xhashidx xhash_shrink_size_shift(xhash_t *xhash);
ssize_t xhash_get_alloc_size(xhashidx size_shift);
-xhash_t *xhash_new(xhashidx minsize_shift);
+xhash_t *xhash_new(xhashidx minsize_shift, enum xhash_type type);
void xhash_free(xhash_t *xhash); // pairs with _new()
-void xhash_init(struct xhash *xhash, xhashidx minsize_shift);
+void xhash_init(struct xhash *xhash, xhashidx minsize_shift, enum xhash_type type);
xhash_t * xhash_resize(xhash_t *xhash, xhashidx new_size_shift, xhash_t *newxhash);
int xhash_insert(xhash_t *xhash, xhashidx key, xhashidx val);