From 8be766e39c6509cc24731b1b757439e58a6248e0 Mon Sep 17 00:00:00 2001 From: Victor Toso Date: Fri, 22 Apr 2022 21:23:40 +0200 Subject: [PATCH] scripts: apibuild: parse 'Since' for typedefs This patch adds 'version' parameter to the generated XML API for typedefs It'll require, for new additions, to add a comment with the version that the typedef value was added. An example bellow of code diff and the change in the generated XML. Note that the Since tag is removed from the comment as there is a proper field for it in the XML. Signed-off-by: Victor Toso Reviewed-by: Andrea Bolognani --- scripts/apibuild.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/scripts/apibuild.py b/scripts/apibuild.py index dd82974c12..116ea9fe5f 100755 --- a/scripts/apibuild.py +++ b/scripts/apibuild.py @@ -2297,9 +2297,11 @@ class docBuilder: def serialize_typedef(self, output, name): id = self.idx.typedefs[name] + (since, comment) = self.retrieve_comment_tags(name, id.extra) + version_tag = len(since) > 0 and f" version='{since}'" or "" if id.info[0:7] == 'struct ': - output.write(" \n") else: - output.write(" \n \n" % (desc)) + if comment is not None and comment != "": + output.write(">\n \n" % (comment)) output.write(" \n") else: output.write("/>\n")