xml_obj   = xml_resources; id       = xmlGetProp(xml_obj, XML_ATTR_ID); priority = xmlGetProp(
action_t *action_stop  = NULL; action_t *action_start = NULL; xmlNodePtr xml_obj     = xml_resources; const char *id         = xmlGetProp(xml_obj, XML_ATTR_ID); const char *priority   = xmlGetProp(
unpack_resources(xmlNodePtr xml_resources,		 GListPtr *resources,		 GListPtr *actions,		 GListPtr *action_cons,		 GListPtr all_nodes){	xmlNodePtr xml_obj   = NULL;	const char *id       = NULL;	const char *priority = NULL;	float priority_f;	resource_t *new_rsc = NULL;	action_t *action_stop = NULL;	action_t *action_start = NULL;	order_constraint_t *order = NULL;	crm_verbose("Begining unpack...");	while(xml_resources != NULL) {		xml_obj   = xml_resources;		id       = xmlGetProp(xml_obj, XML_ATTR_ID);		priority = xmlGetProp(			xml_obj, XML_CIB_ATTR_PRIORITY);		// todo: check for null		priority_f     = atof(priority);		xml_resources = xml_resources->next;		crm_verbose("Processing resource...");				if(id == NULL) {			crm_err("Must specify id tag in <resource>");			continue;		}		new_rsc = crm_malloc(sizeof(resource_t));		new_rsc->id		= id;		new_rsc->class		= xmlGetProp(xml_obj, "class");		new_rsc->type		= xmlGetProp(xml_obj, "type");		new_rsc->xml		= xml_obj;		new_rsc->priority	= priority_f; 		new_rsc->candidate_colors = NULL;		new_rsc->color		= NULL; 		new_rsc->runnable	= TRUE; 		new_rsc->provisional	= TRUE; 		new_rsc->allowed_nodes	= node_list_dup(all_nodes);    		new_rsc->rsc_cons	= NULL; 		new_rsc->node_cons	= NULL; 		new_rsc->cur_node	= NULL;				action_stop = action_new(			action_id++, new_rsc, stop_rsc);		action_start = action_new(			action_id++, new_rsc, start_rsc);		new_rsc->stop = action_stop;		*actions = g_list_append(*actions, action_stop);		new_rsc->start = action_start;		*actions = g_list_append(*actions, action_start);		order = (order_constraint_t*)			crm_malloc(sizeof(order_constraint_t));		order->id	 = order_id++;		order->lh_action = action_stop;		order->rh_action = action_start;		order->strength  = startstop;		*action_cons     = g_list_append(*action_cons, order);		*resources       = g_list_append(*resources, new_rsc);			crm_debug_action(print_resource("Added", new_rsc, FALSE));	}	*resources = g_list_sort(*resources, sort_rsc_priority);	return TRUE;}