Changeset 26721 in vbox for trunk/include
- Timestamp:
- Feb 23, 2010 4:48:30 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 57968
- Location:
- trunk/include/iprt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/iprt/poll.h
r26703 r26721 41 41 */ 42 42 43 /** @name Poll events 44 * @{ */ 45 /** Readable without blocking. */ 46 #define RTPOLL_EVT_READ RT_BIT_32(0) 47 /** Writable without blocking. */ 48 #define RTPOLL_EVT_WRITE RT_BIT_32(1) 49 /** Error condition, hangup, exception or similar. */ 50 #define RTPOLL_EVT_ERROR RT_BIT_32(2) 51 /** @} */ 52 43 53 /** 44 * Polls on the specified poll set until timeout or one of them becomes ready. 54 * Polls on the specified poll set until an event occures on one of the handles 55 * or the timeout expires. 45 56 * 46 57 * @returns IPRT status code. … … 48 59 * @param cMillies Number of milliseconds to wait. Use 49 60 * RT_INDEFINITE_WAIT to wait for ever. 50 * @param pHandle Where to return the info for the readhandle.51 * @param pf Why Where to return details about why the handle is52 * considered ready.61 * @param pHandle Where to return the info about the handle. 62 * @param pfEvent Where to return details about the events that 63 * occured. 53 64 */ 54 RTDECL(int) RTPoll(RTPIPE hPipe, RTMSINTERVAL cMillies );65 RTDECL(int) RTPoll(RTPIPE hPipe, RTMSINTERVAL cMillies, uint32_t *pfEvent); 55 66 56 67 /** … … 61 72 * @param cHandles The number of initial members. 62 73 * @param paHandles Array with the initial members. 74 * @param pafEvents Which events to poll for. This is an array running 75 * parallel to @a paHandles. If NULL, we assume 76 * RTPOLL_EVT_READ and RTPOLL_EVT_ERROR. 63 77 */ 64 RTDECL(int) RTPoll CreateSet(PRTPOLLSET hPollSet, size_t cHandles, PCRTHANDLE paHandles);78 RTDECL(int) RTPollSetCreate(PRTPOLLSET hPollSet, size_t cHandles, PCRTHANDLE paHandles, uint32_t const *pafEvents); 65 79 66 80 /** … … 71 85 * ignored (VINF_SUCCESS). 72 86 */ 73 RTDECL(int) RTPoll DestroySet(RTPOLLSET hPollSet);87 RTDECL(int) RTPollSetDestroy(RTPOLLSET hPollSet); 74 88 75 89 /** 76 * Adds a handle to the poll set.90 * Adds a generic handle to the poll set. 77 91 * 78 92 * @returns IPRT status code 79 93 * @param hPollSet The poll set to modify. 80 94 * @param pHandle The handle to add. 95 * @param fEvents Which events to poll for. 81 96 */ 82 RTDECL(int) RTPoll AddToSet(RTPOLLSET hPollSet, PCRTHANDLE pHandle);97 RTDECL(int) RTPollSetAdd(RTPOLLSET hPollSet, PCRTHANDLE pHandle, uint32_t fEvents); 83 98 84 99 /** 85 * Removes a handle from the poll set.100 * Removes a generic handle from the poll set. 86 101 * 87 102 * @returns IPRT status code … … 89 104 * @param pHandle The handle to remove. 90 105 */ 91 RTDECL(int) RTPollRemoveFromSet(RTPOLLSET hPollSet, PCRTHANDLE pHandle); 106 RTDECL(int) RTPollSetRemove(RTPOLLSET hPollSet, PCRTHANDLE pHandle); 107 108 /** 109 * Adds a pipe handle to the set. 110 * 111 * @returns IPRT status code. 112 * @param hPollSet The poll set. 113 * @param hPipe The pipe handle. 114 * @param fEvents Which events to poll for. 115 * 116 * @todo Maybe we could figure out what to poll for depending on the kind of 117 * pipe we're dealing with. 118 */ 119 DECLINLINE(int) RTPollSetAddPipe(RTPOLLSET hPollSet, RTPIPE hPipe, uint32_t fEvents) 120 { 121 RTHANDLE Handle; 122 Handle.enmType = RTHANDLETYPE_PIPE; 123 Handle.u.hPipe = hPipe; 124 return RTPollSetAdd(hPollSet, &Handle, fEvents); 125 } 126 127 /** 128 * Adds a socket handle to the set. 129 * 130 * @returns IPRT status code. 131 * @param hPollSet The poll set. 132 * @param hSocket The socket handle. 133 * @param fEvents Which events to poll for. 134 */ 135 DECLINLINE(int) RTPollSetAddSocket(RTPOLLSET hPollSet, RTSOCKET hSocket, uint32_t fEvents) 136 { 137 RTHANDLE Handle; 138 Handle.enmType = RTHANDLETYPE_SOCKET; 139 Handle.u.hSocket = hSocket; 140 return RTPollSetAdd(hPollSet, &Handle, fEvents); 141 } 92 142 93 143 /** @} */ … … 97 147 #endif 98 148 99 100 -
trunk/include/iprt/types.h
r26702 r26721 1156 1156 1157 1157 /** Pipe handle. */ 1158 typedef R THCUINTPTRRTPIPE;1158 typedef R3R0PTRTYPE(struct RTPIPEINTERNAL *) RTPIPE; 1159 1159 /** Pointer to a pipe handle. */ 1160 1160 typedef RTPIPE *PRTPIPE; 1161 1161 /** Nil pipe handle. 1162 * @remarks This is not 0 because because of UNIX and OS/2 handle values. 1163 * Take care! */ 1162 * @remarks This is not 0 because of UNIX and OS/2 handle values. Take care! */ 1164 1163 #define NIL_RTPIPE (~(RTPIPE)0) 1165 1164
Note:
See TracChangeset
for help on using the changeset viewer.