summaryrefslogtreecommitdiffstats
path: root/cmd-show-messages.c
diff options
context:
space:
mode:
authornicm <nicm>2016-10-16 19:04:05 +0000
committernicm <nicm>2016-10-16 19:04:05 +0000
commitb342bd0b462f69a9fc9a59d52bcd4bb34b57114f (patch)
tree2da71181e3b540b8b52422cb598682f1505c2e89 /cmd-show-messages.c
parentddc4512d2e0eda6c705e002cb5dbf80719d709e1 (diff)
Mass rename struct cmd_q to struct cmdq_item and related.
Diffstat (limited to 'cmd-show-messages.c')
-rw-r--r--cmd-show-messages.c31
1 files changed, 16 insertions, 15 deletions
diff --git a/cmd-show-messages.c b/cmd-show-messages.c
index f01632ff..57c83881 100644
--- a/cmd-show-messages.c
+++ b/cmd-show-messages.c
@@ -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);