mirror of
https://github.com/tmux/tmux.git
synced 2025-09-01 20:57:00 +00:00
Mass rename struct cmd_q to struct cmdq_item and related.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user