changeset 402:95a8e05dae27

Sync with th-libs API changes.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 20 Feb 2023 23:37:59 +0200
parents 600bd0c3dd83
children f35dddeec243
files sidinfo.c sidlib.c sidlib.h sidutil.c
diffstat 4 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- 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;
--- 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;
--- 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);
--- 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