/* Free malloc'd memory for color elements */ void free_color_lists (void) { if (pair_list) list_remove_nodes (pair_list); if (color_list) list_remove_nodes (color_list); color_list = NULL; pair_list = NULL; }
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; }
static void free_agent_values (GO_UNUSED gpointer k, gpointer v, GO_UNUSED gpointer data_ptr) { void *list = v; if (list != NULL) list_remove_nodes (list); }
static void free_agent_values (TCADB * adb, void *key, int ksize, GO_UNUSED void *user_data) { void *list; int sp = 0; list = tcadbget (adb, key, ksize, &sp); if (list) list_remove_nodes (list); free (key); }