Lines Matching defs:queue
1 /* $OpenBSD: cmd-queue.c,v 1.118 2024/11/22 12:58:05 nicm Exp $ */
31 /* Command queue flags. */
35 /* Command queue item type. */
41 /* Command queue item. */
44 struct cmdq_list *queue;
73 * Command queue state. This is the context for commands on the command queue.
89 /* Command queue. */
95 /* Get command queue name. */
110 /* Get command queue from client. */
121 return (c->queue);
124 /* Create a queue. */
128 struct cmdq_list *queue;
130 queue = xcalloc(1, sizeof *queue);
131 TAILQ_INIT (&queue->list);
132 return (queue);
135 /* Free a queue. */
137 cmdq_free(struct cmdq_list *queue)
139 if (!TAILQ_EMPTY(&queue->list))
140 fatalx("queue not empty");
141 free(queue);
259 /* Add a format to command queue. */
277 /* Add formats to command queue. */
304 struct cmdq_list *queue = cmdq_get(c);
315 item->queue = queue;
316 TAILQ_INSERT_TAIL(&queue->list, item, entry);
321 return (TAILQ_LAST(&queue->list, cmdq_item_list));
329 struct cmdq_list *queue = after->queue;
341 item->queue = queue;
342 TAILQ_INSERT_AFTER(&queue->list, after, item, entry);
446 /* Continue processing command queue. */
463 TAILQ_REMOVE(&item->queue->list, item, entry);
493 /* Get a command for the command queue. */
596 /* Fire command on command queue. */
684 /* Get a callback for the command queue. */
715 /* Get an error callback for the command queue. */
722 /* Fire callback on callback queue. */
729 /* Process next item on command queue. */
733 struct cmdq_list *queue = cmdq_get(c);
740 if (TAILQ_EMPTY(&queue->list)) {
744 if (TAILQ_FIRST(&queue->list)->flags & CMDQ_WAITING) {
751 item = queue->item = TAILQ_FIRST(&queue->list);
801 queue->item = NULL;
815 struct cmdq_list *queue = cmdq_get(c);
817 if (queue->item == NULL)
819 if (queue->item->flags & CMDQ_WAITING)
821 return (queue->item);