summaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
Diffstat (limited to 'content')
-rw-r--r--content/fetch.c15
-rw-r--r--content/fetch.h4
2 files changed, 19 insertions, 0 deletions
diff --git a/content/fetch.c b/content/fetch.c
index 5e27add95..184d78bcb 100644
--- a/content/fetch.c
+++ b/content/fetch.c
@@ -825,6 +825,21 @@ bool fetch_can_fetch(const char *url)
/**
+ * Change the callback function for a fetch.
+ */
+
+void fetch_change_callback(struct fetch *fetch,
+ void (*callback)(fetch_msg msg, void *p, const char *data,
+ unsigned long size),
+ void *p)
+{
+ assert(fetch);
+ fetch->callback = callback;
+ fetch->p = p;
+}
+
+
+/**
* testing framework
*/
diff --git a/content/fetch.h b/content/fetch.h
index df2fd65c6..59767d255 100644
--- a/content/fetch.h
+++ b/content/fetch.h
@@ -53,5 +53,9 @@ void fetch_quit(void);
const char *fetch_filetype(const char *unix_path);
char *fetch_mimetype(const char *ro_path);
bool fetch_can_fetch(const char *url);
+void fetch_change_callback(struct fetch *fetch,
+ void (*callback)(fetch_msg msg, void *p, const char *data,
+ unsigned long size),
+ void *p);
#endif