summaryrefslogtreecommitdiff
path: root/desktop/cache.h
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2002-11-02 22:28:05 +0000
committerJames Bursa <james@netsurf-browser.org>2002-11-02 22:28:05 +0000
commit24080add5c78f09e0604b7ae180ec52209c86d1e (patch)
tree56c08122691d2c35ee50bdd490d7b92290e75c1f /desktop/cache.h
parentc009c7111c99ff78c5116f874a57a9ac7daf960d (diff)
downloadnetsurf-24080add5c78f09e0604b7ae180ec52209c86d1e.tar.gz
netsurf-24080add5c78f09e0604b7ae180ec52209c86d1e.tar.bz2
[project @ 2002-11-02 22:28:05 by bursa]
Memory cache. svn path=/import/netsurf/; revision=47
Diffstat (limited to 'desktop/cache.h')
-rw-r--r--desktop/cache.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/desktop/cache.h b/desktop/cache.h
new file mode 100644
index 000000000..90131d8c2
--- /dev/null
+++ b/desktop/cache.h
@@ -0,0 +1,32 @@
+/**
+ * $Id: cache.h,v 1.1 2002/11/02 22:28:05 bursa Exp $
+ */
+
+/**
+ * Using the cache:
+ *
+ * cache_init();
+ * ...
+ * c = cache_get(url);
+ * if (c == 0) {
+ * ... (create c) ...
+ * cache_put(url, c, size);
+ * }
+ * ...
+ * 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.
+ */
+
+#include "netsurf/desktop/browser.h"
+
+void cache_init(void);
+void cache_quit(void);
+struct content * cache_get(char * const url);
+void cache_put(char * const url, struct content * content, unsigned long size);
+void cache_free(struct content * content);
+