From 63822e94697503766b0ebe1814ba09639eaedaa0 Mon Sep 17 00:00:00 2001 From: James Bursa Date: Tue, 30 Sep 2003 20:33:45 +0000 Subject: [project @ 2003-09-30 20:33:45 by bursa] Document more files. svn path=/import/netsurf/; revision=335 --- content/fetchcache.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'content/fetchcache.c') 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 */ +/** \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 #include #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; -- cgit v1.2.3