search for: add_host_to_hostlist

Displaying 1 result from an estimated 1 matches for "add_host_to_hostlist".

2004 Oct 03
0
[patch] tell user about hosts with same key
...goto fail; --- hostfile.c 2004/10/02 21:27:21 1.1 +++ hostfile.c 2004/10/02 21:57:04 @@ -197,6 +197,115 @@ found, numret)); } +void +free_hostlist(HostList *l) +{ + HostList *n; + + for (; l != NULL; l = n) { + n = l->next; + free(l->host); + free(l); + } +} + +static HostList * +add_host_to_hostlist(HostList *l, char *hostname) +{ + HostList *n = malloc(sizeof(*n)); + n->host = malloc(strlen(hostname) + 1); + sprintf(n->host, "%s", hostname); + n->next = l; + return n; +} + +HostList * +find_hosts_by_key(const char *filename, const Key *search_key, HostList *initial_hosts) +...