diff sidinfo.c @ 85:4c0ecb078591

Rename various variables and functions and change relevant places to use the new th_ctx API.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 11 Feb 2016 23:18:58 +0200
parents c54d74312080
children 1e89b757f8a1
line wrap: on
line diff
--- a/sidinfo.c	Thu Feb 11 23:15:59 2016 +0200
+++ b/sidinfo.c	Thu Feb 11 23:18:58 2016 +0200
@@ -463,11 +463,11 @@
             break;
         case  5:
             if (psid->version >= 2)
-                PR("%s", NULL, siGetSIDClockStr(psid->flags));
+                PR("%s", NULL, si_get_sid_clock_str(psid->flags));
             break;
         case  6:
             if (psid->version >= 2)
-                PR("%s", NULL, siGetSIDModelStr(psid->flags));
+                PR("%s", NULL, si_get_sid_model_str(psid->flags));
             break;
 
         case  7: PR("%d", "$%08x", psid->dataOffset); break;
@@ -499,21 +499,22 @@
 BOOL argHandleFile(char *filename)
 {
     static PSIDHeader psid;
-    FILE *inFile = NULL, *outFile;
+    th_ioctx *inFile = NULL;
+    FILE *outFile;
     int index;
     BOOL shown = FALSE;
 
     optNFiles++;
     outFile = stdout;
 
-    if ((inFile = fopen(filename, "rb")) == NULL)
+    if ((inFile = th_io_fopen(&th_stdio_io_ops, filename, "rb")) == NULL)
     {
         THERR("Could not open file '%s'.\n", filename);
         return TRUE;
     }
 
     // Read PSID data
-    if (siReadPSIDFile(inFile, &psid) != 0)
+    if (si_read_sid_file(inFile, &psid) != 0)
     {
         THERR("Error reading %s\n", filename);
         goto error;
@@ -552,8 +553,7 @@
 
     // Shutdown
 error:
-    if (inFile != NULL)
-        fclose(inFile);
+    th_io_free(inFile);
 
     return TRUE;
 }