00001 #ifndef _MSG_NQ_LIB_H_
00002 #define _MSG_NQ_LIB_H_
00003
00004 #define MSG_Q_ID int
00005
00006 #define WAIT_FOREVER (-1)
00007 #define NO_WAIT 0
00008 #define S_objLib_OBJ_TIMEOUT EAGAIN
00009
00010 #define MSG_Q_TIMEOUT (-1)
00011 #define MSG_Q_ERROR (-2) // OS-specific error i.e. write returns -1
00012 #define MSG_Q_NOTASK (-3) // "no task present" error
00013
00014 #define MSG_Q_LOCK_NONE 0
00015 #define MSG_Q_LOCK 1
00016 #define MSG_Q_LOCK_EXPECT 2
00017
00018 #define MSG_Q_DIR "/tmp"
00019 #define MSG_NQ_MAXQUEUES 256
00020
00021
00022 struct msgNQStruct {
00023 int desc ;
00024 int len ;
00025 int locked ;
00026 int task ;
00027 } ;
00028
00029
00030
00031 extern int msgNQCreate(char *host, int port, int msglen) ;
00032 extern int msgNQSend(int desc, char *what, int size, int timeout = WAIT_FOREVER, int prio = 0) ;
00033 extern int msgNQReceive(int desc, char *where, int size, int timeout = WAIT_FOREVER) ;
00034 extern int msgNQDelete(int desc) ;
00035 extern int msgNQCheck(int desc) ;
00036
00037 #endif