summaryrefslogtreecommitdiff
path: root/content/fetchers/file.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-09-26 21:07:19 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-09-26 21:07:19 +0000
commitc94271edf591226f9a5de88ac59719c4b5290a1b (patch)
tree176856c99c8a1a6eb859df6509df0b44376b6041 /content/fetchers/file.c
parent393b1afd4f09db7205c5e232c0c477ad3bb1ea32 (diff)
downloadnetsurf-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/file.c')
-rw-r--r--content/fetchers/file.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index 164fa5fd9..cc41e8c54 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -34,6 +34,8 @@
#include <limits.h>
#include <stdarg.h>
+#include <libwapcaplet/libwapcaplet.h>
+
#include "utils/config.h"
#include "content/dirlist.h"
#include "content/fetch.h"
@@ -98,13 +100,13 @@ static bool fetch_file_send_header(struct fetch_file_context *ctx,
}
/** callback to initialise the file fetcher. */
-static bool fetch_file_initialise(const char *scheme)
+static bool fetch_file_initialise(lwc_string *scheme)
{
return true;
}
/** callback to initialise the file fetcher. */
-static void fetch_file_finalise(const char *scheme)
+static void fetch_file_finalise(lwc_string *scheme)
{
}
@@ -589,7 +591,7 @@ static void fetch_file_process(struct fetch_file_context *ctx)
}
/** callback to poll for additional file fetch contents */
-static void fetch_file_poll(const char *scheme)
+static void fetch_file_poll(lwc_string *scheme)
{
struct fetch_file_context *c, *next;
@@ -631,7 +633,14 @@ static void fetch_file_poll(const char *scheme)
void fetch_file_register(void)
{
- fetch_add_fetcher("file",
+ lwc_string *scheme;
+
+ if (lwc_intern_string("file", SLEN("file"), &scheme) != lwc_error_ok) {
+ die("Failed to initialise the fetch module "
+ "(couldn't intern \"file\").");
+ }
+
+ fetch_add_fetcher(scheme,
fetch_file_initialise,
fetch_file_setup,
fetch_file_start,