Mercurial > hg > th-libs
diff th_ioctx.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 | 9148bc3fa838 |
children | 347bfd3e017e |
line wrap: on
line diff
--- a/th_ioctx.h Wed Oct 25 22:32:07 2017 +0300 +++ b/th_ioctx.h Tue Jan 02 22:56:03 2018 +0200 @@ -54,7 +54,7 @@ int (*fseek)(th_ioctx *ctx, const off_t, const int whence); off_t (*fsize)(th_ioctx *ctx); off_t (*ftell)(th_ioctx *ctx); - BOOL (*feof)(th_ioctx *ctx); + bool (*feof)(th_ioctx *ctx); int (*fgetc)(th_ioctx *ctx); int (*fputc)(int, th_ioctx *ctx); size_t (*fread)(void *ptr, const size_t, const size_t, th_ioctx *ctx); @@ -83,7 +83,7 @@ void th_io_close(th_ioctx *ctx); void th_io_free(th_ioctx *ctx); -BOOL th_io_set_handlers(th_ioctx *ctx, +bool th_io_set_handlers(th_ioctx *ctx, void (*error)(th_ioctx *, const int, const char *msg), void (*msg)(th_ioctx *, const int, const char *msg)); @@ -101,7 +101,7 @@ int thfseek(th_ioctx *ctx, const off_t, const int whence); off_t thfsize(th_ioctx *ctx); off_t thftell(th_ioctx *ctx); -BOOL thfeof(th_ioctx *ctx); +bool thfeof(th_ioctx *ctx); int thfgetc(th_ioctx *ctx); int thfputc(int ch, th_ioctx *ctx); size_t thfread(void *ptr, const size_t, const size_t, th_ioctx *ctx); @@ -111,35 +111,35 @@ int thvfprintf(th_ioctx *ctx, const char *fmt, va_list ap); int thfprintf(th_ioctx *ctx, const char *fmt, ...); -int thfread_str(th_ioctx *ctx, void *ptr, const size_t len); -BOOL thfread_u8(th_ioctx *ctx, uint8_t *); -int thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len); -BOOL thfwrite_u8(th_ioctx *ctx, const uint8_t); +bool thfread_str(th_ioctx *ctx, void *ptr, const size_t len); +bool thfread_u8(th_ioctx *ctx, uint8_t *); +bool thfwrite_str(th_ioctx *ctx, const void *ptr, const size_t len); +bool thfwrite_u8(th_ioctx *ctx, const uint8_t); // // Endian-handling file read/write routines // -BOOL thfwrite_ne16(th_ioctx *ctx, const uint16_t v); -BOOL thfwrite_ne32(th_ioctx *ctx, const uint32_t v); -BOOL thfwrite_ne64(th_ioctx *ctx, const uint64_t v); -BOOL thfread_ne16(th_ioctx *ctx, uint16_t *v); -BOOL thfread_ne32(th_ioctx *ctx, uint32_t *v); -BOOL thfread_ne64(th_ioctx *ctx, uint64_t *v); +bool thfwrite_ne16(th_ioctx *ctx, const uint16_t v); +bool thfwrite_ne32(th_ioctx *ctx, const uint32_t v); +bool thfwrite_ne64(th_ioctx *ctx, const uint64_t v); +bool thfread_ne16(th_ioctx *ctx, uint16_t *v); +bool thfread_ne32(th_ioctx *ctx, uint32_t *v); +bool thfread_ne64(th_ioctx *ctx, uint64_t *v); -BOOL thfwrite_le16(th_ioctx *ctx, const uint16_t v); -BOOL thfwrite_le32(th_ioctx *ctx, const uint32_t v); -BOOL thfwrite_le64(th_ioctx *ctx, const uint64_t v); -BOOL thfread_le16(th_ioctx *ctx, uint16_t *v); -BOOL thfread_le32(th_ioctx *ctx, uint32_t *v); -BOOL thfread_le64(th_ioctx *ctx, uint64_t *v); +bool thfwrite_le16(th_ioctx *ctx, const uint16_t v); +bool thfwrite_le32(th_ioctx *ctx, const uint32_t v); +bool thfwrite_le64(th_ioctx *ctx, const uint64_t v); +bool thfread_le16(th_ioctx *ctx, uint16_t *v); +bool thfread_le32(th_ioctx *ctx, uint32_t *v); +bool thfread_le64(th_ioctx *ctx, uint64_t *v); -BOOL thfwrite_be16(th_ioctx *ctx, const uint16_t v); -BOOL thfwrite_be32(th_ioctx *ctx, const uint32_t v); -BOOL thfwrite_be64(th_ioctx *ctx, const uint64_t v); -BOOL thfread_be16(th_ioctx *ctx, uint16_t *v); -BOOL thfread_be32(th_ioctx *ctx, uint32_t *v); -BOOL thfread_be64(th_ioctx *ctx, uint64_t *v); +bool thfwrite_be16(th_ioctx *ctx, const uint16_t v); +bool thfwrite_be32(th_ioctx *ctx, const uint32_t v); +bool thfwrite_be64(th_ioctx *ctx, const uint64_t v); +bool thfread_be16(th_ioctx *ctx, uint16_t *v); +bool thfread_be32(th_ioctx *ctx, uint32_t *v); +bool thfread_be64(th_ioctx *ctx, uint64_t *v); #ifdef __cplusplus