diff --git a/src/common/hostlist.h b/src/common/hostlist.h index 3128dfe64201e7ed4943415ca4220064da1cc082..f19826194ca55578a8b0da05645034fb94589d8b 100644 --- a/src/common/hostlist.h +++ b/src/common/hostlist.h @@ -1,7 +1,7 @@ /*****************************************************************************\ * $Id$ ***************************************************************************** - * $LSDId: hostlist.h,v 1.2 2003/04/24 00:15:27 grondo Exp $ + * $LSDId: hostlist.h,v 1.3 2003/04/25 23:38:30 grondo Exp $ ***************************************************************************** * Copyright (C) 2002 The Regents of the University of California. * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). @@ -71,12 +71,6 @@ typedef struct hostset * hostset_t; */ typedef struct hostlist_iterator * hostlist_iterator_t; -/* ----[ general node name functions: ]---- */ - -/* getnodename - equivalent to gethostname, but return only the first component of the fully - * qualified name (e.g. "linux123.foo.bar" becomes "linux123") */ -extern int getnodename (char *name, size_t len); - /* ----[ hostlist_t functions: ]---- */ /* ----[ hostlist creation and destruction ]---- */ @@ -107,14 +101,14 @@ extern int getnodename (char *name, size_t len); * The returned hostlist must be freed with hostlist_destroy() * */ -hostlist_t hostlist_create(char *str); +hostlist_t hostlist_create(const char *hostlist); /* hostlist_copy(): * * Allocate a copy of a hostlist object. Returned hostlist must be freed * with hostlist_destroy. */ -hostlist_t hostlist_copy(hostlist_t hl); +hostlist_t hostlist_copy(const hostlist_t hl); /* hostlist_destroy(): * @@ -134,7 +128,7 @@ void hostlist_destroy(hostlist_t hl); * Returns the number of hostnames inserted into the list, * or 0 on failure. */ -int hostlist_push(hostlist_t hl, char *hosts); +int hostlist_push(hostlist_t hl, const char *hosts); /* hostlist_push_host(): @@ -145,7 +139,7 @@ int hostlist_push(hostlist_t hl, char *hosts); * * return value is 1 for success, 0 for failure. */ -int hostlist_push_host(hostlist_t hl, char *host); +int hostlist_push_host(hostlist_t hl, const char *host); /* hostlist_push_list(): @@ -211,7 +205,7 @@ char * hostlist_shift_range(hostlist_t hl); * Returns -1 if host is not found. * */ -int hostlist_find(hostlist_t hl, char *hostname); +int hostlist_find(hostlist_t hl, const char *hostname); /* hostlist_delete(): * @@ -219,7 +213,7 @@ int hostlist_find(hostlist_t hl, char *hostname); * * Returns the number of hosts successfully deleted */ -int hostlist_delete(hostlist_t hl, char *hosts); +int hostlist_delete(hostlist_t hl, const char *hosts); /* hostlist_delete_host(): @@ -230,7 +224,7 @@ int hostlist_delete(hostlist_t hl, char *hosts); * * Returns 1 if successful, 0 if hostname is not found in list. */ -int hostlist_delete_host(hostlist_t hl, char *hostname); +int hostlist_delete_host(hostlist_t hl, const char *hostname); /* hostlist_delete_nth(): @@ -370,7 +364,7 @@ int hostlist_remove(hostlist_iterator_t i); * Create a new hostset object from a string representation of a list of * hosts. See hostlist_create() for valid hostlist forms. */ -hostset_t hostset_create(char *hostlist); +hostset_t hostset_create(const char *hostlist); /* hostset_copy(): * @@ -388,19 +382,19 @@ void hostset_destroy(hostset_t set); * Returns number of hosts successfully added to "set" * (insertion of a duplicate is not considered successful) */ -int hostset_insert(hostset_t set, char *hosts); +int hostset_insert(hostset_t set, const char *hosts); /* hostset_delete(): * Delete a host or list of hosts from hostset "set." * Returns number of hosts deleted from set. */ -int hostset_delete(hostset_t set, char *hosts); +int hostset_delete(hostset_t set, const char *hosts); /* hostset_within(): * Return 1 if all hosts specified by "hosts" are within the hostset "set" * Retrun 0 if every host in "hosts" is not in the hostset "set" */ -int hostset_within(hostset_t set, char *hosts); +int hostset_within(hostset_t set, const char *hosts); /* hostset_shift(): * hostset equivalent to hostlist_shift()