1GENDERS_TESTQUERY(3) LIBGENDERS GENDERS_TESTQUERY(3)
2
3
4
6 genders_testquery - query genders database for a set of nodes
7
9 #include <genders.h>
10
11 int genders_testquery(genders_t handle, const char *node, const char
12 *query);
13
15 genders_testquery() tests if the node pointed to by node meets the con‐
16 ditions specified in the query. If node is NULL, the current node is
17 tested. Queries are based on the union, intersection, difference, or
18 complement of genders attributes and values. The query is passed as a
19 string through the query parameter. The set operation union is repre‐
20 sented by two pipe symbols ('||'), intersection by two ampersand sym‐
21 bols ('&&'), difference by two minus symbols ('--'), and complement by
22 a tilde ('~'). Set operations are performed left to right. Parenthe‐
23 ses may be used to change the order of operations. A list of query
24 examples are listed below. A NULL query retrieves all nodes from the
25 genders database.
26
28 The following are example queries that can be passed to genders_test‐
29 query().
30
31 Test if a node contains the mgmt or login attribute:
32 "mgmt||login"
33
34 Test if a node is not a login node:
35 "all--login"
36
37 Test if a node is both a login node and ntp server:
38 "login&&ntpserv"
39
40 Test if a node is not a mgmt or login node:
41 "~(mgmt||login)"
42
44 If the node as met the conditions of the query, 1 is returned. 0 is
45 returned if the node does not meet the conditions of the query. On
46 error, -1 is returned, and an error code is returned in handle. The
47 error code can be retrieved via genders_errnum(3) , and a description
48 of the error code can be retrieved via genders_strerror(3). Error
49 codes are defined in genders.h.
50
52 GENDERS_ERR_NULLHANDLE
53 The handle parameter is NULL. The genders handle must be cre‐
54 ated with genders_handle_create(3).
55
56 GENDERS_ERR_NOTLOADED
57 genders_load_data(3) has not been called to load genders data.
58
59 GENDERS_ERR_PARAMETERS
60 An incorrect parameter has been passed in.
61
62 GENDERS_ERR_SYNTAX
63 There is a syntax error in the query.
64
65 GENDERS_ERR_OUTMEM
66 malloc(3) has failed internally, system is out of memory.
67
68 GENDERS_ERR_MAGIC
69 handle has an incorrect magic number. handle does not point to
70 a genders handle or handle has been destroyed by genders_han‐
71 dle_destroy(3).
72
73 GENDERS_ERR_INTERNAL
74 An internal system error has occurred.
75
77 /usr/include/genders.h
78
80 libgenders(3), genders_handle_create(3), genders_load_data(3), gen‐
81 ders_errnum(3), genders_strerror(3)
82
83
84
85LLNL June 2004 GENDERS_TESTQUERY(3)