summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 20:49:12 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 20:49:12 +0000
commite4407cd7e9b9313f6fde24ff503e011823129680 (patch)
tree75d896d1ec2f348bc8aca1181b55162aa033c22a /desktop/netsurf.c
parentce07ebcea8d4c0460b58de7b59bb94734b650cbe (diff)
downloadnetsurf-e4407cd7e9b9313f6fde24ff503e011823129680.tar.gz
netsurf-e4407cd7e9b9313f6fde24ff503e011823129680.tar.bz2
Had to split main() into parts to have netsurf_init() called from one thread, and the loop in another to avoid a deadlock in replicants... hope nobody minds.
svn path=/trunk/netsurf/; revision=5586
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r--desktop/netsurf.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 4e6b6e085..afefd50be 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -43,9 +43,7 @@ bool netsurf_quit = false;
bool netsurf_embedded = true;
bool verbose_log = false;
-static void netsurf_init(int argc, char** argv);
static void netsurf_poll(void);
-static void netsurf_exit(void);
static void lib_init(void);
@@ -55,6 +53,7 @@ static void lib_init(void);
int main(int argc, char** argv)
{
+ setbuf(stderr, NULL);
netsurf_embedded = false;
return netsurf_main(argc, argv);
}
@@ -66,11 +65,9 @@ int main(int argc, char** argv)
int netsurf_main(int argc, char** argv)
{
- setbuf(stderr, NULL);
netsurf_init(argc, argv);
- while (!netsurf_quit)
- netsurf_poll();
+ netsurf_main_loop();
netsurf_exit();
@@ -79,6 +76,19 @@ int netsurf_main(int argc, char** argv)
/**
+ * Gui NetSurf main loop.
+ */
+
+int netsurf_main_loop(void)
+{
+ while (!netsurf_quit)
+ netsurf_poll();
+
+ return 0;
+}
+
+
+/**
* Initialise components used by gui NetSurf.
*/