queue

C code posted
created at 30 May 11:05

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
typedef struct MQ MQ_t;

/* Message Queue API */
MQ_t*  MsgQueueCreate  (char *_msgQueueName, size_t _msgMax, size_t _memSize);  
MQ_t*  MsgQueueConnect  (char *_msgQueueName);
void  MsgQueueDestroy  (MQ_t *_msqQue);

/* Message Manupulation */
/* return number of bytes actually written, 0 if message queue full    */
int    MsgQueueSend  (MQ_t *_msgQue, void* _buffer, size_t _length);
/* return number of bytes actually read, 0 if message queue unavailable */ 
int    MsgQueueRecv  (MQ_t *_msgQue, void* _buffer, size_t _size);

int    IsMsgQueueEmpty (MQ_t *_msgQue);

/* Utility Functions for debugging and unit testing */
void  MsgQueuePrint  (MQ_t* _msgQue);
665 Bytes in 2 ms with coderay