+/*********************************************************************
+ *
+ * Function : parse_numeric_value
+ *
+ * Description : Parse the value of a directive that can only have
+ * a single numeric value. Terminates with a fatal error
+ * if the value is NULL or not numeric.
+ *
+ * Parameters :
+ * 1 : name: The name of the directive. Used for log messages.
+ * 2 : value: The value to parse
+ *
+ *
+ * Returns : The numerical value as integer
+ *
+ *********************************************************************/
+static int parse_numeric_value(const char *name, const char *value)
+{
+ int number;
+ char *endptr;
+
+ assert(name != NULL);
+ assert(value != NULL);
+
+ if ((value == NULL) || (*value == '\0'))
+ {
+ log_error(LOG_LEVEL_FATAL, "Directive %s used without argument", name);
+ }
+
+ number = (int)strtol(value, &endptr, 0);
+ if (*endptr != '\0')
+ {
+ log_error(LOG_LEVEL_FATAL,
+ "Directive '%s' used with non-numerical value: '%s'", name, value);
+ }
+
+ return number;
+
+}
+
+