# HG changeset patch # User Matti Hamalainen # Date 1676929079 -7200 # Node ID 95a8e05dae276665befc697f5c45c0baf8dde7a6 # Parent 600bd0c3dd83765c54cc3a463599db55df9c769c Sync with th-libs API changes. diff -r 600bd0c3dd83 -r 95a8e05dae27 sidinfo.c --- a/sidinfo.c Fri Feb 10 02:49:17 2023 +0200 +++ b/sidinfo.c Mon Feb 20 23:37:59 2023 +0200 @@ -988,7 +988,7 @@ } -void siPSIDError(th_ioctx *fh, const int err, const char *msg) +void siPSIDError(th_ioctx_t *fh, const int err, const char *msg) { (void) err; THERR("%s - %s\n", msg, fh->filename); @@ -998,7 +998,7 @@ bool siHandleSIDFile(const char *filename) { SIDLibPSIDHeader *psid = NULL; - th_ioctx *infh = NULL; + th_ioctx_t *infh = NULL; FILE *outfh; bool shown = false; int res; diff -r 600bd0c3dd83 -r 95a8e05dae27 sidlib.c --- a/sidlib.c Fri Feb 10 02:49:17 2023 +0200 +++ b/sidlib.c Mon Feb 20 23:37:59 2023 +0200 @@ -43,7 +43,7 @@ } -static bool sidlib_fread_str(th_ioctx *ctx, SIDLibChConvCtx *chconv, char **str, const size_t len) +static bool sidlib_fread_str(th_ioctx_t *ctx, SIDLibChConvCtx *chconv, char **str, const size_t len) { char *tmp; @@ -78,7 +78,7 @@ } -static int sidlib_read_hash_data(th_ioctx *ctx, SIDLibPSIDHeader *psid, th_md5state_t *state) +static int sidlib_read_hash_data(th_ioctx_t *ctx, SIDLibPSIDHeader *psid, th_md5state_t *state) { int ret = THERR_OK; uint8_t *data = NULL; @@ -109,7 +109,7 @@ } -int sidlib_read_sid_file(th_ioctx *ctx, SIDLibPSIDHeader *psid, +int sidlib_read_sid_file(th_ioctx_t *ctx, SIDLibPSIDHeader *psid, const int flags, SIDLibChConvCtx *chconv) { int ret = THERR_OK; @@ -265,7 +265,7 @@ } -int sidlib_read_sid_file_alloc(th_ioctx *ctx, SIDLibPSIDHeader **ppsid, +int sidlib_read_sid_file_alloc(th_ioctx_t *ctx, SIDLibPSIDHeader **ppsid, const int flags, SIDLibChConvCtx *chconv) { if ((*ppsid = th_malloc0(sizeof(SIDLibPSIDHeader))) == NULL) @@ -375,7 +375,7 @@ // Parse one SLDB definition line, return SLDB node // -static int sidlib_sldb_parse_entry(th_ioctx *ctx, SIDLibSLDBNode **pnode, const char *line) +static int sidlib_sldb_parse_entry(th_ioctx_t *ctx, SIDLibSLDBNode **pnode, const char *line) { int ret = THERR_OK; SIDLibSLDBNode *node; @@ -474,7 +474,7 @@ // Read SLDB database to memory // -int sidlib_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh) +int sidlib_sldb_read(th_ioctx_t *ctx, SIDLibSLDB *dbh) { int ret = THERR_OK; char *line = NULL; @@ -821,7 +821,7 @@ #define VADDCH(ch) if (strPos < SIDLIB_BUFFER_SIZE) { tmpStr[strPos++] = ch; } -int sidlib_stildb_read(th_ioctx *fh, SIDLibSTILDB *dbh, SIDLibChConvCtx *chconv) +int sidlib_stildb_read(th_ioctx_t *fh, SIDLibSTILDB *dbh, SIDLibChConvCtx *chconv) { int ret = THERR_OK, field = -1; SIDLibSTILParserCtx ctx; @@ -1209,7 +1209,7 @@ } -int sidlib_write_sid_header(th_ioctx *ctx, const SIDLibPSIDHeader *psid) +int sidlib_write_sid_header(th_ioctx_t *ctx, const SIDLibPSIDHeader *psid) { int ret = THERR_OK; SIDLibPSIDHeader hsid; diff -r 600bd0c3dd83 -r 95a8e05dae27 sidlib.h --- a/sidlib.h Fri Feb 10 02:49:17 2023 +0200 +++ b/sidlib.h Mon Feb 20 23:37:59 2023 +0200 @@ -174,23 +174,23 @@ // // Functions // -int sidlib_read_sid_file(th_ioctx *ctx, SIDLibPSIDHeader *psid, const int flags, SIDLibChConvCtx *chconv); -int sidlib_read_sid_file_alloc(th_ioctx *ctx, SIDLibPSIDHeader **ppsid, const int flags, SIDLibChConvCtx *chconv); +int sidlib_read_sid_file(th_ioctx_t *ctx, SIDLibPSIDHeader *psid, const int flags, SIDLibChConvCtx *chconv); +int sidlib_read_sid_file_alloc(th_ioctx_t *ctx, SIDLibPSIDHeader **ppsid, const int flags, SIDLibChConvCtx *chconv); void sidlib_free_sid_file(SIDLibPSIDHeader *psid); -int sidlib_write_sid_header(th_ioctx *ctx, const SIDLibPSIDHeader *psid); +int sidlib_write_sid_header(th_ioctx_t *ctx, const SIDLibPSIDHeader *psid); const char * sidlib_get_sid_clock_str(const int flags); const char * sidlib_get_sid_model_str(const int flags); int sidlib_sldb_new(SIDLibSLDB **pdbh); -int sidlib_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh); +int sidlib_sldb_read(th_ioctx_t *ctx, SIDLibSLDB *dbh); int sidlib_sldb_build_index(SIDLibSLDB *dbh); void sidlib_sldb_free(SIDLibSLDB *dbh); SIDLibSLDBNode * sidlib_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash); int sidlib_stildb_new(SIDLibSTILDB **pdbh); -int sidlib_stildb_read(th_ioctx *ctx, SIDLibSTILDB *dbh, SIDLibChConvCtx *chconv); +int sidlib_stildb_read(th_ioctx_t *ctx, SIDLibSTILDB *dbh, SIDLibChConvCtx *chconv); int sidlib_stildb_build_index(SIDLibSTILDB *dbh); void sidlib_stildb_free(SIDLibSTILDB *dbh); SIDLibSTILNode * sidlib_stildb_get_node(SIDLibSTILDB *dbh, const char *filename); diff -r 600bd0c3dd83 -r 95a8e05dae27 sidutil.c --- a/sidutil.c Fri Feb 10 02:49:17 2023 +0200 +++ b/sidutil.c Mon Feb 20 23:37:59 2023 +0200 @@ -349,7 +349,7 @@ } -void sidutil_ioctx_error(th_ioctx *fh, const int err, const char *msg) +void sidutil_ioctx_error(th_ioctx_t *fh, const int err, const char *msg) { (void) err; THERR("[%s:%" PRIu_SIZE_T "] %s\n", fh->filename, fh->line, msg); @@ -358,7 +358,7 @@ int sidutil_read_sldb_file(const char *filename, SIDLibSLDB **pdbh) { - th_ioctx *infh = NULL; + th_ioctx_t *infh = NULL; int res; // Initialize SLDB @@ -400,7 +400,7 @@ int sidutil_read_stildb_file(const char *filename, SIDLibSTILDB **pdbh, SIDLibChConvCtx *chconv) { - th_ioctx *infh = NULL; + th_ioctx_t *infh = NULL; int res; // Initialize STILDB