提交 5bd8a1c5 编写于 作者: P Pavel Hrdina

util: introduce virXMLNodeNameEqual

Signed-off-by: NPavel Hrdina <phrdina@redhat.com>
上级 a0453176
...@@ -2931,6 +2931,7 @@ virVHBAPathExists; ...@@ -2931,6 +2931,7 @@ virVHBAPathExists;
virXMLCheckIllegalChars; virXMLCheckIllegalChars;
virXMLChildElementCount; virXMLChildElementCount;
virXMLExtractNamespaceXML; virXMLExtractNamespaceXML;
virXMLNodeNameEqual;
virXMLNodeSanitizeNamespaces; virXMLNodeSanitizeNamespaces;
virXMLNodeToString; virXMLNodeToString;
virXMLParseHelper; virXMLParseHelper;
......
...@@ -950,6 +950,22 @@ virXMLNodeToString(xmlDocPtr doc, ...@@ -950,6 +950,22 @@ virXMLNodeToString(xmlDocPtr doc,
return ret; return ret;
} }
/**
* virXMLNodeNameEqual:
* @node: xml Node pointer to check
* @name: name of the @node
*
* Compares the @node name with @name.
*/
bool
virXMLNodeNameEqual(xmlNodePtr node,
const char *name)
{
return xmlStrEqual(node->name, BAD_CAST name);
}
typedef int (*virXMLForeachCallback)(xmlNodePtr node, typedef int (*virXMLForeachCallback)(xmlNodePtr node,
void *opaque); void *opaque);
......
...@@ -168,6 +168,9 @@ int virXMLSaveFile(const char *path, ...@@ -168,6 +168,9 @@ int virXMLSaveFile(const char *path,
char *virXMLNodeToString(xmlDocPtr doc, xmlNodePtr node); char *virXMLNodeToString(xmlDocPtr doc, xmlNodePtr node);
bool virXMLNodeNameEqual(xmlNodePtr node,
const char *name);
xmlNodePtr virXMLFindChildNodeByNs(xmlNodePtr root, xmlNodePtr virXMLFindChildNodeByNs(xmlNodePtr root,
const char *uri); const char *uri);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册