#ifndef __INDEX_H__
#define __INDEX_H__

/*
   a simplistic way to manage indexes for now... 
   Something faster or more generic would be useful, but this will work.
*/

typedef struct IndexNodeStruct {
	struct IndexNodeStruct *next;
	int slot;
	union {
		struct { int key1, key2; } kn;
		struct { char *keystr; } ks;
	} u;
} IndexNode;

typedef struct {
	/* all fields considered private... */
	void **ptr;
	int hashmod, isString;
} Index;

Index *newIndex(int /*hashmod*/, int /* isString */ );
void deleteIndex(Index *);
void setIndexEntry(Index *, int, int, int);
int findIndexEntry(Index *, int, int);
void setIndexEntryString(Index *, int, char *);
int findIndexEntryString(Index *, char *);

#endif
