+int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC;
+
+/*
+ * Config file parser
+ */
+enum {
+ PARSE_COLLAPSE = 0x00010000, // treat consecutive delimiters as one
+ PARSE_TRIM = 0x00020000, // trim leading and trailing delimiters
+// TODO: COLLAPSE and TRIM seem to always go in pair
+ PARSE_GREEDY = 0x00040000, // last token takes entire remainder of the line
+ PARSE_MIN_DIE = 0x00100000, // die if < min tokens found
+ // keep a copy of current line
+ PARSE_KEEP_COPY = 0x00200000 * ENABLE_FEATURE_CROND_D,
+// PARSE_ESCAPE = 0x00400000, // process escape sequences in tokens
+ // NORMAL is:
+ // * remove leading and trailing delimiters and collapse
+ // multiple delimiters into one
+ // * warn and continue if less than mintokens delimiters found
+ // * grab everything into last token
+ PARSE_NORMAL = PARSE_COLLAPSE | PARSE_TRIM | PARSE_GREEDY,
+};
+typedef struct parser_t {
+ FILE *fp;
+ char *line;
+ char *data;
+ int lineno;
+} parser_t;
+parser_t* config_open(const char *filename) FAST_FUNC;
+parser_t* config_open2(const char *filename, FILE* FAST_FUNC (*fopen_func)(const char *path)) FAST_FUNC;
+int config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) FAST_FUNC;
+#define config_read(parser, tokens, max, min, str, flags) \
+ config_read(parser, tokens, ((flags) | (((min) & 0xFF) << 8) | ((max) & 0xFF)), str)
+void config_close(parser_t *parser) FAST_FUNC;