Imported Upstream version 1.4.13+git200906171200

This commit is contained in:
Jan Wagner 2013-11-26 23:56:50 +01:00
parent 4ab9f0d24c
commit d0b8ab8112
362 changed files with 34110 additions and 10773 deletions

View file

@ -35,6 +35,9 @@ void print_thresholds(const char *, thresholds *);
int check_range(double, range *);
int get_status(double, thresholds *);
/* All possible characters in a threshold range */
#define NP_THRESHOLDS_CHARS "0123456789.:@~"
char *np_escaped_string (const char *);
void die (int, const char *, ...) __attribute__((noreturn,format(printf, 2, 3)));
@ -50,4 +53,18 @@ int np_check_if_root(void);
* code from the above function, in case it's helpful for testing */
int np_warn_if_not_root(void);
/*
* Extract the value from key/value pairs, or return NULL. The value returned
* can be free()ed.
* This function can be used to parse NTP control packet data and performance
* data strings.
*/
char *np_extract_value(const char*, const char*, char);
/*
* Same as np_extract_value with separator suitable for NTP control packet
* payloads (comma)
*/
#define np_extract_ntpvar(l, n) np_extract_value(l, n, ',')
#endif /* _UTILS_BASE_ */