version 1.22, 2015/02/12 09:56:19 |
version 1.23, 2015/04/19 21:34:21 |
|
|
|
|
#include <ctype.h> |
#include <ctype.h> |
#include <stdlib.h> |
#include <stdlib.h> |
|
#include <string.h> |
#include <time.h> |
#include <time.h> |
|
|
#include "tmux.h" |
#include "tmux.h" |
|
|
|
|
/* Add command list to queue and begin processing if needed. */ |
/* Add command list to queue and begin processing if needed. */ |
void |
void |
cmdq_run(struct cmd_q *cmdq, struct cmd_list *cmdlist) |
cmdq_run(struct cmd_q *cmdq, struct cmd_list *cmdlist, struct mouse_event *m) |
{ |
{ |
cmdq_append(cmdq, cmdlist); |
cmdq_append(cmdq, cmdlist, m); |
|
|
if (cmdq->item == NULL) { |
if (cmdq->item == NULL) { |
cmdq->cmd = NULL; |
cmdq->cmd = NULL; |
|
|
|
|
/* Add command list to queue. */ |
/* Add command list to queue. */ |
void |
void |
cmdq_append(struct cmd_q *cmdq, struct cmd_list *cmdlist) |
cmdq_append(struct cmd_q *cmdq, struct cmd_list *cmdlist, struct mouse_event *m) |
{ |
{ |
struct cmd_q_item *item; |
struct cmd_q_item *item; |
|
|
|
|
item->cmdlist = cmdlist; |
item->cmdlist = cmdlist; |
TAILQ_INSERT_TAIL(&cmdq->queue, item, qentry); |
TAILQ_INSERT_TAIL(&cmdq->queue, item, qentry); |
cmdlist->references++; |
cmdlist->references++; |
|
|
|
if (m != NULL) |
|
memcpy(&item->mouse, m, sizeof item->mouse); |
|
else |
|
item->mouse.valid = 0; |
} |
} |
|
|
/* Continue processing command queue. Returns 1 if finishes empty. */ |
/* Continue processing command queue. Returns 1 if finishes empty. */ |