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>
This commit is contained in:
committed by
Eric Blake
parent
0dd13589b0
commit
c263de3f41
@@ -250,39 +250,19 @@ for o, a in opts:
|
||||
if o in ('-b', '--builtins'):
|
||||
do_builtins = True
|
||||
|
||||
c_comment = '''
|
||||
/*
|
||||
* deallocation functions for schema-defined QAPI types
|
||||
blurb = '''
|
||||
* Schema-defined QAPI types
|
||||
*
|
||||
* Copyright IBM, Corp. 2011
|
||||
*
|
||||
* Authors:
|
||||
* Anthony Liguori <aliguori@us.ibm.com>
|
||||
* Michael Roth <mdroth@linux.vnet.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 types
|
||||
*
|
||||
* 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-types.c', 'qapi-types.h',
|
||||
c_comment, h_comment)
|
||||
blurb)
|
||||
|
||||
fdef.write(mcgen('''
|
||||
#include "qemu/osdep.h"
|
||||
|
Reference in New Issue
Block a user