StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
msgQLib.h
1 #ifndef _MSG_Q_LIB_
2 #define _MSG_Q_LIB_
3 
4 /**********************************************/
5 /* msgQCreate: */
6 /* Only to be called by the receiving */
7 /* process. It's function is */
8 /* (1) Create a lock that tells other */
9 /* processes its still listening */
10 /* (2) Flush the queue if it has junk */
11 /* left in it. */
12 /* */
13 /* return values: 0 OK. */
14 /* -1 error */
15 /**********************************************/
16 int msgQCreate(int task, int nmsgs, int msglen);
17 
18 
19 /**********************************************/
20 /* msgQSend: */
21 /* non-blocking call */
22 /* if test is set, tests for listener */
23 /* otherwise, not. */
24 /* */
25 /* return values: 0 OK. */
26 /* -1 error */
27 /**********************************************/
28 int msgQSend(int task, char *buff, int size, int *line_number=0);
29 
30 /**********************************************/
31 /* msgQReceive: */
32 /* Blocking call */
33 /* return values: length of msg in bytes */
34 /* -1 error */
35 /**********************************************/
36 int msgQReceive(int task, char *buff, int size);
37 
38 /**********************************************/
39 /* returns size of Q */
40 /**********************************************/
41 int msgQSize(int task);
42 
43 /**********************************************/
44 /* returns messages in Q */
45 /* ********************************************/
46 int msgQUsed(int task);
47 
48 /**********************************************/
49 /* returns free buffers in Q */
50 /**********************************************/
51 int msgQFree(int task);
52 
53 /**********************************************/
54 /* Check if receiver exists for message queue */
55 /* Returns 0 if no task, */
56 /* pid if task... */
57 /**********************************************/
58 int msgQTest(int task);
59 #endif