From 95b190f3dee629b1c1ee2fab5b69c08e511f51b3 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 17 Jun 2010 10:16:43 +0100 Subject: Added skeleton --- lib/utils_base.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib/utils_base.h') diff --git a/lib/utils_base.h b/lib/utils_base.h index 49e40a63..6e1af94a 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -28,6 +28,23 @@ typedef struct thresholds_struct { range *critical; } thresholds; +#define STATE_FORMAT_VERSION "1" + +typedef struct state_data_struct { + time_t time; + void *data; + int length; /* Of binary data */ + } state_data; + + +typedef struct state_key_struct { + char *name; + char *plugin_name; + int data_version; + char *_filename; + state_data *state_data; + } state_key; + range *parse_range_string (char *); int _set_thresholds(thresholds **, char *, char *); void set_thresholds(thresholds **, char *, char *); @@ -67,4 +84,11 @@ char *np_extract_value(const char*, const char*, char); */ #define np_extract_ntpvar(l, n) np_extract_value(l, n, ',') + +char *np_state_generate_key(const char **); +state_key *np_state_init(char *, char *, int); +state_data *np_state_read(state_key *); +void np_state_write_string(state_key *, time_t, char *); +void np_state_cleanup(state_key *); + #endif /* _UTILS_BASE_ */ -- cgit v1.2.3-74-g34f1