annotate sidlib.h @ 260:4a3e8960b3a9

Rename some struct fields.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 05 Jan 2020 22:11:48 +0200
parents 6cb01bf6c8c8
children ef1d6d16718e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1 /*
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
2 * SIDInfoLib - Way too simplistic PSID/RSID file library
171
d86ade7d0dfd Change copyright blurbs slightly.
Matti Hamalainen <ccr@tnsp.org>
parents: 169
diff changeset
3 * Programmed and designed by Matti 'ccr' Hämäläinen <ccr@tnsp.org>
227
2b3d5d49086d Bump copyright years.
Matti Hamalainen <ccr@tnsp.org>
parents: 226
diff changeset
4 * (C) Copyright 2014-2020 Tecnic Software productions (TNSP)
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 */
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
6 #ifndef SIDLIB_H
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #define SIDLIB_H 1
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #include "th_util.h"
85
4c0ecb078591 Rename various variables and functions and change relevant places to use the
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
10 #include "th_ioctx.h"
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11 #include "th_crypto.h"
224
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
12 #include "th_datastruct.h"
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
13
85
4c0ecb078591 Rename various variables and functions and change relevant places to use the
Matti Hamalainen <ccr@tnsp.org>
parents: 74
diff changeset
14
72
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
15 #ifdef __cplusplus
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
16 extern "C" {
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
17 #endif
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
18
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
220
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
20 //
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21 // Some constants
220
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
22 //
230
1e860046a4cc Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 227
diff changeset
23 #define SIDLIB_PSID_MAGIC_LEN (4)
1e860046a4cc Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 227
diff changeset
24 #define SIDLIB_PSID_STR_LEN (32)
1e860046a4cc Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 227
diff changeset
25 #define SIDLIB_BUFFER_SIZE (1024 * 16)
86
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
26
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
27
220
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
28 enum
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
29 {
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
30 // Player flags
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
31 PSF_PLAYER_TYPE = 0x01, // 0 = built-in, 1 = Compute! SIDPlayer MUS
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
32 PSF_PLAYSID_TUNE = 0x02, // 0 = Real C64-compatible, 1 = PlaySID specific (v2NG)
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
33
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
34 // Video standard used (v2NG+)
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
35 PSF_CLOCK_UNKNOWN = 0x00,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
36 PSF_CLOCK_PAL = 0x01,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
37 PSF_CLOCK_NTSC = 0x02,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
38 PSF_CLOCK_ANY = 0x03,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
39 PSF_CLOCK_MASK = 0x03,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
40
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
41 // SID model (v2NG+)
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
42 PSF_MODEL_UNKNOWN = 0x00,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
43 PSF_MODEL_MOS6581 = 0x01,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
44 PSF_MODEL_MOS8580 = 0x02,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
45 PSF_MODEL_ANY = 0x03,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
46 PSF_MODEL_MASK = 0x03,
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
47 };
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
48
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
49
241
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
50 // STIL database subtune fields, see SIDLibSTILSubNode
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
51 enum
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
52 {
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
53 STF_NAME,
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
54 STF_AUTHOR,
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
55 STF_TITLE,
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
56 STF_INFO,
242
537420ccd05b More work on STIL parser.
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
57 STF_ARTIST,
537420ccd05b More work on STIL parser.
Matti Hamalainen <ccr@tnsp.org>
parents: 241
diff changeset
58 STF_COMMENT,
241
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
59
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
60 STF_LAST
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
61 };
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
62
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
63
220
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
64 //
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
65 // Structures
e79a93971d27 Cosmetic reorganization.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
66 //
224
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
67 typedef struct
86
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
68 {
224
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
69 th_llist_t node;
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
70
86
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
71 th_md5hash_t hash; // MD5 hash-digest
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
72 int nlengths; // Number of lengths
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
73 int *lengths; // Lengths in seconds
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
74 } SIDLibSLDBNode;
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
75
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
76
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
77 typedef struct
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
78 {
224
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
79 SIDLibSLDBNode *nodes, **pindex;
4bec78f45188 Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents: 223
diff changeset
80 size_t nnodes;
86
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
81 } SIDLibSLDB;
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
82
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
83
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
84 typedef struct
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
85 {
241
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
86 char *fields[STF_LAST];
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
87 } SIDLibSTILSubNode;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
88
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
89
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
90 typedef struct
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
91 {
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
92 th_llist_t node;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
93
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
94 char *filename;
260
4a3e8960b3a9 Rename some struct fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 245
diff changeset
95 int nsubtunes;
4a3e8960b3a9 Rename some struct fields.
Matti Hamalainen <ccr@tnsp.org>
parents: 245
diff changeset
96 SIDLibSTILSubNode **subtunes;
241
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
97 } SIDLibSTILNode;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
98
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
99
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
100 typedef struct
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
101 {
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
102 SIDLibSTILNode *nodes, **pindex;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
103 size_t nnodes;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
104 } SIDLibSTILDB;
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
105
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
106
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
107 typedef struct
c9b57c8fd058 Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents: 236
diff changeset
108 {
223
a76276ff7ba8 Rename PSID_* constant defines to SIDLIB_PSID_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 222
diff changeset
109 char magic[SIDLIB_PSID_MAGIC_LEN + 1]; // "PSID" / "RSID" magic identifier
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
110 uint16_t
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
111 version, // Version number
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
112 dataOffset, // Start of actual c64 data in file
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
113 loadAddress, // Loading address
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
114 initAddress, // Initialization address
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
115 playAddress, // Play one frame
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
116 nSongs, // Number of subsongs
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
117 startSong; // Default starting song
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
118 uint32_t speed; // Speed
128
2636185649c6 Add si_fread_str() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
119 char *sidName; // Descriptive text-fields, ASCIIZ
2636185649c6 Add si_fread_str() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
120 char *sidAuthor;
2636185649c6 Add si_fread_str() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents: 126
diff changeset
121 char *sidCopyright;
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
122
144
6418286a7e4c Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 133
diff changeset
123 // PSIDv2+ data
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
124 uint16_t flags; // Flags
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
125 uint8_t startPage, pageLength;
133
9cfa0553e7f9 Add support for reading PSID/RSID v4 in sidlib.
Matti Hamalainen <ccr@tnsp.org>
parents: 132
diff changeset
126 uint8_t sid2Addr, sid3Addr;
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
127
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
128 // Extra data
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
129 BOOL isRSID;
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
130 size_t dataSize; // Total size of data - header
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
131 th_md5hash_t hash; // Songlength database hash
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
132
88
c5ff71d64e53 More work on sidlib SLDB code.
Matti Hamalainen <ccr@tnsp.org>
parents: 86
diff changeset
133 SIDLibSLDBNode *lengths; // Songlength information node pointer
226
c32015f4969e Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
134 BOOL allocated; // TRUE if structure has been allocated
88
c5ff71d64e53 More work on sidlib SLDB code.
Matti Hamalainen <ccr@tnsp.org>
parents: 86
diff changeset
135
226
c32015f4969e Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
136 } SIDLibPSIDHeader;
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
137
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
138
74
5d61d8dbc77f Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
139 //
5d61d8dbc77f Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
140 // Functions
5d61d8dbc77f Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
141 //
226
c32015f4969e Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
142 int sidlib_read_sid_file(th_ioctx *ctx, SIDLibPSIDHeader *psid, const BOOL newSLDB);
c32015f4969e Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
143 int sidlib_read_sid_file_alloc(th_ioctx *ctx, SIDLibPSIDHeader **ppsid, const BOOL newSLDB);
c32015f4969e Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents: 224
diff changeset
144 void sidlib_free_sid_file(SIDLibPSIDHeader *psid);
74
5d61d8dbc77f Cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 73
diff changeset
145
222
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
146 const char * sidlib_get_sid_clock_str(const int flags);
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
147 const char * sidlib_get_sid_model_str(const int flags);
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
148
236
609bfc1bd628 Change sidlib_sldb_new() API to int sidlib_sldb_new(SIDLibSLDB **pdbh).
Matti Hamalainen <ccr@tnsp.org>
parents: 231
diff changeset
149 int sidlib_sldb_new(SIDLibSLDB **pdbh);
222
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
150 int sidlib_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh);
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
151 int sidlib_sldb_build_index(SIDLibSLDB *dbh);
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
152 void sidlib_sldb_free(SIDLibSLDB *dbh);
3a01518fffe0 Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents: 221
diff changeset
153 SIDLibSLDBNode * sidlib_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash);
86
e1ff9cd27a84 Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents: 85
diff changeset
154
245
6cb01bf6c8c8 Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
155 int sidlib_stildb_new(SIDLibSTILDB **pdbh);
6cb01bf6c8c8 Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
156 int sidlib_stildb_read(th_ioctx *ctx, SIDLibSTILDB *dbh);
6cb01bf6c8c8 Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
157 int sidlib_stildb_build_index(SIDLibSTILDB *dbh);
6cb01bf6c8c8 Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
158 void sidlib_stildb_free(SIDLibSTILDB *dbh);
6cb01bf6c8c8 Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents: 242
diff changeset
159 SIDLibSTILNode * sidlib_stildb_get_node(SIDLibSTILDB *dbh, const char *filename);
101
9d4d1783800b Add si_sldb_{read,write}_bin() functions to write and read a binary format
Matti Hamalainen <ccr@tnsp.org>
parents: 100
diff changeset
160
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
161
72
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
162 #ifdef __cplusplus
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
163 }
d5a34a3a602d Add C++ include guards.
Matti Hamalainen <ccr@tnsp.org>
parents: 70
diff changeset
164 #endif
70
4779bbec2f28 Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
165 #endif // SIDLIB_H