2 #define GRAPH_IDENT_H 1
6 #define ANY_TOKEN "/any/"
7 #define ALL_TOKEN "/all/"
9 #define IS_ANY(str) (((str) != NULL) && (strcasecmp (ANY_TOKEN, (str)) == 0))
10 #define IS_ALL(str) (((str) != NULL) && (strcasecmp (ALL_TOKEN, (str)) == 0))
13 typedef struct graph_ident_s graph_ident_t;
15 graph_ident_t *ident_create (const char *host,
16 const char *plugin, const char *plugin_instance,
17 const char *type, const char *type_instance);
18 graph_ident_t *ident_clone (const graph_ident_t *ident);
20 #define IDENT_FLAG_REPLACE_ALL 0x01
21 #define IDENT_FLAG_REPLACE_ANY 0x02
22 graph_ident_t *ident_copy_with_selector (const graph_ident_t *selector,
23 const graph_ident_t *ident, unsigned int flags);
25 void ident_destroy (graph_ident_t *ident);
27 const char *ident_get_host (graph_ident_t *ident);
28 const char *ident_get_plugin (graph_ident_t *ident);
29 const char *ident_get_plugin_instance (graph_ident_t *ident);
30 const char *ident_get_type (graph_ident_t *ident);
31 const char *ident_get_type_instance (graph_ident_t *ident);
33 int ident_set_host (graph_ident_t *ident, const char *host);
34 int ident_set_plugin (graph_ident_t *ident, const char *plugin);
35 int ident_set_plugin_instance (graph_ident_t *ident,
36 const char *plugin_instance);
37 int ident_set_type (graph_ident_t *ident, const char *type);
38 int ident_set_type_instance (graph_ident_t *ident,
39 const char *type_instance);
41 int ident_compare (const graph_ident_t *i0,
42 const graph_ident_t *i1);
44 _Bool ident_matches (const graph_ident_t *selector,
45 const graph_ident_t *ident);
47 char *ident_to_string (const graph_ident_t *ident);
48 char *ident_to_file (const graph_ident_t *ident);
49 char *ident_to_json (const graph_ident_t *ident);
51 time_t ident_get_mtime (const graph_ident_t *ident);
53 /* vim: set sw=2 sts=2 et fdm=marker : */
54 #endif /* GRAPH_IDENT_H */