mail-tree.h revision 38a5a537d2a082f4492fde4caf7dbc541fb8abd7
#ifndef __MAIL_TREE_H
#define __MAIL_TREE_H
typedef struct _MailTreeHeader MailTreeHeader;
typedef struct _MailTreeNode MailTreeNode;
struct _MailTree {
int fd;
char *filepath;
void *mmap_base;
unsigned int sync_id;
unsigned int anon_mmap:1;
unsigned int modified:1;
};
struct _MailTreeHeader {
unsigned int indexid;
unsigned int sync_id;
unsigned int root;
};
struct _MailTreeNode {
unsigned int left;
unsigned int right;
unsigned int up;
/* number of child nodes + 1, used to figure out message
sequence numbers. also highest bit specifies if the node is
red or black */
unsigned int node_count;
unsigned int key;
unsigned int value;
};
/* Find first existing UID in range. Returns (unsigned int)-1 if not found. */
unsigned int first_uid,
unsigned int last_uid);
/* Find message by sequence number. Returns (unsigned int)-1 if not found. */
/* Insert a new record in tree. */
/* Update existing record in tree. */
/* Delete record from tree. */
/* private: */
#endif