Mercurial > hg > th-libs
diff th_ioctx_mem.c @ 771:c17eadc60c3d
Rename th_ioctx struct to th_ioctx_t, for consistency. Breaks API.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 20 Feb 2023 23:33:45 +0200 |
parents | 31bc1ed07cf5 |
children | 1959ba53e9dc |
line wrap: on
line diff
--- a/th_ioctx_mem.c Sun Feb 12 14:08:09 2023 +0200 +++ b/th_ioctx_mem.c Mon Feb 20 23:33:45 2023 +0200 @@ -8,7 +8,7 @@ #include "th_ioctx.h" -static int th_mem_fopen(th_ioctx *ctx) +static int th_mem_fopen(th_ioctx_t *ctx) { if (ctx->mode == NULL) return THERR_NULLPTR; @@ -43,7 +43,7 @@ } -static void th_mem_fclose(th_ioctx *ctx) +static void th_mem_fclose(th_ioctx_t *ctx) { if (ctx->memFree) { @@ -54,7 +54,7 @@ } -static bool th_mem_realloc(th_ioctx *ctx, const size_t newSize) +static bool th_mem_realloc(th_ioctx_t *ctx, const size_t newSize) { size_t grow; @@ -105,20 +105,20 @@ } -static int th_mem_freset(th_ioctx *ctx) +static int th_mem_freset(th_ioctx_t *ctx) { ctx->memOffset = 0; return THERR_OK; } -static int th_mem_ferror(th_ioctx *ctx) +static int th_mem_ferror(th_ioctx_t *ctx) { return ctx->status; } -static int th_mem_fseek(th_ioctx *ctx, const off_t offset, const int whence) +static int th_mem_fseek(th_ioctx_t *ctx, const off_t offset, const int whence) { off_t newPos; @@ -159,25 +159,25 @@ } -static off_t th_mem_fsize(th_ioctx *ctx) +static off_t th_mem_fsize(th_ioctx_t *ctx) { return ctx->memSize; } -static off_t th_mem_ftell(th_ioctx *ctx) +static off_t th_mem_ftell(th_ioctx_t *ctx) { return ctx->memOffset; } -static bool th_mem_feof(th_ioctx *ctx) +static bool th_mem_feof(th_ioctx_t *ctx) { return ((size_t) ctx->memOffset) >= ctx->memSize; } -static int th_mem_fgetc(th_ioctx *ctx) +static int th_mem_fgetc(th_ioctx_t *ctx) { // Check for EOF if ((size_t) ctx->memOffset < ctx->memSize) @@ -187,7 +187,7 @@ } -static size_t th_mem_fread(void *buf, size_t size, size_t nmemb, th_ioctx *ctx) +static size_t th_mem_fread(void *buf, size_t size, size_t nmemb, th_ioctx_t *ctx) { size_t length = size * nmemb; @@ -208,7 +208,7 @@ } -static int th_mem_fputc(int ch, th_ioctx *ctx) +static int th_mem_fputc(int ch, th_ioctx_t *ctx) { // Check for EOF if (!th_mem_realloc(ctx, ctx->memOffset + 1)) @@ -219,7 +219,7 @@ } -static size_t th_mem_fwrite(const void *buf, size_t size, size_t nmemb, th_ioctx *ctx) +static size_t th_mem_fwrite(const void *buf, size_t size, size_t nmemb, th_ioctx_t *ctx) { size_t length = size * nmemb; @@ -239,7 +239,7 @@ } -const th_ioctx_ops th_mem_io_ops = +const th_ioctx_t_ops th_mem_io_ops = { "MemIO",