# HG changeset patch # User Matti Hamalainen # Date 1676185473 -7200 # Node ID 8eca15bde07d9d7fb0a74dcfcc5dafd233a06e9c # Parent 600a3c08747f807da9e2287842760d44a7149a7b Rename some th_ioctx members. diff -r 600a3c08747f -r 8eca15bde07d th_ioctx.c --- 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); } } diff -r 600a3c08747f -r 8eca15bde07d th_ioctx.h --- 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