CamelIndex
3
CAMEL Library

# CamelIndex

## Synopsis

                        CamelIndex;
    char*               (*CamelIndexNorm)                   (CamelIndex *idx,
                                                             const char *word,
                                                             void *data);
                        CamelIndexCursor;
    CamelIndexCursor*   camel_index_cursor_new              (CamelIndex *idx,
                                                             const char *name);
    const char*         camel_index_cursor_next             (CamelIndexCursor *idc);
    void                camel_index_cursor_reset            (CamelIndexCursor *idc);
                        CamelIndexName;
    CamelIndexName*     camel_index_name_new                (CamelIndex *idx,
                                                             const char *name);
    void                camel_index_name_add_word           (CamelIndexName *name,
                                                             const char *word);
    size_t              camel_index_name_add_buffer         (CamelIndexName *name,
                                                             const char *buffer,
                                                             size_t len);
    #define             CAMEL_INDEX_DELETED
    CamelIndex*         camel_index_new                     (const char *path,
                                                             int flags);
    void                camel_index_construct               (CamelIndex *,
                                                             const char *path,
                                                             int flags);
    int                 camel_index_rename                  (CamelIndex *,
                                                             const char *path);
    void                camel_index_set_normalise           (CamelIndex *idx,
                                                             CamelIndexNorm func,
                                                             void *data);
    int                 camel_index_sync                    (CamelIndex *idx);
    int                 camel_index_compress                (CamelIndex *idx);
    int                 camel_index_delete                  (CamelIndex *idx);
    int                 camel_index_has_name                (CamelIndex *idx,
                                                             const char *name);
    CamelIndexName*     camel_index_add_name                (CamelIndex *idx,
                                                             const char *name);
    int                 camel_index_write_name              (CamelIndex *idx,
                                                             CamelIndexName *idn);
    CamelIndexCursor*   camel_index_find_name               (CamelIndex *idx,
                                                             const char *name);
    void                camel_index_delete_name             (CamelIndex *idx,
                                                             const char *name);
    CamelIndexCursor*   camel_index_find                    (CamelIndex *idx,
                                                             const char *word);
    CamelIndexCursor*   camel_index_words                   (CamelIndex *idx);
    CamelIndexCursor*   camel_index_names                   (CamelIndex *idx);

## Description

## Details

### CamelIndex

    typedef struct {
    	CamelObject parent;

    	struct _CamelIndexPrivate *priv;

    	char *path;
    	guint32 version;
    	guint32 flags;		/* open flags */
    	guint32 state;

    	CamelIndexNorm normalise;
    	void *normalise_data;
    } CamelIndex;

### CamelIndexNorm ()

    char*               (*CamelIndexNorm)                   (CamelIndex *idx,
                                                             const char *word,
                                                             void *data);

`idx` :

`word` :

`data` :

Returns :

### CamelIndexCursor

    typedef struct {
    	CamelObject parent;

    	struct _CamelIndexCursorPrivate *priv;

    	CamelIndex *index;
    } CamelIndexCursor;

### camel_index_cursor_new ()

    CamelIndexCursor*   camel_index_cursor_new              (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

Returns :

### camel_index_cursor_next ()

    const char*         camel_index_cursor_next             (CamelIndexCursor *idc);

`idc` :

Returns :

### camel_index_cursor_reset ()

    void                camel_index_cursor_reset            (CamelIndexCursor *idc);

`idc` :

### CamelIndexName

    typedef struct {
    	CamelObject parent;

    	struct _CamelIndexNamePrivate *priv;

    	CamelIndex *index;

    	char *name;		/* name being indexed */

    	GByteArray *buffer;	/* used for normalisation */
    	GHashTable *words;	/* unique list of words */
    } CamelIndexName;

### camel_index_name_new ()

    CamelIndexName*     camel_index_name_new                (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

Returns :

### camel_index_name_add_word ()

    void                camel_index_name_add_word           (CamelIndexName *name,
                                                             const char *word);

`name` :

`word` :

### camel_index_name_add_buffer ()

    size_t              camel_index_name_add_buffer         (CamelIndexName *name,
                                                             const char *buffer,
                                                             size_t len);

`name` :

`buffer` :

`len` :

Returns :

### CAMEL_INDEX_DELETED

    #define CAMEL_INDEX_DELETED (1<<0)

### camel_index_new ()

    CamelIndex*         camel_index_new                     (const char *path,
                                                             int flags);

`path` :

`flags` :

Returns :

### camel_index_construct ()

    void                camel_index_construct               (CamelIndex *,
                                                             const char *path,
                                                             int flags);

`Param1` :

`path` :

`flags` :

### camel_index_rename ()

    int                 camel_index_rename                  (CamelIndex *,
                                                             const char *path);

`Param1` :

`path` :

Returns :

### camel_index_set_normalise ()

    void                camel_index_set_normalise           (CamelIndex *idx,
                                                             CamelIndexNorm func,
                                                             void *data);

`idx` :

`func` :

`data` :

### camel_index_sync ()

    int                 camel_index_sync                    (CamelIndex *idx);

`idx` :

Returns :

### camel_index_compress ()

    int                 camel_index_compress                (CamelIndex *idx);

`idx` :

Returns :

### camel_index_delete ()

    int                 camel_index_delete                  (CamelIndex *idx);

`idx` :

Returns :

### camel_index_has_name ()

    int                 camel_index_has_name                (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

Returns :

### camel_index_add_name ()

    CamelIndexName*     camel_index_add_name                (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

Returns :

### camel_index_write_name ()

    int                 camel_index_write_name              (CamelIndex *idx,
                                                             CamelIndexName *idn);

`idx` :

`idn` :

Returns :

### camel_index_find_name ()

    CamelIndexCursor*   camel_index_find_name               (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

Returns :

### camel_index_delete_name ()

    void                camel_index_delete_name             (CamelIndex *idx,
                                                             const char *name);

`idx` :

`name` :

### camel_index_find ()

    CamelIndexCursor*   camel_index_find                    (CamelIndex *idx,
                                                             const char *word);

`idx` :

`word` :

Returns :

### camel_index_words ()

    CamelIndexCursor*   camel_index_words                   (CamelIndex *idx);

`idx` :

Returns :

### camel_index_names ()

    CamelIndexCursor*   camel_index_names                   (CamelIndex *idx);

`idx` :

Returns :