diff options
Diffstat (limited to 'lib/utils_base.h')
-rw-r--r-- | lib/utils_base.h | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/lib/utils_base.h b/lib/utils_base.h index bda76595..c616c5bd 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h | |||
@@ -31,7 +31,7 @@ typedef struct thresholds_struct { | |||
31 | range *parse_range_string (char *); | 31 | range *parse_range_string (char *); |
32 | int _set_thresholds(thresholds **, char *, char *); | 32 | int _set_thresholds(thresholds **, char *, char *); |
33 | void set_thresholds(thresholds **, char *, char *); | 33 | void set_thresholds(thresholds **, char *, char *); |
34 | void print_thresholds(const char *, thresholds *); | 34 | void print_thresholds(thresholds *); |
35 | int check_range(double, range *); | 35 | int check_range(double, range *); |
36 | int get_status(double, thresholds *); | 36 | int get_status(double, thresholds *); |
37 | 37 | ||
@@ -39,9 +39,22 @@ char *np_escaped_string (const char *); | |||
39 | 39 | ||
40 | void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); | 40 | void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3))); |
41 | 41 | ||
42 | /* Return codes for _set_thresholds */ | 42 | |
43 | #define NP_RANGE_UNPARSEABLE 1 | 43 | /* Parses a threshold string, as entered from command line */ |
44 | #define NP_WARN_WITHIN_CRIT 2 | 44 | /* Returns a malloc'd threshold* which can be freed */ |
45 | thresholds *parse_thresholds_string(char *); | ||
46 | thresholds * _parse_thresholds_string(char *); | ||
47 | void free_thresholds(thresholds *); | ||
48 | range * _parse_range_string_v2(char *); | ||
49 | int utils_errno; | ||
50 | |||
51 | |||
52 | /* Error codes */ | ||
53 | #define NP_RANGE_UNPARSEABLE 1 | ||
54 | #define NP_WARN_WITHIN_CRIT 2 | ||
55 | #define NP_RANGE_MISSING_COLON 3 | ||
56 | #define NP_THRESHOLD_UNPARSEABLE 4 | ||
57 | #define NP_MEMORY_ERROR 5 | ||
45 | 58 | ||
46 | /* a simple check to see if we're running as root. | 59 | /* a simple check to see if we're running as root. |
47 | * returns zero on failure, nonzero on success */ | 60 | * returns zero on failure, nonzero on success */ |