mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
docs: drop building of API -refs.xml files
The API cross reference files are not used since
commit d3043afe5c
Author: Daniel Veillard <veillard@redhat.com>
Date: Mon Jan 21 08:08:33 2008 +0000
Remove docs/API*.html
* docs/API* docs/api.xsl docs/site.xsl docs/Makefile.am: remove the
generation of the API*.html files as it's not really useful here
Reviewed-by: Pavel Hrdina <phrdina@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
f6fbb2e67f
commit
4ce0fea015
@ -147,20 +147,16 @@ htmldir = $(HTML_DIR)
|
|||||||
html_DATA = $(css) $(png) $(gif) $(dot_html)
|
html_DATA = $(css) $(png) $(gif) $(dot_html)
|
||||||
|
|
||||||
xml = \
|
xml = \
|
||||||
libvirt-api.xml \
|
libvirt-api.xml
|
||||||
libvirt-refs.xml
|
|
||||||
|
|
||||||
qemu_xml = \
|
qemu_xml = \
|
||||||
libvirt-qemu-api.xml \
|
libvirt-qemu-api.xml
|
||||||
libvirt-qemu-refs.xml
|
|
||||||
|
|
||||||
lxc_xml = \
|
lxc_xml = \
|
||||||
libvirt-lxc-api.xml \
|
libvirt-lxc-api.xml
|
||||||
libvirt-lxc-refs.xml
|
|
||||||
|
|
||||||
admin_xml = \
|
admin_xml = \
|
||||||
libvirt-admin-api.xml \
|
libvirt-admin-api.xml
|
||||||
libvirt-admin-refs.xml
|
|
||||||
|
|
||||||
apidir = $(pkgdatadir)/api
|
apidir = $(pkgdatadir)/api
|
||||||
api_DATA = \
|
api_DATA = \
|
||||||
@ -220,10 +216,10 @@ timestamp="$(shell if test -n "$$SOURCE_DATE_EPOCH"; \
|
|||||||
date -u; \
|
date -u; \
|
||||||
fi)"
|
fi)"
|
||||||
|
|
||||||
api: libvirt-api.xml libvirt-refs.xml
|
api: libvirt-api.xml
|
||||||
qemu_api: libvirt-qemu-api.xml libvirt-qemu-refs.xml
|
qemu_api: libvirt-qemu-api.xml
|
||||||
lxc_api: libvirt-lxc-api.xml libvirt-lxc-refs.xml
|
lxc_api: libvirt-lxc-api.xml
|
||||||
admin_api: libvirt-admin-api.xml libvirt-admin-refs.xml
|
admin_api: libvirt-admin-api.xml
|
||||||
|
|
||||||
hvsupport.html: hvsupport.html.in
|
hvsupport.html: hvsupport.html.in
|
||||||
|
|
||||||
@ -285,13 +281,9 @@ python_generated_files = \
|
|||||||
html/libvirt-libvirt-admin.html \
|
html/libvirt-libvirt-admin.html \
|
||||||
html/libvirt-virterror.html \
|
html/libvirt-virterror.html \
|
||||||
libvirt-api.xml \
|
libvirt-api.xml \
|
||||||
libvirt-refs.xml \
|
|
||||||
libvirt-lxc-api.xml \
|
libvirt-lxc-api.xml \
|
||||||
libvirt-lxc-refs.xml \
|
|
||||||
libvirt-qemu-api.xml \
|
libvirt-qemu-api.xml \
|
||||||
libvirt-qemu-refs.xml \
|
|
||||||
libvirt-admin-api.xml \
|
libvirt-admin-api.xml \
|
||||||
libvirt-admin-refs.xml \
|
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
APIBUILD=$(srcdir)/apibuild.py
|
APIBUILD=$(srcdir)/apibuild.py
|
||||||
|
170
docs/apibuild.py
170
docs/apibuild.py
@ -2323,166 +2323,6 @@ class docBuilder:
|
|||||||
output.write(" <exports symbol='%s' type='function'/>\n" % (id))
|
output.write(" <exports symbol='%s' type='function'/>\n" % (id))
|
||||||
output.write(" </file>\n")
|
output.write(" </file>\n")
|
||||||
|
|
||||||
def serialize_xrefs_files(self, output):
|
|
||||||
headers = sorted(self.headers.keys())
|
|
||||||
for file in headers:
|
|
||||||
module = self.modulename_file(file)
|
|
||||||
output.write(" <file name='%s'>\n" % (module))
|
|
||||||
dict = self.headers[file]
|
|
||||||
ids = uniq(list(dict.functions.keys()) +
|
|
||||||
list(dict.variables.keys()) +
|
|
||||||
list(dict.macros.keys()) +
|
|
||||||
list(dict.typedefs.keys()) +
|
|
||||||
list(dict.structs.keys()) +
|
|
||||||
list(dict.enums.keys()))
|
|
||||||
for id in ids:
|
|
||||||
output.write(" <ref name='%s'/>\n" % (id))
|
|
||||||
output.write(" </file>\n")
|
|
||||||
pass
|
|
||||||
|
|
||||||
def serialize_xrefs_functions(self, output):
|
|
||||||
funcs = {}
|
|
||||||
for name in self.idx.functions.keys():
|
|
||||||
id = self.idx.functions[name]
|
|
||||||
try:
|
|
||||||
(ret, params, desc) = id.info
|
|
||||||
for param in params:
|
|
||||||
if param[0] == 'void':
|
|
||||||
continue
|
|
||||||
if param[0] in funcs:
|
|
||||||
funcs[param[0]].append(name)
|
|
||||||
else:
|
|
||||||
funcs[param[0]] = [name]
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
typ = sorted(funcs.keys())
|
|
||||||
for type in typ:
|
|
||||||
if type in ['', "void", "int", "char *", "const char *"]:
|
|
||||||
continue
|
|
||||||
output.write(" <type name='%s'>\n" % (type))
|
|
||||||
ids = funcs[type]
|
|
||||||
ids.sort()
|
|
||||||
pid = '' # not sure why we have dups, but get rid of them!
|
|
||||||
for id in ids:
|
|
||||||
if id != pid:
|
|
||||||
output.write(" <ref name='%s'/>\n" % (id))
|
|
||||||
pid = id
|
|
||||||
output.write(" </type>\n")
|
|
||||||
|
|
||||||
def serialize_xrefs_constructors(self, output):
|
|
||||||
funcs = {}
|
|
||||||
for name in self.idx.functions.keys():
|
|
||||||
id = self.idx.functions[name]
|
|
||||||
try:
|
|
||||||
(ret, params, desc) = id.info
|
|
||||||
if ret[0] == "void":
|
|
||||||
continue
|
|
||||||
if ret[0] in funcs:
|
|
||||||
funcs[ret[0]].append(name)
|
|
||||||
else:
|
|
||||||
funcs[ret[0]] = [name]
|
|
||||||
except Exception:
|
|
||||||
pass
|
|
||||||
typ = sorted(funcs.keys())
|
|
||||||
for type in typ:
|
|
||||||
if type in ['', "void", "int", "char *", "const char *"]:
|
|
||||||
continue
|
|
||||||
output.write(" <type name='%s'>\n" % (type))
|
|
||||||
ids = sorted(funcs[type])
|
|
||||||
for id in ids:
|
|
||||||
output.write(" <ref name='%s'/>\n" % (id))
|
|
||||||
output.write(" </type>\n")
|
|
||||||
|
|
||||||
def serialize_xrefs_alpha(self, output):
|
|
||||||
letter = None
|
|
||||||
ids = sorted(self.idx.identifiers.keys())
|
|
||||||
for id in ids:
|
|
||||||
if id[0] != letter:
|
|
||||||
if letter is not None:
|
|
||||||
output.write(" </letter>\n")
|
|
||||||
letter = id[0]
|
|
||||||
output.write(" <letter name='%s'>\n" % (letter))
|
|
||||||
output.write(" <ref name='%s'/>\n" % (id))
|
|
||||||
if letter is not None:
|
|
||||||
output.write(" </letter>\n")
|
|
||||||
|
|
||||||
def serialize_xrefs_references(self, output):
|
|
||||||
typ = sorted(self.idx.identifiers.keys())
|
|
||||||
for id in typ:
|
|
||||||
idf = self.idx.identifiers[id]
|
|
||||||
module = idf.header
|
|
||||||
output.write(" <reference name='%s' href='%s'/>\n" %
|
|
||||||
(id, 'html/' + self.basename + '-' +
|
|
||||||
self.modulename_file(module) + '.html#' +
|
|
||||||
id))
|
|
||||||
|
|
||||||
def serialize_xrefs_index(self, output):
|
|
||||||
index = self.xref
|
|
||||||
typ = sorted(index.keys())
|
|
||||||
letter = None
|
|
||||||
count = 0
|
|
||||||
chunk = 0
|
|
||||||
chunks = []
|
|
||||||
first_letter = None
|
|
||||||
for id in typ:
|
|
||||||
if len(index[id]) > 30:
|
|
||||||
continue
|
|
||||||
if id[0] != letter:
|
|
||||||
if letter is None or count > 200:
|
|
||||||
if letter is not None:
|
|
||||||
output.write(" </letter>\n")
|
|
||||||
output.write(" </chunk>\n")
|
|
||||||
count = 0
|
|
||||||
chunks.append(["chunk%s" % (chunk - 1), first_letter, letter])
|
|
||||||
output.write(" <chunk name='chunk%s'>\n" % (chunk))
|
|
||||||
first_letter = id[0]
|
|
||||||
chunk = chunk + 1
|
|
||||||
elif letter is not None:
|
|
||||||
output.write(" </letter>\n")
|
|
||||||
letter = id[0]
|
|
||||||
output.write(" <letter name='%s'>\n" % (letter))
|
|
||||||
output.write(" <word name='%s'>\n" % (id))
|
|
||||||
tokens = index[id]
|
|
||||||
tokens.sort()
|
|
||||||
tok = None
|
|
||||||
for token in tokens:
|
|
||||||
if tok == token:
|
|
||||||
continue
|
|
||||||
tok = token
|
|
||||||
output.write(" <ref name='%s'/>\n" % (token))
|
|
||||||
count = count + 1
|
|
||||||
output.write(" </word>\n")
|
|
||||||
if letter is not None:
|
|
||||||
output.write(" </letter>\n")
|
|
||||||
output.write(" </chunk>\n")
|
|
||||||
if count != 0:
|
|
||||||
chunks.append(["chunk%s" % (chunk - 1), first_letter, letter])
|
|
||||||
output.write(" <chunks>\n")
|
|
||||||
for ch in chunks:
|
|
||||||
output.write(" <chunk name='%s' start='%s' end='%s'/>\n" % (
|
|
||||||
ch[0], ch[1], ch[2]))
|
|
||||||
output.write(" </chunks>\n")
|
|
||||||
|
|
||||||
def serialize_xrefs(self, output):
|
|
||||||
output.write(" <references>\n")
|
|
||||||
self.serialize_xrefs_references(output)
|
|
||||||
output.write(" </references>\n")
|
|
||||||
output.write(" <alpha>\n")
|
|
||||||
self.serialize_xrefs_alpha(output)
|
|
||||||
output.write(" </alpha>\n")
|
|
||||||
output.write(" <constructors>\n")
|
|
||||||
self.serialize_xrefs_constructors(output)
|
|
||||||
output.write(" </constructors>\n")
|
|
||||||
output.write(" <functions>\n")
|
|
||||||
self.serialize_xrefs_functions(output)
|
|
||||||
output.write(" </functions>\n")
|
|
||||||
output.write(" <files>\n")
|
|
||||||
self.serialize_xrefs_files(output)
|
|
||||||
output.write(" </files>\n")
|
|
||||||
output.write(" <index>\n")
|
|
||||||
self.serialize_xrefs_index(output)
|
|
||||||
output.write(" </index>\n")
|
|
||||||
|
|
||||||
def serialize(self):
|
def serialize(self):
|
||||||
filename = "%s/%s-api.xml" % (self.path, self.name)
|
filename = "%s/%s-api.xml" % (self.path, self.name)
|
||||||
if not quiet:
|
if not quiet:
|
||||||
@ -2519,16 +2359,6 @@ class docBuilder:
|
|||||||
print("apibuild.py: %d error(s) encountered during generation" % self.errors, file=sys.stderr)
|
print("apibuild.py: %d error(s) encountered during generation" % self.errors, file=sys.stderr)
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
filename = "%s/%s-refs.xml" % (self.path, self.name)
|
|
||||||
if not quiet:
|
|
||||||
print("Saving XML Cross References %s" % (filename))
|
|
||||||
output = open(filename, "w")
|
|
||||||
output.write('<?xml version="1.0" encoding="ISO-8859-1"?>\n')
|
|
||||||
output.write("<apirefs name='%s'>\n" % self.name)
|
|
||||||
self.serialize_xrefs(output)
|
|
||||||
output.write("</apirefs>\n")
|
|
||||||
output.close()
|
|
||||||
|
|
||||||
|
|
||||||
class app:
|
class app:
|
||||||
def warning(self, msg):
|
def warning(self, msg):
|
||||||
|
Loading…
Reference in New Issue
Block a user