From 93e9bfe3232fbcb3531acf07a870ed404c526f27 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sun, 13 Mar 2011 18:26:46 +0000 Subject: Shunt the schedule function definitions to desktop/schedule.h. Shunt the hlcache/llcache to using schedule to get their cleanups run. svn path=/trunk/netsurf/; revision=12029 --- desktop/browser.c | 1 + desktop/browser.h | 6 ------ desktop/cookies.c | 1 + desktop/netsurf.c | 5 +++-- desktop/schedule.h | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 desktop/schedule.h (limited to 'desktop') diff --git a/desktop/browser.c b/desktop/browser.c index ecf43b61b..63b61de16 100644 --- a/desktop/browser.c +++ b/desktop/browser.c @@ -51,6 +51,7 @@ #include "desktop/knockout.h" #include "desktop/options.h" #include "desktop/selection.h" +#include "desktop/schedule.h" #include "desktop/textinput.h" #include "desktop/plotters.h" diff --git a/desktop/browser.h b/desktop/browser.h index 717c032c2..a9cba2ee7 100644 --- a/desktop/browser.h +++ b/desktop/browser.h @@ -291,12 +291,6 @@ void global_history_add(const char *url); void global_history_add_recent(const char *url); char **global_history_get_recent(int *count); -/* In platform specific schedule.c. */ -typedef void (*schedule_callback_fn)(void *p); - -void schedule(int t, schedule_callback_fn callback, void *p); -void schedule_remove(schedule_callback_fn callback, void *p); - /* In platform specific theme_install.c. */ #ifdef WITH_THEME_INSTALL void theme_install_start(struct hlcache_handle *c); diff --git a/desktop/cookies.c b/desktop/cookies.c index a49a8db9f..4862b690e 100644 --- a/desktop/cookies.c +++ b/desktop/cookies.c @@ -32,6 +32,7 @@ #include "content/urldb.h" #include "desktop/cookies.h" #include "desktop/options.h" +#include "desktop/schedule.h" #include "desktop/tree.h" #include "utils/messages.h" #include "utils/log.h" diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 789868ec3..3edbae8d5 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -145,8 +145,9 @@ nserror netsurf_init(int *pargc, setlocale(LC_ALL, "C"); fetch_init(); - - llcache_initialise(netsurf_llcache_query_handler, NULL); + + /* Initialise the hlcache and allow it to init the llcache for us */ + hlcache_initialise(netsurf_llcache_query_handler, NULL); /* Initialize system colours */ gui_system_colour_init(); diff --git a/desktop/schedule.h b/desktop/schedule.h new file mode 100644 index 000000000..8d5aa1e90 --- /dev/null +++ b/desktop/schedule.h @@ -0,0 +1,32 @@ +/* + * Copyright 2011 Daniel Silverstone + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** \file + * Job scheduler (interface). + */ + +#ifndef _NETSURF_DESKTOP_SCHEDULE_H_ +#define _NETSURF_DESKTOP_SCHEDULE_H_ + +/* In platform specific schedule.c. */ +typedef void (*schedule_callback_fn)(void *p); + +void schedule(int t, schedule_callback_fn callback, void *p); +void schedule_remove(schedule_callback_fn callback, void *p); + +#endif -- cgit v1.2.3