comparison th_string.h @ 451:db45d6d2e576

Expose some of the internal vprintf() implementation helper functions.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 Oct 2017 22:20:21 +0300
parents 57a3472131fd
children 4471eadea472
comparison
equal deleted inserted replaced
450:051226a06f70 451:db45d6d2e576
98 int th_strcasecmp(const char *haystack, const char *needle); 98 int th_strcasecmp(const char *haystack, const char *needle);
99 int th_strncasecmp(const char *haystack, const char *needle, size_t n); 99 int th_strncasecmp(const char *haystack, const char *needle, size_t n);
100 char *th_strrcasecmp(char *haystack, const char *needle); 100 char *th_strrcasecmp(char *haystack, const char *needle);
101 void th_strip_ctrlchars(char *str); 101 void th_strip_ctrlchars(char *str);
102 102
103 int th_vprintf_do(th_vprintf_ctx *ctx, th_vprintf_putch vputch, const char *fmt, va_list ap);
104 int th_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap); 103 int th_vsnprintf(char *buf, size_t size, const char *fmt, va_list ap);
105 int th_snprintf(char *buf, size_t size, const char *fmt, ...); 104 int th_snprintf(char *buf, size_t size, const char *fmt, ...);
106 int th_vfprintf(FILE *fh, const char *fmt, va_list ap); 105 int th_vfprintf(FILE *fh, const char *fmt, va_list ap);
107 int th_fprintf(FILE *fh, const char *fmt, ...); 106 int th_fprintf(FILE *fh, const char *fmt, ...);
108 107
113 void th_pstr_vprintf(char **buf, const char *fmt, va_list ap); 112 void th_pstr_vprintf(char **buf, const char *fmt, va_list ap);
114 void th_pstr_printf(char **buf, const char *fmt, ...); 113 void th_pstr_printf(char **buf, const char *fmt, ...);
115 114
116 int th_pstr_cpy(char **pdst, const char *src); 115 int th_pstr_cpy(char **pdst, const char *src);
117 int th_pstr_cat(char **pdst, const char *src); 116 int th_pstr_cat(char **pdst, const char *src);
117
118
119 /* Internal printf() implementation. NOTICE! This API may be unstable.
120 */
121 int th_vprintf_do(th_vprintf_ctx *ctx, th_vprintf_putch vputch, const char *fmt, va_list ap);
122 int th_vprintf_put_str(th_vprintf_ctx *ctx, th_vprintf_putch vputch,
123 const char *str, int f_flags, const int f_width, const int f_prec);
124 int th_vprintf_put_int(th_vprintf_ctx *ctx, th_vprintf_putch vputch,
125 va_list ap, const int f_radix, int f_flags, int f_width, int f_prec,
126 const BOOL f_unsig, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags));
127 int th_vprintf_put_int_format(th_vprintf_ctx *ctx, th_vprintf_putch vputch,
128 char *buf, int f_flags, int f_width, int f_prec, int f_len, int vret,
129 BOOL f_neg, BOOL f_unsig, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags));
130
131 char * th_printf_altfmt_oct(const char *buf, const size_t len, const int vret, const int flags);
132 char * th_printf_altfmt_hex(const char *buf, const size_t len, const int vret, const int flags);
133
134 #define TH_PFUNC_NAME th_vprintf_buf_int
135 #define TH_PFUNC_TYPE_S int
136 #define TH_PFUNC_TYPE_U unsigned int
137 #define TH_PFUNC_HEADER 1
138 #include "th_printf1.c"
139
140
141 #define TH_PFUNC_NAME th_vprintf_buf_int64
142 #define TH_PFUNC_TYPE_S int64_t
143 #define TH_PFUNC_TYPE_U uint64_t
144 #define TH_PFUNC_HEADER 1
145 #include "th_printf1.c"
118 146
119 147
120 /* Parsing, matching 148 /* Parsing, matching
121 */ 149 */
122 const char *th_findnext(const char *, size_t *); 150 const char *th_findnext(const char *, size_t *);