Fix compiler warnings.
[collection4.git] / graph_ident.h
1 #ifndef GRAPH_IDENT_H
2 #define GRAPH_IDENT_H 1
3
4 #define ANY_TOKEN "/any/"
5 #define ALL_TOKEN "/all/"
6
7 struct graph_ident_s;
8 typedef struct graph_ident_s graph_ident_t;
9
10 graph_ident_t *ident_create (const char *host,
11     const char *plugin, const char *plugin_instance,
12     const char *type, const char *type_instance);
13 graph_ident_t *ident_clone (const graph_ident_t *ident);
14
15 #define IDENT_FLAG_REPLACE_ALL 0x01
16 #define IDENT_FLAG_REPLACE_ANY 0x02
17 graph_ident_t *ident_copy_with_selector (const graph_ident_t *selector,
18     const graph_ident_t *ident, unsigned int flags);
19
20 void ident_destroy (graph_ident_t *ident);
21
22 const char *ident_get_host (graph_ident_t *ident);
23 const char *ident_get_plugin (graph_ident_t *ident);
24 const char *ident_get_plugin_instance (graph_ident_t *ident);
25 const char *ident_get_type (graph_ident_t *ident);
26 const char *ident_get_type_instance (graph_ident_t *ident);
27
28 int ident_set_host (graph_ident_t *ident, const char *host);
29 int ident_set_plugin (graph_ident_t *ident, const char *plugin);
30 int ident_set_plugin_instance (graph_ident_t *ident,
31     const char *plugin_instance);
32 int ident_set_type (graph_ident_t *ident, const char *type);
33 int ident_set_type_instance (graph_ident_t *ident,
34     const char *type_instance);
35
36 int ident_compare (const graph_ident_t *i0,
37     const graph_ident_t *i1);
38
39 _Bool ident_matches (const graph_ident_t *selector,
40                 const graph_ident_t *ident);
41
42 char *ident_to_string (const graph_ident_t *ident);
43 char *ident_to_file (const graph_ident_t *ident);
44 char *ident_to_json (const graph_ident_t *ident);
45
46 /* vim: set sw=2 sts=2 et fdm=marker : */
47 #endif /* GRAPH_IDENT_H */