| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | * Copyright (c) 2017 Phil Sutter <phil@nwl.cc> | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License version 2 (or any | ||
| 6 | * later) as published by the Free Software Foundation. | ||
| 7 | */ | ||
| 8 | |||
| 9 | #include <nft.h> | ||
| 10 | |||
| 11 | #include <stdarg.h> | ||
| 12 | #include <nftables.h> | ||
| 13 | #include <utils.h> | ||
| 14 | |||
| 15 | 1203470 | int nft_print(struct output_ctx *octx, const char *fmt, ...) | |
| 16 | { | ||
| 17 | int ret; | ||
| 18 | va_list arg; | ||
| 19 | |||
| 20 | 1203470 | va_start(arg, fmt); | |
| 21 | 1203470 | ret = vfprintf(octx->output_fp, fmt, arg); | |
| 22 | 1203470 | va_end(arg); | |
| 23 | 1203470 | fflush(octx->output_fp); | |
| 24 | |||
| 25 | 1203470 | return ret; | |
| 26 | } | ||
| 27 | |||
| 28 | 44478 | int nft_gmp_print(struct output_ctx *octx, const char *fmt, ...) | |
| 29 | { | ||
| 30 | int ret; | ||
| 31 | va_list arg; | ||
| 32 | |||
| 33 | 44478 | va_start(arg, fmt); | |
| 34 | 44478 | ret = gmp_vfprintf(octx->output_fp, fmt, arg); | |
| 35 | 44478 | va_end(arg); | |
| 36 | 44478 | fflush(octx->output_fp); | |
| 37 | |||
| 38 | 44478 | return ret; | |
| 39 | } | ||
| 40 |