Code

Whitespace changes only
[nagiosplug.git] / lib / utils_base.h
index bda765959ba2f72821665b705424a4b0edf01e24..f40fdb0f9e2fc77004667f919ccc92dc9d2bc64e 100644 (file)
@@ -50,4 +50,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_ */