summaryrefslogtreecommitdiff
path: root/content/fetchers/file.c
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-06-19 18:27:24 +0100
committerVincent Sanders <vince@kyllikki.org>2014-06-19 18:27:24 +0100
commit4b2101ba6ab62ae26d82cc8b86e0e61e9c007156 (patch)
treee46413e8f7a99d68f26f4b6e4f898b8400758933 /content/fetchers/file.c
parent904cefd388aa613126b69c858e489c5867163a87 (diff)
downloadnetsurf-4b2101ba6ab62ae26d82cc8b86e0e61e9c007156.tar.gz
netsurf-4b2101ba6ab62ae26d82cc8b86e0e61e9c007156.tar.bz2
clean up the fetcher factory and improve its API
Diffstat (limited to 'content/fetchers/file.c')
-rw-r--r--content/fetchers/file.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/content/fetchers/file.c b/content/fetchers/file.c
index 7834b2702..f08be6288 100644
--- a/content/fetchers/file.c
+++ b/content/fetchers/file.c
@@ -55,6 +55,7 @@
#include "content/dirlist.h"
#include "content/fetch.h"
+#include "content/fetchers.h"
#include "content/urldb.h"
#include "content/fetchers/file.h"
@@ -760,17 +761,19 @@ static void fetch_file_poll(lwc_string *scheme)
} while ( (c = next) != ring && ring != NULL);
}
-void fetch_file_register(void)
+nserror fetch_file_register(void)
{
lwc_string *scheme = lwc_string_ref(corestring_lwc_file);
-
- fetch_add_fetcher(scheme,
- fetch_file_initialise,
- fetch_file_can_fetch,
- fetch_file_setup,
- fetch_file_start,
- fetch_file_abort,
- fetch_file_free,
- fetch_file_poll,
- fetch_file_finalise);
+ const struct fetcher_operation_table fetcher_ops = {
+ .initialise = fetch_file_initialise,
+ .acceptable = fetch_file_can_fetch,
+ .setup = fetch_file_setup,
+ .start = fetch_file_start,
+ .abort = fetch_file_abort,
+ .free = fetch_file_free,
+ .poll = fetch_file_poll,
+ .finalise = fetch_file_finalise
+ };
+
+ return fetcher_add(scheme, &fetcher_ops);
}