StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
msgQSLib.h
1 #ifndef _MSGSQLIB_H_
2 #define _MSGSQLIB_H_
3 
4 #include "objLib.h"
5 
6 typedef int MSG_Q_ID;
7 
8 // kill all message queues
9 void msgQSSystemReset();
10 
11 // MSG_Q_ID is an int shared among all process's (the task)
12 // You may request a specific process
13 // or allow system to create one.
14 // System created id's are > 256...
15 
16 // options: NO_SEM 0x00
17 // PROCESS_SEM 0x11
18 // THREAD_SEM 0x10
19 
20 STATUS msgQSCreate(int maxMsgs, int maxMsgLength, int options, int id=-1);
21 
22 // OPTION
23 // ------
24 // NO_SEM -- never blocks. timeout completely ignored. EAGAIN if can't send
25 //
26 // xxx_SEM && timeout == NO_WAIT -- never blocks. EAGAIN if can't send
27 // xxx_SEM && timeout == WAIT_FOREVER -- blocks forever. No interrupt.
28 // xxx_SEM && timeout == int -- blocks, but can be interrupted. EAGAIN if
29 // interrupted
30 //
31 // priority 0 -- add to end.
32 // priotity 1 -- add to begining
33 //
34 STATUS msgQSSend(MSG_Q_ID msgQId, char *buffer, int nBytes, int timeout=NO_WAIT, int priority=0);
35 
36 STATUS msgQSReceive(MSG_Q_ID msgQId, char *buffer, int maxNBytes, int timeout=WAIT_FOREVER);
37 
38 
39 
40 
41 #endif