00001 #ifndef _MSGSQLIB_H_ 00002 #define _MSGSQLIB_H_ 00003 00004 #include "objLib.h" 00005 00006 typedef int MSG_Q_ID; 00007 00008 // kill all message queues 00009 void msgSQSystemReset(); 00010 00011 // MSG_Q_ID is an int shared among all process's (the task) 00012 // You may request a specific process 00013 // or allow system to create one. 00014 // System created id's are > 256... 00015 00016 // options: NO_SEM 0x00 00017 // PROCESS_SEM 0x11 00018 // THREAD_SEM 0x10 00019 00020 STATUS msgSQCreate(int maxMsgs, int maxMsgLength, int options, int id=-1); 00021 00022 // OPTION 00023 // ------ 00024 // NO_SEM -- never blocks. timeout completely ignored. EAGAIN if can't send 00025 // 00026 // xxx_SEM && timeout == NO_WAIT -- never blocks. EAGAIN if can't send 00027 // xxx_SEM && timeout == WAIT_FOREVER -- blocks forever. No interrupt. 00028 // xxx_SEM && timeout == int -- blocks, but can be interrupted. EAGAIN if 00029 // interrupted 00030 // 00031 // priority 0 -- add to end. 00032 // priotity 1 -- add to begining 00033 // 00034 STATUS msgSQSend(MSG_Q_ID msgQId, char *buffer, int nBytes, int timeout=NO_WAIT, int priority=0); 00035 00036 STATUS msgSQReceive(MSG_Q_ID msgQId, char *buffer, int maxNBytes, int timeout=WAIT_FOREVER); 00037 00038 00039 00040 00041 #endif
1.5.9