From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34344) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYtTu-0001bf-Hg for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZYtTs-0000Sg-T8 for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47077) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZYtTs-0000SZ-MQ for qemu-devel@nongnu.org; Mon, 07 Sep 2015 06:16:56 -0400 From: Markus Armbruster Date: Mon, 7 Sep 2015 12:16:36 +0200 Message-Id: <1441621003-2434-26-git-send-email-armbru@redhat.com> In-Reply-To: <1441621003-2434-1-git-send-email-armbru@redhat.com> References: <1441621003-2434-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH RFC v5 25/32] qapi: Improve built-in type documentation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: mdroth@linux.vnet.ibm.com Clarify how they map to JSON. Add how they map to C. Fix the reference to StringInputVisitor. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake --- docs/qapi-code-gen.txt | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/docs/qapi-code-gen.txt b/docs/qapi-code-gen.txt index 147638f..35a4a0f 100644 --- a/docs/qapi-code-gen.txt +++ b/docs/qapi-code-gen.txt @@ -140,17 +140,24 @@ must have a value that forms a struct name. === Built-in Types === -The following types are built-in to the parser: - 'str' - arbitrary UTF-8 string - 'int' - 64-bit signed integer (although the C code may place further - restrictions on acceptable range) - 'number' - floating point number - 'bool' - JSON value of true or false - 'int8', 'int16', 'int32', 'int64' - like 'int', but enforce maximum - bit size - 'uint8', 'uint16', 'uint32', 'uint64' - unsigned counterparts - 'size' - like 'uint64', but allows scaled suffix from command line - visitor +The following types are predefined, and map to C as follows: + + Schema C JSON + str char * any JSON string, UTF-8 + number double any JSON number + int int64_t a JSON number without fractional part + that fits into the C integer type + int8 int8_t likewise + int16 int16_t likewise + int32 int32_t likewise + 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 === -- 2.4.3