From c263de3f419be945499ff7e6bd7512702f8bd522 Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Sun, 11 Feb 2018 10:35:40 +0100 Subject: qapi: Streamline boilerplate comment generation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every generator has separate boilerplate for .h and .c, and their differences are boring. All of them repeat the license note. Reduce the repetition as follows. Move common text like the license note to common open_output(), next to the existing common text there. For each generator, replace the two separate descriptions by a single one. While there, emit an "automatically generated" note into generated documentation, too. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Reviewed-by: Marc-André Lureau Message-Id: <20180211093607.27351-3-armbru@redhat.com> Signed-off-by: Eric Blake --- scripts/qapi-event.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) (limited to 'scripts/qapi-event.py') diff --git a/scripts/qapi-event.py b/scripts/qapi-event.py index c710968dc2..2b7d720c08 100644 --- a/scripts/qapi-event.py +++ b/scripts/qapi-event.py @@ -171,38 +171,18 @@ class QAPISchemaGenEventVisitor(QAPISchemaVisitor): (input_file, output_dir, do_c, do_h, prefix, dummy) = parse_command_line() -c_comment = ''' -/* - * schema-defined QAPI event functions +blurb = ''' + * Schema-defined QAPI/QMP events * * Copyright (c) 2014 Wenchao Xia * * Authors: * Wenchao Xia - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. - * See the COPYING.LIB file in the top-level directory. - * - */ -''' -h_comment = ''' -/* - * schema-defined QAPI event functions - * - * Copyright (c) 2014 Wenchao Xia - * - * Authors: - * Wenchao Xia - * - * This work is licensed under the terms of the GNU LGPL, version 2.1 or later. - * See the COPYING.LIB file in the top-level directory. - * - */ ''' (fdef, fdecl) = open_output(output_dir, do_c, do_h, prefix, 'qapi-event.c', 'qapi-event.h', - c_comment, h_comment) + blurb) fdef.write(mcgen(''' #include "qemu/osdep.h" -- cgit v1.2.3