MCPcopy Create free account
hub / github.com/ClusterLabs/pacemaker / find_xml_node

Function find_xml_node

lib/common/xml.c:165–196  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165xmlNode *
166find_xml_node(xmlNode *root, const char * search_path, gboolean must_find)
167{
168 xmlNode *a_child = NULL;
169 const char *name = "NULL";
170 if(root != NULL) {
171 name = crm_element_name(root);
172 }
173
174 if(search_path == NULL) {
175 crm_warn("Will never find <NULL>");
176 return NULL;
177 }
178
179 for(a_child = __xml_first_child(root); a_child != NULL; a_child = __xml_next(a_child)) {
180 if(strcmp((const char *)a_child->name, search_path) == 0) {
181/* crm_trace("returning node (%s).", crm_element_name(a_child)); */
182 return a_child;
183 }
184 }
185
186 if(must_find) {
187 crm_warn("Could not find %s in %s.", search_path, name);
188 } else if(root != NULL) {
189 crm_trace("Could not find %s in %s.", search_path, name);
190 } else {
191 crm_trace("Could not find %s in <NULL>.", search_path);
192 }
193
194
195 return NULL;
196}
197
198xmlNode*
199find_entity(xmlNode *parent, const char *node_name, const char *id)

Callers 15

print_node_summaryFunction · 0.85
print_xml_diffFunction · 0.85
delete_cib_objectFunction · 0.85
readCibXmlFileFunction · 0.85
write_cib_contentsFunction · 0.85
register_cib_deviceFunction · 0.85
load_file_cibFunction · 0.85
cib_diff_version_detailsFunction · 0.85
fix_cib_diffFunction · 0.85
update_cib_objectFunction · 0.85
add_cib_objectFunction · 0.85
apply_cib_diffFunction · 0.85

Calls 2

__xml_first_childFunction · 0.85
__xml_nextFunction · 0.85

Tested by

no test coverage detected