2017-03-20 16:11:54 +03:00
|
|
|
# -*- Mode: Python -*-
|
2020-07-29 21:50:24 +03:00
|
|
|
# vim: filetype=python
|
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# Positive QAPI doc comment tests
|
|
|
|
|
|
|
|
{ 'pragma': { 'doc-required': true } }
|
|
|
|
|
|
|
|
##
|
|
|
|
# = Section
|
|
|
|
#
|
|
|
|
# == Subsection
|
|
|
|
#
|
2020-09-25 19:23:07 +03:00
|
|
|
# *with emphasis*
|
2017-03-20 16:11:54 +03:00
|
|
|
# @var {in braces}
|
2020-09-25 19:22:58 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# * List item one
|
2020-09-25 19:22:58 +03:00
|
|
|
# * Two, multiple
|
2017-03-20 16:11:54 +03:00
|
|
|
# lines
|
|
|
|
#
|
2020-09-25 19:22:58 +03:00
|
|
|
# * Three
|
|
|
|
# Still in list
|
|
|
|
#
|
|
|
|
# Not in list
|
2017-03-20 16:11:54 +03:00
|
|
|
#
|
|
|
|
# - Second list
|
2020-09-25 19:22:58 +03:00
|
|
|
# Note: still in list
|
2017-03-20 16:11:54 +03:00
|
|
|
#
|
|
|
|
# Note: not in list
|
2020-09-25 19:22:58 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# 1. Third list
|
|
|
|
# is numbered
|
|
|
|
#
|
2020-09-25 19:22:58 +03:00
|
|
|
# 2. another item
|
2017-03-20 16:11:54 +03:00
|
|
|
#
|
|
|
|
# Returns: the King
|
|
|
|
# Since: the first age
|
|
|
|
# Notes:
|
|
|
|
#
|
|
|
|
# 1. Lorem ipsum dolor sit amet
|
|
|
|
#
|
|
|
|
# 2. Ut enim ad minim veniam
|
|
|
|
#
|
|
|
|
# Duis aute irure dolor
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> in
|
|
|
|
# <- out
|
|
|
|
# Examples:
|
|
|
|
# - *verbatim*
|
|
|
|
# - {braces}
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# @Enum:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# @one: The _one_ {and only}
|
|
|
|
#
|
2020-03-17 14:54:37 +03:00
|
|
|
# Features:
|
|
|
|
# @enum-feat: Also _one_ {and only}
|
2021-10-25 07:24:02 +03:00
|
|
|
# @enum-member-feat: a member feature
|
2020-03-17 14:54:37 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# @two is undocumented
|
|
|
|
##
|
2021-09-17 17:31:12 +03:00
|
|
|
{ 'enum': 'Enum',
|
2021-10-25 07:24:02 +03:00
|
|
|
'data': [ { 'name': 'one', 'if': 'IFONE',
|
|
|
|
'features': [ 'enum-member-feat' ] },
|
|
|
|
'two' ],
|
2020-03-17 14:54:37 +03:00
|
|
|
'features': [ 'enum-feat' ],
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'IFCOND' }
|
2017-03-20 16:11:54 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @Base:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# @base1:
|
2020-09-25 19:22:58 +03:00
|
|
|
# the first member
|
2017-03-20 16:11:54 +03:00
|
|
|
##
|
2021-08-04 11:31:01 +03:00
|
|
|
{ 'struct': 'Base', 'data': { 'base1': 'Enum' },
|
|
|
|
'if': { 'all': ['IFALL1', 'IFALL2'] } }
|
2017-03-20 16:11:54 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @Variant1:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# A paragraph
|
|
|
|
#
|
2023-04-28 13:54:21 +03:00
|
|
|
# Another paragraph
|
|
|
|
#
|
|
|
|
# @var1 is undocumented
|
2019-10-18 11:14:53 +03:00
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
# @variant1-feat: a feature
|
2020-03-17 14:54:45 +03:00
|
|
|
# @member-feat: a member feature
|
2017-03-20 16:11:54 +03:00
|
|
|
##
|
2018-12-13 15:37:21 +03:00
|
|
|
{ 'struct': 'Variant1',
|
2019-10-18 11:14:53 +03:00
|
|
|
'features': [ 'variant1-feat' ],
|
2020-03-17 14:54:45 +03:00
|
|
|
'data': { 'var1': { 'type': 'str',
|
|
|
|
'features': [ 'member-feat' ],
|
2021-08-04 11:31:05 +03:00
|
|
|
'if': 'IFSTR' } } }
|
2017-03-20 16:11:54 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @Variant2:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
##
|
|
|
|
{ 'struct': 'Variant2', 'data': {} }
|
|
|
|
|
|
|
|
##
|
|
|
|
# @Object:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2020-03-17 14:54:37 +03:00
|
|
|
# Features:
|
|
|
|
# @union-feat1: a feature
|
2017-03-20 16:11:54 +03:00
|
|
|
##
|
|
|
|
{ 'union': 'Object',
|
2020-03-17 14:54:37 +03:00
|
|
|
'features': [ 'union-feat1' ],
|
2017-03-20 16:11:54 +03:00
|
|
|
'base': 'Base',
|
|
|
|
'discriminator': 'base1',
|
2021-08-04 11:31:02 +03:00
|
|
|
'data': { 'one': 'Variant1',
|
|
|
|
'two': { 'type': 'Variant2',
|
|
|
|
'if': { 'any': ['IFONE', 'IFTWO'] } } } }
|
2017-03-20 16:11:54 +03:00
|
|
|
|
2019-10-24 14:02:21 +03:00
|
|
|
##
|
|
|
|
# @Alternate:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2019-10-24 14:02:21 +03:00
|
|
|
# @i: an integer
|
2020-09-25 19:22:58 +03:00
|
|
|
# @b is undocumented
|
2020-03-17 14:54:37 +03:00
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
# @alt-feat: a feature
|
2019-10-24 14:02:21 +03:00
|
|
|
##
|
|
|
|
{ 'alternate': 'Alternate',
|
2020-03-17 14:54:37 +03:00
|
|
|
'features': [ 'alt-feat' ],
|
2021-08-04 11:31:04 +03:00
|
|
|
'data': { 'i': 'int', 'b': 'bool' },
|
2021-08-31 15:38:01 +03:00
|
|
|
'if': { 'not': { 'any': [ 'IFONE', 'IFTWO' ] } } }
|
2019-10-24 14:02:21 +03:00
|
|
|
|
2017-03-20 16:11:54 +03:00
|
|
|
##
|
|
|
|
# == Another subsection
|
|
|
|
##
|
|
|
|
|
|
|
|
##
|
|
|
|
# @cmd:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# @arg1: the first argument
|
|
|
|
#
|
|
|
|
# @arg2: the second
|
2020-09-25 19:22:58 +03:00
|
|
|
# argument
|
2019-10-18 11:14:53 +03:00
|
|
|
#
|
|
|
|
# Features:
|
|
|
|
# @cmd-feat1: a feature
|
|
|
|
# @cmd-feat2: another feature
|
2017-03-20 16:11:54 +03:00
|
|
|
# Note: @arg3 is undocumented
|
|
|
|
# Returns: @Object
|
|
|
|
# TODO: frobnicate
|
|
|
|
# Notes:
|
2020-09-25 19:22:58 +03:00
|
|
|
#
|
2017-03-20 16:11:54 +03:00
|
|
|
# - Lorem ipsum dolor sit amet
|
|
|
|
# - Ut enim ad minim veniam
|
|
|
|
#
|
|
|
|
# Duis aute irure dolor
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> in
|
|
|
|
# <- out
|
|
|
|
# Examples:
|
|
|
|
# - *verbatim*
|
|
|
|
# - {braces}
|
|
|
|
# Since: 2.10
|
|
|
|
##
|
|
|
|
{ 'command': 'cmd',
|
|
|
|
'data': { 'arg1': 'int', '*arg2': 'str', 'arg3': 'bool' },
|
2019-10-18 11:14:53 +03:00
|
|
|
'returns': 'Object',
|
|
|
|
'features': [ 'cmd-feat1', 'cmd-feat2' ] }
|
2017-03-20 16:11:54 +03:00
|
|
|
|
|
|
|
##
|
|
|
|
# @cmd-boxed:
|
|
|
|
# If you're bored enough to read this, go see a video of boxed cats
|
2019-10-18 11:14:53 +03:00
|
|
|
# Features:
|
|
|
|
# @cmd-feat1: a feature
|
|
|
|
# @cmd-feat2: another feature
|
2017-03-20 16:11:54 +03:00
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# -> in
|
|
|
|
#
|
|
|
|
# <- out
|
|
|
|
##
|
|
|
|
{ 'command': 'cmd-boxed', 'boxed': true,
|
2019-10-18 11:14:53 +03:00
|
|
|
'data': 'Object',
|
|
|
|
'features': [ 'cmd-feat1', 'cmd-feat2' ] }
|
2019-10-24 14:02:20 +03:00
|
|
|
|
|
|
|
##
|
2021-03-23 12:40:10 +03:00
|
|
|
# @EVT_BOXED:
|
2021-09-30 23:57:07 +03:00
|
|
|
#
|
2020-03-17 14:54:37 +03:00
|
|
|
# Features:
|
|
|
|
# @feat3: a feature
|
2019-10-24 14:02:20 +03:00
|
|
|
##
|
2021-03-23 12:40:10 +03:00
|
|
|
{ 'event': 'EVT_BOXED', 'boxed': true,
|
2020-03-17 14:54:37 +03:00
|
|
|
'features': [ 'feat3' ],
|
2019-10-24 14:02:20 +03:00
|
|
|
'data': 'Object' }
|