OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef MOJO_PUBLIC_SYSTEM_CORE_H_ | 5 #ifndef MOJO_PUBLIC_SYSTEM_CORE_H_ |
6 #define MOJO_PUBLIC_SYSTEM_CORE_H_ | 6 #define MOJO_PUBLIC_SYSTEM_CORE_H_ |
7 | 7 |
8 // Note: This header should be compilable as C. | 8 // Note: This header should be compilable as C. |
9 | 9 |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // |handle[i]| will ever satisfy any of its flags |flags[i]|. | 341 // |handle[i]| will ever satisfy any of its flags |flags[i]|. |
342 MOJO_SYSTEM_EXPORT MojoResult MojoWaitMany(const MojoHandle* handles, | 342 MOJO_SYSTEM_EXPORT MojoResult MojoWaitMany(const MojoHandle* handles, |
343 const MojoWaitFlags* flags, | 343 const MojoWaitFlags* flags, |
344 uint32_t num_handles, | 344 uint32_t num_handles, |
345 MojoDeadline deadline); | 345 MojoDeadline deadline); |
346 | 346 |
347 // Message pipe: | 347 // Message pipe: |
348 | 348 |
349 // Creates a message pipe, which is a bidirectional communication channel for | 349 // Creates a message pipe, which is a bidirectional communication channel for |
350 // framed data (i.e., messages). Messages can contain plain data and/or Mojo | 350 // framed data (i.e., messages). Messages can contain plain data and/or Mojo |
351 // handles. On success, |*message_pipe_handle_0| and |*message_pipe_1| are set | 351 // handles. On success, |*message_pipe_handle0| and |*message_pipe_handle1| are |
352 // to handles for the two endpoints (ports) for the message pipe. | 352 // set to handles for the two endpoints (ports) for the message pipe. |
353 // | 353 // |
354 // Returns: | 354 // Returns: |
355 // |MOJO_RESULT_OK| on success. | 355 // |MOJO_RESULT_OK| on success. |
356 // |MOJO_RESULT_INVALID_ARGUMENT| if |message_pipe_handle_0| and/or | 356 // |MOJO_RESULT_INVALID_ARGUMENT| if |message_pipe_handle0| and/or |
357 // |message_pipe_handle_1| do not appear to be valid pointers. | 357 // |message_pipe_handle1| do not appear to be valid pointers. |
358 // |MOJO_RESULT_RESOURCE_EXHAUSTED| if a process/system/quota/etc. limit has | 358 // |MOJO_RESULT_RESOURCE_EXHAUSTED| if a process/system/quota/etc. limit has |
359 // been reached. | 359 // been reached. |
360 // | 360 // |
361 // TODO(vtl): Add an options struct pointer argument. | 361 // TODO(vtl): Add an options struct pointer argument. |
362 MOJO_SYSTEM_EXPORT MojoResult MojoCreateMessagePipe( | 362 MOJO_SYSTEM_EXPORT MojoResult MojoCreateMessagePipe( |
363 MojoHandle* message_pipe_handle_0, | 363 MojoHandle* message_pipe_handle0, |
364 MojoHandle* message_pipe_handle_1); | 364 MojoHandle* message_pipe_handle1); |
365 | 365 |
366 // Writes a message to the message pipe endpoint given by |message_pipe_handle|, | 366 // Writes a message to the message pipe endpoint given by |message_pipe_handle|, |
367 // with message data specified by |bytes| of size |num_bytes| and attached | 367 // with message data specified by |bytes| of size |num_bytes| and attached |
368 // handles specified by |handles| of count |num_handles|, and options specified | 368 // handles specified by |handles| of count |num_handles|, and options specified |
369 // by |flags|. If there is no message data, |bytes| may be null, in which case | 369 // by |flags|. If there is no message data, |bytes| may be null, in which case |
370 // |num_bytes| must be zero. If there are no attached handles, |handles| may be | 370 // |num_bytes| must be zero. If there are no attached handles, |handles| may be |
371 // null, in which case |num_handles| must be zero. | 371 // null, in which case |num_handles| must be zero. |
372 // | 372 // |
373 // If handles are attached, on success the handles will no longer be valid (the | 373 // If handles are attached, on success the handles will no longer be valid (the |
374 // receiver will receive equivalent, but logically different, handles). Handles | 374 // receiver will receive equivalent, but logically different, handles). Handles |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 // |MojoEndReadData()| has already been called). | 689 // |MojoEndReadData()| has already been called). |
690 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData( | 690 MOJO_SYSTEM_EXPORT MojoResult MojoEndReadData( |
691 MojoHandle data_pipe_consumer_handle, | 691 MojoHandle data_pipe_consumer_handle, |
692 uint32_t num_bytes_read); | 692 uint32_t num_bytes_read); |
693 | 693 |
694 #ifdef __cplusplus | 694 #ifdef __cplusplus |
695 } // extern "C" | 695 } // extern "C" |
696 #endif | 696 #endif |
697 | 697 |
698 #endif // MOJO_PUBLIC_SYSTEM_CORE_H_ | 698 #endif // MOJO_PUBLIC_SYSTEM_CORE_H_ |
OLD | NEW |