summaryrefslogtreecommitdiff
path: root/content/fetchcache.c
diff options
context:
space:
mode:
authorJames Bursa <james@netsurf-browser.org>2003-09-30 20:33:45 +0000
committerJames Bursa <james@netsurf-browser.org>2003-09-30 20:33:45 +0000
commit63822e94697503766b0ebe1814ba09639eaedaa0 (patch)
tree71920190942edd6799e4d9731eac50bf955dc414 /content/fetchcache.c
parent90e77a0d4f9b0b14023353f06f76274285296a98 (diff)
downloadnetsurf-63822e94697503766b0ebe1814ba09639eaedaa0.tar.gz
netsurf-63822e94697503766b0ebe1814ba09639eaedaa0.tar.bz2
[project @ 2003-09-30 20:33:45 by bursa]
Document more files. svn path=/import/netsurf/; revision=335
Diffstat (limited to 'content/fetchcache.c')
-rw-r--r--content/fetchcache.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/content/fetchcache.c b/content/fetchcache.c
index 4996edd81..84ba57bda 100644
--- a/content/fetchcache.c
+++ b/content/fetchcache.c
@@ -5,6 +5,14 @@
* Copyright 2003 James Bursa <bursa@users.sourceforge.net>
*/
+/** \file
+ * High-level fetching, caching and conversion (implementation).
+ *
+ * The implementation checks the cache for the requested URL. If it is not
+ * present, a content is created and a fetch is initiated. As the status of the
+ * fetch changes and data is received, the content is updated appropriately.
+ */
+
#include <assert.h>
#include <string.h>
#include "netsurf/content/cache.h"
@@ -18,6 +26,18 @@
static void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size);
+/**
+ * Retrieve a URL or fetch, convert, and cache it.
+ *
+ * The referer may be 0.
+ *
+ * The caller must supply a callback function which is called when anything
+ * interesting happens to the content which is returned. See content.h.
+ *
+ * If an error occurs immediately, 0 may be returned. Later errors will be
+ * reported via the callback.
+ */
+
struct content * fetchcache(const char *url0, char *referer,
void (*callback)(content_msg msg, struct content *c, void *p1,
void *p2, const char *error),
@@ -57,6 +77,12 @@ struct content * fetchcache(const char *url0, char *referer,
}
+/**
+ * Callback function for fetch.
+ *
+ * This is called when the status of a fetch changes.
+ */
+
void fetchcache_callback(fetch_msg msg, void *p, char *data, unsigned long size)
{
struct content *c = p;