Mercurial > hg > th-libs
comparison th_string.h @ 735:31bc1ed07cf5
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 07 Dec 2022 12:14:39 +0200 |
parents | 29e44a58bc73 |
children | 4181d43f91f9 |
comparison
equal
deleted
inserted
replaced
734:2ae1045f6c18 | 735:31bc1ed07cf5 |
---|---|
186 int th_vprintf_put_str(th_vprintf_ctx *ctx, th_vprintf_putch vputch, | 186 int th_vprintf_put_str(th_vprintf_ctx *ctx, th_vprintf_putch vputch, |
187 const th_char_t *str, int f_flags, const int f_width, const int f_prec); | 187 const th_char_t *str, int f_flags, const int f_width, const int f_prec); |
188 | 188 |
189 int th_vprintf_put_int(th_vprintf_ctx *ctx, th_vprintf_putch vputch, | 189 int th_vprintf_put_int(th_vprintf_ctx *ctx, th_vprintf_putch vputch, |
190 va_list ap, const int f_radix, int f_flags, int f_width, int f_prec, | 190 va_list ap, const int f_radix, int f_flags, int f_width, int f_prec, |
191 const BOOL f_unsig, th_vprintf_altfmt_func f_alt); | 191 const bool f_unsig, th_vprintf_altfmt_func f_alt); |
192 | 192 |
193 int th_vprintf_put_int_format(th_vprintf_ctx *ctx, th_vprintf_putch vputch, | 193 int th_vprintf_put_int_format(th_vprintf_ctx *ctx, th_vprintf_putch vputch, |
194 th_char_t *buf, int f_flags, int f_width, int f_prec, int f_len, int vret, | 194 th_char_t *buf, int f_flags, int f_width, int f_prec, int f_len, int vret, |
195 BOOL f_neg, BOOL f_unsig, th_vprintf_altfmt_func f_alt); | 195 bool f_neg, bool f_unsig, th_vprintf_altfmt_func f_alt); |
196 | 196 |
197 | 197 |
198 #define TH_VPRINTF_INTFMT_NAME th_vprintf_buf_int | 198 #define TH_VPRINTF_INTFMT_NAME th_vprintf_buf_int |
199 #define TH_VPRINTF_INTFMT_TYPE_S int | 199 #define TH_VPRINTF_INTFMT_TYPE_S int |
200 #define TH_VPRINTF_INTFMT_TYPE_U unsigned int | 200 #define TH_VPRINTF_INTFMT_TYPE_U unsigned int |
208 #define TH_VPRINTF_INTFMT_HEADER 1 | 208 #define TH_VPRINTF_INTFMT_HEADER 1 |
209 #include "th_printf1.c" | 209 #include "th_printf1.c" |
210 | 210 |
211 | 211 |
212 #ifdef TH_PRINTF_DEBUG | 212 #ifdef TH_PRINTF_DEBUG |
213 extern BOOL th_printf_debug; | 213 extern bool th_printf_debug; |
214 extern char *th_printf_debug_prefix; | 214 extern char *th_printf_debug_prefix; |
215 #endif | 215 #endif |
216 | 216 |
217 | 217 |
218 /* Parsing, matching | 218 /* Parsing, matching |
219 */ | 219 */ |
220 const th_char_t *th_findnext(const th_char_t *str, size_t *pos); | 220 const th_char_t *th_findnext(const th_char_t *str, size_t *pos); |
221 const th_char_t *th_findsep(const th_char_t *str, size_t *pos, const th_char_t sep); | 221 const th_char_t *th_findsep(const th_char_t *str, size_t *pos, const th_char_t sep); |
222 const th_char_t *th_findseporspace(const th_char_t *str, size_t *pos, const th_char_t sep); | 222 const th_char_t *th_findseporspace(const th_char_t *str, size_t *pos, const th_char_t sep); |
223 | 223 |
224 BOOL th_strmatch(const th_char_t *haystack, const th_char_t *pattern); | 224 bool th_strmatch(const th_char_t *haystack, const th_char_t *pattern); |
225 BOOL th_strcasematch(const th_char_t *haystack, const th_char_t *pattern); | 225 bool th_strcasematch(const th_char_t *haystack, const th_char_t *pattern); |
226 | 226 |
227 BOOL th_get_hex_triplet(const th_char_t *str, unsigned int *value); | 227 bool th_get_hex_triplet(const th_char_t *str, unsigned int *value); |
228 BOOL th_get_boolean(const th_char_t *str, BOOL *value); | 228 bool th_get_boolean(const th_char_t *str, bool *value); |
229 BOOL th_get_int(const th_char_t *str, unsigned int *value, BOOL *neg); | 229 bool th_get_int(const th_char_t *str, unsigned int *value, bool *neg); |
230 | 230 |
231 | 231 |
232 #ifdef __cplusplus | 232 #ifdef __cplusplus |
233 } | 233 } |
234 #endif | 234 #endif |