return (0);
} /* }}} int strtoderive */
+int strtogauge (const char *string, gauge_t *ret_value) /* {{{ */
+{
+ gauge_t tmp;
+ char *endptr = NULL;
+
+ if ((string == NULL) || (ret_value == NULL))
+ return (EINVAL);
+
+ errno = 0;
+ endptr = NULL;
+ tmp = (gauge_t) strtod (string, &endptr);
+ if (errno != 0)
+ return (errno);
+ else if ((endptr == NULL) || (*endptr != 0))
+ return (EINVAL);
+
+ *ret_value = tmp;
+ return (0);
+} /* }}} int strtogauge */
+
int strarray_add (char ***ret_array, size_t *ret_array_len, char const *str) /* {{{ */
{
char **array;
* failure. If failure is returned, ret_value is not touched. */
int strtoderive (const char *string, derive_t *ret_value);
+/** Parse a string to a gauge_t value. Returns zero on success or non-zero on
+ * failure. If failure is returned, ret_value is not touched. */
+int strtogauge (const char *string, gauge_t *ret_value);
+
int strarray_add (char ***ret_array, size_t *ret_array_len, char const *str);
void strarray_free (char **array, size_t array_len);