From a4c5929a2fac1cb0c039b2d009d8093ac81a90d7 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Sun, 9 Feb 2003 12:58:15 +0000 Subject: [project @ 2003-02-09 12:58:14 by bursa] Reorganization and rewrite of fetch, cache, and content handling. svn path=/import/netsurf/; revision=96 --- content/cache.h | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 content/cache.h (limited to 'content/cache.h') diff --git a/content/cache.h b/content/cache.h new file mode 100644 index 000000000..2ee4e3b81 --- /dev/null +++ b/content/cache.h @@ -0,0 +1,38 @@ +/** + * $Id: cache.h,v 1.1 2003/02/09 12:58:14 bursa Exp $ + */ + +/** + * Using the cache: + * + * cache_init(); + * ... + * c = cache_get(url); + * if (c == 0) { + * ... (create c) ... + * cache_put(c); + * } + * ... + * cache_free(c); + * ... + * cache_quit(); + * + * cache_free informs the cache that the content is no longer being used, so + * it can be deleted from the cache if necessary. There must be a call to + * cache_free for each cache_get or cache_put. + */ + +#ifndef _NETSURF_DESKTOP_CACHE_H_ +#define _NETSURF_DESKTOP_CACHE_H_ + +struct content; +struct cache_entry; + +void cache_init(void); +void cache_quit(void); +struct content * cache_get(char * const url); +void cache_put(struct content * content); +void cache_free(struct content * content); +void cache_dump(void); + +#endif -- cgit v1.2.3