| Camel Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | ||||
CamelUIDCache;
CamelUIDCache * camel_uid_cache_new (const char *filename);
gboolean camel_uid_cache_save (CamelUIDCache *cache);
void camel_uid_cache_destroy (CamelUIDCache *cache);
GPtrArray * camel_uid_cache_get_new_uids (CamelUIDCache *cache,
GPtrArray *uids);
void camel_uid_cache_save_uid (CamelUIDCache *cache,
const char *uid);
void camel_uid_cache_free_uids (GPtrArray *uids);
typedef struct {
char *filename;
GHashTable *uids;
unsigned int level;
size_t expired;
size_t size;
int fd;
} CamelUIDCache;
CamelUIDCache * camel_uid_cache_new (const char *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.
|
path to load the cache from |
Returns : |
a new UID cache, or NULL
|
gboolean camel_uid_cache_save (CamelUIDCache *cache);
Attempts to save cache back to disk.
|
a CamelUIDCache |
Returns : |
success or failure |
void camel_uid_cache_destroy (CamelUIDCache *cache);
Destroys cache and frees its data.
|
a CamelUIDCache |
GPtrArray * camel_uid_cache_get_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.
|
a CamelUIDCache |
|
an array of UIDs |
Returns : |
an array of new UIDs, which must be freed with
camel_uid_cache_free_uids().
|
void camel_uid_cache_save_uid (CamelUIDCache *cache, const char *uid);
Marks a uid for saving.
|
a CamelUIDCache |
|
a uid to save |
void camel_uid_cache_free_uids (GPtrArray *uids);
Frees the array of UIDs.
|
an array returned from camel_uid_cache_get_new_uids()
|