From 35dacc36716bdac66bc2673a6725083dc265d310 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 23 May 2013 11:50:57 +0100 Subject: move the logging initialisation out to be call by frontends This allows each frontend to pass a distinct callback to configure the output file stream appropriately for their use. --- windows/main.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'windows') diff --git a/windows/main.c b/windows/main.c index 19f71dd33..3ead210c7 100644 --- a/windows/main.c +++ b/windows/main.c @@ -66,9 +66,9 @@ void gui_quit(void) } /** - * Ensures output stdio stream is available + * Ensures output logging stream is available */ -bool nslog_ensure(FILE *fptr) +static bool nslog_ensure(FILE *fptr) { /* mwindows compile flag normally invalidates standard io unless * already redirected @@ -136,8 +136,17 @@ WinMain(HINSTANCE hInstance, HINSTANCE hLastInstance, LPSTR lpcli, int ncmd) options_file_location = filepath_find(respaths, "preferences"); + /* initialise logging - not fatal if it fails but not much we + * can do about it + */ + nslog_init(nslog_ensure, &argc, argv); + /* initialise netsurf */ - netsurf_init(&argc, &argv, options_file_location, messages); + ret = netsurf_init(&argc, &argv, options_file_location, messages); + if (ret != NSERROR_OK) { + free(options_file_location); + return 1; + } free(messages); -- cgit v1.2.3