Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/msgqlib_8h_source.html
Week 28 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 1897 and Bug 1522.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>TB9.2 Example Applications: examples/PIPS/opencmessagequeuelibraryex/engine/inc/msgqlib.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.2 -->
<h1>examples/PIPS/opencmessagequeuelibraryex/engine/inc/msgqlib.h</h1><a href="msgqlib_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
<a name="l00010"></a>00010 <span class="preprocessor">#ifndef MSGQLIB_H</span>
<a name="l00011"></a>00011 <span class="preprocessor"></span><span class="preprocessor">#define MSGQLIB_H</span>
<a name="l00012"></a>00012 <span class="preprocessor"></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include <_ansi.h></span>
<a name="l00014"></a>00014
<a name="l00015"></a>00015 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {
<a name="l00017"></a>00017 <span class="preprocessor">#endif</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a>00019 <span class="comment">/* MsgQLib sizes */</span>
<a name="l00020"></a>00020 <span class="preprocessor">#define MAX_MSG_LEN 2048 </span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00022"></a>00022 <span class="comment">/* hash table parameters - table size must be a prime number */</span>
<a name="l00023"></a>00023 <span class="preprocessor">#define MSGQ_TBL_SZ 101</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span>
<a name="l00025"></a>00025 <span class="comment">/* message send states */</span>
<a name="l00026"></a>00026 <span class="preprocessor">#define MSG_Q_READY 0</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">#define MSG_Q_CLEANING 1</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00029"></a>00029
<a name="l00030"></a>00030 <span class="preprocessor">#define NO_WAIT 0</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#define WAIT_FOREVER 0xFFFF</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span>
<a name="l00033"></a>00033 <span class="preprocessor">#ifndef NULL</span>
<a name="l00034"></a>00034 <span class="preprocessor"></span><span class="preprocessor">#define NULL 0</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="preprocessor">#endif </span><span class="comment">/* NULL */</span>
<a name="l00036"></a>00036
<a name="l00037"></a>00037 <span class="comment">/* errors */</span>
<a name="l00038"></a>00038 <span class="preprocessor">#define KMsgQLibErr 0x100</span>
<a name="l00039"></a>00039 <span class="preprocessor"></span><span class="preprocessor">#define KMsgQLibNoMemoryErr (KMsgQLibErr | 1) </span><span class="comment">/* out of memory */</span>
<a name="l00040"></a>00040 <span class="preprocessor">#define KMsgQLibQIdErr (KMsgQLibErr | 2) </span><span class="comment">/* queue already in use or invalid */</span>
<a name="l00041"></a>00041 <span class="preprocessor">#define KMsgQLibParamErr (KMsgQLibErr | 3) </span><span class="comment">/* illegal parm(s)/val(s) */</span>
<a name="l00042"></a>00042 <span class="preprocessor">#define KMsgQLibQFlushErr (KMsgQLibErr | 4) </span><span class="comment">/* queue being flushed */</span>
<a name="l00043"></a>00043 <span class="preprocessor">#define KMsgQLibQShortErr (KMsgQLibErr | 5) </span><span class="comment">/* internal error: inconsistency between #of msgs*/</span>
<a name="l00044"></a>00044
<a name="l00045"></a>00045 <span class="preprocessor">#define MSG_Q_FIFO 1</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#define MSG_Q_PRIORITY 2</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#define MSG_PRI_NORMAL 3</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span><span class="preprocessor">#define MSG_PRI_URGENT 4</span>
<a name="l00049"></a>00049 <span class="preprocessor"></span><span class="preprocessor">#define SEM_Q_FIFO 5</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="preprocessor">#define SEM_Q_PRIORITY 6</span>
<a name="l00051"></a>00051 <span class="preprocessor"></span>
<a name="l00052"></a>00052 <span class="preprocessor">#define OK 0</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span><span class="preprocessor">#define ERROR -1 </span>
<a name="l00054"></a>00054 <span class="preprocessor"></span>
<a name="l00055"></a>00055 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> ULONG ;
<a name="l00056"></a>00056 <span class="keyword">typedef</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> ushort_t;
<a name="l00057"></a>00057
<a name="l00071"></a>00071 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#acc58bf2bd8d3b904069d8d604ccea5b1">MsgQCreate</a> (ULONG qName, ULONG maxMsgs, ULONG qOptions, <span class="keywordtype">int</span>* err);
<a name="l00072"></a>00072
<a name="l00082"></a>00082 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#ae9435d91016cacef90a4d92db16a6fe1">MsgQDelete</a> (ULONG qName, <span class="keywordtype">int</span>* err);
<a name="l00083"></a>00083
<a name="l00098"></a>00098 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#a5272782967b922604e4f47e8bc67a468">MsgQSend</a> (ULONG qName, <span class="keywordtype">char</span>* msg, ULONG nBytes, ULONG priority, <span class="keywordtype">int</span> timeout, <span class="keywordtype">int</span>* err);
<a name="l00099"></a>00099
<a name="l00113"></a>00113 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#a92645de66865355158589ff1dd7bc28d">MsgQReceive</a> (ULONG qName, <span class="keywordtype">char</span>* msg, ULONG maxNBytes, <span class="keywordtype">int</span> timeout, <span class="keywordtype">int</span>* err);
<a name="l00114"></a>00114
<a name="l00124"></a>00124 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#a6539cca974e31b9571caae1a93576b21">MsgQCheck</a> (ULONG qName, <span class="keywordtype">int</span>* err);
<a name="l00125"></a>00125
<a name="l00134"></a>00134 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#ac3714b7e3c9e3eafb7375ca1fe5d5ad7">MsgQMaxCheck</a> (ULONG qName, <span class="keywordtype">int</span>* err);
<a name="l00135"></a>00135
<a name="l00145"></a>00145 IMPORT_C <span class="keywordtype">int</span> <a class="code" href="msgqlib_8h.html#af100b3206a8771a0b599a1ba5a4c8cb8">MsgQClean</a> (ULONG qName, <span class="keywordtype">int</span>* err);
<a name="l00146"></a>00146
<a name="l00147"></a>00147 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span>}
<a name="l00149"></a>00149 <span class="preprocessor">#endif</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span>
<a name="l00151"></a>00151 <span class="preprocessor">#endif </span><span class="comment">/* MSGQLIB_H */</span>
</pre></div></div>
<hr size="1"/><address style="text-align: right;"><small>Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2 </small></address>
</body>
</html>