1LIBGENDERS(3) LIBGENDERS LIBGENDERS(3)
2
3
4
6 libgenders - a library of functions to parse and retrieve genders data
7
9 #include <genders.h>
10
11 genders_t genders_handle_create(void);
12
13 int genders_handle_destroy(genders_t handle);
14
15 int genders_load_data(genders_t handle, const char *filename);
16
17 int genders_errnum(genders_t handle);
18
19 char *genders_strerror(int errnum);
20
21 char *genders_errormsg(genders_t handle);
22
23 void genders_perror(genders_t handle, const char *msg);
24
25 int genders_getnumnodes(genders_t handle);
26
27 int genders_getnumattrs(genders_t handle);
28
29 int genders_getmaxattrs(genders_t handle);
30
31 int genders_getmaxnodelen(genders_t handle);
32
33 int genders_getmaxattrlen(genders_t handle);
34
35 int genders_getmaxvallen(genders_t handle);
36
37 int genders_nodelist_create(genders_t handle, char ***nodelist);
38
39 int genders_nodelist_clear(genders_t handle, char **nodelist);
40
41 int genders_nodelist_destroy(genders_t handle, char **nodelist);
42
43 int genders_attrlist_create(genders_t handle, char ***attrlist);
44
45 int genders_attrlist_clear(genders_t handle, char **attrlist);
46
47 int genders_attrlist_destroy(genders_t handle, char **attrlist);
48
49 int genders_vallist_create(genders_t handle, char ***vallist);
50
51 int genders_vallist_clear(genders_t handle, char **vallist);
52
53 int genders_vallist_destroy(genders_t handle, char **vallist);
54
55 int genders_getnodename(genders_t handle, char *node, int len);
56
57 int genders_getnodes(genders_t handle, char *nodes[], int len, const
58 char *attr, const char *val);
59
60 int genders_getattr(genders_t handle, char *attrs[], char *vals[], int
61 len, const char *node);
62
63 int genders_getattr_all(genders_t handle, char *attrs[], int len);
64
65 int genders_testattr(genders_t handle, const char *node, const char
66 *attr, char *val, int len);
67
68 int genders_testattrval(genders_t handle, const char *node, const char
69 *attr, const char *val);
70
71 int genders_isnode(genders_t handle, const char *node);
72
73 int genders_isattr(genders_t handle, const char *attr);
74
75 int genders_isattrval(genders_t handle, const char *attr, const char
76 *val);
77
78 int genders_index_attrvals(genders_t handle, const char *attr);
79
80 int genders_query(genders_t handle, char *nodes[], int len, const char
81 *query);
82
83 int genders_testquery(genders_t handle, const char *node, const char
84 *query);
85
86 int genders_parse(genders_t handle, const char *filename, FILE
87 *stream);
88
90 The genders library functions are a set of functions used to parse and
91 retrieve data from a genders file. For API details, please see the
92 individual manpages for each of the functions above, or read the com‐
93 ments written in /usr/include/genders.h.
94
96 Each line of the genders file has one of the following formats. See
97 the section HOST RANGES below for information on host range formatting.
98
99 nodename attr[=value],attr[=value],...
100 nodename1,nodename2,... attr[=value],attr[=value],...
101 nodenames[A-B] attr[=value],attr[=value],...
102
103 The nodename(s) are the shortened hostnames of a node. This is fol‐
104 lowed by any number of spaces or tabs, and then the comma-separated
105 list of attributes, each of which can optionally have a value. The
106 substitution string "%n" can be used in an attribute value to represent
107 the nodename. Nodenames can be listed on multiple lines, so a node's
108 attributes can be specified on multiple lines. However, no single node
109 may have duplicate attributes.
110
111 There must be no spaces embedded in the attribute list and there is no
112 provision for continuation lines. Commas and equal characters are spe‐
113 cial and cannot appear in attribute names or their values. Comments
114 are prefixed with the hash chracter (#) and can appear anywhere in the
115 file. The active genders file is typically found at /etc/genders or
116 /admin/etc/genders.
117
118 Here is an example genders file from a small 16-node linux cluster:
119
120 # slc cluster genders file
121 slci,slcj,slc[0-15] eth2=e%n,cluster=slc,all
122 slci passwdhost
123 slci,slcj management
124 slc[1-15] compute
125
126
128 As noted in sections above, the genders database accepts ranges of
129 nodenames in the general form: prefix[n-m,l-k,...], where n < m and l <
130 k, etc., as an alternative to explicit lists of nodenames.
131
132 This range syntax is meant only as a convenience on clusters with a
133 prefixNN naming convention and specification of ranges should not be
134 considered necessary -- the list foo1,foo9 could be specified as such,
135 or by the range foo[1,9].
136
137 Some examples of range usage follow:
138
139 foo01,foo02,foo03,foo04,foo05: foo[01-05]
140
141 foo3,foo7,foo9,foo11: foo[3,7,9-11]
142
143 fooi,fooj,foo0,foo1,foo2: fooi,fooj,foo[0-2]
144
145
147 /usr/include/genders.h
148
149 /etc/genders
150
152 Libgenders(3), Genders(3), genders_handle_create(3), genders_han‐
153 dle_destroy(3), genders_load_data(3), genders_errnum(3), genders_str‐
154 error(3), genders_errormsg(3), genders_perror(3), genders_get‐
155 numnodes(3), genders_getnumattrs(3), genders_getmaxattrs(3), gen‐
156 ders_getmaxnodelen(3), genders_getmaxattrlen(3), genders_getmax‐
157 vallen(3), genders_nodelist_create(3), genders_nodelist_clear(3), gen‐
158 ders_nodelist_destroy(3), genders_attrlist_create(3), gen‐
159 ders_attrlist_clear(3), genders_attrlist_destroy(3), genders_val‐
160 list_create(3), genders_vallist_clear(3), genders_vallist_destroy(3),
161 genders_getnodename(3), genders_getnodes(3), genders_getattr(3), gen‐
162 ders_getattr_all(3), genders_testattr(3), genders_testattrval(3), gen‐
163 ders_testnode(3), genders_index_nodes(3), genders_index_attrs(3), gen‐
164 ders_index_attrvals(3), genders_query(3), genders_testquery(3), gen‐
165 ders_parse(3)
166
167
168
169LLNL August 2003 LIBGENDERS(3)