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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 // Note: This struct is not extensible (and only has 32-bit quantities), so it's | 182 // Note: This struct is not extensible (and only has 32-bit quantities), so it's |
183 // 32-bit-aligned. | 183 // 32-bit-aligned. |
184 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); | 184 MOJO_STATIC_ASSERT(MOJO_ALIGNOF(int32_t) == 4, "int32_t has weird alignment"); |
185 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { | 185 struct MOJO_ALIGNAS(4) MojoHandleSignalsState { |
186 MojoHandleSignals satisfied_signals; | 186 MojoHandleSignals satisfied_signals; |
187 MojoHandleSignals satisfiable_signals; | 187 MojoHandleSignals satisfiable_signals; |
188 }; | 188 }; |
189 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, | 189 MOJO_STATIC_ASSERT(sizeof(MojoHandleSignalsState) == 8, |
190 "MojoHandleSignalsState has wrong size"); | 190 "MojoHandleSignalsState has wrong size"); |
191 | 191 |
192 // |MojoWatchNotificationFlags|: Passed to a callback invoked as a result of | 192 // |MojoWatcherNotificationFlags|: Passed to a callback invoked by a watcher |
193 // signals being raised on a handle watched by |MojoWatch()|. May take the | 193 // when some observed signals are raised or a watched handle is closed. May take |
194 // following values: | 194 // on any combination of the following values: |
195 // |MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being invoked | 195 // |
196 // as a result of a system-level event rather than a direct API call from | 196 // |MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM| - The callback is being |
197 // user code. This may be used as an indication that user code is safe to | 197 // invoked as a result of a system-level event rather than a direct API |
198 // call without fear of reentry. | 198 // call from user code. This may be used as an indication that user code |
| 199 // is safe to call without fear of reentry. |
199 | 200 |
200 typedef uint32_t MojoWatchNotificationFlags; | 201 typedef uint32_t MojoWatcherNotificationFlags; |
201 | 202 |
202 #ifdef __cplusplus | 203 #ifdef __cplusplus |
203 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_NONE = 0; | 204 const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_NONE = 0; |
204 const MojoWatchNotificationFlags MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM = | 205 const MojoWatcherNotificationFlags MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM = |
205 1 << 0; | 206 1 << 0; |
206 #else | 207 #else |
207 #define MOJO_WATCH_NOTIFICATION_FLAG_NONE ((MojoWatchNotificationFlags)0) | 208 #define MOJO_WATCHER_NOTIFICATION_FLAG_NONE ((MojoWatcherNotificationFlags)0) |
208 #define MOJO_WATCH_NOTIFICATION_FLAG_FROM_SYSTEM \ | 209 #define MOJO_WATCHER_NOTIFICATION_FLAG_FROM_SYSTEM \ |
209 ((MojoWatchNotificationFlags)1 << 0); | 210 ((MojoWatcherNotificationFlags)1 << 0); |
210 #endif | 211 #endif |
211 | 212 |
212 // |MojoPropertyType|: Property types that can be passed to |MojoGetProperty()| | 213 // |MojoPropertyType|: Property types that can be passed to |MojoGetProperty()| |
213 // to retrieve system properties. May take the following values: | 214 // to retrieve system properties. May take the following values: |
214 // |MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED| - Whether making synchronous calls | 215 // |MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED| - Whether making synchronous calls |
215 // (i.e., blocking to wait for a response to an outbound message) is | 216 // (i.e., blocking to wait for a response to an outbound message) is |
216 // allowed. The property value is of boolean type. If the value is true, | 217 // allowed. The property value is of boolean type. If the value is true, |
217 // users should refrain from making sync calls. | 218 // users should refrain from making sync calls. |
218 typedef uint32_t MojoPropertyType; | 219 typedef uint32_t MojoPropertyType; |
219 | 220 |
220 #ifdef __cplusplus | 221 #ifdef __cplusplus |
221 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; | 222 const MojoPropertyType MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED = 0; |
222 #else | 223 #else |
223 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) | 224 #define MOJO_PROPERTY_TYPE_SYNC_CALL_ALLOWED ((MojoPropertyType)0) |
224 #endif | 225 #endif |
225 | 226 |
226 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ | 227 #endif // MOJO_PUBLIC_C_SYSTEM_TYPES_H_ |
OLD | NEW |