mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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: Ján Tomko <jtomko@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user