diff options
| author | David Lamparter <equinox@diac24.net> | 2021-03-02 20:45:57 +0100 |
|---|---|---|
| committer | David Lamparter <equinox@diac24.net> | 2021-03-30 22:32:59 +0200 |
| commit | 9c4380daee0e495ea63d161af61d7f7e70c9d9ea (patch) | |
| tree | 6399c667867d1f6618d15894f5bb1b1f42cfdf7a /lib/printfrr.h | |
| parent | cb4928ce77c089ae521301776ed90e994c29800c (diff) | |
lib: add `%pVA` recursive printfrr
Analogous to Linux kernel `%pV` (but our mechanism expects 2 specifier
chars and `%pVA` is clearer anyway.)
Signed-off-by: David Lamparter <equinox@diac24.net>
Diffstat (limited to 'lib/printfrr.h')
| -rw-r--r-- | lib/printfrr.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/printfrr.h b/lib/printfrr.h index 8245a664b3..6ca4d963c4 100644 --- a/lib/printfrr.h +++ b/lib/printfrr.h @@ -251,6 +251,17 @@ static inline ssize_t bputch(struct fbuf *buf, char ch) return 1; } +/* %pVA extension, equivalent to Linux kernel %pV */ + +struct va_format { + const char *fmt; + va_list *va; +}; + +#ifdef _FRR_ATTRIBUTE_PRINTFRR +#pragma FRR printfrr_ext "%pVA" (struct va_format *) +#endif + /* when using non-ISO-C compatible extension specifiers... */ #ifdef _FRR_ATTRIBUTE_PRINTFRR |
