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 # pylint: disable=F0401 | 5 # pylint: disable=F0401 |
6 | 6 |
7 import interface_dsl | 7 import interface_dsl |
8 | 8 |
9 def MakeInterface(): | 9 def MakeInterface(): |
10 mojo = interface_dsl.Interface() | 10 mojo = interface_dsl.Interface() |
11 | 11 |
12 f = mojo.Func('MojoCreateSharedBuffer', 'MojoResult') | 12 f = mojo.Func('MojoCreateSharedBuffer', 'MojoResult') |
13 f.Param('options').InStruct('MojoCreateSharedBufferOptions').Optional() | 13 p = f.Param('options') |
| 14 p.InExtensibleStruct('MojoCreateSharedBufferOptions').Optional() |
14 f.Param('num_bytes').In('uint64_t') | 15 f.Param('num_bytes').In('uint64_t') |
15 f.Param('shared_buffer_handle').Out('MojoHandle') | 16 f.Param('shared_buffer_handle').Out('MojoHandle') |
16 | 17 |
17 f = mojo.Func('MojoDuplicateBufferHandle', 'MojoResult') | 18 f = mojo.Func('MojoDuplicateBufferHandle', 'MojoResult') |
18 f.Param('buffer_handle').In('MojoHandle') | 19 f.Param('buffer_handle').In('MojoHandle') |
19 f.Param('options').InStruct('MojoDuplicateBufferHandleOptions').Optional() | 20 p = f.Param('options') |
| 21 p.InExtensibleStruct('MojoDuplicateBufferHandleOptions').Optional() |
20 f.Param('new_buffer_handle').Out('MojoHandle') | 22 f.Param('new_buffer_handle').Out('MojoHandle') |
21 | 23 |
22 f = mojo.Func('MojoMapBuffer', 'MojoResult') | 24 f = mojo.Func('MojoMapBuffer', 'MojoResult') |
23 f.Param('buffer_handle').In('MojoHandle') | 25 f.Param('buffer_handle').In('MojoHandle') |
24 f.Param('offset').In('uint64_t') | 26 f.Param('offset').In('uint64_t') |
25 f.Param('num_bytes').In('uint64_t') | 27 f.Param('num_bytes').In('uint64_t') |
26 f.Param('buffer').Out('void*') | 28 f.Param('buffer').Out('void*') |
27 f.Param('flags').In('MojoMapBufferFlags') | 29 f.Param('flags').In('MojoMapBufferFlags') |
28 | 30 |
29 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') | 31 f = mojo.Func('MojoUnmapBuffer', 'MojoResult') |
30 f.Param('buffer').In('void*') | 32 f.Param('buffer').In('void*') |
31 | 33 |
32 f = mojo.Func('MojoCreateDataPipe', 'MojoResult') | 34 f = mojo.Func('MojoCreateDataPipe', 'MojoResult') |
33 f.Param('options').InStruct('MojoCreateDataPipeOptions').Optional() | 35 p = f.Param('options') |
| 36 p.InExtensibleStruct('MojoCreateDataPipeOptions').Optional() |
34 f.Param('data_pipe_producer_handle').Out('MojoHandle') | 37 f.Param('data_pipe_producer_handle').Out('MojoHandle') |
35 f.Param('data_pipe_consumer_handle').Out('MojoHandle') | 38 f.Param('data_pipe_consumer_handle').Out('MojoHandle') |
36 | 39 |
37 f = mojo.Func('MojoWriteData', 'MojoResult') | 40 f = mojo.Func('MojoWriteData', 'MojoResult') |
38 f.Param('data_pipe_producer_handle').In('MojoHandle') | 41 f.Param('data_pipe_producer_handle').In('MojoHandle') |
39 f.Param('elements').InArray('void', 'num_bytes') | 42 f.Param('elements').InArray('void', 'num_bytes') |
40 f.Param('num_bytes').InOut('uint32_t') | 43 f.Param('num_bytes').InOut('uint32_t') |
41 f.Param('flags').In('MojoWriteDataFlags') | 44 f.Param('flags').In('MojoWriteDataFlags') |
42 | 45 |
43 f = mojo.Func('MojoBeginWriteData', 'MojoResult') | 46 f = mojo.Func('MojoBeginWriteData', 'MojoResult') |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 f.Param('handle').In('MojoHandle') | 78 f.Param('handle').In('MojoHandle') |
76 f.Param('signals').In('MojoHandleSignals') | 79 f.Param('signals').In('MojoHandleSignals') |
77 f.Param('deadline').In('MojoDeadline') | 80 f.Param('deadline').In('MojoDeadline') |
78 | 81 |
79 f = mojo.Func('MojoWaitMany', 'MojoResult') | 82 f = mojo.Func('MojoWaitMany', 'MojoResult') |
80 f.Param('handles').InArray('MojoHandle', 'num_handles') | 83 f.Param('handles').InArray('MojoHandle', 'num_handles') |
81 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') | 84 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') |
82 f.Param('num_handles').In('uint32_t') | 85 f.Param('num_handles').In('uint32_t') |
83 f.Param('deadline').In('MojoDeadline') | 86 f.Param('deadline').In('MojoDeadline') |
84 | 87 |
| 88 f = mojo.Func('MojoNewWait', 'MojoResult') |
| 89 f.Param('handle').In('MojoHandle') |
| 90 f.Param('signals').In('MojoHandleSignals') |
| 91 f.Param('deadline').In('MojoDeadline') |
| 92 f.Param('signals_state').OutFixedStruct('MojoHandleSignalsState').Optional() |
| 93 |
| 94 f = mojo.Func('MojoNewWaitMany', 'MojoResult') |
| 95 f.Param('handles').InArray('MojoHandle', 'num_handles') |
| 96 f.Param('signals').InArray('MojoHandleSignals', 'num_handles') |
| 97 f.Param('num_handles').In('uint32_t') |
| 98 f.Param('deadline').In('MojoDeadline') |
| 99 f.Param('result_index').Out('uint32_t').Optional() |
| 100 p = f.Param('signals_states') |
| 101 p.OutArray('MojoHandleSignalsState', 'num_handles').Optional() |
| 102 |
85 f = mojo.Func('MojoCreateMessagePipe', 'MojoResult') | 103 f = mojo.Func('MojoCreateMessagePipe', 'MojoResult') |
86 f.Param('options').InStruct('MojoCreateMessagePipeOptions').Optional() | 104 p = f.Param('options') |
| 105 p.InExtensibleStruct('MojoCreateMessagePipeOptions').Optional() |
87 f.Param('message_pipe_handle0').Out('MojoHandle') | 106 f.Param('message_pipe_handle0').Out('MojoHandle') |
88 f.Param('message_pipe_handle1').Out('MojoHandle') | 107 f.Param('message_pipe_handle1').Out('MojoHandle') |
89 | 108 |
90 f = mojo.Func('MojoWriteMessage', 'MojoResult') | 109 f = mojo.Func('MojoWriteMessage', 'MojoResult') |
91 f.Param('message_pipe_handle').In('MojoHandle') | 110 f.Param('message_pipe_handle').In('MojoHandle') |
92 f.Param('bytes').InArray('void', 'num_bytes').Optional() | 111 f.Param('bytes').InArray('void', 'num_bytes').Optional() |
93 f.Param('num_bytes').In('uint32_t') | 112 f.Param('num_bytes').In('uint32_t') |
94 f.Param('handles').InArray('MojoHandle', 'num_handles').Optional() | 113 f.Param('handles').InArray('MojoHandle', 'num_handles').Optional() |
95 f.Param('num_handles').In('uint32_t') | 114 f.Param('num_handles').In('uint32_t') |
96 f.Param('flags').In('MojoWriteMessageFlags') | 115 f.Param('flags').In('MojoWriteMessageFlags') |
97 | 116 |
98 f = mojo.Func('MojoReadMessage', 'MojoResult') | 117 f = mojo.Func('MojoReadMessage', 'MojoResult') |
99 f.Param('message_pipe_handle').In('MojoHandle') | 118 f.Param('message_pipe_handle').In('MojoHandle') |
100 f.Param('bytes').OutArray('void', 'num_bytes').Optional() | 119 f.Param('bytes').OutArray('void', 'num_bytes').Optional() |
101 f.Param('num_bytes').InOut('uint32_t').Optional() | 120 f.Param('num_bytes').InOut('uint32_t').Optional() |
102 f.Param('handles').OutArray('MojoHandle', 'num_handles').Optional() | 121 f.Param('handles').OutArray('MojoHandle', 'num_handles').Optional() |
103 f.Param('num_handles').InOut('uint32_t').Optional() | 122 f.Param('num_handles').InOut('uint32_t').Optional() |
104 f.Param('flags').In('MojoReadMessageFlags') | 123 f.Param('flags').In('MojoReadMessageFlags') |
105 | 124 |
106 mojo.Finalize() | 125 mojo.Finalize() |
107 | 126 |
108 return mojo | 127 return mojo |
OLD | NEW |