]> xenbits.xensource.com Git - libvirt.git/commitdiff
apibuild: Allow completely skipping certain macros
authorPeter Krempa <pkrempa@redhat.com>
Thu, 21 Apr 2016 12:31:23 +0000 (14:31 +0200)
committerPeter Krempa <pkrempa@redhat.com>
Thu, 21 Apr 2016 13:39:08 +0000 (15:39 +0200)
Some macros don't make sense to be documented at all. Add infrastructure
to the web/api generator and add VIR_DEPRECATED and VIR_EXPORT_VAR as
macros we should not document.

docs/apibuild.py

index f934fb20e9ae372234d6f981d3306409b3c032c8..9e63270f1f9f1f35605b07ec320751b3d2047688 100755 (executable)
@@ -111,6 +111,12 @@ ignored_macros = {
   "_virMemoryParameter": "backward compatibility macro for virTypedParameter",
 }
 
+# macros that should be completely skipped
+hidden_macros = {
+  "VIR_DEPRECATED", # internal macro to mark deprecated apis
+  "VIR_EXPORT_VAR", # internal macro to mark exported vars
+}
+
 def escape(raw):
     raw = string.replace(raw, '&', '&amp;')
     raw = string.replace(raw, '<', '&lt;')
@@ -1034,6 +1040,11 @@ class CParser:
                     name = string.split(name, '(') [0]
                 except:
                     pass
+
+                # skip hidden macros
+                if name in hidden_macros:
+                    return token
+
                 strValue = None
                 if len(lst) == 1 and lst[0][0] == '"' and lst[0][-1] == '"':
                     strValue = lst[0][1:-1]