libgenders - a library of functions to parse and retrieve genders data
Contents
Description
The genders library functions are a set of functions used to parse and retrieve data from a genders file.
For API details, please see the individual manpages for each of the functions above, or read the comments
written in /usr/include/genders.h.
Files
/usr/include/genders.h
/etc/genders
Genders File Format
Each line of the genders file has one of the following formats. See the section HOST RANGES below for
information on host range formatting.
nodename attr[=value],attr[=value],...
nodename1,nodename2,... attr[=value],attr[=value],...
nodenames[A-B] attr[=value],attr[=value],...
The nodename(s) are the shortened hostnames of a node. This is followed by any number of spaces or tabs,
and then the comma-separated list of attributes, each of which can optionally have a value. The
substitution string "%n" can be used in an attribute value to represent the nodename. Nodenames can be
listed on multiple lines, so a node's attributes can be specified on multiple lines. However, no single
node may have duplicate attributes.
There must be no spaces embedded in the attribute list and there is no provision for continuation lines.
Commas and equal characters are special and cannot appear in attribute names or their values. Comments
are prefixed with the hash chracter (#) and can appear anywhere in the file. The active genders file is
typically found at /etc/genders or /admin/etc/genders.
Here is an example genders file from a small 16-node linux cluster:
# slc cluster genders file
slci,slcj,slc[0-15] eth2=e%n,cluster=slc,all
slci passwdhost
slci,slcj management
slc[1-15] compute
Host Ranges
As noted in sections above, the genders database accepts ranges of nodenames in the general form:
prefix[n-m,l-k,...], where n < m and l < k, etc., as an alternative to explicit lists of nodenames.
This range syntax is meant only as a convenience on clusters with a prefixNN naming convention and
specification of ranges should not be considered necessary -- the list foo1,foo9 could be specified as
such, or by the range foo[1,9].
Some examples of range usage follow:
foo01,foo02,foo03,foo04,foo05: foo[01-05]
foo3,foo7,foo9,foo11: foo[3,7,9-11]
fooi,fooj,foo0,foo1,foo2: fooi,fooj,foo[0-2]
Name
libgenders - a library of functions to parse and retrieve genders data
See Also
Libgenders(3), Genders(3), genders_handle_create(3), genders_handle_destroy(3), genders_load_data(3), genders_errnum(3), genders_strerror(3), genders_errormsg(3), genders_perror(3), genders_getnumnodes(3), genders_getnumattrs(3), genders_getmaxattrs(3), genders_getmaxnodelen(3), genders_getmaxattrlen(3), genders_getmaxvallen(3), genders_nodelist_create(3), genders_nodelist_clear(3), genders_nodelist_destroy(3), genders_attrlist_create(3), genders_attrlist_clear(3), genders_attrlist_destroy(3), genders_vallist_create(3), genders_vallist_clear(3), genders_vallist_destroy(3), genders_getnodename(3), genders_getnodes(3), genders_getattr(3), genders_getattr_all(3), genders_testattr(3), genders_testattrval(3), genders_testnode(3), genders_index_nodes(3), genders_index_attrs(3), genders_index_attrvals(3), genders_query(3), genders_testquery(3), genders_parse(3) LLNL August 2003 LIBGENDERS(3)
Synopsis
#include<genders.h>genders_tgenders_handle_create(void);intgenders_handle_destroy(genders_thandle);intgenders_load_data(genders_thandle,constchar*filename);intgenders_errnum(genders_thandle);char*genders_strerror(interrnum);char*genders_errormsg(genders_thandle);voidgenders_perror(genders_thandle,constchar*msg);intgenders_getnumnodes(genders_thandle);intgenders_getnumattrs(genders_thandle);intgenders_getmaxattrs(genders_thandle);intgenders_getmaxnodelen(genders_thandle);intgenders_getmaxattrlen(genders_thandle);intgenders_getmaxvallen(genders_thandle);intgenders_nodelist_create(genders_thandle,char***nodelist);intgenders_nodelist_clear(genders_thandle,char**nodelist);intgenders_nodelist_destroy(genders_thandle,char**nodelist);intgenders_attrlist_create(genders_thandle,char***attrlist);intgenders_attrlist_clear(genders_thandle,char**attrlist);intgenders_attrlist_destroy(genders_thandle,char**attrlist);intgenders_vallist_create(genders_thandle,char***vallist);intgenders_vallist_clear(genders_thandle,char**vallist);intgenders_vallist_destroy(genders_thandle,char**vallist);intgenders_getnodename(genders_thandle,char*node,intlen);intgenders_getnodes(genders_thandle,char*nodes[],intlen,constchar*attr,constchar*val);intgenders_getattr(genders_thandle,char*attrs[],char*vals[],intlen,constchar*node);intgenders_getattr_all(genders_thandle,char*attrs[],intlen);intgenders_testattr(genders_thandle,constchar*node,constchar*attr,char*val,intlen);intgenders_testattrval(genders_thandle,constchar*node,constchar*attr,constchar*val);intgenders_isnode(genders_thandle,constchar*node);intgenders_isattr(genders_thandle,constchar*attr);intgenders_isattrval(genders_thandle,constchar*attr,constchar*val);intgenders_index_attrvals(genders_thandle,constchar*attr);intgenders_query(genders_thandle,char*nodes[],intlen,constchar*query);intgenders_testquery(genders_thandle,constchar*node,constchar*query);intgenders_parse(genders_thandle,constchar*filename,FILE*stream);
