diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-11-22 14:41:12 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2012-11-22 14:41:12 +0000 |
commit | 01495edec5eadd83d063278c57226d5fda3069e5 (patch) | |
tree | d31b1beb40baee8a3fae4d711a5370dbf25961f8 /usr.bin/tmux | |
parent | e97fc3e897c4b8091e749b6054b3425c3ff1ba24 (diff) |
Put helper function back, will be needed in a bit.
Diffstat (limited to 'usr.bin/tmux')
-rw-r--r-- | usr.bin/tmux/cmd-server-info.c | 4 | ||||
-rw-r--r-- | usr.bin/tmux/tmux.h | 5 | ||||
-rw-r--r-- | usr.bin/tmux/tty-keys.c | 12 | ||||
-rw-r--r-- | usr.bin/tmux/tty.c | 10 |
4 files changed, 20 insertions, 11 deletions
diff --git a/usr.bin/tmux/cmd-server-info.c b/usr.bin/tmux/cmd-server-info.c index af75a9f016a..7b402393fd4 100644 --- a/usr.bin/tmux/cmd-server-info.c +++ b/usr.bin/tmux/cmd-server-info.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-server-info.c,v 1.28 2012/11/22 14:26:04 nicm Exp $ */ +/* $OpenBSD: cmd-server-info.c,v 1.29 2012/11/22 14:41:11 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott <nicm@users.sourceforge.net> @@ -92,7 +92,7 @@ cmd_server_info_exec(unused struct cmd *self, struct cmd_ctx *ctx) "class=%u] [flags=0x%x/0x%x, references=%u]", i, c->tty.path, c->ibuf.fd, c->tty.fd, c->session->name, c->tty.sx, c->tty.sy, c->tty.termname, - c->tty.tio.c_cc[VERASE], c->tty.service_class, + c->tty.tio.c_cc[VERASE], c->tty.class, c->flags, c->tty.flags, c->references); } ctx->print(ctx, "%s", ""); diff --git a/usr.bin/tmux/tmux.h b/usr.bin/tmux/tmux.h index 159ecc7574c..62b7e47223f 100644 --- a/usr.bin/tmux/tmux.h +++ b/usr.bin/tmux/tmux.h @@ -1,4 +1,4 @@ -/* $OpenBSD: tmux.h,v 1.363 2012/11/22 14:26:04 nicm Exp $ */ +/* $OpenBSD: tmux.h,v 1.364 2012/11/22 14:41:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -1193,7 +1193,7 @@ struct tty { struct client *client; char *path; - u_int service_class; + u_int class; u_int sx; u_int sy; @@ -1637,6 +1637,7 @@ void tty_pututf8(struct tty *, const struct grid_utf8 *); void tty_init(struct tty *, struct client *, int, char *); int tty_resize(struct tty *); int tty_set_size(struct tty *, u_int, u_int); +void tty_set_class(struct tty *, u_int); void tty_start_tty(struct tty *); void tty_stop_tty(struct tty *); void tty_set_title(struct tty *, const char *); diff --git a/usr.bin/tmux/tty-keys.c b/usr.bin/tmux/tty-keys.c index 466bd80587c..c29a1c4b6e3 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.46 2012/11/22 14:26:04 nicm Exp $ */ +/* $OpenBSD: tty-keys.c,v 1.47 2012/11/22 14:41:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -724,7 +724,7 @@ tty_keys_mouse(struct tty *tty, const char *buf, size_t len, size_t *size) int tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size) { - u_int i, n; + u_int i, class; char tmp[64], *endptr; /* @@ -764,12 +764,12 @@ tty_keys_device(struct tty *tty, const char *buf, size_t len, size_t *size) return (0); /* Convert service class. */ - n = strtoul(tmp, &endptr, 10); + class = strtoul(tmp, &endptr, 10); if (*endptr != ';') - n = 0; + class = 0; - log_debug("received service class %u", n); - tty->service_class = n; + log_debug("received service class %u", class); + tty_set_class(tty, class); return (0); } diff --git a/usr.bin/tmux/tty.c b/usr.bin/tmux/tty.c index 20c9b67a672..6f60de4ecdf 100644 --- a/usr.bin/tmux/tty.c +++ b/usr.bin/tmux/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.144 2012/11/22 14:26:04 nicm Exp $ */ +/* $OpenBSD: tty.c,v 1.145 2012/11/22 14:41:11 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -240,6 +240,14 @@ tty_start_tty(struct tty *tty) } void +tty_set_class(struct tty *tty, u_int class) +{ + if (tty->class != 0) + return; + tty->class = class; +} + +void tty_stop_tty(struct tty *tty) { struct winsize ws; |