OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains types and constants/macros common to different Mojo system | 5 // This file contains types and constants/macros common to different Mojo system |
6 // APIs. | 6 // APIs. |
7 // | 7 // |
8 // Note: This header should be compilable as C. | 8 // Note: This header should be compilable as C. |
9 | 9 |
10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 10 #ifndef MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 #endif | 142 #endif |
143 | 143 |
144 // |MojoHandleSignals|: Used to specify signals that can be waited on for a | 144 // |MojoHandleSignals|: Used to specify signals that can be waited on for a |
145 // handle (and which can be triggered), e.g., the ability to read or write to | 145 // handle (and which can be triggered), e.g., the ability to read or write to |
146 // the handle. | 146 // the handle. |
147 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return | 147 // |MOJO_HANDLE_SIGNAL_NONE| - No flags. |MojoWait()|, etc. will return |
148 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this. | 148 // |MOJO_RESULT_FAILED_PRECONDITION| if you attempt to wait on this. |
149 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle. | 149 // |MOJO_HANDLE_SIGNAL_READABLE| - Can read (e.g., a message) from the handle. |
150 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle. | 150 // |MOJO_HANDLE_SIGNAL_WRITABLE| - Can write (e.g., a message) to the handle. |
151 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed. | 151 // |MOJO_HANDLE_SIGNAL_PEER_CLOSED| - The peer handle is closed. |
| 152 // |MOJO_HANDLE_SIGNAL_NEW_DATA_READABLE| - Can read data from a data pipe |
| 153 // consumer handle (implying MOJO_HANDLE_SIGNAL_READABLE is also set), |
| 154 // AND there is some nonzero quantity of new data available on the pipe |
| 155 // since the last |MojoReadData()| or |MojoBeginReadData()| call on the |
| 156 // handle. |
152 | 157 |
153 typedef uint32_t MojoHandleSignals; | 158 typedef uint32_t MojoHandleSignals; |
154 | 159 |
155 #ifdef __cplusplus | 160 #ifdef __cplusplus |
156 const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE = 0; | 161 const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE = 0; |
157 const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE = 1 << 0; | 162 const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE = 1 << 0; |
158 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1; | 163 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE = 1 << 1; |
159 const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED = 1 << 2; | 164 const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED = 1 << 2; |
| 165 const MojoHandleSignals MOJO_HANDLE_SIGNAL_NEW_DATA_READABLE = 1 << 3; |
160 #else | 166 #else |
161 #define MOJO_HANDLE_SIGNAL_NONE ((MojoHandleSignals)0) | 167 #define MOJO_HANDLE_SIGNAL_NONE ((MojoHandleSignals)0) |
162 #define MOJO_HANDLE_SIGNAL_READABLE ((MojoHandleSignals)1 << 0) | 168 #define MOJO_HANDLE_SIGNAL_READABLE ((MojoHandleSignals)1 << 0) |
163 #define MOJO_HANDLE_SIGNAL_WRITABLE ((MojoHandleSignals)1 << 1) | 169 #define MOJO_HANDLE_SIGNAL_WRITABLE ((MojoHandleSignals)1 << 1) |
164 #define MOJO_HANDLE_SIGNAL_PEER_CLOSED ((MojoHandleSignals)1 << 2) | 170 #define MOJO_HANDLE_SIGNAL_PEER_CLOSED ((MojoHandleSignals)1 << 2) |
| 171 #define MOJO_HANDLE_SIGNAL_NEW_DATA_READABLE ((MojoHandleSignals)1 << 3); |
165 #endif | 172 #endif |
166 | 173 |
167 // |MojoHandleSignalsState|: Returned by wait functions to indicate the | 174 // |MojoHandleSignalsState|: Returned by wait functions to indicate the |
168 // signaling state of handles. Members are as follows: | 175 // signaling state of handles. Members are as follows: |
169 // - |satisfied signals|: Bitmask of signals that were satisfied at some time | 176 // - |satisfied signals|: Bitmask of signals that were satisfied at some time |
170 // before the call returned. | 177 // before the call returned. |
171 // - |satisfiable signals|: These are the signals that are possible to | 178 // - |satisfiable signals|: These are the signals that are possible to |
172 // satisfy. For example, if the return value was | 179 // satisfy. For example, if the return value was |
173 // |MOJO_RESULT_FAILED_PRECONDITION|, you can use this field to | 180 // |MOJO_RESULT_FAILED_PRECONDITION|, you can use this field to |
174 // determine which, if any, of the signals can still be satisfied. | 181 // determine which, if any, of the signals can still be satisfied. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // users should refrain from making sync calls. | 217 // users should refrain from making sync calls. |
211 typedef uint32_t MojoPropertyType; | 218 typedef uint32_t MojoPropertyType; |
212 | 219 |
213 #ifdef __cplusplus | 220 #ifdef __cplusplus |
214 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; | 221 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; |
215 #else | 222 #else |
216 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) | 223 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) |
217 #endif | 224 #endif |
218 | 225 |
219 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 226 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
OLD | NEW |