+static void read_config(void) {
+ struct swb_config cfg;
+
+ swb_config_init(&cfg);
+
+ swb_config_load(&cfg);
+
+ log_config(cfg.logging);
+#ifdef FREMANTLE
+ /* continuous mode is required on Fremantle */
+ ctx.continuous_mode = 1;
+ if (!cfg.continuous_mode)
+ log_msg("continuous_mode = 0 operation no longer supported, ignoring config setting\n");
+#else
+ ctx.continuous_mode = cfg.continuous_mode;
+#endif
+ free(ctx.other_browser_cmd);
+ if (cfg.other_browser_cmd) {
+ if (!(ctx.other_browser_cmd = strdup(cfg.other_browser_cmd))) {
+ log_perror(errno, "Failed to set other_browser_cmd");
+ exit(1);
+ }
+ } else
+ ctx.other_browser_cmd = NULL;
+ update_default_browser(&ctx, cfg.default_browser);
+#ifdef FREMANTLE
+ ctx.autostart_microb = cfg.autostart_microb;
+#endif
+
+ log_msg("continuous_mode: %d\n", cfg.continuous_mode);
+ log_msg("default_browser: '%s'\n", cfg.default_browser);
+ log_msg("other_browser_cmd: '%s'\n",
+ cfg.other_browser_cmd?cfg.other_browser_cmd:"NULL");
+ log_msg("logging: '%s'\n", cfg.logging);
+
+ swb_config_free(&cfg);