From 67ecfb9781a79c7dd155a1ddfa936021b913ccbe Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Tue, 20 Aug 2019 17:45:10 +0200 Subject: [PATCH] util: introduce virXMLNamespace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit For various XMLs, we allow a custom namespace for passing unsupported configurations. Introduce a single structure to hold all the driver-specific functions to remove duplication. Signed-off-by: Ján Tomko Reviewed-by: Jiri Denemark --- src/util/virxml.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/util/virxml.h b/src/util/virxml.h index 6208977dd1..c0012d691d 100644 --- a/src/util/virxml.h +++ b/src/util/virxml.h @@ -246,3 +246,17 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore); VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); + +typedef int (*virXMLNamespaceParse)(xmlXPathContextPtr ctxt, void **nsdata); +typedef void (*virXMLNamespaceFree)(void *nsdata); +typedef int (*virXMLNamespaceFormat)(virBufferPtr buf, void *nsdata); +typedef const char *(*virXMLNamespaceHref)(void); + +struct _virXMLNamespace { + virXMLNamespaceParse parse; + virXMLNamespaceFree free; + virXMLNamespaceFormat format; + virXMLNamespaceHref href; +}; +typedef struct _virXMLNamespace virXMLNamespace; +typedef virXMLNamespace *virXMLNamespacePtr; -- 2.47.2