summaryrefslogtreecommitdiff
path: root/cocoa/NetsurfApp.m
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-05-28 13:34:34 +0100
committerVincent Sanders <vince@netsurf-browser.org>2013-05-28 14:16:11 +0100
commite6539c51b325451425d1c603309ce7a3aa271cf1 (patch)
treeebd827dcb724183dd2b91d159a155e50fb5405dd /cocoa/NetsurfApp.m
parent1b4e0d11d36bcb78fa1ad275ad24c444d99fab3d (diff)
downloadnetsurf-e6539c51b325451425d1c603309ce7a3aa271cf1.tar.gz
netsurf-e6539c51b325451425d1c603309ce7a3aa271cf1.tar.bz2
move cocoa to new option API
Diffstat (limited to 'cocoa/NetsurfApp.m')
-rw-r--r--cocoa/NetsurfApp.m25
1 files changed, 23 insertions, 2 deletions
diff --git a/cocoa/NetsurfApp.m b/cocoa/NetsurfApp.m
index 0bcbefd24..073b1687e 100644
--- a/cocoa/NetsurfApp.m
+++ b/cocoa/NetsurfApp.m
@@ -163,13 +163,20 @@ void cocoa_autorelease( void )
pool = [[NSAutoreleasePool alloc] init];
}
-/* Documented in utils/nsoption.h */
-void gui_options_init_defaults(void)
+/**
+ * Set option defaults for cocoa frontend
+ *
+ * @param defaults The option table to update.
+ * @return error status.
+ */
+static nserror set_defaults(struct nsoption_s *defaults)
{
/* Set defaults for absent option strings */
const char * const ca_bundle = [[[NSBundle mainBundle] pathForResource: @"ca-bundle" ofType: @""] UTF8String];
nsoption_setnull_charp(ca_bundle, strdup(ca_bundle));
+
+ return NSERROR_OK;
}
int main( int argc, char **argv )
@@ -187,6 +194,20 @@ int main( int argc, char **argv )
*/
nslog_init(NULL, &argc, argv);
+ /* user options setup */
+ error = nsoption_init(set_defaults, &nsoptions, &nsoptions_default);
+ if (error != NSERROR_OK) {
+ die("Options failed to initialise");
+ }
+ nsoption_read(options, NULL);
+ nsoption_commandline(&argc, argv, NULL);
+
+ /* common initialisation */
+ error = netsurf_init(messages);
+ if (error != NSERROR_OK) {
+ die("NetSurf failed to initialise");
+ }
+
netsurf_init(&argc, &argv, options, messages);
/* Initialise filename allocator */