~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to camel/camel-data-cache.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.10.5 upstream)
  • mto: This revision was merged to the branch mainline in revision 128.
  • Revision ID: james.westby@ubuntu.com-20100517170206-xu1wmjuy40nt2sk0
Tags: upstream-2.30.1
ImportĀ upstreamĀ versionĀ 2.30.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <glib/gstdio.h>
38
38
#include <glib/gi18n-lib.h>
39
39
 
40
 
#include <libedataserver/e-data-server-util.h>
41
40
#include "camel-data-cache.h"
42
41
#include "camel-exception.h"
43
42
#include "camel-stream-fs.h"
123
122
 *
124
123
 * Create a new data cache.
125
124
 *
126
 
 * Return value: A new cache object, or NULL if the base path cannot
 
125
 * Returns: A new cache object, or NULL if the base path cannot
127
126
 * be written to.
128
127
 **/
129
128
CamelDataCache *
203
202
                return;
204
203
 
205
204
        s = g_string_new("");
206
 
        while ( (dname = g_dir_read_name(dir)) ) {
 
205
        while ((dname = g_dir_read_name(dir))) {
207
206
                if (strcmp(dname, keep) == 0)
208
207
                        continue;
209
208
 
254
253
                dd(printf("Checking expire cycle time on dir '%s'\n", dir));
255
254
 
256
255
                /* This has a race, but at worst we re-run an expire cycle which is safe */
257
 
                now = time(0);
 
256
                now = time(NULL);
258
257
                if (cdc->priv->expire_last[hash] + CAMEL_DATA_CACHE_CYCLE_TIME < now) {
259
258
                        cdc->priv->expire_last[hash] = now;
260
259
                        data_cache_expire(cdc, dir, key, now);
283
282
 * Potentially, expiry processing will be performed while this call
284
283
 * is executing.
285
284
 *
286
 
 * Return value: A CamelStream (file) opened in read-write mode.
 
285
 * Returns: A CamelStream (file) opened in read-write mode.
287
286
 * The caller must unref this when finished.
288
287
 **/
289
288
CamelStream *
328
327
 * multiple callers, so ensure the stream is in a valid state
329
328
 * through external locking.
330
329
 *
331
 
 * Return value: A cache item, or NULL if the cache item does not exist.
 
330
 * Returns: A cache item, or NULL if the cache item does not exist.
332
331
 **/
333
332
CamelStream *
334
333
camel_data_cache_get(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
359
358
 *
360
359
 * Lookup the filename for an item in the cache
361
360
 *
362
 
 * Return value: The filename for a cache item
 
361
 * Returns: The filename for a cache item
 
362
 *
 
363
 * Since: 2.26
363
364
 **/
364
365
gchar *
365
366
camel_data_cache_get_filename (CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
380
381
 *
381
382
 * Remove/expire a cache item.
382
383
 *
383
 
 * Return value:
 
384
 * Returns:
384
385
 **/
385
386
gint
386
387
camel_data_cache_remove(CamelDataCache *cdc, const gchar *path, const gchar *key, CamelException *ex)
423
424
 *
424
425
 * CURRENTLY UNIMPLEMENTED
425
426
 *
426
 
 * Return value: -1 on error.
 
427
 * Returns: -1 on error.
427
428
 **/
428
429
gint camel_data_cache_rename(CamelDataCache *cache,
429
430
                            const gchar *old, const gchar *new, CamelException *ex)
442
443
 *
443
444
 * CURRENTLY_UNIMPLEMENTED
444
445
 *
445
 
 * Return value: -1 on error.
 
446
 * Returns: -1 on error.
446
447
 **/
447
448
gint
448
449
camel_data_cache_clear(CamelDataCache *cache, const gchar *path, CamelException *ex)