| 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 # distutils: language = c++ | 5 # distutils: language = c++ |
| 6 | 6 |
| 7 from cpython.buffer cimport PyBUF_CONTIG | 7 from cpython.buffer cimport PyBUF_CONTIG |
| 8 from cpython.buffer cimport PyBUF_CONTIG_RO | 8 from cpython.buffer cimport PyBUF_CONTIG_RO |
| 9 from cpython.buffer cimport Py_buffer | 9 from cpython.buffer cimport Py_buffer |
| 10 from cpython.buffer cimport PyBuffer_FillInfo | 10 from cpython.buffer cimport PyBuffer_FillInfo |
| 11 from cpython.buffer cimport PyBuffer_Release | 11 from cpython.buffer cimport PyBuffer_Release |
| 12 from cpython.buffer cimport PyObject_GetBuffer | 12 from cpython.buffer cimport PyObject_GetBuffer |
| 13 from cpython.mem cimport PyMem_Malloc, PyMem_Free | 13 from cpython.mem cimport PyMem_Malloc, PyMem_Free |
| 14 from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t | 14 from libc.stdint cimport int32_t, int64_t, uint32_t, uint64_t, uintptr_t |
| 15 | 15 |
| 16 cdef extern from "mojo/public/c/system/handle.h" nogil: | |
| 17 ctypedef uint32_t MojoHandle | |
| 18 const MojoHandle MOJO_HANDLE_INVALID | |
| 19 | |
| 20 ctypedef uint32_t MojoHandleSignals | |
| 21 const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE | |
| 22 const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE | |
| 23 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE | |
| 24 const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED | |
| 25 | |
| 26 cdef struct MojoHandleSignalsState: | |
| 27 MojoHandleSignals satisfied_signals | |
| 28 MojoHandleSignals satisfiable_signals | |
| 29 | |
| 30 cdef extern from "mojo/public/c/system/result.h" nogil: | 16 cdef extern from "mojo/public/c/system/result.h" nogil: |
| 31 ctypedef int32_t MojoResult | 17 ctypedef int32_t MojoResult |
| 32 const MojoResult MOJO_RESULT_OK | 18 const MojoResult MOJO_RESULT_OK |
| 33 const MojoResult MOJO_RESULT_CANCELLED | 19 const MojoResult MOJO_RESULT_CANCELLED |
| 34 const MojoResult MOJO_RESULT_UNKNOWN | 20 const MojoResult MOJO_RESULT_UNKNOWN |
| 35 const MojoResult MOJO_RESULT_INVALID_ARGUMENT | 21 const MojoResult MOJO_RESULT_INVALID_ARGUMENT |
| 36 const MojoResult MOJO_RESULT_DEADLINE_EXCEEDED | 22 const MojoResult MOJO_RESULT_DEADLINE_EXCEEDED |
| 37 const MojoResult MOJO_RESULT_NOT_FOUND | 23 const MojoResult MOJO_RESULT_NOT_FOUND |
| 38 const MojoResult MOJO_RESULT_ALREADY_EXISTS | 24 const MojoResult MOJO_RESULT_ALREADY_EXISTS |
| 39 const MojoResult MOJO_RESULT_PERMISSION_DENIED | 25 const MojoResult MOJO_RESULT_PERMISSION_DENIED |
| 40 const MojoResult MOJO_RESULT_RESOURCE_EXHAUSTED | 26 const MojoResult MOJO_RESULT_RESOURCE_EXHAUSTED |
| 41 const MojoResult MOJO_RESULT_FAILED_PRECONDITION | 27 const MojoResult MOJO_RESULT_FAILED_PRECONDITION |
| 42 const MojoResult MOJO_RESULT_ABORTED | 28 const MojoResult MOJO_RESULT_ABORTED |
| 43 const MojoResult MOJO_RESULT_OUT_OF_RANGE | 29 const MojoResult MOJO_RESULT_OUT_OF_RANGE |
| 44 const MojoResult MOJO_RESULT_UNIMPLEMENTED | 30 const MojoResult MOJO_RESULT_UNIMPLEMENTED |
| 45 const MojoResult MOJO_RESULT_INTERNAL | 31 const MojoResult MOJO_RESULT_INTERNAL |
| 46 const MojoResult MOJO_RESULT_UNAVAILABLE | 32 const MojoResult MOJO_RESULT_UNAVAILABLE |
| 47 const MojoResult MOJO_RESULT_DATA_LOSS | 33 const MojoResult MOJO_RESULT_DATA_LOSS |
| 48 const MojoResult MOJO_RESULT_BUSY | 34 const MojoResult MOJO_RESULT_BUSY |
| 49 const MojoResult MOJO_RESULT_SHOULD_WAIT | 35 const MojoResult MOJO_RESULT_SHOULD_WAIT |
| 50 | 36 |
| 51 cdef extern from "mojo/public/c/system/types.h" nogil: | 37 cdef extern from "mojo/public/c/system/handle.h" nogil: |
| 38 ctypedef uint32_t MojoHandle |
| 39 const MojoHandle MOJO_HANDLE_INVALID |
| 40 |
| 41 ctypedef uint32_t MojoHandleSignals |
| 42 const MojoHandleSignals MOJO_HANDLE_SIGNAL_NONE |
| 43 const MojoHandleSignals MOJO_HANDLE_SIGNAL_READABLE |
| 44 const MojoHandleSignals MOJO_HANDLE_SIGNAL_WRITABLE |
| 45 const MojoHandleSignals MOJO_HANDLE_SIGNAL_PEER_CLOSED |
| 46 |
| 47 cdef struct MojoHandleSignalsState: |
| 48 MojoHandleSignals satisfied_signals |
| 49 MojoHandleSignals satisfiable_signals |
| 50 |
| 51 MojoResult MojoClose(MojoHandle handle) |
| 52 |
| 53 cdef extern from "mojo/public/c/system/time.h" nogil: |
| 52 ctypedef int64_t MojoTimeTicks | 54 ctypedef int64_t MojoTimeTicks |
| 53 | 55 |
| 54 ctypedef uint64_t MojoDeadline | 56 ctypedef uint64_t MojoDeadline |
| 55 const MojoDeadline MOJO_DEADLINE_INDEFINITE | 57 const MojoDeadline MOJO_DEADLINE_INDEFINITE |
| 56 | 58 |
| 57 cdef extern from "mojo/public/c/system/functions.h" nogil: | |
| 58 MojoTimeTicks MojoGetTimeTicksNow() | 59 MojoTimeTicks MojoGetTimeTicksNow() |
| 59 MojoResult MojoClose(MojoHandle handle) | 60 |
| 61 cdef extern from "mojo/public/c/system/wait.h" nogil: |
| 60 MojoResult MojoWait "MojoWait"(MojoHandle handle, | 62 MojoResult MojoWait "MojoWait"(MojoHandle handle, |
| 61 MojoHandleSignals signals, | 63 MojoHandleSignals signals, |
| 62 MojoDeadline deadline, | 64 MojoDeadline deadline, |
| 63 MojoHandleSignalsState* signals_state) | 65 MojoHandleSignalsState* signals_state) |
| 64 MojoResult MojoWaitMany "MojoWaitMany"(const MojoHandle* handles, | 66 MojoResult MojoWaitMany "MojoWaitMany"(const MojoHandle* handles, |
| 65 const MojoHandleSignals* signals, | 67 const MojoHandleSignals* signals, |
| 66 uint32_t num_handles, | 68 uint32_t num_handles, |
| 67 MojoDeadline deadline, | 69 MojoDeadline deadline, |
| 68 uint32_t* result_index, | 70 uint32_t* result_index, |
| 69 MojoHandleSignalsState* signals_states) | 71 MojoHandleSignalsState* signals_states) |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 const MojoDuplicateBufferHandleOptions* options, | 194 const MojoDuplicateBufferHandleOptions* options, |
| 193 MojoHandle* new_buffer_handle) | 195 MojoHandle* new_buffer_handle) |
| 194 | 196 |
| 195 MojoResult MojoMapBuffer(MojoHandle buffer_handle, | 197 MojoResult MojoMapBuffer(MojoHandle buffer_handle, |
| 196 uint64_t offset, | 198 uint64_t offset, |
| 197 uint64_t num_bytes, | 199 uint64_t num_bytes, |
| 198 void** buffer, | 200 void** buffer, |
| 199 MojoMapBufferFlags flags) | 201 MojoMapBufferFlags flags) |
| 200 | 202 |
| 201 MojoResult MojoUnmapBuffer(void* buffer) | 203 MojoResult MojoUnmapBuffer(void* buffer) |
| OLD | NEW |