Mercurial > hg > th-libs
changeset 769:8eca15bde07d
Rename some th_ioctx members.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 12 Feb 2023 09:04:33 +0200 |
parents | 600a3c08747f |
children | 79f888e4616f |
files | th_ioctx.c th_ioctx.h |
diffstat | 2 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/th_ioctx.c Fri Feb 10 02:46:57 2023 +0200 +++ b/th_ioctx.c Sun Feb 12 09:04:33 2023 +0200 @@ -40,18 +40,18 @@ th_io_init(ctx); - ctx->allocated = true; + ctx->ctx_allocated = true; ctx->fops = fops; ctx->filename = th_strdup(filename); - ctx->fallocated = true; + ctx->fn_allocated = true; if (filename != NULL && ctx->filename == NULL) goto err; if (mode != NULL && (ctx->mode = th_strdup(mode)) == NULL) goto err; - ctx->mallocated = true; + ctx->md_allocated = true; return ctx; @@ -88,14 +88,14 @@ thfclose(ctx); - if (ctx->mallocated) + if (ctx->md_allocated) { if ((ctx->status = th_pstr_cpy(&ctx->mode, mode)) != THERR_OK) return ctx->status; } else { - ctx->mallocated = true; + ctx->md_allocated = true; if ((ctx->mode = th_strdup(mode)) == NULL) return THERR_MALLOC; } @@ -110,13 +110,13 @@ { thfclose(ctx); - if (ctx->fallocated) + if (ctx->fn_allocated) th_free_r(&ctx->filename); - if (ctx->mallocated) + if (ctx->md_allocated) th_free_r(&ctx->mode); - if (ctx->allocated) + if (ctx->ctx_allocated) th_free(ctx); } }
--- a/th_ioctx.h Fri Feb 10 02:46:57 2023 +0200 +++ b/th_ioctx.h Sun Feb 12 09:04:33 2023 +0200 @@ -31,10 +31,10 @@ typedef struct th_ioctx { char *filename; ///< Context filename, if any. May be NULL. - bool fallocated; ///< true if filename is allocated, false if "const" + bool fn_allocated; ///< true if filename is allocated, false if "const" char *mode; ///< Context's stdio open "mode", may also be NULL. - bool mallocated; ///< true if mode string is allocated, false if "const" - bool allocated; ///< true if this structure has been allocated + bool md_allocated; ///< true if mode string is allocated, false if "const" + bool ctx_allocated; ///< true if this structure has been allocated void *data; ///< Internal data time_t atime; ///< Last access time