StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
msgNQLib.h
1 #ifndef _MSG_NQ_LIB_H_
2 #define _MSG_NQ_LIB_H_
3 
4 #define MSG_Q_ID int
5 
6 #define WAIT_FOREVER (-1)
7 #define NO_WAIT 0
8 #define S_objLib_OBJ_TIMEOUT EAGAIN
9 
10 #define MSG_Q_TIMEOUT (-1)
11 #define MSG_Q_ERROR (-2) // OS-specific error i.e. write returns -1
12 #define MSG_Q_NOTASK (-3) // "no task present" error
13 
14 #define MSG_Q_LOCK_NONE 0
15 #define MSG_Q_LOCK 1
16 #define MSG_Q_LOCK_EXPECT 2
17 
18 #define MSG_Q_DIR "/tmp"
19 #define MSG_NQ_MAXQUEUES 256
20 
21 
22 struct msgNQStruct {
23  int desc ;
24  int len ;
25  int locked ;
26  int task ;
27 } ;
28 
29 
30 
31 extern int msgNQCreate(char *host, int port, int msglen) ;
32 extern int msgNQSend(int desc, char *what, int size, int timeout = WAIT_FOREVER, int prio = 0) ;
33 extern int msgNQReceive(int desc, char *where, int size, int timeout = WAIT_FOREVER) ;
34 extern int msgNQDelete(int desc) ;
35 extern int msgNQCheck(int desc) ;
36 
37 #endif