[PATCH v2 28/34] scripts: apibuild: parse 'Since' for macros

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 scripts/apibuild.py | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/scripts/apibuild.py b/scripts/apibuild.py
index da70d67fa6..c4ff733550 100755
--- a/scripts/apibuild.py
+++ b/scripts/apibuild.py
@@ -2265,11 +2265,15 @@ class docBuilder:
             output.write(" string='%s'" % strValue)
         else:
             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")
 
-        if desc is not None and desc != "":
-            output.write("      <info><![CDATA[%s]]></info>\n" % (desc))
-            self.indexString(name, desc)
+        if comment is not None and comment != "":
+            output.write("      <info><![CDATA[%s]]></info>\n" % (comment))
+            self.indexString(name, comment)
         for arg in args:
             (name, desc) = arg
             if desc is not None and desc != "":
-- 
2.35.1




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux