From 2535ba7006f22a6470f4c88ea7d30c343a1d8799 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Thu, 28 Sep 2017 17:17:45 +0200 Subject: src: get rid of printf This patch introduces nft_print()/nft_gmp_print() functions which have to be used instead of printf to output information that were previously send to stdout. These functions print to a FILE pointer defined in struct output_ctx. It is set by calling: | old_fp = nft_ctx_set_output(ctx, new_fp); Having an application-defined FILE pointer is actually quite flexible: Using fmemopen() or even fopencookie(), an application gains full control over what is printed and where it should go to. Signed-off-by: Eric Leblond Signed-off-by: Phil Sutter Signed-off-by: Pablo Neira Ayuso --- include/netlink.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index 79dc08f8..2ca6f345 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -180,14 +180,14 @@ extern int netlink_delete_obj(struct netlink_ctx *ctx, const struct handle *h, struct location *loc, uint32_t type); extern void netlink_dump_chain(const struct nftnl_chain *nlc, - unsigned int debug_mask); + struct netlink_ctx *ctx); extern void netlink_dump_rule(const struct nftnl_rule *nlr, - unsigned int debug_mask); + struct netlink_ctx *ctx); extern void netlink_dump_expr(const struct nftnl_expr *nle, FILE *fp, unsigned int debug_mask); extern void netlink_dump_set(const struct nftnl_set *nls, - unsigned int debug_mask); -extern void netlink_dump_obj(struct nftnl_obj *nlo, unsigned int debug_mask); + struct netlink_ctx *ctx); +extern void netlink_dump_obj(struct nftnl_obj *nlo, struct netlink_ctx *ctx); extern int netlink_batch_send(struct netlink_ctx *ctx, struct list_head *err_list); -- cgit v1.2.3