diff options
author | nicm <nicm> | 2015-10-27 15:58:42 +0000 |
---|---|---|
committer | nicm <nicm> | 2015-10-27 15:58:42 +0000 |
commit | 44657bf932b068aff5ce1019a4e8a2e7b00b5321 (patch) | |
tree | 9efb1fa8a96b0a362a51d894bd36c45aa9731a98 /cmd-show-options.c | |
parent | 67c3a014b960b8c1d7931d3c99f570610b1d4d3f (diff) | |
download | rtmux-44657bf932b068aff5ce1019a4e8a2e7b00b5321.tar.gz rtmux-44657bf932b068aff5ce1019a4e8a2e7b00b5321.tar.bz2 rtmux-44657bf932b068aff5ce1019a4e8a2e7b00b5321.zip |
Move struct options into options.c.
Diffstat (limited to 'cmd-show-options.c')
-rw-r--r-- | cmd-show-options.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c index a5011e72..e99d665f 100644 --- a/cmd-show-options.c +++ b/cmd-show-options.c @@ -61,28 +61,28 @@ cmd_show_options_exec(struct cmd *self, struct cmd_q *cmdq) int quiet; if (args_has(self->args, 's')) { - oo = &global_options; + oo = global_options; table = server_options_table; } else if (args_has(self->args, 'w') || self->entry == &cmd_show_window_options_entry) { table = window_options_table; if (args_has(self->args, 'g')) - oo = &global_w_options; + oo = global_w_options; else { wl = cmd_find_window(cmdq, args_get(args, 't'), NULL); if (wl == NULL) return (CMD_RETURN_ERROR); - oo = &wl->window->options; + oo = wl->window->options; } } else { table = session_options_table; if (args_has(self->args, 'g')) - oo = &global_s_options; + oo = global_s_options; else { s = cmd_find_session(cmdq, args_get(args, 't'), 0); if (s == NULL) return (CMD_RETURN_ERROR); - oo = &s->options; + oo = s->options; } } @@ -151,13 +151,15 @@ cmd_show_options_all(struct cmd *self, struct cmd_q *cmdq, struct options_entry *o; const char *optval; - RB_FOREACH(o, options_tree, &oo->tree) { + o = options_first(oo); + while (o != NULL) { if (*o->name == '@') { if (args_has(self->args, 'v')) cmdq_print(cmdq, "%s", o->str); else cmdq_print(cmdq, "%s \"%s\"", o->name, o->str); } + o = options_next(o); } for (oe = table; oe->name != NULL; oe++) { |