summaryrefslogtreecommitdiff
path: root/desktop/netsurf.c
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 11:10:43 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-16 11:10:43 +0000
commit6330f8e475bad2aa9dd3f0f7994a25980491023c (patch)
treeeb91b5bec6ad72298ca9bcbb5bd2a5dd85dc09e6 /desktop/netsurf.c
parenta6b42a06fff08bd4997d19f9cde40e4554a3692d (diff)
downloadnetsurf-6330f8e475bad2aa9dd3f0f7994a25980491023c.tar.gz
netsurf-6330f8e475bad2aa9dd3f0f7994a25980491023c.tar.bz2
Have netsurf_main() do the real work and main() call it. This allows ports to call it from elsewhere to embed NetSurf in another application.
The netsurf_embedded bool remembers it for later (like, we shouldn't probably save the hotlist and preferences in that case). svn path=/trunk/netsurf/; revision=5579
Diffstat (limited to 'desktop/netsurf.c')
-rw-r--r--desktop/netsurf.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 7342ac443..4e6b6e085 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -40,6 +40,7 @@
#include "utils/utils.h"
bool netsurf_quit = false;
+bool netsurf_embedded = true;
bool verbose_log = false;
static void netsurf_init(int argc, char** argv);
@@ -49,11 +50,22 @@ static void lib_init(void);
/**
- * Gui NetSurf main().
+ * The regular main(), when not embedded
*/
int main(int argc, char** argv)
{
+ netsurf_embedded = false;
+ return netsurf_main(argc, argv);
+}
+
+
+/**
+ * Gui NetSurf main().
+ */
+
+int netsurf_main(int argc, char** argv)
+{
setbuf(stderr, NULL);
netsurf_init(argc, argv);