CamelKeyTable: Camel Reference Manual

## CamelKeyTable CamelKeyTable |

## Functions

CamelPartitionTable * | camel_partition_table_new ()
gint | camel_partition_table_sync ()
gint | camel_partition_table_add ()
camel_key_t | camel_partition_table_lookup ()
gboolean | camel_partition_table_remove ()
#define | CAMEL_KEY_TABLE_MAX_KEY
CamelKeyTable * | camel_key_table_new ()
gint | camel_key_table_sync ()
camel_key_t | camel_key_table_add ()
gboolean | camel_key_table_set_data ()
gboolean | camel_key_table_set_flags ()
camel_block_t | camel_key_table_lookup ()
camel_key_t | camel_key_table_next ()

## Types and Values

typedef | camel_hash_t
struct | CamelPartitionKey
struct | CamelPartitionKeyBlock
struct | CamelPartitionMap
struct | CamelPartitionMapBlock
struct | CamelPartitionTable
struct | CamelKeyBlock
struct | CamelKeyRootBlock
struct | CamelKeyKey
struct | CamelKeyTable

## Object Hierarchy

        GObject
        ├── CamelKeyTable
        ╰── CamelPartitionTable

## Description

## Functions

### camel_partition_table_new ()

    CamelPartitionTable *
    camel_partition_table_new (struct _CamelBlockFile *bs,
                               camel_block_t root);

### camel_partition_table_sync ()

    gint
    camel_partition_table_sync (CamelPartitionTable *cpi);

### camel_partition_table_add ()

    gint
    camel_partition_table_add (CamelPartitionTable *cpi,
                               const gchar *key,
                               camel_key_t keyid);

### camel_partition_table_lookup ()

    camel_key_t
    camel_partition_table_lookup (CamelPartitionTable *cpi,
                                  const gchar *key);

### camel_partition_table_remove ()

    gboolean
    camel_partition_table_remove (CamelPartitionTable *cpi,
                                  const gchar *key);

### CAMEL_KEY_TABLE_MAX_KEY

    #define CAMEL_KEY_TABLE_MAX_KEY (128) /* max size of any key */

### camel_key_table_new ()

    CamelKeyTable *
    camel_key_table_new (CamelBlockFile *bs,
                         camel_block_t root);

### camel_key_table_sync ()

    gint
    camel_key_table_sync (CamelKeyTable *ki);

### camel_key_table_add ()

    camel_key_t
    camel_key_table_add (CamelKeyTable *ki,
                         const gchar *key,
                         camel_block_t data,
                         guint flags);

### camel_key_table_set_data ()

    gboolean
    camel_key_table_set_data (CamelKeyTable *ki,
                              camel_key_t keyid,
                              camel_block_t data);

### camel_key_table_set_flags ()

    gboolean
    camel_key_table_set_flags (CamelKeyTable *ki,
                               camel_key_t keyid,
                               guint flags,
                               guint set);

### camel_key_table_lookup ()

    camel_block_t
    camel_key_table_lookup (CamelKeyTable *ki,
                            camel_key_t keyid,
                            gchar **key,
                            guint *flags);

### camel_key_table_next ()

    camel_key_t
    camel_key_table_next (CamelKeyTable *ki,
                          camel_key_t next,
                          gchar **keyp,
                          guint *flagsp,
                          camel_block_t *datap);

## Types and Values

### camel_hash_t

    typedef guint32 camel_hash_t; /* a hashed key */

### struct CamelPartitionKey

    struct CamelPartitionKey {
    	camel_hash_t hashid;
    	camel_key_t keyid;
    };

### struct CamelPartitionKeyBlock

    struct CamelPartitionKeyBlock {
    	guint32 used;
    	struct _CamelPartitionKey keys[(CAMEL_BLOCK_SIZE - 4) / sizeof (struct _CamelPartitionKey)];
    };

### struct CamelPartitionMap

    struct CamelPartitionMap {
    	camel_hash_t hashid;
    	camel_block_t blockid;
    };

### struct CamelPartitionMapBlock

    struct CamelPartitionMapBlock {
    	camel_block_t next;
    	guint32 used;
    	struct _CamelPartitionMap partition[(CAMEL_BLOCK_SIZE - 8) / sizeof (struct _CamelPartitionMap)];
    };

### struct CamelPartitionTable

    struct CamelPartitionTable;

### struct CamelKeyBlock

    struct CamelKeyBlock {
    	camel_block_t next;
    	guint32 used;
    	union {
    		struct _CamelKeyKey keys[(CAMEL_BLOCK_SIZE - 8) / sizeof (struct _CamelKeyKey)];
    		gchar keydata[CAMEL_BLOCK_SIZE - 8];
    	} u;
    };

### struct CamelKeyRootBlock

    struct CamelKeyRootBlock {
    	camel_block_t first;
    	camel_block_t last;
    	camel_key_t free; /* free list */
    };

### struct CamelKeyKey

    struct CamelKeyKey {
    	camel_block_t data;
    	guint offset : 10;
    	guint flags : 22;
    };

### struct CamelKeyTable

    struct CamelKeyTable;