Mercurial > hg > th-libs
diff th_string.h @ 251:7b76108248e9
More work on printing functions.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 16 Feb 2016 20:32:02 +0200 |
parents | 917e341d445b |
children | 80ffeb316596 |
line wrap: on
line diff
--- a/th_string.h Tue Feb 16 19:05:00 2016 +0200 +++ b/th_string.h Tue Feb 16 20:32:02 2016 +0200 @@ -48,6 +48,14 @@ }; +typedef struct +{ + char *buf; + size_t size, pos; + void *data; +} th_printf_ctx; + + /* Normal NUL-terminated string functions */ char *th_strdup(const char *src); @@ -60,7 +68,7 @@ char *th_strrcasecmp(char *haystack, const char *needle); void th_strip_ctrlchars(char *str); -int th_vprintf_do(void *ctx, int (*vputch)(void *ctx, const char ch), const char *fmt, va_list ap); +int th_vprintf_do(th_printf_ctx *ctx, int (*vputch)(th_printf_ctx *ctx, const char ch), const char *fmt, va_list ap, const BOOL eol); int th_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap); int th_snprintf(char *buf, size_t size, const char *fmt, ...); int th_vfprintf(FILE *fh, const char *fmt, va_list ap);