-#define PARSER_STDIO_BASED 1
-#if !PARSER_STDIO_BASED
-typedef struct parser_t {
- char *data;
- char *line;
- int lineno;
-} parser_t;
-extern char* config_open(parser_t *parser, const char *filename) FAST_FUNC;
-#else
+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,
+};