summaryrefslogtreecommitdiff
path: root/cocoa/NetsurfApp.m
diff options
context:
space:
mode:
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 */