00001 00010 #ifndef MSGQLIB_H 00011 #define MSGQLIB_H 00012 00013 #include <_ansi.h> 00014 00015 #ifdef __cplusplus 00016 extern "C" { 00017 #endif 00018 00019 /* MsgQLib sizes */ 00020 #define MAX_MSG_LEN 2048 00021 00022 /* hash table parameters - table size must be a prime number */ 00023 #define MSGQ_TBL_SZ 101 00024 00025 /* message send states */ 00026 #define MSG_Q_READY 0 00027 #define MSG_Q_CLEANING 1 00028 00029 00030 #define NO_WAIT 0 00031 #define WAIT_FOREVER 0xFFFF 00032 00033 #ifndef NULL 00034 #define NULL 0 00035 #endif /* NULL */ 00036 00037 /* errors */ 00038 #define KMsgQLibErr 0x100 00039 #define KMsgQLibNoMemoryErr (KMsgQLibErr | 1) /* out of memory */ 00040 #define KMsgQLibQIdErr (KMsgQLibErr | 2) /* queue already in use or invalid */ 00041 #define KMsgQLibParamErr (KMsgQLibErr | 3) /* illegal parm(s)/val(s) */ 00042 #define KMsgQLibQFlushErr (KMsgQLibErr | 4) /* queue being flushed */ 00043 #define KMsgQLibQShortErr (KMsgQLibErr | 5) /* internal error: inconsistency between #of msgs*/ 00044 00045 #define MSG_Q_FIFO 1 00046 #define MSG_Q_PRIORITY 2 00047 #define MSG_PRI_NORMAL 3 00048 #define MSG_PRI_URGENT 4 00049 #define SEM_Q_FIFO 5 00050 #define SEM_Q_PRIORITY 6 00051 00052 #define OK 0 00053 #define ERROR -1 00054 00055 typedef unsigned long ULONG ; 00056 typedef unsigned short ushort_t; 00057 00071 IMPORT_C int MsgQCreate (ULONG qName, ULONG maxMsgs, ULONG qOptions, int* err); 00072 00082 IMPORT_C int MsgQDelete (ULONG qName, int* err); 00083 00098 IMPORT_C int MsgQSend (ULONG qName, char* msg, ULONG nBytes, ULONG priority, int timeout, int* err); 00099 00113 IMPORT_C int MsgQReceive (ULONG qName, char* msg, ULONG maxNBytes, int timeout, int* err); 00114 00124 IMPORT_C int MsgQCheck (ULONG qName, int* err); 00125 00134 IMPORT_C int MsgQMaxCheck (ULONG qName, int* err); 00135 00145 IMPORT_C int MsgQClean (ULONG qName, int* err); 00146 00147 #ifdef __cplusplus 00148 } 00149 #endif 00150 00151 #endif /* MSGQLIB_H */
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.