Mercurial > hg > th-libs
diff th_printf.c @ 546:edfe8ac12408
Add function typedef th_vprintf_altfmt_func and #define
TH_VPRINTF_ALTFMT_FUNC macro for defining printf altfmt helpers and use
them. This breaks the API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 31 Dec 2019 05:19:11 +0200 |
parents | 4d2e9c806b98 |
children | c21051972015 |
line wrap: on
line diff
--- a/th_printf.c Tue Dec 31 05:16:58 2019 +0200 +++ b/th_printf.c Tue Dec 31 05:19:11 2019 +0200 @@ -114,7 +114,7 @@ #include "th_printf1.c" -char * th_vprintf_altfmt_oct(const char *buf, const size_t len, const int vret, const int flags) +TH_VPRINTF_ALTFMT_FUNC(th_vprintf_altfmt_oct) { (void) vret; (void) flags; @@ -123,7 +123,7 @@ } -char * th_vprintf_altfmt_hex(const char *buf, const size_t len, const int vret, const int flags) +TH_VPRINTF_ALTFMT_FUNC(th_vprintf_altfmt_hex) { (void) buf; (void) len; @@ -137,7 +137,7 @@ int th_vprintf_put_int_format(th_vprintf_ctx *ctx, th_vprintf_putch vputch, char *buf, int f_flags, int f_width, int f_prec, int f_len, int vret, - BOOL f_neg, BOOL f_unsig, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags)) + BOOL f_neg, BOOL f_unsig, th_vprintf_altfmt_func f_alt) { int ret = 0, nspacepad, nzeropad; char f_sign, *f_altstr; @@ -237,7 +237,7 @@ int th_vprintf_put_int(th_vprintf_ctx *ctx, th_vprintf_putch vputch, va_list ap, const int f_radix, int f_flags, int f_width, int f_prec, - const BOOL f_unsig, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags)) + const BOOL f_unsig, th_vprintf_altfmt_func f_alt) { char buf[32]; int f_len = 0, vret;