aboutsummaryrefslogtreecommitdiff
path: root/src/grecs.h
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-06-23 13:29:06 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2011-06-23 13:46:11 +0300
commit582d89672b36583a50a10be741853d3315d95bd0 (patch)
tree4c1e03152001525517abc784b4d546f40a5d2902 /src/grecs.h
parent00466520a845c0abd58ca7e98bc8bdbbe754702a (diff)
downloadgrecs-582d89672b36583a50a10be741853d3315d95bd0.tar.gz
grecs-582d89672b36583a50a10be741853d3315d95bd0.tar.bz2
Conditionally include tests related to parser formats that can be disabled at configuration time.
* src/Make.am (PARSER_DEFS, AM_CPPFLAGS): New variables. [GRECS_COND_META1_PARSER]: Update PARSER_DEFS. [GRECS_COND_BIND_PARSER]: Likewise. [GRECS_COND_GIT_PARSER]: Likewise. (GRECS_SRC): Add parsertab.c * src/parsertab.c: New file. * src/grecs.h (grecs_parser_t): New typedef. (grecs_enumerate_parsers) (grecs_get_parser_by_type): New functions. * tests/Makefile.am (PARSER_DEFS): New variable. [GRECS_COND_META1_PARSER]: Update PARSER_DEFS. [GRECS_COND_BIND_PARSER]: Likewise. [GRECS_COND_GIT_PARSER]: Likewise. (package.m4): Define ENABLE_* according to the PARSER_DEFS settings. * tests/empty.at: Test ENABLE_* defines to avoid testing unsupported parser formats. * tests/testsuite.at: Likewise. * tests/gcffmt.c: New option -list. Improve help output.
Diffstat (limited to 'src/grecs.h')
-rw-r--r--src/grecs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/grecs.h b/src/grecs.h
index fd957a8..8bd70d1 100644
--- a/src/grecs.h
+++ b/src/grecs.h
@@ -218,7 +218,9 @@ int grecs_lex_begin(const char*, int);
void grecs_lex_end(int err);
struct grecs_node *grecs_parse(const char *name);
-extern struct grecs_node *(*grecs_parser_fun)(const char *name, int trace);
+typedef struct grecs_node *(*grecs_parser_t)(const char *name, int trace);
+
+extern grecs_parser_t grecs_parser_fun;
/* Parsers: */
struct grecs_node *grecs_grecs_parser(const char *name, int traceflags);
@@ -228,6 +230,12 @@ struct grecs_node *grecs_git_parser(const char *name, int traceflags);
struct grecs_node *grecs_path_parser(const char *name, int traceflags);
+/* Parser database */
+int grecs_enumerate_parsers(int (*fun)(const char *, grecs_parser_t, void *),
+ void *);
+grecs_parser_t grecs_get_parser_by_type(const char *type);
+
+
struct grecs_list *_grecs_simple_list_create(int dispose);
struct grecs_list *grecs_value_list_create(void);

Return to:

Send suggestions and report system problems to the System administrator.