char *xml_text = NULL; 
struct ha_msg *update_msg = ha_msg_new(6); const char *id = xmlGetProp(update, XML_ATTR_ID); const char *type = NULL;  ha_msg_add(update_msg, F_TYPE, T_CIB_NOTIFY); ha_msg_add(update_msg, F_SUBTYPE, T_CIB_PRE_NOTIFY); ha_msg_add(update_msg, F_CIB_OPERATION, op);  if(id != NULL) { ha_msg_add(update_msg, F_CIB_OBJID, id); }  if(update != NULL) { ha_msg_add(update_msg, F_CIB_OBJTYPE, update->name); } else if(existing != NULL) { ha_msg_add(update_msg, F_CIB_OBJTYPE, existing->name); }  type = cl_get_string(update_msg, F_CIB_OBJTYPE);  if(existing != NULL) { char *existing_s = dump_xml_unformatted(existing); if(existing_s != NULL) { ha_msg_add(update_msg, F_CIB_EXISTING, existing_s); } else { crm_debug("Update string was NULL (xml=%p)", update); } crm_free(existing_s); } if(update != NULL) { char *update_s = dump_xml_unformatted(update); if(update_s != NULL) { ha_msg_add(update_msg, F_CIB_UPDATE, update_s); } else { crm_debug("Update string was NULL (xml=%p)", update); } crm_free(update_s); }  g_hash_table_foreach(client_list, cib_notify_client, update_msg);  pending_updates++;  if(update == NULL) { crm_verbose("Performing operation %s (on section=%s)", op, type);  } else { crm_verbose("Performing %s on <%s%s%s>", op, type, id?" id=":"", id?id?""); }  ha_msg_del(update_msg); }  void cib_post_notify( const char *op, xmlNodePtr update, enum cib_errors result, xmlNodePtr new_obj) { struct ha_msg *update_msg = ha_msg_new(8); const char *id = xmlGetProp(new_obj, XML_ATTR_ID); const char *type = NULL;  ha_msg_add(update_msg, F_TYPE, T_CIB_NOTIFY); ha_msg_add(update_msg, F_SUBTYPE, T_CIB_POST_NOTIFY); ha_msg_add(update_msg, F_CIB_OPERATION, op); ha_msg_add_int(update_msg, F_CIB_RC, result);  if(id != NULL) { ha_msg_add(update_msg, F_CIB_OBJID, id); } if(update != NULL) { ha_msg_add(update_msg, F_CIB_OBJTYPE, update->name); } else if(new_obj != NULL) { ha_msg_add(update_msg, F_CIB_OBJTYPE, new_obj->name); }  type = cl_get_string(update_msg, F_CIB_OBJTYPE);  if(update != NULL) { char *update_s = dump_xml_unformatted(update); if(update_s != NULL) { ha_msg_add(update_msg, F_CIB_UPDATE, update_s); } else { crm_debug("Update string was NULL (xml=%p)", update); } crm_free(update_s); } if(new_obj != NULL) { char *new_obj_s = dump_xml_unformatted(new_obj); if(new_obj_s != NULL) { ha_msg_add(update_msg, F_CIB_UPDATE_RESULT, new_obj_s); } else { crm_debug("Update string was NULL (xml=%p)", new_obj); } crm_free(new_obj_s); }  g_hash_table_foreach(client_list, cib_notify_client, update_msg);  pending_updates--;  if(pending_updates == 0) { ha_msg_mod(update_msg, F_SUBTYPE, T_CIB_UPDATE_CONFIRM); g_hash_table_foreach(client_list, cib_notify_client, update_msg); }  ha_msg_del(update_msg); 
cib_pre_notify(	const char *op,  const char *type, const char *id, xmlNodePtr update) {	char *xml_text = NULL;	if(update == NULL) {		crm_verbose("Performing oeration %s (on section=%s)", op, type);	} else {		crm_verbose("Performing %s on <%s %s%s>",			    op, type, id?"id=":"", id);	}		if(msg_cib_strm == NULL) {		msg_cib_strm = fopen(DEVEL_DIR"/cib.log", "w");	}	xml_text = dump_xml_formatted(update);	fprintf(msg_cib_strm, "[Request (%s : %s : %s)]\t%s\n",		op, crm_str(type), crm_str(id), xml_text);	crm_free(xml_text);	xml_text = dump_xml_formatted(get_the_CIB());	fprintf(msg_cib_strm, "[CIB before %s]\t%s\n", op, xml_text);	crm_free(xml_text);	fflush(msg_cib_strm);}
8182	/local/tlutelli/issta_data/temp/c/2005_temp/2005/8182/e1a3ef58273c82ae249ab59987c9c008ab3b3822/notify.c/buggy/crm/cib/notify.c