Lines Matching refs:parser
72 parser_t *parser; in config_open2() local
77 parser = xzalloc(sizeof(*parser)); in config_open2()
78 parser->fp = fp; in config_open2()
79 return parser; in config_open2()
87 void FAST_FUNC config_close(parser_t *parser) in config_close() argument
89 if (parser) { in config_close()
91 free(parser->data); in config_close()
92 fclose(parser->fp); in config_close()
93 free(parser->line); in config_close()
94 free(parser->nline); in config_close()
95 free(parser); in config_close()
104 static int get_line_with_continuation(parser_t *parser) in get_line_with_continuation() argument
109 len = getline(&parser->line, &parser->line_alloc, parser->fp); in get_line_with_continuation()
113 line = parser->line; in get_line_with_continuation()
115 parser->lineno++; in get_line_with_continuation()
122 nlen = getline(&parser->nline, &parser->nline_alloc, parser->fp); in get_line_with_continuation()
126 if (parser->line_alloc < len + nlen + 1) { in get_line_with_continuation()
127 parser->line_alloc = len + nlen + 1; in get_line_with_continuation()
128 line = parser->line = xrealloc(line, parser->line_alloc); in get_line_with_continuation()
130 memcpy(&line[len], parser->nline, nlen); in get_line_with_continuation()
163 int FAST_FUNC config_read(parser_t *parser, char **tokens, unsigned flags, const char *delims) in config_read() argument
170 if (!parser) in config_read()
184 if (get_line_with_continuation(parser) < 0) in config_read()
187 line = parser->line; in config_read()
200 free(parser->data); in config_read()
201 parser->data = xstrdup(line); in config_read()
245 parser->lineno, t, mintokens); in config_read()