From 8dfe22515312a8ecf4da974feb31b0f5e7f317e5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 14 Jan 2014 16:04:02 +0000 Subject: move download operations to download table --- riscos/download.c | 17 +++++++++++++---- riscos/gui.c | 1 + riscos/gui.h | 1 + 3 files changed, 15 insertions(+), 4 deletions(-) (limited to 'riscos') diff --git a/riscos/download.c b/riscos/download.c index ebd981dca..aeeeeffbd 100644 --- a/riscos/download.c +++ b/riscos/download.c @@ -215,7 +215,7 @@ const char *ro_gui_download_temp_name(struct gui_download_window *dw) * reported */ -struct gui_download_window *gui_download_window_create(download_context *ctx, +static struct gui_download_window *gui_download_window_create(download_context *ctx, struct gui_window *gui) { const char *url = download_context_get_url(ctx); @@ -445,7 +445,7 @@ struct gui_download_window *gui_download_window_create(download_context *ctx, * \return NSERROR_OK on success, appropriate error otherwise */ -nserror gui_download_window_data(struct gui_download_window *dw, +static nserror gui_download_window_data(struct gui_download_window *dw, const char *data, unsigned int size) { while (true) { @@ -714,7 +714,7 @@ void ro_gui_download_window_hide_caret(struct gui_download_window *dw) * \param error_msg error message */ -void gui_download_window_error(struct gui_download_window *dw, +static void gui_download_window_error(struct gui_download_window *dw, const char *error_msg) { os_error *error; @@ -766,7 +766,7 @@ void gui_download_window_error(struct gui_download_window *dw, * \param dw download window */ -void gui_download_window_done(struct gui_download_window *dw) +static void gui_download_window_done(struct gui_download_window *dw) { os_error *error; @@ -1631,3 +1631,12 @@ bool ro_gui_download_prequit(void) } return true; } + +static struct gui_download_table gui_download_table = { + .create = gui_download_window_create, + .data = gui_download_window_data, + .error = gui_download_window_error, + .done = gui_download_window_done, +}; + +struct gui_download_table *riscos_gui_download_table = &gui_download_table; diff --git a/riscos/gui.c b/riscos/gui.c index f7caf02da..60b14833c 100644 --- a/riscos/gui.c +++ b/riscos/gui.c @@ -898,6 +898,7 @@ int main(int argc, char** argv) /* common initialisation */ riscos_gui_table.window = riscos_gui_window_table; + riscos_gui_table.download = riscos_gui_download_table; ret = netsurf_init(path, &riscos_gui_table); if (ret != NSERROR_OK) { diff --git a/riscos/gui.h b/riscos/gui.h index 1abb40fba..38f3fc60c 100644 --- a/riscos/gui.h +++ b/riscos/gui.h @@ -123,6 +123,7 @@ const char *ro_gui_default_language(void); void ro_gui_download_init(void); void ro_gui_download_datasave_ack(wimp_message *message); bool ro_gui_download_prequit(void); +extern struct gui_download_table *riscos_gui_download_table; /* in 401login.c */ void ro_gui_401login_init(void); -- cgit v1.2.3