int set_host_agents (const char *addr, void (*func) (void *, void *, int), void *arr) { TCLIST *tclist; GSLList *list; int data_nkey, count = 0; data_nkey = get_int_from_keymap (addr, HOSTS); if (data_nkey == 0) return 1; tclist = get_host_agent_list (data_nkey); if (!tclist) return 1; list = tclist_to_gsllist (tclist); if ((count = list_count (list)) == 0) { free (list); return 1; } func (list, arr, count); list_remove_nodes (list); tclistdel (tclist); return 0; }
int set_host_agents (const char *addr, void (*func) (void *, void *, int), void *arr) { TCLIST *tclist; GSLList *list; int key, count = 0; key = ht_get_keymap (HOSTS, addr); if (key == 0) return 1; tclist = ht_get_host_agent_tclist (HOSTS, key); if (!tclist) return 1; list = tclist_to_gsllist (tclist); if ((count = list_count (list)) == 0) { free (list); return 1; } func (list, arr, count); list_remove_nodes (list); tclistdel (tclist); return 0; }