Mercurial > hg > th-libs
diff th_datastruct.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 | 2ae1045f6c18 |
children | ca837a4417f5 |
line wrap: on
line diff
--- a/th_datastruct.h Wed Dec 07 11:58:54 2022 +0200 +++ b/th_datastruct.h Wed Dec 07 12:14:39 2022 +0200 @@ -55,7 +55,7 @@ */ typedef struct { - BOOL is_allocated; ///< True if this structure has been allocated dynamically + bool is_allocated; ///< True if this structure has been allocated dynamically void **data; ///< Array of pointers to the data size_t size; ///< Size of this ringbuffer in elements (aka pointers to data) size_t n; ///< Number of elements currently in the ringbuffer (@p n <= @p size) @@ -77,10 +77,10 @@ /* Simple growing string buffer */ -BOOL th_strbuf_grow(char **buf, size_t *bufsize, size_t *len, const size_t grow); -BOOL th_strbuf_putch(char **buf, size_t *bufsize, size_t *len, const uint8_t ch); -BOOL th_strbuf_putsn(char **buf, size_t *bufsize, size_t *len, const char *str, const size_t slen); -BOOL th_strbuf_puts(char **buf, size_t *bufsize, size_t *len, const char *str); +bool th_strbuf_grow(char **buf, size_t *bufsize, size_t *len, const size_t grow); +bool th_strbuf_putch(char **buf, size_t *bufsize, size_t *len, const uint8_t ch); +bool th_strbuf_putsn(char **buf, size_t *bufsize, size_t *len, const char *str, const size_t slen); +bool th_strbuf_puts(char **buf, size_t *bufsize, size_t *len, const char *str); /** @brief @@ -88,7 +88,7 @@ */ typedef struct { - BOOL is_allocated; ///< True if this structure has been allocated dynamically + bool is_allocated; ///< True if this structure has been allocated dynamically uint8_t *data; ///< Pointer to data size_t size; ///< Current allocated size of data size_t len; ///< Actual used size of data (must be < size) @@ -105,15 +105,15 @@ void th_growbuf_free(th_growbuf_t *buf); -BOOL th_growbuf_grow(th_growbuf_t *buf, const size_t grow); -BOOL th_growbuf_puts(th_growbuf_t *buf, const char *str, BOOL eos); -BOOL th_growbuf_putch(th_growbuf_t *buf, const char ch); -BOOL th_growbuf_put_str(th_growbuf_t *buf, const void *s, const size_t len); -BOOL th_growbuf_put_u8(th_growbuf_t *buf, const uint8_t val); -BOOL th_growbuf_put_u16_be(th_growbuf_t *buf, const uint16_t val); -BOOL th_growbuf_put_u16_le(th_growbuf_t *buf, const uint16_t val); -BOOL th_growbuf_put_u32_be(th_growbuf_t *buf, const uint32_t val); -BOOL th_growbuf_put_u32_le(th_growbuf_t *buf, const uint32_t val); +bool th_growbuf_grow(th_growbuf_t *buf, const size_t grow); +bool th_growbuf_puts(th_growbuf_t *buf, const char *str, bool eos); +bool th_growbuf_putch(th_growbuf_t *buf, const char ch); +bool th_growbuf_put_str(th_growbuf_t *buf, const void *s, const size_t len); +bool th_growbuf_put_u8(th_growbuf_t *buf, const uint8_t val); +bool th_growbuf_put_u16_be(th_growbuf_t *buf, const uint16_t val); +bool th_growbuf_put_u16_le(th_growbuf_t *buf, const uint16_t val); +bool th_growbuf_put_u32_be(th_growbuf_t *buf, const uint32_t val); +bool th_growbuf_put_u32_le(th_growbuf_t *buf, const uint32_t val); #ifdef __cplusplus