summaryrefslogtreecommitdiffstats
path: root/cmd-show-messages.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2016-10-16 22:01:14 +0100
committerThomas Adam <thomas@xteddy.org>2016-10-16 22:01:14 +0100
commit1a6e696b08113ca17ee8e881844167cf94276846 (patch)
tree60ecdd8c9e51bff46624e48d9373686b858d2fb1 /cmd-show-messages.c
parentd401340c516131ae8e07bfb978b670347486d077 (diff)
parentd15d54c2c8e6b95695169442eb2a27d814efc078 (diff)
Merge branch 'obsd-master'
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 8d33cdd0..6eaf35d0 100644
--- a/cmd-show-messages.c
+++ b/cmd-show-messages.c
@@ -28,7 +28,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",
@@ -54,11 +55,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;
@@ -66,20 +67,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;
@@ -87,10 +88,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++;
}
@@ -98,21 +99,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)
@@ -122,7 +123,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);