| 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/constants and functions specific to data pipes. | 5 // This file contains types/constants and functions specific to data pipes. |
| 6 // | 6 // |
| 7 // Note: This header should be compilable as C. | 7 // Note: This header should be compilable as C. |
| 8 | 8 |
| 9 #ifndef MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ | 9 #ifndef MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ |
| 10 #define MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ | 10 #define MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = 0; | 39 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE = 0; |
| 40 const MojoCreateDataPipeOptionsFlags | 40 const MojoCreateDataPipeOptionsFlags |
| 41 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0; | 41 MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD = 1 << 0; |
| 42 #else | 42 #else |
| 43 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE \ | 43 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE \ |
| 44 ((MojoCreateDataPipeOptionsFlags) 0) | 44 ((MojoCreateDataPipeOptionsFlags) 0) |
| 45 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD \ | 45 #define MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_MAY_DISCARD \ |
| 46 ((MojoCreateDataPipeOptionsFlags) 1 << 0) | 46 ((MojoCreateDataPipeOptionsFlags) 1 << 0) |
| 47 #endif | 47 #endif |
| 48 | 48 |
| 49 struct MojoCreateDataPipeOptions { | 49 struct MOJO_ALIGNAS(MOJO_ALIGNOF(int64_t)) MojoCreateDataPipeOptions { |
| 50 uint32_t struct_size; | 50 uint32_t struct_size; |
| 51 MojoCreateDataPipeOptionsFlags flags; | 51 MojoCreateDataPipeOptionsFlags flags; |
| 52 uint32_t element_num_bytes; | 52 uint32_t element_num_bytes; |
| 53 uint32_t capacity_num_bytes; | 53 uint32_t capacity_num_bytes; |
| 54 }; | 54 }; |
| 55 MOJO_COMPILE_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16, | 55 MOJO_COMPILE_ASSERT(sizeof(MojoCreateDataPipeOptions) == 16, |
| 56 MojoCreateDataPipeOptions_has_wrong_size); | 56 MojoCreateDataPipeOptions_has_wrong_size); |
| 57 | 57 |
| 58 // |MojoWriteDataFlags|: Used to specify different modes to |MojoWriteData()| | 58 // |MojoWriteDataFlags|: Used to specify different modes to |MojoWriteData()| |
| 59 // and |MojoBeginWriteData()|. | 59 // and |MojoBeginWriteData()|. |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 356 // |MojoEndReadData()| has already been called). | 356 // |MojoEndReadData()| has already been called). |
| 357 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData( | 357 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData( |
| 358 MojoHandle data_pipe_consumer_handle, | 358 MojoHandle data_pipe_consumer_handle, |
| 359 uint32_t num_bytes_read); | 359 uint32_t num_bytes_read); |
| 360 | 360 |
| 361 #ifdef __cplusplus | 361 #ifdef __cplusplus |
| 362 } // extern "C" | 362 } // extern "C" |
| 363 #endif | 363 #endif |
| 364 | 364 |
| 365 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ | 365 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ |
| OLD | NEW |