From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39894) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydivj-0000KW-Qc for qemu-devel@nongnu.org; Thu, 02 Apr 2015 13:29:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ydivh-0007JR-SE for qemu-devel@nongnu.org; Thu, 02 Apr 2015 13:29:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:59074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ydivh-0007JF-Kc for qemu-devel@nongnu.org; Thu, 02 Apr 2015 13:29:21 -0400 From: Markus Armbruster Date: Thu, 2 Apr 2015 19:28:59 +0200 Message-Id: <1427995743-7865-16-git-send-email-armbru@redhat.com> In-Reply-To: <1427995743-7865-1-git-send-email-armbru@redhat.com> References: <1427995743-7865-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH RFC 15/19] qapi: Inline gen_command_decl_prologue(), gen_command_def_prologue() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, berto@igalia.com, akong@redhat.com, mdroth@linux.vnet.ibm.com Signed-off-by: Markus Armbruster --- scripts/qapi-commands.py | 58 ++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 34 deletions(-) diff --git a/scripts/qapi-commands.py b/scripts/qapi-commands.py index 10fa570..bf41a78 100644 --- a/scripts/qapi-commands.py +++ b/scripts/qapi-commands.py @@ -319,36 +319,6 @@ qapi_init(qmp_init_marshal); registry=registry.rstrip()) return ret -def gen_command_decl_prologue(prefix=""): - ret = mcgen(''' -#include "%(prefix)sqapi-types.h" -#include "qapi/qmp/qdict.h" -#include "qapi/error.h" - -''', - prefix=prefix) - return ret - -def gen_command_def_prologue(prefix="", proxy=False): - ret = mcgen(''' -#include "qemu-common.h" -#include "qemu/module.h" -#include "qapi/qmp/qerror.h" -#include "qapi/qmp/types.h" -#include "qapi/qmp/dispatch.h" -#include "qapi/visitor.h" -#include "qapi/qmp-output-visitor.h" -#include "qapi/qmp-input-visitor.h" -#include "qapi/dealloc-visitor.h" -#include "%(prefix)sqapi-types.h" -#include "%(prefix)sqapi-visit.h" - -''', - prefix=prefix) - if not proxy: - ret += '#include "%sqmp-commands.h"' % prefix - return ret + "\n\n" - middle_mode = False (input_file, output_dir, do_c, do_h, prefix, opts) = \ @@ -395,10 +365,30 @@ h_comment = ''' 'qmp-marshal.c', 'qmp-commands.h', c_comment, h_comment) -ret = gen_command_decl_prologue(prefix=prefix) -fdecl.write(ret) -ret = gen_command_def_prologue(prefix=prefix) -fdef.write(ret) +fdef.write(mcgen(''' +#include "qemu-common.h" +#include "qemu/module.h" +#include "qapi/qmp/qerror.h" +#include "qapi/qmp/types.h" +#include "qapi/qmp/dispatch.h" +#include "qapi/visitor.h" +#include "qapi/qmp-output-visitor.h" +#include "qapi/qmp-input-visitor.h" +#include "qapi/dealloc-visitor.h" +#include "%(prefix)sqapi-types.h" +#include "%(prefix)sqapi-visit.h" +#include "%(prefix)sqmp-commands.h" + +''', + prefix=prefix)) + +fdecl.write(mcgen(''' +#include "%(prefix)sqapi-types.h" +#include "qapi/qmp/qdict.h" +#include "qapi/error.h" + +''', + prefix=prefix)) for cmd in commands: arglist = [] -- 1.9.3