summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils_base.h')
-rw-r--r--lib/utils_base.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h
index 49e40a6..6e1af94 100644
--- a/lib/utils_base.h
+++ b/lib/utils_base.h
@@ -28,6 +28,23 @@ typedef struct thresholds_struct {
28 range *critical; 28 range *critical;
29 } thresholds; 29 } thresholds;
30 30
31#define STATE_FORMAT_VERSION "1"
32
33typedef struct state_data_struct {
34 time_t time;
35 void *data;
36 int length; /* Of binary data */
37 } state_data;
38
39
40typedef struct state_key_struct {
41 char *name;
42 char *plugin_name;
43 int data_version;
44 char *_filename;
45 state_data *state_data;
46 } state_key;
47
31range *parse_range_string (char *); 48range *parse_range_string (char *);
32int _set_thresholds(thresholds **, char *, char *); 49int _set_thresholds(thresholds **, char *, char *);
33void set_thresholds(thresholds **, char *, char *); 50void set_thresholds(thresholds **, char *, char *);
@@ -67,4 +84,11 @@ char *np_extract_value(const char*, const char*, char);
67 */ 84 */
68#define np_extract_ntpvar(l, n) np_extract_value(l, n, ',') 85#define np_extract_ntpvar(l, n) np_extract_value(l, n, ',')
69 86
87
88char *np_state_generate_key(const char **);
89state_key *np_state_init(char *, char *, int);
90state_data *np_state_read(state_key *);
91void np_state_write_string(state_key *, time_t, char *);
92void np_state_cleanup(state_key *);
93
70#endif /* _UTILS_BASE_ */ 94#endif /* _UTILS_BASE_ */