object_id = xmlGetProp(new_obj, XML_ATTR_ID); 
object_id = crm_element_value(new_obj, XML_ATTR_ID); 
update_cib_object(xmlNodePtr parent, xmlNodePtr new_obj, gboolean force){	const char *replace = NULL;	const char *object_name = NULL;	const char *object_id = NULL;	xmlNodePtr equiv_node = NULL;	int result = cib_ok;		if(new_obj != NULL) {		object_name = new_obj->name;	}	object_id = xmlGetProp(new_obj, XML_ATTR_ID);		if(new_obj == NULL) {		result = cib_NOOBJECT;	} else if(parent == NULL) {		result = cib_NOPARENT;	} else if(object_id == NULL) {		/*  placeholder object */		equiv_node = find_xml_node(parent, object_name, FALSE);	} else {		equiv_node = find_entity(parent, object_name, object_id, FALSE);	}	cib_pre_notify(CRM_OP_CIB_UPDATE, equiv_node, new_obj);	if(result != cib_ok) {		; /* nothing */			} else if(equiv_node == NULL) {		crm_debug("No node to update, creating %s instead", new_obj->name);		if(parent == NULL) {			crm_warn("Failed to add <%s id=%s> (NULL parent)",				 object_name, object_id);			result = cib_NODECOPY;					} else if(add_node_copy(parent, new_obj) == NULL) {			crm_warn("Failed to add  <%s id=%s>", object_name, object_id);			result = cib_NODECOPY;		} else {			crm_debug("Added  <%s id=%s>", object_name, object_id);			if(object_id == NULL) {				/*  placeholder object */				equiv_node = find_xml_node(parent, object_name, TRUE);							} else {				equiv_node = find_entity(parent, object_name, object_id, FALSE);			}		}			} else {		crm_verbose("Found node <%s id=%s> to update", object_name, object_id);		replace = xmlGetProp(new_obj, XML_CIB_ATTR_REPLACE);				if(replace != NULL) {			xmlNodePtr remove = find_xml_node(equiv_node, replace, FALSE);			if(remove != NULL) {				crm_debug("Replacing node <%s> in <%s>",					  replace, equiv_node->name);				xmlUnlinkNode(remove);				remove->doc = NULL;				free_xml(remove);				}			xmlUnsetProp(new_obj, XML_CIB_ATTR_REPLACE);			xmlUnsetProp(equiv_node, XML_CIB_ATTR_REPLACE);		}				if(safe_str_eq(XML_CIB_TAG_STATE, object_name)){			update_node_state(equiv_node, new_obj);					} else {			copy_in_properties(equiv_node, new_obj);					}		crm_debug("Processing children of <%s id=%s>",			  object_name, object_id);				xml_child_iter(			new_obj, a_child, NULL, 			int tmp_result = 0;			crm_debug("Updating child <%s id=%s>",				  a_child->name,				  xmlGetProp(a_child, XML_ATTR_ID));						tmp_result =				update_cib_object(equiv_node, a_child, force);			/*  only the first error is likely to be interesting */			if(tmp_result != cib_ok) {				crm_err("Error updating child <%s id=%s>",					a_child->name,					xmlGetProp(a_child, XML_ATTR_ID));								if(result == cib_ok) {					result = tmp_result;				}			}			);			}	crm_debug("Finished with <%s id=%s>", object_name, object_id);		cib_post_notify(CRM_OP_CIB_UPDATE, new_obj, result, equiv_node);	return result;}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/c7c5fc7c53a15eefc2aea4bf8ccaf2175307f9f5/primatives.c/clean/crm/cib/primatives.c