diff th_string.h @ 453:efd33accdc81

Break backwards compatibility by renaming BOOL, TRUE and FALSE to lowercase. Introduce optional but default use of stdbool.h.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 02 Jan 2018 22:56:03 +0200
parents 4471eadea472
children 347bfd3e017e
line wrap: on
line diff
--- a/th_string.h	Wed Oct 25 22:32:07 2017 +0300
+++ b/th_string.h	Tue Jan 02 22:56:03 2018 +0200
@@ -123,10 +123,10 @@
         const char *str, int f_flags, const int f_width, const int f_prec);
 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, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags));
 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, char *(f_alt)(const char *buf, const size_t blen, const int vret, const int flags));
 
 char *  th_vprintf_altfmt_oct(const char *buf, const size_t len, const int vret, const int flags);
 char *  th_vprintf_altfmt_hex(const char *buf, const size_t len, const int vret, const int flags);
@@ -152,11 +152,11 @@
 const char    *th_findsep(const char *, size_t *, char);
 const char    *th_findseporspace(const char *, size_t *, char);
 
-BOOL    th_strmatch(const char *haystack, const char *pattern);
-BOOL    th_strcasematch(const char *haystack, const char *pattern);
+bool    th_strmatch(const char *haystack, const char *pattern);
+bool    th_strcasematch(const char *haystack, const char *pattern);
 
 int     th_get_hex_triplet(const char *str);
-BOOL    th_get_boolean(const char *str, BOOL *value);
+bool    th_get_boolean(const char *str, bool *value);
 
 void    th_print_wrap(FILE *fh, const char *str, int spad, int rpad, int width);