2 #define GRAPH_IDENT_H 1
5 #include "graph_types.h"
7 #define ANY_TOKEN "/any/"
8 #define ALL_TOKEN "/all/"
10 #define IS_ANY(str) (((str) != NULL) && (strcasecmp (ANY_TOKEN, (str)) == 0))
11 #define IS_ALL(str) (((str) != NULL) && (strcasecmp (ALL_TOKEN, (str)) == 0))
13 enum graph_ident_field_e
22 typedef enum graph_ident_field_e graph_ident_field_t;
24 graph_ident_t *ident_create (const char *host,
25 const char *plugin, const char *plugin_instance,
26 const char *type, const char *type_instance);
27 graph_ident_t *ident_clone (const graph_ident_t *ident);
29 #define IDENT_FLAG_REPLACE_ALL 0x01
30 #define IDENT_FLAG_REPLACE_ANY 0x02
31 graph_ident_t *ident_copy_with_selector (const graph_ident_t *selector,
32 const graph_ident_t *ident, unsigned int flags);
34 void ident_destroy (graph_ident_t *ident);
36 const char *ident_get_host (graph_ident_t *ident);
37 const char *ident_get_plugin (graph_ident_t *ident);
38 const char *ident_get_plugin_instance (graph_ident_t *ident);
39 const char *ident_get_type (graph_ident_t *ident);
40 const char *ident_get_type_instance (graph_ident_t *ident);
41 const char *ident_get_field (graph_ident_t *ident,
42 graph_ident_field_t field);
44 int ident_set_host (graph_ident_t *ident, const char *host);
45 int ident_set_plugin (graph_ident_t *ident, const char *plugin);
46 int ident_set_plugin_instance (graph_ident_t *ident,
47 const char *plugin_instance);
48 int ident_set_type (graph_ident_t *ident, const char *type);
49 int ident_set_type_instance (graph_ident_t *ident,
50 const char *type_instance);
52 int ident_compare (const graph_ident_t *i0,
53 const graph_ident_t *i1);
55 _Bool ident_matches (const graph_ident_t *selector,
56 const graph_ident_t *ident);
58 char *ident_to_string (const graph_ident_t *ident);
59 char *ident_to_file (const graph_ident_t *ident);
60 char *ident_to_json (const graph_ident_t *ident);
62 time_t ident_get_mtime (const graph_ident_t *ident);
64 /* vim: set sw=2 sts=2 et fdm=marker : */
65 #endif /* GRAPH_IDENT_H */