summaryrefslogtreecommitdiff
path: root/content/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'content/cache.h')
-rw-r--r--content/cache.h38
1 files changed, 21 insertions, 17 deletions
diff --git a/content/cache.h b/content/cache.h
index a1c681507..ae1ab503f 100644
--- a/content/cache.h
+++ b/content/cache.h
@@ -1,25 +1,28 @@
/**
- * $Id: cache.h,v 1.2 2003/03/04 11:59:35 bursa Exp $
+ * $Id: cache.h,v 1.3 2003/06/17 19:24:20 bursa Exp $
*/
/**
- * Using the cache:
+ * The cache contains a content structure for each url. If a structure is not
+ * in state CONTENT_STATUS_DONE, then loading and converting must be actively
+ * in progress, so that when a not done content is retrieved no action needs
+ * to be taken to load it.
*
- * cache_init();
- * ...
- * c = cache_get(url);
- * if (c == 0) {
- * ... (create c) ...
- * cache_put(c);
- * }
- * ...
- * cache_free(c);
- * ...
- * cache_quit();
+ * Each content in the cache is either freeable or not freeable. If an entry
+ * is freeable, the cache may destroy it through content_destroy at any time.
*
- * 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.
+ * cache_get attempts to retrieve an url from the cache, returning the
+ * content and setting it to not freeable on success, and returning 0 on
+ * failure.
+ *
+ * cache_put adds a content to the cache, setting it to not freeable.
+ *
+ * cache_freeable sets the content to freeable.
+ *
+ * cache_destroy informs the cache that a content is about to be destroyed,
+ * and must be removed from the cache. This should be called when an error
+ * occurs when loading an url and the content is destroyed. The content must
+ * be non freeable.
*/
#ifndef _NETSURF_DESKTOP_CACHE_H_
@@ -32,7 +35,8 @@ void cache_init(void);
void cache_quit(void);
struct content * cache_get(const char * const url);
void cache_put(struct content * content);
-void cache_free(struct content * content);
+void cache_freeable(struct content * content);
+void cache_destroy(struct content * content);
void cache_dump(void);
#endif