提交 67ecfb97 编写于 作者: J Ján Tomko

util: introduce virXMLNamespace

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: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJiri Denemark <jdenemar@redhat.com>
上级 94c34cbd
...@@ -246,3 +246,17 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore); ...@@ -246,3 +246,17 @@ VIR_DEFINE_AUTOCLEAN_FUNC(virXPathContextNodeSave, virXPathContextNodeRestore);
VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc); VIR_DEFINE_AUTOPTR_FUNC(xmlDoc, xmlFreeDoc);
VIR_DEFINE_AUTOPTR_FUNC(xmlXPathContext, xmlXPathFreeContext); 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;
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册