/* Add the given user agent value into our array of GAgents. * * On error, 1 is returned. * On success, the user agent is added to the array and 0 is returned. */ static int fill_host_agents (void *val, void *user_data) { GAgents *agents = user_data; char *agent = ht_get_host_agent_val ((*(int *) val)); if (agent == NULL) return 1; agents->items[agents->size].agent = agent; agents->size++; return 0; }
/* Fill the given terminal dashboard menu with user agent data. * * On error, the 1 is returned. * On success, 0 is returned. */ static int fill_host_agents_gmenu (void *val, void *user_data) { GMenu *menu = user_data; char *agent = ht_get_host_agent_val ((*(int *) val)); if (agent == NULL) return 1; menu->items[menu->size].name = agent; menu->items[menu->size].checked = 0; menu->size++; return 0; }