#ifndef UDPCOMM_MSG_Q_H #define UDPCOMM_MSG_Q_H /* Prioritized message queue */ typedef void *QEl; typedef struct QRec_ *MsgQ; /* Send a message (doesn't block; must not be called from ISR) * RETURNS: nonzero on error (queue full), zero on success */ int qsend(MsgQ q, QEl *e_p); /* Send a high-priority message (doesn't block; must not be called from ISR) * RETURNS: nonzero on error (queue full), zero on success */ int qsend_hp(MsgQ q, QEl *e_p); /* Block (indefinitely) for a message * RETURNS: zero on success */ int qrecv(MsgQ q, QEl *e_p); /* Create a message queue; 'lsz', 'hsz': number of low- and high-priority * message buffers, respectively * * RETURNS new queue or NULL on error. */ MsgQ qinit(unsigned lsz, unsigned hsz); void qfini(MsgQ q); #endif