util: rename qemu_open() to qemu_open_old()
[qemu/ar7.git] / tests / qapi-schema / doc-good.json
blob9da72a1f556e0dedcbc43b7d0eabb33eea895697
1 # -*- Mode: Python -*-
2 # vim: filetype=python
4 # Positive QAPI doc comment tests
6 { 'pragma': { 'doc-required': true } }
8 ##
9 # = Section
11 # == Subsection
13 # *strong* _with emphasis_
14 # @var {in braces}
15 # * List item one
16 # - Two, multiple
17 #   lines
19 # 3. Three
20 # Still in list
22 #   Not in list
23 # - Second list
24 # Note: still in list
26 # Note: not in list
27 # 1. Third list
28 #    is numbered
30 # - another item
32 # | example
33 # | multiple lines
35 # Returns: the King
36 # Since: the first age
37 # Notes:
39 # 1. Lorem ipsum dolor sit amet
41 # 2. Ut enim ad minim veniam
43 # Duis aute irure dolor
45 # Example:
47 # -> in
48 # <- out
49 # Examples:
50 # - *verbatim*
51 # - {braces}
55 # @Enum:
56 # @one: The _one_ {and only}
58 # Features:
59 # @enum-feat: Also _one_ {and only}
61 # @two is undocumented
63 { 'enum': 'Enum', 'data':
64   [ { 'name': 'one', 'if': 'defined(IFONE)' }, 'two' ],
65   'features': [ 'enum-feat' ],
66   'if': 'defined(IFCOND)' }
69 # @Base:
70 # @base1:
71 #   the first member
73 { 'struct': 'Base', 'data': { 'base1': 'Enum' } }
76 # @Variant1:
77 # A paragraph
79 # Another paragraph (but no @var: line)
81 # Features:
82 # @variant1-feat: a feature
83 # @member-feat: a member feature
85 { 'struct': 'Variant1',
86   'features': [ 'variant1-feat' ],
87   'data': { 'var1': { 'type': 'str',
88                       'features': [ 'member-feat' ],
89                       'if': 'defined(IFSTR)' } } }
92 # @Variant2:
94 { 'struct': 'Variant2', 'data': {} }
97 # @Object:
98 # Features:
99 # @union-feat1: a feature
101 { 'union': 'Object',
102   'features': [ 'union-feat1' ],
103   'base': 'Base',
104   'discriminator': 'base1',
105   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
108 # @SugaredUnion:
109 # Features:
110 # @union-feat2: a feature
112 { 'union': 'SugaredUnion',
113   'features': [ 'union-feat2' ],
114   'data': { 'one': 'Variant1', 'two': { 'type': 'Variant2', 'if': 'IFTWO' } } }
117 # @Alternate:
118 # @i: an integer
119 # @b is undocumented
121 # Features:
122 # @alt-feat: a feature
124 { 'alternate': 'Alternate',
125   'features': [ 'alt-feat' ],
126   'data': { 'i': 'int', 'b': 'bool' } }
129 # == Another subsection
133 # @cmd:
134 # @arg1: the first argument
136 # @arg2: the second
137 # argument
139 # Features:
140 # @cmd-feat1: a feature
141 # @cmd-feat2: another feature
142 # Note: @arg3 is undocumented
143 # Returns: @Object
144 # TODO: frobnicate
145 # Notes:
146 # - Lorem ipsum dolor sit amet
147 # - Ut enim ad minim veniam
149 # Duis aute irure dolor
150 # Example:
152 # -> in
153 # <- out
154 # Examples:
155 # - *verbatim*
156 # - {braces}
157 # Since: 2.10
159 { 'command': 'cmd',
160   'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
161   'returns': 'Object',
162   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
165 # @cmd-boxed:
166 # If you're bored enough to read this, go see a video of boxed cats
167 # Features:
168 # @cmd-feat1: a feature
169 # @cmd-feat2: another feature
170 # Example:
172 # -> in
174 # <- out
176 { 'command': 'cmd-boxed', 'boxed': true,
177   'data': 'Object',
178   'features': [ 'cmd-feat1', 'cmd-feat2' ] }
181 # @EVT-BOXED:
182 # Features:
183 # @feat3: a feature
185 { 'event': 'EVT-BOXED',  'boxed': true,
186   'features': [ 'feat3' ],
187   'data': 'Object' }