summaryrefslogtreecommitdiff
path: root/src/kmscon_conf.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2012-10-23 12:05:42 +0200
committerDavid Herrmann <dh.herrmann@googlemail.com>2012-10-23 12:05:42 +0200
commitd4529d735af4e8289c909b06ed747a97884d0a2e (patch)
tree565315fae2e35447ea086961ce59ff3d7e85a824 /src/kmscon_conf.c
parent8923fe2123a3f21ddc9ed21763ba6b6a86fd1c2f (diff)
conf: simplify helper macros
Instead of using "NULL, NULL, NULL, " in every macro, we now provide a *_FULL variant which allows setting these. All other macros simply set these to NULL by default. Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
Diffstat (limited to 'src/kmscon_conf.c')
-rw-r--r--src/kmscon_conf.c66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/kmscon_conf.c b/src/kmscon_conf.c
index c8452ea..20c445f 100644
--- a/src/kmscon_conf.c
+++ b/src/kmscon_conf.c
@@ -353,54 +353,54 @@ int kmscon_conf_new(struct conf_ctx **out)
struct conf_option options[] = {
/* Global Options */
- CONF_OPTION_BOOL('h', "help", aftercheck_help, NULL, &conf->help, false),
- CONF_OPTION_BOOL('v', "verbose", NULL, NULL, &conf->verbose, false),
- CONF_OPTION_BOOL(0, "debug", aftercheck_debug, NULL, &conf->debug, false),
- CONF_OPTION_BOOL(0, "silent", NULL, NULL, &conf->silent, false),
+ CONF_OPTION_BOOL_FULL('h', "help", aftercheck_help, NULL, NULL, &conf->help, false),
+ CONF_OPTION_BOOL('v', "verbose", &conf->verbose, false),
+ CONF_OPTION_BOOL_FULL(0, "debug", aftercheck_debug, NULL, NULL, &conf->debug, false),
+ CONF_OPTION_BOOL(0, "silent", &conf->silent, false),
/* Seat Options */
CONF_OPTION(0, 0, "vt", &conf_vt, NULL, NULL, NULL, &conf->vt, NULL),
- CONF_OPTION_BOOL('s', "switchvt", NULL, NULL, &conf->switchvt, false),
- CONF_OPTION_STRING_LIST(0, "seats", aftercheck_seats, copy_seats, &conf->seats, def_seats),
+ CONF_OPTION_BOOL('s', "switchvt", &conf->switchvt, false),
+ CONF_OPTION_STRING_LIST_FULL(0, "seats", aftercheck_seats, copy_seats, NULL, &conf->seats, def_seats),
/* Session Options */
- CONF_OPTION_UINT(0, "session-max", NULL, NULL, &conf->session_max, 50),
+ CONF_OPTION_UINT(0, "session-max", &conf->session_max, 50),
/* Terminal Options */
- CONF_OPTION_BOOL('l', "login", aftercheck_login, copy_login, &conf->login, false),
- CONF_OPTION_STRING('t', "term", NULL, NULL, &conf->term, "xterm-256color"),
- CONF_OPTION_STRING(0, "palette", NULL, NULL, &conf->palette, NULL),
- CONF_OPTION_UINT(0, "sb-size", NULL, NULL, &conf->sb_size, 1000),
+ CONF_OPTION_BOOL_FULL('l', "login", aftercheck_login, copy_login, NULL, &conf->login, false),
+ CONF_OPTION_STRING('t', "term", &conf->term, "xterm-256color"),
+ CONF_OPTION_STRING(0, "palette", &conf->palette, NULL),
+ CONF_OPTION_UINT(0, "sb-size", &conf->sb_size, 1000),
/* Input Options */
- CONF_OPTION_STRING(0, "xkb-layout", NULL, NULL, &conf->xkb_layout, "us"),
- CONF_OPTION_STRING(0, "xkb-variant", NULL, NULL, &conf->xkb_variant, ""),
- CONF_OPTION_STRING(0, "xkb-options", NULL, NULL, &conf->xkb_options, ""),
- CONF_OPTION_UINT(0, "xkb-repeat-delay", NULL, NULL, &conf->xkb_repeat_delay, 250),
- CONF_OPTION_UINT(0, "xkb-repeat-rate", NULL, NULL, &conf->xkb_repeat_rate, 50),
+ CONF_OPTION_STRING(0, "xkb-layout", &conf->xkb_layout, "us"),
+ CONF_OPTION_STRING(0, "xkb-variant", &conf->xkb_variant, ""),
+ CONF_OPTION_STRING(0, "xkb-options", &conf->xkb_options, ""),
+ CONF_OPTION_UINT(0, "xkb-repeat-delay", &conf->xkb_repeat_delay, 250),
+ CONF_OPTION_UINT(0, "xkb-repeat-rate", &conf->xkb_repeat_rate, 50),
/* Grabs / Keyboard-Shortcuts */
- CONF_OPTION_GRAB(0, "grab-scroll-up", NULL, NULL, &conf->grab_scroll_up, &def_grab_scroll_up),
- CONF_OPTION_GRAB(0, "grab-scroll-down", NULL, NULL, &conf->grab_scroll_down, &def_grab_scroll_down),
- CONF_OPTION_GRAB(0, "grab-page-up", NULL, NULL, &conf->grab_page_up, &def_grab_page_up),
- CONF_OPTION_GRAB(0, "grab-page-down", NULL, NULL, &conf->grab_page_down, &def_grab_page_down),
- CONF_OPTION_GRAB(0, "grab-session-next", NULL, NULL, &conf->grab_session_next, &def_grab_session_next),
- CONF_OPTION_GRAB(0, "grab-session-prev", NULL, NULL, &conf->grab_session_prev, &def_grab_session_prev),
- CONF_OPTION_GRAB(0, "grab-session-close", NULL, NULL, &conf->grab_session_close, &def_grab_session_close),
- CONF_OPTION_GRAB(0, "grab-terminal-new", NULL, NULL, &conf->grab_terminal_new, &def_grab_terminal_new),
+ CONF_OPTION_GRAB(0, "grab-scroll-up", &conf->grab_scroll_up, &def_grab_scroll_up),
+ CONF_OPTION_GRAB(0, "grab-scroll-down", &conf->grab_scroll_down, &def_grab_scroll_down),
+ CONF_OPTION_GRAB(0, "grab-page-up", &conf->grab_page_up, &def_grab_page_up),
+ CONF_OPTION_GRAB(0, "grab-page-down", &conf->grab_page_down, &def_grab_page_down),
+ CONF_OPTION_GRAB(0, "grab-session-next", &conf->grab_session_next, &def_grab_session_next),
+ CONF_OPTION_GRAB(0, "grab-session-prev", &conf->grab_session_prev, &def_grab_session_prev),
+ CONF_OPTION_GRAB(0, "grab-session-close", &conf->grab_session_close, &def_grab_session_close),
+ CONF_OPTION_GRAB(0, "grab-terminal-new", &conf->grab_terminal_new, &def_grab_terminal_new),
/* Video Options */
- CONF_OPTION_BOOL(0, "fbdev", NULL, NULL, &conf->fbdev, false),
- CONF_OPTION_BOOL(0, "dumb", NULL, NULL, &conf->dumb, false),
- CONF_OPTION_UINT(0, "fps", NULL, NULL, &conf->fps, 50),
- CONF_OPTION_STRING(0, "render-engine", NULL, NULL, &conf->render_engine, NULL),
- CONF_OPTION_BOOL(0, "render-timing", NULL, NULL, &conf->render_timing, false),
+ CONF_OPTION_BOOL(0, "fbdev", &conf->fbdev, false),
+ CONF_OPTION_BOOL(0, "dumb", &conf->dumb, false),
+ CONF_OPTION_UINT(0, "fps", &conf->fps, 50),
+ CONF_OPTION_STRING(0, "render-engine", &conf->render_engine, NULL),
+ CONF_OPTION_BOOL(0, "render-timing", &conf->render_timing, false),
/* Font Options */
- CONF_OPTION_STRING(0, "font-engine", NULL, NULL, &conf->font_engine, "pango"),
- CONF_OPTION_UINT(0, "font-size", NULL, NULL, &conf->font_size, 12),
- CONF_OPTION_STRING(0, "font-name", NULL, NULL, &conf->font_name, "monospace"),
- CONF_OPTION_UINT(0, "font-dpi", NULL, NULL, &conf->font_ppi, 96),
+ CONF_OPTION_STRING(0, "font-engine", &conf->font_engine, "pango"),
+ CONF_OPTION_UINT(0, "font-size", &conf->font_size, 12),
+ CONF_OPTION_STRING(0, "font-name", &conf->font_name, "monospace"),
+ CONF_OPTION_UINT(0, "font-dpi", &conf->font_ppi, 96),
};
ret = conf_ctx_new(&ctx, options, sizeof(options) / sizeof(*options),