From 35f6cd327c2ec46296adf464f981cd6cddfec27b Mon Sep 17 00:00:00 2001 From: Varsha Rao Date: Fri, 16 Jun 2017 14:54:06 +0530 Subject: src: Pass stateless, numeric, ip2name and handle variables as structure members. libnftables library will be created soon. So declare numeric_output, stateless_output, ip2name_output and handle_output as members of structure output_ctx, instead of global variables. Rename these variables as following, numeric_output -> numeric stateless_output -> stateless ip2name_output -> ip2name handle_output -> handle Also add struct output_ctx *octx as member of struct netlink_ctx. Signed-off-by: Varsha Rao Signed-off-by: Pablo Neira Ayuso --- include/datatype.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'include/datatype.h') diff --git a/include/datatype.h b/include/datatype.h index 04b7d880..58c4d3e0 100644 --- a/include/datatype.h +++ b/include/datatype.h @@ -145,7 +145,8 @@ struct datatype { const char *desc; const struct datatype *basetype; const char *basefmt; - void (*print)(const struct expr *expr); + void (*print)(const struct expr *expr, + struct output_ctx *octx); struct error_record *(*parse)(const struct expr *sym, struct expr **res); const struct symbol_table *sym_tbl; @@ -157,7 +158,7 @@ extern const struct datatype *datatype_lookup_byname(const char *name); extern struct error_record *symbol_parse(const struct expr *sym, struct expr **res); -extern void datatype_print(const struct expr *expr); +extern void datatype_print(const struct expr *expr, struct output_ctx *octx); static inline bool datatype_equal(const struct datatype *d1, const struct datatype *d2) @@ -205,7 +206,8 @@ extern struct error_record *symbolic_constant_parse(const struct expr *sym, const struct symbol_table *tbl, struct expr **res); extern void symbolic_constant_print(const struct symbol_table *tbl, - const struct expr *expr, bool quotes); + const struct expr *expr, bool quotes, + struct output_ctx *octx); extern void symbol_table_print(const struct symbol_table *tbl, const struct datatype *dtype, enum byteorder byteorder); -- cgit v1.2.3