Mercurial > hg > sidinfo
comparison sidlib.c @ 133:9cfa0553e7f9
Add support for reading PSID/RSID v4 in sidlib.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 02 Jun 2017 02:39:15 +0300 |
parents | b3e034b8c4b9 |
children | 27365eae837b |
comparison
equal
deleted
inserted
replaced
132:b3e034b8c4b9 | 133:9cfa0553e7f9 |
---|---|
90 | 90 |
91 psid->magic[PSID_MAGIC_LEN] = 0; | 91 psid->magic[PSID_MAGIC_LEN] = 0; |
92 | 92 |
93 if ((psid->magic[0] != 'R' && psid->magic[0] != 'P') || | 93 if ((psid->magic[0] != 'R' && psid->magic[0] != 'P') || |
94 psid->magic[1] != 'S' || psid->magic[2] != 'I' || psid->magic[3] != 'D' || | 94 psid->magic[1] != 'S' || psid->magic[2] != 'I' || psid->magic[3] != 'D' || |
95 psid->version < 1 || psid->version > 3) | 95 psid->version < 1 || psid->version > 4) |
96 { | 96 { |
97 th_io_error(ctx, THERR_NOT_SUPPORTED, | 97 th_io_error(ctx, THERR_NOT_SUPPORTED, |
98 "Not a supported PSID or RSID file.\n"); | 98 "Not a supported PSID or RSID file.\n"); |
99 goto error; | 99 goto error; |
100 } | 100 } |
116 { | 116 { |
117 // Yes, we need to | 117 // Yes, we need to |
118 if (!thfread_be16(ctx, &psid->flags) || | 118 if (!thfread_be16(ctx, &psid->flags) || |
119 !thfread_u8(ctx, &psid->startPage) || | 119 !thfread_u8(ctx, &psid->startPage) || |
120 !thfread_u8(ctx, &psid->pageLength) || | 120 !thfread_u8(ctx, &psid->pageLength) || |
121 !thfread_be16(ctx, &psid->reserved)) | 121 !thfread_u8(ctx, &psid->sid2Addr) || |
122 !thfread_u8(ctx, &psid->sid3Addr)) | |
122 { | 123 { |
123 th_io_error(ctx, ctx->status, | 124 th_io_error(ctx, ctx->status, |
124 "Error reading PSID/RSID v2+ extra header data: %s.\n", | 125 "Error reading PSID/RSID v2+ extra header data: %s.\n", |
125 th_error_str(ctx->status)); | 126 th_error_str(ctx->status)); |
126 goto error; | 127 goto error; |