| 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 // |MOJO_READ_DATA_FLAG_DISCARD| and |MOJO_READ_DATA_FLAG_QUERY|. | 71 // |MOJO_READ_DATA_FLAG_DISCARD| and |MOJO_READ_DATA_FLAG_QUERY|. |
| 72 | 72 |
| 73 typedef uint32_t MojoReadDataFlags; | 73 typedef uint32_t MojoReadDataFlags; |
| 74 | 74 |
| 75 #define MOJO_READ_DATA_FLAG_NONE ((MojoReadDataFlags)0) | 75 #define MOJO_READ_DATA_FLAG_NONE ((MojoReadDataFlags)0) |
| 76 #define MOJO_READ_DATA_FLAG_ALL_OR_NONE ((MojoReadDataFlags)1 << 0) | 76 #define MOJO_READ_DATA_FLAG_ALL_OR_NONE ((MojoReadDataFlags)1 << 0) |
| 77 #define MOJO_READ_DATA_FLAG_DISCARD ((MojoReadDataFlags)1 << 1) | 77 #define MOJO_READ_DATA_FLAG_DISCARD ((MojoReadDataFlags)1 << 1) |
| 78 #define MOJO_READ_DATA_FLAG_QUERY ((MojoReadDataFlags)1 << 2) | 78 #define MOJO_READ_DATA_FLAG_QUERY ((MojoReadDataFlags)1 << 2) |
| 79 #define MOJO_READ_DATA_FLAG_PEEK ((MojoReadDataFlags)1 << 3) | 79 #define MOJO_READ_DATA_FLAG_PEEK ((MojoReadDataFlags)1 << 3) |
| 80 | 80 |
| 81 #ifdef __cplusplus | 81 MOJO_BEGIN_EXTERN_C |
| 82 extern "C" { | |
| 83 #endif | |
| 84 | 82 |
| 85 // Creates a data pipe, which is a unidirectional communication channel for | 83 // Creates a data pipe, which is a unidirectional communication channel for |
| 86 // unframed data, with the given options. Data is unframed, but must come as | 84 // unframed data, with the given options. Data is unframed, but must come as |
| 87 // (multiples of) discrete elements, of the size given in |options|. See | 85 // (multiples of) discrete elements, of the size given in |options|. See |
| 88 // |MojoCreateDataPipeOptions| for a description of the different options | 86 // |MojoCreateDataPipeOptions| for a description of the different options |
| 89 // available for data pipes. | 87 // available for data pipes. |
| 90 // | 88 // |
| 91 // |options| may be set to null for a data pipe with the default options (which | 89 // |options| may be set to null for a data pipe with the default options (which |
| 92 // will have an element size of one byte and have some system-dependent | 90 // will have an element size of one byte and have some system-dependent |
| 93 // capacity). | 91 // capacity). |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g., | 292 // |MOJO_RESULT_INVALID_ARGUMENT| if some argument was invalid (e.g., |
| 295 // |data_pipe_consumer_handle| is not a handle to a data pipe consumer or | 293 // |data_pipe_consumer_handle| is not a handle to a data pipe consumer or |
| 296 // |num_bytes_written| is greater than the maximum value provided by | 294 // |num_bytes_written| is greater than the maximum value provided by |
| 297 // |MojoBeginReadData()| or not a multiple of the element size). | 295 // |MojoBeginReadData()| or not a multiple of the element size). |
| 298 // |MOJO_RESULT_FAILED_PRECONDITION| if the data pipe consumer is not in a | 296 // |MOJO_RESULT_FAILED_PRECONDITION| if the data pipe consumer is not in a |
| 299 // two-phase read (e.g., |MojoBeginReadData()| was not called or | 297 // two-phase read (e.g., |MojoBeginReadData()| was not called or |
| 300 // |MojoEndReadData()| has already been called). | 298 // |MojoEndReadData()| has already been called). |
| 301 MojoResult MojoEndReadData(MojoHandle data_pipe_consumer_handle, | 299 MojoResult MojoEndReadData(MojoHandle data_pipe_consumer_handle, |
| 302 uint32_t num_bytes_read); | 300 uint32_t num_bytes_read); |
| 303 | 301 |
| 304 #ifdef __cplusplus | 302 MOJO_END_EXTERN_C |
| 305 } // extern "C" | |
| 306 #endif | |
| 307 | 303 |
| 308 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ | 304 #endif // MOJO_PUBLIC_C_SYSTEM_DATA_PIPE_H_ |
| OLD | NEW |