📄 group__nanox__event.html
字号:
</td> <td><p>An infinite loop that dispatches events.<p>Calls the specified callback function whenever an event arrives or there is data to be read on a file descriptor registered with <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>. Never returns.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>fncb</em> </td><td>Pointer to the function to call when an event needs handling. </td></tr> </table></dl> </td> </tr></table><a name="a7" doxytag="nano-X.h::GrPeekEvent"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int GrPeekEvent </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> * </td> <td class="mdname1" valign="top" nowrap> <em>ep</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Gets a copy of the next event on the queue, without actually removing it from the queue.<p>Does not block - an event type of GR_EVENT_TYPE_NONE is given if the queue is empty.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>ep</em> </td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr> </table></dl><dl compact><dt><b>Returns:</b></dt><dd>1 if an event was returned, or 0 if the queue was empty. </dd></dl> </td> </tr></table><a name="a8" doxytag="nano-X.h::GrPeekWaitEvent"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrPeekWaitEvent </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="unionGR__EVENT.html">GR_EVENT</a> * </td> <td class="mdname1" valign="top" nowrap> <em>ep</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Wait until an event is available for a client, and then peek at it.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>ep</em> </td><td>Pointer to the <a class="el" href="unionGR__EVENT.html">GR_EVENT</a> structure to return the event in. </td></tr> </table></dl> </td> </tr></table><a name="a2" doxytag="nano-X.h::GrPrepareSelect"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrPrepareSelect </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int * </td> <td class="mdname" nowrap> <em>maxfd</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>void * </td> <td class="mdname" nowrap> <em>rfdset</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Prepare for the client to call select().<p>Asks the server to send the next event but does not wait around for it to arrive. Initializes the specified fd_set structure with the client/server socket descriptor and any previously registered external file descriptors. Also compares the current contents of maxfd, the client/server socket descriptor, and the previously registered external file descriptors, and returns the highest of them in maxfd.<p>Usually used in conjunction with <a class="el" href="group__nanox__event.html#a3">GrServiceSelect()</a>.<p>Note that in a multithreaded client, the application must ensure that no Nano-X calls are made between the calls to <a class="el" href="group__nanox__event.html#a2">GrPrepareSelect()</a> and <a class="el" href="group__nanox__event.html#a3">GrServiceSelect()</a>, else there will be race conditions.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>maxfd</em> </td><td>Pointer to a variable which the highest in use fd will be written to. Must contain a valid value on input - will only be overwritten if the new value is higher than the old value. </td></tr> <tr><td valign=top><em>rfdset</em> </td><td>Pointer to the file descriptor set structure to use. Must be valid on input - file descriptors will be added to this set without clearing the previous contents. </td></tr> </table></dl> </td> </tr></table><a name="a13" doxytag="nano-X.h::GrQueueLength"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int GrQueueLength </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the current length of the client side queue.<p><dl compact><dt><b>Returns:</b></dt><dd>The current length of the client side queue. </dd></dl> </td> </tr></table><a name="a0" doxytag="nano-X.h::GrRegisterInput"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrRegisterInput </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>fd</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Register an extra file descriptor to monitor in the main select() call.<p>An event will be returned when the fd has data waiting to be read if that event has been selected for.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>fd</em> </td><td>The file descriptor to monitor. </td></tr> </table></dl> </td> </tr></table><a name="a12" doxytag="nano-X.h::GrSelectEvents"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrSelectEvents </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">GR_WINDOW_ID </td> <td class="mdname" nowrap> <em>wid</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>GR_EVENT_MASK </td> <td class="mdname" nowrap> <em>eventmask</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Select the event types which should be returned for the specified window.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>wid</em> </td><td>The ID of the window to set the event mask of. </td></tr> <tr><td valign=top><em>eventmask</em> </td><td>A bit field specifying the desired event mask. </td></tr> </table></dl> </td> </tr></table><a name="a3" doxytag="nano-X.h::GrServiceSelect"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrServiceSelect </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">void * </td> <td class="mdname" nowrap> <em>rfdset</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>GR_FNCALLBACKEVENT </td> <td class="mdname" nowrap> <em>fncb</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Handles events after the client has done a select() call.<p>Calls the specified callback function is an event has arrived, or if there is data waiting on an external fd specified by <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>.<p>Used by <a class="el" href="group__nanox__event.html#a4">GrMainLoop()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>rfdset</em> </td><td>Pointer to the file descriptor set containing those file descriptors that are ready for reading. </td></tr> <tr><td valign=top><em>fncb</em> </td><td>Pointer to the function to call when an event needs handling. </td></tr> </table></dl> </td> </tr></table><a name="a1" doxytag="nano-X.h::GrUnregisterInput"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void GrUnregisterInput </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname1" valign="top" nowrap> <em>fd</em> </td> <td class="md" valign="top"> ) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Stop monitoring a file descriptor previously registered with <a class="el" href="group__nanox__event.html#a0">GrRegisterInput()</a>.<p><dl compact><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign=top><em>fd</em> </td><td>The file descriptor to stop monitoring. </td></tr> </table></dl> </td> </tr></table><hr><address style="align: right;"><small>Generated on Sun May 18 21:03:07 2003 for Microwindows Nano-X API by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 width=110 height=53></a>1.3 </small></address></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -