qapi: Improve built-in type documentation
Clarify how they map to JSON. Add how they map to C. Fix the reference to StringInputVisitor. Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Daniel P. Berrange <berrange@redhat.com> Message-Id: <1442401589-24189-20-git-send-email-armbru@redhat.com>
This commit is contained in:
parent
56d92b003a
commit
f133f2db1e
|
@ -140,17 +140,24 @@ must have a value that forms a struct name.
|
||||||
|
|
||||||
=== Built-in Types ===
|
=== Built-in Types ===
|
||||||
|
|
||||||
The following types are built-in to the parser:
|
The following types are predefined, and map to C as follows:
|
||||||
'str' - arbitrary UTF-8 string
|
|
||||||
'int' - 64-bit signed integer (although the C code may place further
|
Schema C JSON
|
||||||
restrictions on acceptable range)
|
str char * any JSON string, UTF-8
|
||||||
'number' - floating point number
|
number double any JSON number
|
||||||
'bool' - JSON value of true or false
|
int int64_t a JSON number without fractional part
|
||||||
'int8', 'int16', 'int32', 'int64' - like 'int', but enforce maximum
|
that fits into the C integer type
|
||||||
bit size
|
int8 int8_t likewise
|
||||||
'uint8', 'uint16', 'uint32', 'uint64' - unsigned counterparts
|
int16 int16_t likewise
|
||||||
'size' - like 'uint64', but allows scaled suffix from command line
|
int32 int32_t likewise
|
||||||
visitor
|
int64 int64_t likewise
|
||||||
|
uint8 uint8_t likewise
|
||||||
|
uint16 uint16_t likewise
|
||||||
|
uint32 uint32_t likewise
|
||||||
|
uint64 uint64_t likewise
|
||||||
|
size uint64_t like uint64_t, except StringInputVisitor
|
||||||
|
accepts size suffixes
|
||||||
|
bool bool JSON true or false
|
||||||
|
|
||||||
|
|
||||||
=== Includes ===
|
=== Includes ===
|
||||||
|
|
Loading…
Reference in New Issue