mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 11:35:19 +00:00
apibuild: Allow completely skipping certain macros
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.
This commit is contained in:
parent
9b99bcf02c
commit
a253396a47
@ -111,6 +111,12 @@ ignored_macros = {
|
|||||||
"_virMemoryParameter": "backward compatibility macro for virTypedParameter",
|
"_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):
|
def escape(raw):
|
||||||
raw = string.replace(raw, '&', '&')
|
raw = string.replace(raw, '&', '&')
|
||||||
raw = string.replace(raw, '<', '<')
|
raw = string.replace(raw, '<', '<')
|
||||||
@ -1034,6 +1040,11 @@ class CParser:
|
|||||||
name = string.split(name, '(') [0]
|
name = string.split(name, '(') [0]
|
||||||
except:
|
except:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
# skip hidden macros
|
||||||
|
if name in hidden_macros:
|
||||||
|
return token
|
||||||
|
|
||||||
strValue = None
|
strValue = None
|
||||||
if len(lst) == 1 and lst[0][0] == '"' and lst[0][-1] == '"':
|
if len(lst) == 1 and lst[0][0] == '"' and lst[0][-1] == '"':
|
||||||
strValue = lst[0][1:-1]
|
strValue = lst[0][1:-1]
|
||||||
|
Loading…
Reference in New Issue
Block a user