Skip to content
Snippets Groups Projects
Commit 9cb1fcba authored by Mark Grondona's avatar Mark Grondona
Browse files

o Updated to latest hostlist.h from LSD-Tools project.

parent 78616bc6
No related branches found
No related tags found
No related merge requests found
/*****************************************************************************\ /*****************************************************************************\
* $Id$ * $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. * Copyright (C) 2002 The Regents of the University of California.
* Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER). * Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
...@@ -71,12 +71,6 @@ typedef struct hostset * hostset_t; ...@@ -71,12 +71,6 @@ typedef struct hostset * hostset_t;
*/ */
typedef struct hostlist_iterator * hostlist_iterator_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_t functions: ]---- */
/* ----[ hostlist creation and destruction ]---- */ /* ----[ hostlist creation and destruction ]---- */
...@@ -107,14 +101,14 @@ extern int getnodename (char *name, size_t len); ...@@ -107,14 +101,14 @@ extern int getnodename (char *name, size_t len);
* The returned hostlist must be freed with hostlist_destroy() * The returned hostlist must be freed with hostlist_destroy()
* *
*/ */
hostlist_t hostlist_create(char *str); hostlist_t hostlist_create(const char *hostlist);
/* hostlist_copy(): /* hostlist_copy():
* *
* Allocate a copy of a hostlist object. Returned hostlist must be freed * Allocate a copy of a hostlist object. Returned hostlist must be freed
* with hostlist_destroy. * with hostlist_destroy.
*/ */
hostlist_t hostlist_copy(hostlist_t hl); hostlist_t hostlist_copy(const hostlist_t hl);
/* hostlist_destroy(): /* hostlist_destroy():
* *
...@@ -134,7 +128,7 @@ void hostlist_destroy(hostlist_t hl); ...@@ -134,7 +128,7 @@ void hostlist_destroy(hostlist_t hl);
* Returns the number of hostnames inserted into the list, * Returns the number of hostnames inserted into the list,
* or 0 on failure. * or 0 on failure.
*/ */
int hostlist_push(hostlist_t hl, char *hosts); int hostlist_push(hostlist_t hl, const char *hosts);
/* hostlist_push_host(): /* hostlist_push_host():
...@@ -145,7 +139,7 @@ int hostlist_push(hostlist_t hl, char *hosts); ...@@ -145,7 +139,7 @@ int hostlist_push(hostlist_t hl, char *hosts);
* *
* return value is 1 for success, 0 for failure. * 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(): /* hostlist_push_list():
...@@ -211,7 +205,7 @@ char * hostlist_shift_range(hostlist_t hl); ...@@ -211,7 +205,7 @@ char * hostlist_shift_range(hostlist_t hl);
* Returns -1 if host is not found. * 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(): /* hostlist_delete():
* *
...@@ -219,7 +213,7 @@ int hostlist_find(hostlist_t hl, char *hostname); ...@@ -219,7 +213,7 @@ int hostlist_find(hostlist_t hl, char *hostname);
* *
* Returns the number of hosts successfully deleted * 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(): /* hostlist_delete_host():
...@@ -230,7 +224,7 @@ int hostlist_delete(hostlist_t hl, char *hosts); ...@@ -230,7 +224,7 @@ int hostlist_delete(hostlist_t hl, char *hosts);
* *
* Returns 1 if successful, 0 if hostname is not found in list. * 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(): /* hostlist_delete_nth():
...@@ -370,7 +364,7 @@ int hostlist_remove(hostlist_iterator_t i); ...@@ -370,7 +364,7 @@ int hostlist_remove(hostlist_iterator_t i);
* Create a new hostset object from a string representation of a list of * Create a new hostset object from a string representation of a list of
* hosts. See hostlist_create() for valid hostlist forms. * hosts. See hostlist_create() for valid hostlist forms.
*/ */
hostset_t hostset_create(char *hostlist); hostset_t hostset_create(const char *hostlist);
/* hostset_copy(): /* hostset_copy():
* *
...@@ -388,19 +382,19 @@ void hostset_destroy(hostset_t set); ...@@ -388,19 +382,19 @@ void hostset_destroy(hostset_t set);
* Returns number of hosts successfully added to "set" * Returns number of hosts successfully added to "set"
* (insertion of a duplicate is not considered successful) * (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(): /* hostset_delete():
* Delete a host or list of hosts from hostset "set." * Delete a host or list of hosts from hostset "set."
* Returns number of hosts deleted from 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(): /* hostset_within():
* Return 1 if all hosts specified by "hosts" are within the hostset "set" * 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" * 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_shift():
* hostset equivalent to hostlist_shift() * hostset equivalent to hostlist_shift()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment