diff options
author | James Bursa <james@netsurf-browser.org> | 2003-11-06 19:41:41 +0000 |
---|---|---|
committer | James Bursa <james@netsurf-browser.org> | 2003-11-06 19:41:41 +0000 |
commit | b212e59a20f304132e8c6636771d250ac7998ad3 (patch) | |
tree | 41ae6f084229ac7a517b81dbe6a3f2e3f3ea6137 /desktop/netsurf.c | |
parent | 33759f1e7b56b9ec682f3b82c878818018e652c8 (diff) | |
download | netsurf-b212e59a20f304132e8c6636771d250ac7998ad3.tar.gz netsurf-b212e59a20f304132e8c6636771d250ac7998ad3.tar.bz2 |
[project @ 2003-11-06 19:41:41 by bursa]
Mask null polls and use PollIdle when appropriate.
svn path=/import/netsurf/; revision=406
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r-- | desktop/netsurf.c | 55 |
1 files changed, 35 insertions, 20 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c index 0392d986a..ebc364612 100644 --- a/desktop/netsurf.c +++ b/desktop/netsurf.c @@ -6,6 +6,8 @@ * Copyright 2003 James Bursa <bursa@users.sourceforge.net> */ +#include <stdbool.h> +#include <stdlib.h> #include "netsurf/desktop/options.h" #include "netsurf/desktop/netsurf.h" #include "netsurf/desktop/browser.h" @@ -13,21 +15,35 @@ #include "netsurf/content/cache.h" #include "netsurf/content/fetch.h" #include "netsurf/utils/log.h" -#include <stdlib.h> -int netsurf_quit = 0; +bool netsurf_quit = false; static void netsurf_init(int argc, char** argv); +static void netsurf_poll(void); static void netsurf_exit(void); -void netsurf_poll(void) +/** + * Gui NetSurf main(). + */ + +int main(int argc, char** argv) { - gui_poll(); - fetch_poll(); + netsurf_init(argc, argv); + + while (!netsurf_quit) + netsurf_poll(); + + netsurf_exit(); + + return EXIT_SUCCESS; } +/** + * Initialise components used by gui NetSurf. + */ + void netsurf_init(int argc, char** argv) { stdout = stderr; @@ -41,24 +57,23 @@ void netsurf_init(int argc, char** argv) } -void netsurf_exit(void) -{ - cache_quit(); - fetch_quit(); -} - +/** + * Poll components which require it. + */ -int main(int argc, char** argv) +void netsurf_poll(void) { - netsurf_init(argc, argv); + gui_poll(fetch_active); + fetch_poll(); +} - while (netsurf_quit == 0) - netsurf_poll(); - LOG(("Netsurf quit!")); - netsurf_exit(); +/** + * Clean up components used by gui NetSurf. + */ - return 0; +void netsurf_exit(void) +{ + cache_quit(); + fetch_quit(); } - - |