summaryrefslogtreecommitdiffstats
path: root/tmux.h
diff options
context:
space:
mode:
authornicm <nicm>2015-11-20 12:01:19 +0000
committernicm <nicm>2015-11-20 12:01:19 +0000
commitfce56c56efc57e80cc3ed755c192cf88822ebf0e (patch)
treeac91bccebcaebc7738e248e4f0564e6ad52078d0 /tmux.h
parent374e273df5f66e90e06f60617495446facfbd4f3 (diff)
Instead of separate tables for different types of options, give each
option a scope type (server, session, window) in one table.
Diffstat (limited to 'tmux.h')
-rw-r--r--tmux.h32
1 files changed, 17 insertions, 15 deletions
diff --git a/tmux.h b/tmux.h
index d58ee8c9..a112e7df 100644
--- a/tmux.h
+++ b/tmux.h
@@ -1393,19 +1393,25 @@ enum options_table_type {
OPTIONS_TABLE_CHOICE,
OPTIONS_TABLE_STYLE
};
+enum options_table_scope {
+ OPTIONS_TABLE_SERVER,
+ OPTIONS_TABLE_SESSION,
+ OPTIONS_TABLE_WINDOW,
+};
struct options_table_entry {
- const char *name;
- enum options_table_type type;
+ const char *name;
+ enum options_table_type type;
+ enum options_table_scope scope;
- u_int minimum;
- u_int maximum;
- const char **choices;
+ u_int minimum;
+ u_int maximum;
+ const char **choices;
- const char *default_str;
- long long default_num;
+ const char *default_str;
+ long long default_num;
- const char *style;
+ const char *style;
};
/* Common command usages. */
@@ -1543,15 +1549,11 @@ struct options_entry *options_set_style(struct options *, const char *,
struct grid_cell *options_get_style(struct options *, const char *);
/* options-table.c */
-extern const struct options_table_entry server_options_table[];
-extern const struct options_table_entry session_options_table[];
-extern const struct options_table_entry window_options_table[];
-void options_table_populate_tree(const struct options_table_entry *,
- struct options *);
+extern const struct options_table_entry options_table[];
+void options_table_populate_tree(enum options_table_scope, struct options *);
const char *options_table_print_entry(const struct options_table_entry *,
struct options_entry *, int);
-int options_table_find(const char *, const struct options_table_entry **,
- const struct options_table_entry **);
+int options_table_find(const char *, const struct options_table_entry **);
/* job.c */
extern struct joblist all_jobs;