scripts: apibuild: parse 'Since' for macros

This patch adds 'version' parameter to the generated XML API for
macros

It'll require, for new additions, to add a comment with the version
that the macro 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 <victortoso@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
This commit is contained in:
Victor Toso 2022-04-22 21:23:41 +02:00 committed by Andrea Bolognani
parent 8be766e39c
commit b7472a1d79

View File

@ -2266,11 +2266,15 @@ class docBuilder:
output.write(" string='%s'" % strValue) output.write(" string='%s'" % strValue)
else: else:
output.write(" raw='%s'" % escape(rawValue)) output.write(" raw='%s'" % escape(rawValue))
(since, comment) = self.retrieve_comment_tags(name, desc)
if len(since) > 0:
output.write(" version='%s'" % escape(since))
output.write(">\n") output.write(">\n")
if desc is not None and desc != "": if comment is not None and comment != "":
output.write(" <info><![CDATA[%s]]></info>\n" % (desc)) output.write(" <info><![CDATA[%s]]></info>\n" % (comment))
self.indexString(name, desc) self.indexString(name, comment)
for arg in args: for arg in args:
(name, desc) = arg (name, desc) = arg
if desc is not None and desc != "": if desc is not None and desc != "":