/* Function: int msgqueue_msglength(MsgQueue_t *msgq) Purpose : calculate the total length of all messages on the message queue Params : msgq - queue to examine Returns : number of bytes of messages in queue  */
int msgqueue_msglength(MsgQueue_t *msgq)
/* Function: int msgqueue_msglength(MsgQueue_t *msgq) Purpose : calculate the total length of all messages on the message queue Params : msgq - queue to examine Returns : number of bytes of messages in queue  */
int msgqueue_msglength(MsgQueue_t *msgq)
{
	struct msgqueue_entry *mq = msgq->qe;
	int length = 0;
	for (mq = msgq->qe; mq; mq = mq->next)
		length += mq->msg.length;
	return length;
}