4 * Thomas Leonard, <tal197@users.sourceforge.net>
17 typedef struct _GFSCacheKey GFSCacheKey
;
18 typedef struct _GFSCacheData GFSCacheData
;
19 typedef gpointer (*GFSLoadFunc
)(char *pathname
, gpointer user_data
);
20 typedef void (*GFSRefFunc
)(gpointer object
, gpointer user_data
);
21 typedef int (*GFSGetRefFunc
)(gpointer object
, gpointer user_data
);
22 typedef void (*GFSUpdateFunc
)(gpointer object
,
29 GHashTable
*inode_to_stats
;
46 gpointer data
; /* The object from the file */
49 /* Details of the file last time we checked it */
56 FSCACHE_LOOKUP_CREATE
, /* Load if missing. Update as needed. */
57 FSCACHE_LOOKUP_ONLY_NEW
,/* Return NULL if not present AND uptodate */
58 FSCACHE_LOOKUP_PEEK
, /* Lookup; don't load or update */
59 FSCACHE_LOOKUP_INIT
, /* Internal use */
62 GFSCache
*g_fscache_new(GFSLoadFunc load
,
68 void g_fscache_destroy(GFSCache
*cache
);
69 gpointer
g_fscache_lookup(GFSCache
*cache
, char *pathname
);
70 gpointer
g_fscache_lookup_full(GFSCache
*cache
, char *pathname
,
71 FSCacheLookup lookup_type
,
73 void g_fscache_may_update(GFSCache
*cache
, char *pathname
);
74 void g_fscache_update(GFSCache
*cache
, char *pathname
);
75 void g_fscache_purge(GFSCache
*cache
, gint age
);
77 void g_fscache_data_ref(GFSCache
*cache
, gpointer data
);
78 void g_fscache_data_unref(GFSCache
*cache
, gpointer data
);
80 void g_fscache_insert(GFSCache
*cache
, char *pathname
, gpointer obj
);
82 #endif /* _FSCACHE_H */