]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/libvirt.git/commitdiff
Ignore backward compatibility macros in apibuild.py
authorMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 31 May 2011 08:41:37 +0000 (10:41 +0200)
committerMatthias Bolte <matthias.bolte@googlemail.com>
Tue, 31 May 2011 14:17:34 +0000 (16:17 +0200)
This fixes this three warnings from the parser by allowing the parser
to ignore some macros in the same way as it can ignore functions.

Parsing ./../include/libvirt/libvirt.h
Misformatted macro comment for _virSchedParameter
 Expecting '* _virSchedParameter:' got '* virSchedParameter:'
Misformatted macro comment for _virBlkioParameter
 Expecting '* _virBlkioParameter:' got '* virBlkioParameter:'
Misformatted macro comment for _virMemoryParameter
 Expecting '* _virMemoryParameter:' got '* virMemoryParameter:'

docs/apibuild.py

index 2ab05999cf00a20d942ffd161cc1214a4c6380fe..f160c478aa745502175e9ab06a7d4b728b64d545 100755 (executable)
@@ -58,6 +58,12 @@ ignored_functions = {
   "virEventRemoveTimeout": "internal function in event.c",
 }
 
+ignored_macros = {
+  "_virSchedParameter": "backward compatibility macro for virTypedParameter",
+  "_virBlkioParameter": "backward compatibility macro for virTypedParameter",
+  "_virMemoryParameter": "backward compatibility macro for virTypedParameter",
+}
+
 def escape(raw):
     raw = string.replace(raw, '&', '&amp;')
     raw = string.replace(raw, '<', '&lt;')
@@ -716,8 +722,12 @@ class CParser:
     # Parse a comment block associate to a macro
     #
     def parseMacroComment(self, name, quiet = 0):
+        global ignored_macros
+
         if name[0:2] == '__':
             quiet = 1
+        if ignored_macros.has_key(name):
+            quiet = 1
 
         args = []
         desc = ""