camel-uid-cache: Camel Reference Manual

## camel-uid-cache camel-uid-cache |

## Functions

CamelUIDCache * | camel_uid_cache_new ()
gboolean | camel_uid_cache_save ()
void | camel_uid_cache_destroy ()
GPtrArray * | camel_uid_cache_dup_new_uids ()
void | camel_uid_cache_save_uid ()

## Types and Values

| CamelUIDCache

## Description

## Functions

### camel_uid_cache_new ()

    CamelUIDCache *
    camel_uid_cache_new (const gchar *filename);

Creates a new UID cache, initialized from `filename` . If `filename` doesn't already exist, the UID cache will be empty. Otherwise, if it does exist but can't be read, the function will return `NULL`.

[skip]

#### Parameters

filename | path to load the cache from |

#### Returns

a new UID cache, or `NULL`.

[nullable]

### camel_uid_cache_save ()

    gboolean
    camel_uid_cache_save (CamelUIDCache *cache);

Attempts to save `cache` back to disk.

#### Parameters

cache | a CamelUIDCache |

#### Returns

success or failure

### camel_uid_cache_destroy ()

    void
    camel_uid_cache_destroy (CamelUIDCache *cache);

Destroys `cache` and frees its data.

#### Parameters

cache | a CamelUIDCache |

### camel_uid_cache_dup_new_uids ()

    GPtrArray *
    camel_uid_cache_dup_new_uids (CamelUIDCache *cache,
                                  GPtrArray *uids);

Returns an array of UIDs from `uids` that are not in `cache` , and removes UIDs from `cache` that aren't in `uids` .

#### Parameters

cache | a CamelUIDCache |
uids | an array of UIDs. | [element-type utf8][transfer none]

#### Returns

an array of new UIDs, free with `g_ptr_array_unref()`, when no longer needed.

[element-type utf8][transfer container]

### camel_uid_cache_save_uid ()

    void
    camel_uid_cache_save_uid (CamelUIDCache *cache,
                              const gchar *uid);

Marks a uid for saving.

#### Parameters

cache | a CamelUIDCache |
uid | a uid to save |

## Types and Values

### CamelUIDCache

    typedef struct {
    	gchar *filename;
    	GHashTable *uids;
    	guint level;
    	gsize expired;
    	gsize size;
    	gint fd;
    } CamelUIDCache;