diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/libbb.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/libbb.h b/include/libbb.h index 4b2a839a5..684e130c9 100644 --- a/include/libbb.h +++ b/include/libbb.h | |||
| @@ -631,6 +631,10 @@ extern FILE *fopen_or_warn(const char *filename, const char *mode) FAST_FUNC; | |||
| 631 | /* "Opens" stdin if filename is special, else just opens file: */ | 631 | /* "Opens" stdin if filename is special, else just opens file: */ |
| 632 | extern FILE *xfopen_stdin(const char *filename) FAST_FUNC; | 632 | extern FILE *xfopen_stdin(const char *filename) FAST_FUNC; |
| 633 | extern FILE *fopen_or_warn_stdin(const char *filename) FAST_FUNC; | 633 | extern FILE *fopen_or_warn_stdin(const char *filename) FAST_FUNC; |
| 634 | extern FILE* fopen_for_read(const char *path) FAST_FUNC; | ||
| 635 | extern FILE* xfopen_for_read(const char *path) FAST_FUNC; | ||
| 636 | extern FILE* fopen_for_write(const char *path) FAST_FUNC; | ||
| 637 | extern FILE* xfopen_for_write(const char *path) FAST_FUNC; | ||
| 634 | 638 | ||
| 635 | int bb_pstrcmp(const void *a, const void *b) /* not FAST_FUNC! */; | 639 | int bb_pstrcmp(const void *a, const void *b) /* not FAST_FUNC! */; |
| 636 | void qsort_string_vector(char **sv, unsigned count) FAST_FUNC; | 640 | void qsort_string_vector(char **sv, unsigned count) FAST_FUNC; |
| @@ -993,10 +997,12 @@ int bb_parse_mode(const char* s, mode_t* theMode) FAST_FUNC; | |||
| 993 | * Config file parser | 997 | * Config file parser |
| 994 | */ | 998 | */ |
| 995 | enum { | 999 | enum { |
| 1000 | PARSE_VANILLA = 0x00000000, // trim line, collapse delimiters, warn and continue if less than mintokens | ||
| 996 | PARSE_DONT_REDUCE = 0x00010000, // do not treat consecutive delimiters as one | 1001 | PARSE_DONT_REDUCE = 0x00010000, // do not treat consecutive delimiters as one |
| 997 | PARSE_DONT_TRIM = 0x00020000, // do not trim line of leading and trailing delimiters | 1002 | PARSE_DONT_TRIM = 0x00020000, // do not trim line of leading and trailing delimiters |
| 998 | PARSE_LAST_IS_GREEDY = 0x00040000, // last token takes whole remainder of the line | 1003 | PARSE_LAST_IS_GREEDY = 0x00040000, // last token takes whole remainder of the line |
| 999 | // PARSE_DONT_NULL = 0x00080000, // do not set tokens[] to NULL | 1004 | // PARSE_DONT_NULL = 0x00080000, // do not set tokens[] to NULL |
| 1005 | PARSE_MIN_DIE = 0x00100000, // die if less tokens found | ||
| 1000 | // keep a copy of current line | 1006 | // keep a copy of current line |
| 1001 | PARSE_KEEP_COPY = 0x00200000 * ENABLE_DEBUG_CROND_OPTION, | 1007 | PARSE_KEEP_COPY = 0x00200000 * ENABLE_DEBUG_CROND_OPTION, |
| 1002 | }; | 1008 | }; |
| @@ -1007,6 +1013,7 @@ typedef struct parser_t { | |||
| 1007 | int lineno; | 1013 | int lineno; |
| 1008 | } parser_t; | 1014 | } parser_t; |
| 1009 | parser_t* config_open(const char *filename) FAST_FUNC; | 1015 | parser_t* config_open(const char *filename) FAST_FUNC; |
| 1016 | parser_t* config_open2(const char *filename, FILE* FAST_FUNC (*fopen_func)(const char *path)) FAST_FUNC; | ||
| 1010 | int config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) FAST_FUNC; | 1017 | int config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) FAST_FUNC; |
| 1011 | #define config_read(parser, tokens, max, min, str, flags) \ | 1018 | #define config_read(parser, tokens, max, min, str, flags) \ |
| 1012 | config_read(parser, tokens, ((flags) | (((min) & 0xFF) << 8) | ((max) & 0xFF)), str) | 1019 | config_read(parser, tokens, ((flags) | (((min) & 0xFF) << 8) | ((max) & 0xFF)), str) |
