From ba132e9e521218efc5d35aa5f7a024cba93f5e29 Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Mon, 26 Jan 2009 02:05:21 -0500 Subject: Make extract_value more generic: Add a separator argument passed using defines. --- lib/utils_base.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lib/utils_base.h') diff --git a/lib/utils_base.h b/lib/utils_base.h index c34f0445..f40fdb0f 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h @@ -56,6 +56,12 @@ int np_warn_if_not_root(void); * This function can be used to parse NTP control packet data and performance * data strings. */ -char *np_extract_value(const char*, const char*); +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_ */ -- cgit v1.2.3