From b553eefe5ef1ac538fdf051df51481d19c9fbf4e Mon Sep 17 00:00:00 2001 From: Pablo Neira Date: Tue, 12 Jul 2016 22:04:16 +0200 Subject: src: expose delinearize/linearize structures and stmt_error() Needed by the follow up xt compatibility layer patch. Signed-off-by: Arturo Borrero Gonzalez Signed-off-by: Pablo Neira Ayuso --- include/erec.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'include/erec.h') diff --git a/include/erec.h b/include/erec.h index 25df1d0f..36e0efa4 100644 --- a/include/erec.h +++ b/include/erec.h @@ -61,4 +61,16 @@ static inline void erec_queue(struct error_record *erec, extern void erec_print(FILE *f, const struct error_record *erec); extern void erec_print_list(FILE *f, struct list_head *list); +struct eval_ctx; + +extern int __fmtstring(4, 5) __stmt_binary_error(struct eval_ctx *ctx, + const struct location *l1, + const struct location *l2, + const char *fmt, ...); + +#define stmt_error(ctx, s1, fmt, args...) \ + __stmt_binary_error(ctx, &(s1)->location, NULL, fmt, ## args) +#define stmt_binary_error(ctx, s1, s2, fmt, args...) \ + __stmt_binary_error(ctx, &(s1)->location, &(s2)->location, fmt, ## args) + #endif /* NFTABLES_EREC_H */ -- cgit v1.2.3