diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2011-09-26 21:07:19 +0000 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2011-09-26 21:07:19 +0000 |
commit | c94271edf591226f9a5de88ac59719c4b5290a1b (patch) | |
tree | 176856c99c8a1a6eb859df6509df0b44376b6041 /content/fetchers/data.c | |
parent | 393b1afd4f09db7205c5e232c0c477ad3bb1ea32 (diff) | |
download | netsurf-c94271edf591226f9a5de88ac59719c4b5290a1b.tar.gz netsurf-c94271edf591226f9a5de88ac59719c4b5290a1b.tar.bz2 |
Fetchers register with an lwc_string, rather than a string.
svn path=/trunk/netsurf/; revision=12891
Diffstat (limited to 'content/fetchers/data.c')
-rw-r--r-- | content/fetchers/data.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/content/fetchers/data.c b/content/fetchers/data.c index 5abe2d6dd..d9d7f768a 100644 --- a/content/fetchers/data.c +++ b/content/fetchers/data.c @@ -27,6 +27,8 @@ #include <curl/curl.h> /* for URL unescaping functions */ +#include <libwapcaplet/libwapcaplet.h> + #include "utils/config.h" #include "content/fetch.h" #include "content/fetchers/data.h" @@ -58,18 +60,18 @@ static struct fetch_data_context *ring = NULL; static CURL *curl; -static bool fetch_data_initialise(const char *scheme) +static bool fetch_data_initialise(lwc_string *scheme) { - LOG(("fetch_data_initialise called for %s", scheme)); + LOG(("fetch_data_initialise called for %s", lwc_string_data(scheme))); if ( (curl = curl_easy_init()) == NULL) return false; else return true; } -static void fetch_data_finalise(const char *scheme) +static void fetch_data_finalise(lwc_string *scheme) { - LOG(("fetch_data_finalise called for %s", scheme)); + LOG(("fetch_data_finalise called for %s", lwc_string_data(scheme))); curl_easy_cleanup(curl); } @@ -226,7 +228,7 @@ static bool fetch_data_process(struct fetch_data_context *c) return true; } -static void fetch_data_poll(const char *scheme) +static void fetch_data_poll(lwc_string *scheme) { struct fetch_data_context *c, *next; @@ -306,7 +308,14 @@ static void fetch_data_poll(const char *scheme) void fetch_data_register(void) { - fetch_add_fetcher("data", + lwc_string *scheme; + + if (lwc_intern_string("data", SLEN("data"), &scheme) != lwc_error_ok) { + die("Failed to initialise the fetch module " + "(couldn't intern \"data\")."); + } + + fetch_add_fetcher(scheme, fetch_data_initialise, fetch_data_setup, fetch_data_start, |