summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae97bd3)
raw | patch | inline | side by side (parent: ae97bd3)
author | Max Kellermann <max@duempel.org> | |
Fri, 7 Nov 2008 07:29:23 +0000 (08:29 +0100) | ||
committer | Max Kellermann <max@duempel.org> | |
Fri, 7 Nov 2008 07:29:23 +0000 (08:29 +0100) |
Initialize the options struct statically.
src/options.c | patch | blob | history |
diff --git a/src/options.c b/src/options.c
index 1b745bb76467854c7ebc488d13797d13b228d9ad..853f105452c0d47c610b1b8c7381600d9c71bfca 100644 (file)
--- a/src/options.c
+++ b/src/options.c
typedef void (*option_callback_fn_t)(int c, const char *arg);
-options_t options;
+options_t options = {
+ .port = DEFAULT_PORT,
+ .crossfade_time = DEFAULT_CROSSFADE_TIME,
+ .seek_time = 1,
+ .lyrics_timeout = DEFAULT_LYRICS_TIMEOUT,
+ .find_wrap = true,
+ .wide_cursor = true,
+ .audible_bell = true,
+ .scroll = DEFAULT_SCROLL,
+ .welcome_screen_list = true,
+};
static const arg_opt_t option_table[] = {
{ '?', "help", NULL, "Show this help message" },
/* get initial values for port from MPD_PORT (enviroment) */
if ((value = g_getenv(MPD_PORT_ENV)))
options.port = atoi(value);
- else
- options.port = DEFAULT_PORT;
/* default option values */
options.list_format = g_strdup(DEFAULT_LIST_FORMAT);
options.status_format = g_strdup(DEFAULT_STATUS_FORMAT);
- options.find_wrap = true;
- options.wide_cursor = true;
- options.welcome_screen_list = true;
- options.audible_bell = true;
- options.crossfade_time = DEFAULT_CROSSFADE_TIME;
- options.seek_time = 1;
options.screen_list = g_strsplit_set(DEFAULT_SCREEN_LIST, " ", 0);
options.timedisplay_type = g_strdup(DEFAULT_TIMEDISPLAY_TYPE);
- options.lyrics_timeout = DEFAULT_LYRICS_TIMEOUT;
- options.scroll = DEFAULT_SCROLL;
options.scroll_sep = g_strdup(DEFAULT_SCROLL_SEP);
}