view src/file_cache.h @ 0:d39e1d0d75b6

initial add
author paulo@hit-nxdomain.opendns.com
date Sat, 20 Feb 2010 21:18:28 -0800
parents
children
line source
1 /*
2 * $Id: file_cache.h,v 1.6 2004/03/24 06:28:16 hipnod Exp $
3 *
4 * Copyright (C) 2001-2003 giFT project (gift.sourceforge.net)
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 */
17 #ifndef GIFT_GT_FILE_CACHE_H_
18 #define GIFT_GT_FILE_CACHE_H_
20 /*****************************************************************************/
22 typedef struct _file_cache
23 {
24 Dataset *d;
25 time_t mtime;
26 char *file;
27 } FileCache;
29 /*****************************************************************************/
31 FileCache *file_cache_new (const char *file);
32 void file_cache_free (FileCache *cache);
33 int file_cache_load (FileCache *cache);
34 void file_cache_flush (FileCache *cache);
35 BOOL file_cache_sync (FileCache *cache);
37 /*****************************************************************************/
39 char *file_cache_lookup (FileCache *cache, const char *key);
40 void file_cache_insert (FileCache *cache, const char *key,
41 const char *value);
42 void file_cache_remove (FileCache *cache, const char *key);
44 /*****************************************************************************/
46 #endif /* GIFT_GT_FILE_CACHE_H_ */