diff options
author | 2012-01-21 08:40:09 +0000 | |
---|---|---|
committer | 2012-01-21 08:40:09 +0000 | |
commit | f193b8ed5c0ec20345e0f1ce456ee30fb477038a (patch) | |
tree | 952a8f9ca3bacd4559133ef7bc6429712a0b4c29 /usr.bin/tmux/options.c | |
parent | Add strings to allow the aixterm bright colours to be used when (diff) | |
download | wireguard-openbsd-f193b8ed5c0ec20345e0f1ce456ee30fb477038a.tar.xz wireguard-openbsd-f193b8ed5c0ec20345e0f1ce456ee30fb477038a.zip |
Drop the ability to have a list of keys in the prefix in favour of two
separate options, prefix and prefix2. This simplifies the code and gets
rid the data options type which was only used for this one option.
Also add a -2 flag to send-prefix to send the secondary prefix key,
fixing a cause of minor irritation.
People who want three prefix keys are out of luck :-).
Diffstat (limited to 'usr.bin/tmux/options.c')
-rw-r--r-- | usr.bin/tmux/options.c | 43 |
1 files changed, 1 insertions, 42 deletions
diff --git a/usr.bin/tmux/options.c b/usr.bin/tmux/options.c index cc40545598e..0b6b66fc0dd 100644 --- a/usr.bin/tmux/options.c +++ b/usr.bin/tmux/options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: options.c,v 1.5 2009/09/22 12:38:10 nicm Exp $ */ +/* $OpenBSD: options.c,v 1.6 2012/01/21 08:40:09 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -54,8 +54,6 @@ options_free(struct options *oo) xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); xfree(o); } } @@ -97,8 +95,6 @@ options_remove(struct options *oo, const char *name) xfree(o->name); if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); xfree(o); } @@ -114,8 +110,6 @@ options_set_string(struct options *oo, const char *name, const char *fmt, ...) SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); va_start(ap, fmt); o->type = OPTIONS_STRING; @@ -147,8 +141,6 @@ options_set_number(struct options *oo, const char *name, long long value) SPLAY_INSERT(options_tree, &oo->tree, o); } else if (o->type == OPTIONS_STRING) xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); o->type = OPTIONS_NUMBER; o->num = value; @@ -166,36 +158,3 @@ options_get_number(struct options *oo, const char *name) fatalx("option not a number"); return (o->num); } - -struct options_entry * -options_set_data( - struct options *oo, const char *name, void *value, void (*freefn)(void *)) -{ - struct options_entry *o; - - if ((o = options_find1(oo, name)) == NULL) { - o = xmalloc(sizeof *o); - o->name = xstrdup(name); - SPLAY_INSERT(options_tree, &oo->tree, o); - } else if (o->type == OPTIONS_STRING) - xfree(o->str); - else if (o->type == OPTIONS_DATA) - o->freefn(o->data); - - o->type = OPTIONS_DATA; - o->data = value; - o->freefn = freefn; - return (o); -} - -void * -options_get_data(struct options *oo, const char *name) -{ - struct options_entry *o; - - if ((o = options_find(oo, name)) == NULL) - fatalx("missing option"); - if (o->type != OPTIONS_DATA) - fatalx("option not data"); - return (o->data); -} |