1GENDERS_QUERY(3) LIBGENDERS GENDERS_QUERY(3)
2
3
4
6 genders_query - query genders database for a set of nodes
7
9 #include <genders.h>
10
11 int genders_query(genders_t handle, char *nodes[], int len, const char
12 *query);
13
15 genders_query() queries the genders database for a set of nodes based
16 on the union, intersection, difference, or complement of genders
17 attributes and values. The query for a set of nodes is passed as a
18 string through the query parameter. The set operation union is repre‐
19 sented by two pipe symbols ('||'), intersection by two ampersand sym‐
20 bols ('&&'), difference by two minus symbols ('--'), and complement by
21 a tilde ('~'). Set operations are performed left to right. Parenthe‐
22 ses may be used to change the order of operations. A list of query
23 examples are listed below. A NULL query retrieves all nodes from the
24 genders database.
25
26 The nodes from the query are stored in the list pointed to by nodes.
27 len indicates the number of nodes that can be stored in the list.
28
29 To avoid passing in a list that is not large enough to store all the
30 nodes, genders_getnumnodes(3) should be used to determine the minimum
31 number of elements nodes should be able to store. gen‐
32 ders_nodelist_create(3) could be used to create a list that is guaran‐
33 teed to be large enough to store all of the nodes.
34
36 The following are example queries that can be passed to gen‐
37 ders_query().
38
39 Determine the set of nodes with the mgmt or login attribute:
40 "mgmt||login"
41
42 Determine the set of nodes that are not login nodes:
43 "all--login"
44
45 Determine the set of nodes that both login nodes and ntp servers:
46 "login&&ntpserv"
47
48 Determine the set of nodes that are not mgmt or login nodes:
49 "~(mgmt||login)"
50
52 On success, the number of nodes stored in nodes is returned. On error,
53 -1 is returned, and an error code is returned in handle. The error
54 code can be retrieved via genders_errnum(3) , and a description of the
55 error code can be retrieved via genders_strerror(3). Error codes are
56 defined in genders.h.
57
59 GENDERS_ERR_NULLHANDLE
60 The handle parameter is NULL. The genders handle must be cre‐
61 ated with genders_handle_create(3).
62
63 GENDERS_ERR_NOTLOADED
64 genders_load_data(3) has not been called to load genders data.
65
66 GENDERS_ERR_OVERFLOW
67 The list pointed to by nodes is not large enough to store all
68 the nodes.
69
70 GENDERS_ERR_PARAMETERS
71 An incorrect parameter has been passed in.
72
73 GENDERS_ERR_SYNTAX
74 There is a syntax error in the query.
75
76 GENDERS_ERR_OUTMEM
77 malloc(3) has failed internally, system is out of memory.
78
79 GENDERS_ERR_NULLPTR
80 A null pointer has been found in the list passed in.
81
82 GENDERS_ERR_MAGIC
83 handle has an incorrect magic number. handle does not point to
84 a genders handle or handle has been destroyed by genders_han‐
85 dle_destroy(3).
86
87 GENDERS_ERR_INTERNAL
88 An internal system error has occurred.
89
91 /usr/include/genders.h
92
94 libgenders(3), genders_handle_create(3), genders_load_data(3), gen‐
95 ders_getnumnodes(3), genders_nodelist_create(3), genders_errnum(3),
96 genders_strerror(3)
97
98
99
100LLNL June 2004 GENDERS_QUERY(3)