summaryrefslogtreecommitdiff
path: root/usr.bin/tmux
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2009-11-05 10:44:37 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2009-11-05 10:44:37 +0000
commit6bd0b9032b505002e9925869b8385ba856693b94 (patch)
tree7adb1fc4cbfa03ac2ee4012215de0edef2233ae5 /usr.bin/tmux
parent099044743396f0352b01fc43f78006a07ec334a9 (diff)
Key flags are only used for initialisation so they are not needed in the main
tty_key struct.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r--usr.bin/tmux/tmux.h6
-rw-r--r--usr.bin/tmux/tty-keys.c13
2 files changed, 8 insertions, 11 deletions
diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h
index 2148451bf78..5b42fce46d9 100644
--- a/usr.bin/tmux/tmux.h
+++ b/usr.bin/tmux/tmux.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmux.h,v 1.171 2009/11/05 08:48:15 nicm Exp $ */
+/* $OpenBSD: tmux.h,v 1.172 2009/11/05 10:44:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -939,10 +939,6 @@ struct tty_key {
int key;
char *string;
- int flags;
-#define TTYKEY_CTRL 0x1
-#define TTYKEY_RAW 0x2
-
RB_ENTRY(tty_key) entry;
};
diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c
index ceacd795fa5..2b766842c7a 100644
--- a/usr.bin/tmux/tty-keys.c
+++ b/usr.bin/tmux/tty-keys.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty-keys.c,v 1.14 2009/11/05 08:45:08 nicm Exp $ */
+/* $OpenBSD: tty-keys.c,v 1.15 2009/11/05 10:44:36 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -29,7 +29,7 @@
* Handle keys input from the outside terminal.
*/
-void tty_keys_add(struct tty *, const char *, int, int);
+void tty_keys_add(struct tty *, const char *, int);
void tty_keys_callback(int, short, void *);
int tty_keys_mouse(char *, size_t, size_t *, struct mouse_event *);
@@ -39,6 +39,8 @@ struct tty_key_ent {
int key;
int flags;
+#define TTYKEY_CTRL 0x1
+#define TTYKEY_RAW 0x2
};
struct tty_key_ent tty_keys[] = {
@@ -195,14 +197,13 @@ tty_keys_cmp(struct tty_key *k1, struct tty_key *k2)
}
void
-tty_keys_add(struct tty *tty, const char *s, int key, int flags)
+tty_keys_add(struct tty *tty, const char *s, int key)
{
struct tty_key *tk, *tl;
tk = xmalloc(sizeof *tk);
tk->string = xstrdup(s);
tk->key = key;
- tk->flags = flags;
if ((tl = RB_INSERT(tty_keys, &tty->ktree, tk)) != NULL) {
xfree(tk->string);
@@ -240,12 +241,12 @@ tty_keys_init(struct tty *tty)
continue;
}
- tty_keys_add(tty, s + 1, tke->key, tke->flags);
+ tty_keys_add(tty, s + 1, tke->key);
if (tke->flags & TTYKEY_CTRL) {
if (strlcpy(tmp, s, sizeof tmp) >= sizeof tmp)
continue;
tmp[strlen(tmp) - 1] ^= 0x20;
- tty_keys_add(tty, tmp + 1, tke->key | KEYC_CTRL, 0);
+ tty_keys_add(tty, tmp + 1, tke->key | KEYC_CTRL);
}
}
}