00001 #ifndef _MSG_NQ_LIB_H_
00002 #define _MSG_NQ_LIB_H_
00003
00004
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
00015 #define MSG_NQ_MAXQUEUES 256
00016
00017
00018 struct msgNQStruct {
00019 int desc ;
00020 int len ;
00021 int locked ;
00022 int task ;
00023 } ;
00024
00025
00026
00027 extern int msgNQCreate(char *host, int port, int msglen) ;
00028 extern int msgNQSend(int desc, char *what, int size, int timeout = WAIT_FOREVER, int prio = 0) ;
00029 extern int msgNQReceive(int desc, char *where, int size, int timeout = WAIT_FOREVER) ;
00030 extern int msgNQDelete(int desc) ;
00031 extern int msgNQCheck(int desc) ;
00032
00033 #endif