diff options
| author | David Lamparter <equinox@diac24.net> | 2021-03-02 20:16:18 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2021-03-27 17:01:29 +0100 |
| commit | 487eefcfbec8a24d639e6b8c805540d5c1fe38e8 (patch) | |
| tree | 49b095d2ebf319223532bd5da12f3ef641450d34 /lib/printfrr.h | |
| parent | eba599a39756b3d9424467f1e1f4f4475dffad17 (diff) | |
lib: record output positions in printfrr
This replaces `%n` with a safe, out-of-band option that simply records
the start and end offset of the output produced for each `%...`
specifier.
The old `%n` code is removed.
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/printfrr.h')
| -rw-r--r-- | lib/printfrr.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/printfrr.h b/lib/printfrr.h index 549334ba5b..49243248d6 100644 --- a/lib/printfrr.h +++ b/lib/printfrr.h @@ -28,10 +28,17 @@ extern "C" { #endif +struct fmt_outpos { + unsigned int off_start, off_end; +}; + struct fbuf { char *buf; char *pos; size_t len; + + struct fmt_outpos *outpos; + size_t outpos_n, outpos_i; }; #define at(a, b) PRINTFRR(a, b) |
