comparison sidinfo.c @ 186:2f129ea15405

Adjust to new th_io_fopen() API.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 09 Jul 2018 08:10:50 +0300
parents 5bc837384177
children cf081a98dccd
comparison
equal deleted inserted replaced
185:2dfe46fda09e 186:2f129ea15405
966 { 966 {
967 PSIDHeader *psid = NULL; 967 PSIDHeader *psid = NULL;
968 th_ioctx *inFile = NULL; 968 th_ioctx *inFile = NULL;
969 FILE *outFile; 969 FILE *outFile;
970 BOOL shown = FALSE; 970 BOOL shown = FALSE;
971 int res;
971 972
972 optNFiles++; 973 optNFiles++;
973 outFile = stdout; 974 outFile = stdout;
974 975
975 if ((inFile = th_io_fopen(&th_stdio_io_ops, filename, "rb")) == NULL) 976 if ((res = th_io_fopen(&inFile, &th_stdio_io_ops, filename, "rb")) != THERR_OK)
976 { 977 {
977 THERR("Could not open file '%s'.\n", filename); 978 THERR("Could not open file '%s': %s\n",
979 filename, th_error_str(res));
978 goto error; 980 goto error;
979 } 981 }
980 982
981 // Read PSID data 983 // Read PSID data
982 if (!si_read_sid_file(inFile, &psid, setSLDBNewFormat)) 984 if (!si_read_sid_file(inFile, &psid, setSLDBNewFormat))
1090 if (setSLDBPath != NULL) 1092 if (setSLDBPath != NULL)
1091 { 1093 {
1092 // Initialize SLDB 1094 // Initialize SLDB
1093 int ret = THERR_OK; 1095 int ret = THERR_OK;
1094 th_ioctx *inFile = NULL; 1096 th_ioctx *inFile = NULL;
1095 if ((inFile = th_io_fopen(&th_stdio_io_ops, setSLDBPath, "r")) == NULL) 1097 if ((ret = th_io_fopen(&inFile, &th_stdio_io_ops, setSLDBPath, "r")) != THERR_OK)
1096 { 1098 {
1097 THERR("Could not open SLDB '%s'.\n", 1099 THERR("Could not open SLDB '%s': %s\n",
1098 setSLDBPath); 1100 setSLDBPath, th_error_str(ret));
1099 goto err; 1101 goto err;
1100 } 1102 }
1101 1103
1102 THMSG(1, "Reading SLDB.\n"); 1104 THMSG(1, "Reading SLDB.\n");
1103 if ((sidSLDB = si_sldb_new()) == NULL) 1105 if ((sidSLDB = si_sldb_new()) == NULL)