#define PTRALIGN(LEN) TYPEALIGN(sizeof(void*), (LEN))
+/*#define HASHSIZE(LEN) ( TYPEALIGN(2, (int)((LEN)*2)) + 1 )*/
+#define HASHSIZE(LEN) ( (LEN)<<1 )
/* end utils */
unused:29;
struct TBTMemPage *prev;
struct TBTMemPage *next;
+ struct TBTMemPage *link;
TBTPage page;
} TBTMemPage;
-#define TBTMEMPAGEHDRSZ (sizeof(u_int32_t)*2 + sizeof(TBTMemPage*)*2 + TBTPAGEHDRSZ)
+#define TBTMEMPAGEHDRSZ (sizeof(u_int32_t)*2 + sizeof(TBTMemPage*)*3 + TBTPAGEHDRSZ)
typedef struct {
u_int16_t length;
char *value;
int TBTFind(TBTree *db, TBTValue *key, TBTValue *value);
int TBTInsert(TBTree *db, TBTValue *key, TBTValue *value);
int TBTDelete(TBTree *db, TBTValue *key);
+
+/* debug function, assume key is int4 or string and values are strings */
void dumpTree(TBTree *db, u_int32_t pagenumber, int follow);
typedef struct {