summaryrefslogtreecommitdiffabout
path: root/src/grecs.h
Side-by-side diff
Diffstat (limited to 'src/grecs.h') (more/less context) (ignore whitespace changes)
-rw-r--r--src/grecs.h35
1 files changed, 33 insertions, 2 deletions
diff --git a/src/grecs.h b/src/grecs.h
index 61a915b..ff47698 100644
--- a/src/grecs.h
+++ b/src/grecs.h
@@ -198,18 +198,39 @@ void grecs_warning(grecs_locus_t *locus, int errcode, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
void grecs_error(grecs_locus_t *locus, int errcode, const char *fmt, ...)
__attribute__ ((__format__ (__printf__, 3, 4)));
+
+
+extern int grecs_trace_flags;
+
+#define GRECS_TRACE_GRAM 0x01
+#define GRECS_TRACE_LEX 0x02
void grecs_gram_trace(int n);
void grecs_lex_trace(int n);
+
-int grecs_lex_begin(const char*);
+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);
+
+/* Parsers: */
+struct grecs_node *grecs_grecs_parser(const char *name, int traceflags);
+struct grecs_node *grecs_meta1_parser(const char *name, int traceflags);
+
struct grecs_list *_grecs_simple_list_create(int dispose);
struct grecs_list *grecs_value_list_create(void);
+void grecs_line_acc_create(void);
+void grecs_line_acc_free(void);
+void grecs_line_acc_grow_char(int c);
+void grecs_line_acc_grow_char_unescape(int c);
+void grecs_line_acc_grow(const char *text, size_t len);
+void grecs_line_acc_grow_unescape_last(char *text, size_t len);
+
void grecs_line_begin(void);
-void grecs_line_add(const char *text, size_t len);
+#define grecs_line_add grecs_line_acc_grow
char *grecs_line_finish(void);
extern int grecs_string_convert(void *target, enum grecs_data_type type,
@@ -295,6 +316,13 @@ void grecs_list_add(struct grecs_list *dst, struct grecs_list *src);
int grecs_vasprintf(char **pbuf, size_t *psize, const char *fmt, va_list ap);
int grecs_asprintf(char **pbuf, size_t *psize, const char *fmt, ...);
+#define GRECS_TXTACC_BUFSIZE 1024
+struct grecs_txtacc *grecs_txtacc_create(void);
+void grecs_txtacc_free(struct grecs_txtacc *acc);
+void grecs_txtacc_grow(struct grecs_txtacc *acc, const char *buf, size_t size);
+char *grecs_txtacc_finish(struct grecs_txtacc *acc, int steal);
+void grecs_txtacc_free_string(struct grecs_txtacc *acc, char *str);
+
struct grecs_symtab;
struct grecs_syment {
@@ -363,6 +391,9 @@ struct grecs_node *grecs_match_next(struct grecs_match_buf *buf);
void grecs_match_buf_free(struct grecs_match_buf *buf);
int grecs_value_eq(struct grecs_value *a, struct grecs_value *b);
+int grecs_value_match(struct grecs_value *pat, struct grecs_value *b,
+ int flags);
+
struct grecs_node *grecs_find_node(struct grecs_node *node, const char *path);
struct grecs_node *grecs_node_from_path(const char *path, const char *value);

Return to:

Send suggestions and report system problems to the System administrator.