summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/cmd-show-messages.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2016-10-16 19:04:05 +0000
committernicm <nicm@openbsd.org>2016-10-16 19:04:05 +0000
commit68e0a7f271bc1c08e58a23a65844d346c6665089 (patch)
tree315962d2740c0dca5e710bb5c9db0ac9878f55ba /usr.bin/tmux/cmd-show-messages.c
parentReplace fs/msdosfs/{msdosfs_conv.c,direntry.h} with stripped-down (diff)
downloadwireguard-openbsd-68e0a7f271bc1c08e58a23a65844d346c6665089.tar.xz
wireguard-openbsd-68e0a7f271bc1c08e58a23a65844d346c6665089.zip
Mass rename struct cmd_q to struct cmdq_item and related.
Diffstat (limited to 'usr.bin/tmux/cmd-show-messages.c')
-rw-r--r--usr.bin/tmux/cmd-show-messages.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/usr.bin/tmux/cmd-show-messages.c b/usr.bin/tmux/cmd-show-messages.c
index 586ca265a84..be066f0dd05 100644
--- a/usr.bin/tmux/cmd-show-messages.c
+++ b/usr.bin/tmux/cmd-show-messages.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-show-messages.c,v 1.22 2016/10/14 22:14:22 nicm Exp $ */
+/* $OpenBSD: cmd-show-messages.c,v 1.23 2016/10/16 19:04:05 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -29,7 +29,8 @@
* Show client message log.
*/
-static enum cmd_retval cmd_show_messages_exec(struct cmd *, struct cmd_q *);
+static enum cmd_retval cmd_show_messages_exec(struct cmd *,
+ struct cmdq_item *);
const struct cmd_entry cmd_show_messages_entry = {
.name = "show-messages",
@@ -55,11 +56,11 @@ const struct cmd_entry cmd_server_info_entry = {
.exec = cmd_show_messages_exec
};
-static int cmd_show_messages_terminals(struct cmd_q *, int);
-static int cmd_show_messages_jobs(struct cmd_q *, int);
+static int cmd_show_messages_terminals(struct cmdq_item *, int);
+static int cmd_show_messages_jobs(struct cmdq_item *, int);
static int
-cmd_show_messages_terminals(struct cmd_q *cmdq, int blank)
+cmd_show_messages_terminals(struct cmdq_item *item, int blank)
{
struct tty_term *term;
u_int i, n;
@@ -67,20 +68,20 @@ cmd_show_messages_terminals(struct cmd_q *cmdq, int blank)
n = 0;
LIST_FOREACH(term, &tty_terms, entry) {
if (blank) {
- cmdq_print(cmdq, "%s", "");
+ cmdq_print(item, "%s", "");
blank = 0;
}
- cmdq_print(cmdq, "Terminal %u: %s [references=%u, flags=0x%x]:",
+ cmdq_print(item, "Terminal %u: %s [references=%u, flags=0x%x]:",
n, term->name, term->references, term->flags);
n++;
for (i = 0; i < tty_term_ncodes(); i++)
- cmdq_print(cmdq, "%s", tty_term_describe(term, i));
+ cmdq_print(item, "%s", tty_term_describe(term, i));
}
return (n != 0);
}
static int
-cmd_show_messages_jobs(struct cmd_q *cmdq, int blank)
+cmd_show_messages_jobs(struct cmdq_item *item, int blank)
{
struct job *job;
u_int n;
@@ -88,10 +89,10 @@ cmd_show_messages_jobs(struct cmd_q *cmdq, int blank)
n = 0;
LIST_FOREACH(job, &all_jobs, lentry) {
if (blank) {
- cmdq_print(cmdq, "%s", "");
+ cmdq_print(item, "%s", "");
blank = 0;
}
- cmdq_print(cmdq, "Job %u: %s [fd=%d, pid=%d, status=%d]",
+ cmdq_print(item, "Job %u: %s [fd=%d, pid=%d, status=%d]",
n, job->cmd, job->fd, job->pid, job->status);
n++;
}
@@ -99,21 +100,21 @@ cmd_show_messages_jobs(struct cmd_q *cmdq, int blank)
}
static enum cmd_retval
-cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
+cmd_show_messages_exec(struct cmd *self, struct cmdq_item *item)
{
struct args *args = self->args;
- struct client *c = cmdq->state.c;
+ struct client *c = item->state.c;
struct message_entry *msg;
char *tim;
int done, blank;
done = blank = 0;
if (args_has(args, 'T') || self->entry == &cmd_server_info_entry) {
- blank = cmd_show_messages_terminals(cmdq, blank);
+ blank = cmd_show_messages_terminals(item, blank);
done = 1;
}
if (args_has(args, 'J') || self->entry == &cmd_server_info_entry) {
- cmd_show_messages_jobs(cmdq, blank);
+ cmd_show_messages_jobs(item, blank);
done = 1;
}
if (done)
@@ -123,7 +124,7 @@ cmd_show_messages_exec(struct cmd *self, struct cmd_q *cmdq)
tim = ctime(&msg->msg_time);
*strchr(tim, '\n') = '\0';
- cmdq_print(cmdq, "%s %s", tim, msg->msg);
+ cmdq_print(item, "%s %s", tim, msg->msg);
}
return (CMD_RETURN_NORMAL);