Lines Matching refs:msgq
20 * Function: struct msgqueue_entry *mqe_alloc(MsgQueue_t *msgq)
22 * Params : msgq - message queue to claim entry for
25 static struct msgqueue_entry *mqe_alloc(MsgQueue_t *msgq)
29 if ((mq = msgq->free) != NULL)
30 msgq->free = mq->next;
36 * Function: void mqe_free(MsgQueue_t *msgq, struct msgqueue_entry *mq)
38 * Params : msgq - message queue to free entry from
41 static void mqe_free(MsgQueue_t *msgq, struct msgqueue_entry *mq)
44 mq->next = msgq->free;
45 msgq->free = mq;
50 * Function: void msgqueue_initialise(MsgQueue_t *msgq)
52 * Params : msgq - queue to initialise
54 void msgqueue_initialise(MsgQueue_t *msgq)
58 msgq->qe = NULL;
59 msgq->free = &msgq->entries[0];
62 msgq->entries[i].next = &msgq->entries[i + 1];
64 msgq->entries[NR_MESSAGES - 1].next = NULL;
69 * Function: void msgqueue_free(MsgQueue_t *msgq)
71 * Params : msgq - queue to free
73 void msgqueue_free(MsgQueue_t *msgq)
78 * Function: int msgqueue_msglength(MsgQueue_t *msgq)
80 * Params : msgq - queue to examine
83 int msgqueue_msglength(MsgQueue_t *msgq)
85 struct msgqueue_entry *mq = msgq->qe;
88 for (mq = msgq->qe; mq; mq = mq->next)
95 * Function: struct message *msgqueue_getmsg(MsgQueue_t *msgq, int msgno)
97 * Params : msgq - queue to obtain message from
101 struct message *msgqueue_getmsg(MsgQueue_t *msgq, int msgno)
105 for (mq = msgq->qe; mq && msgno; mq = mq->next, msgno--);
111 * Function: int msgqueue_addmsg(MsgQueue_t *msgq, int length, ...)
113 * Params : msgq - queue to add message on
118 int msgqueue_addmsg(MsgQueue_t *msgq, int length, ...)
120 struct msgqueue_entry *mq = mqe_alloc(msgq);
136 mqp = &msgq->qe;
147 * Function: void msgqueue_flush(MsgQueue_t *msgq)
149 * Params : msgq - queue to flush
151 void msgqueue_flush(MsgQueue_t *msgq)
155 for (mq = msgq->qe; mq; mq = mqnext) {
157 mqe_free(msgq, mq);
159 msgq->qe = NULL;