diff options
author | Markus Armbruster <armbru@redhat.com> | 2018-02-11 10:35:40 +0100 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2018-03-02 13:14:08 -0600 |
commit | c263de3f419be945499ff7e6bd7512702f8bd522 (patch) | |
tree | 29e6fa4f4bec7b97c199616d34a1228de95514bc /scripts/qapi-visit.py | |
parent | 0dd13589b0dc1d91bb1281a0d10ddaa71b8b5ccd (diff) |
qapi: Streamline boilerplate comment generation
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 <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20180211093607.27351-3-armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'scripts/qapi-visit.py')
-rw-r--r-- | scripts/qapi-visit.py | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/scripts/qapi-visit.py b/scripts/qapi-visit.py index bc2b8b581a..0a367072fb 100644 --- a/scripts/qapi-visit.py +++ b/scripts/qapi-visit.py @@ -334,38 +334,18 @@ for o, a in opts: if o in ('-b', '--builtins'): do_builtins = True -c_comment = ''' -/* - * schema-defined QAPI visitor functions +blurb = ''' + * Schema-defined QAPI visitors * * Copyright IBM, Corp. 2011 * * Authors: * Anthony Liguori <aliguori@us.ibm.com> - * - * 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 visitor functions - * - * Copyright IBM, Corp. 2011 - * - * Authors: - * Anthony Liguori <aliguori@us.ibm.com> - * - * 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-visit.c', 'qapi-visit.h', - c_comment, h_comment) + blurb) fdef.write(mcgen(''' #include "qemu/osdep.h" |