Mercurial > hg > sidinfo
annotate sidlib.h @ 404:39cebb2b0677
Bump copyright years.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 28 Mar 2023 15:30:39 +0300 |
parents | 95a8e05dae27 |
children |
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> |
404 | 4 * (C) Copyright 2014-2023 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 | 15 #ifdef __cplusplus |
16 extern "C" { | |
17 #endif | |
18 | |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
19 |
220 | 20 // |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
21 // Some constants |
220 | 22 // |
230 | 23 #define SIDLIB_PSID_MAGIC_LEN (4) |
24 #define SIDLIB_PSID_STR_LEN (32) | |
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 | 28 enum |
29 { | |
388
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
30 SIDLIB_FLG_NEW_SLDB = 0x01, // Using 'new' Songlengths.md5 style SLDB |
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
31 }; |
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
32 |
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
33 |
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
34 enum |
c96448875797
Change "new SLDB" boolean to a flags int.
Matti Hamalainen <ccr@tnsp.org>
parents:
386
diff
changeset
|
35 { |
220 | 36 // Player flags |
37 PSF_PLAYER_TYPE = 0x01, // 0 = built-in, 1 = Compute! SIDPlayer MUS | |
38 PSF_PLAYSID_TUNE = 0x02, // 0 = Real C64-compatible, 1 = PlaySID specific (v2NG) | |
39 | |
40 // Video standard used (v2NG+) | |
41 PSF_CLOCK_UNKNOWN = 0x00, | |
42 PSF_CLOCK_PAL = 0x01, | |
43 PSF_CLOCK_NTSC = 0x02, | |
44 PSF_CLOCK_ANY = 0x03, | |
45 PSF_CLOCK_MASK = 0x03, | |
46 | |
47 // SID model (v2NG+) | |
48 PSF_MODEL_UNKNOWN = 0x00, | |
49 PSF_MODEL_MOS6581 = 0x01, | |
50 PSF_MODEL_MOS8580 = 0x02, | |
51 PSF_MODEL_ANY = 0x03, | |
52 PSF_MODEL_MASK = 0x03, | |
53 }; | |
54 | |
55 | |
262
ef1d6d16718e
s/SIDLibSTILSubNode/SIDLibSTILSubTune/g
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
56 // STIL database subtune fields, see SIDLibSTILSubTune |
241
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
57 enum |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
58 { |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
59 STF_NAME, |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
60 STF_AUTHOR, |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
61 STF_TITLE, |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
62 STF_INFO, |
242 | 63 STF_ARTIST, |
64 STF_COMMENT, | |
241
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
65 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
66 STF_LAST |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
67 }; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
68 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
69 |
220 | 70 // |
71 // Structures | |
72 // | |
224
4bec78f45188
Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents:
223
diff
changeset
|
73 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
|
74 { |
224
4bec78f45188
Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents:
223
diff
changeset
|
75 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
|
76 |
86
e1ff9cd27a84
Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents:
85
diff
changeset
|
77 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
|
78 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
|
79 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
|
80 } SIDLibSLDBNode; |
e1ff9cd27a84
Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents:
85
diff
changeset
|
81 |
e1ff9cd27a84
Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents:
85
diff
changeset
|
82 |
e1ff9cd27a84
Initial port of songlength database (SLDB) handling code from XMMS-SID to here.
Matti Hamalainen <ccr@tnsp.org>
parents:
85
diff
changeset
|
83 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
|
84 { |
224
4bec78f45188
Use th_datastruct::th_llist_t instead of yet another linked list
Matti Hamalainen <ccr@tnsp.org>
parents:
223
diff
changeset
|
85 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
|
86 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
|
87 } SIDLibSLDB; |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
88 |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
89 |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
90 typedef struct |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
91 { |
264
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
92 int ndata; |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
93 char **data; // Converted through SIDLibChConvCtx if conversion is used |
264
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
94 } SIDLibSTILField; |
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
95 |
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
96 |
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
97 typedef struct |
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
98 { |
311
ee56f1f2b528
Change how the STIL subtune are handled internally. Also fix a bug that
Matti Hamalainen <ccr@tnsp.org>
parents:
310
diff
changeset
|
99 int tune; // Subtune number this structure contains information for |
264
5afa6052f796
Change SIDLibSTILSubTune::fields to new SIDLibSTILField structure for
Matti Hamalainen <ccr@tnsp.org>
parents:
262
diff
changeset
|
100 SIDLibSTILField fields[STF_LAST]; |
262
ef1d6d16718e
s/SIDLibSTILSubNode/SIDLibSTILSubTune/g
Matti Hamalainen <ccr@tnsp.org>
parents:
260
diff
changeset
|
101 } SIDLibSTILSubTune; |
241
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
102 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
103 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
104 typedef struct |
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 th_llist_t node; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
107 |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
108 char *filename; // HVSC path/filename (NOT converted through SIDLibChConvCtx) |
311
ee56f1f2b528
Change how the STIL subtune are handled internally. Also fix a bug that
Matti Hamalainen <ccr@tnsp.org>
parents:
310
diff
changeset
|
109 size_t nsubtunes; // Number of subtune information structures |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
110 SIDLibSTILSubTune *subtunes; // NOTE! Subtunes are in undefined order here |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
111 // (through with correct SIDLibSTILSubTune::tune number, of course) |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
112 // unless sidlib_stildb_build_index() has been run on the SIDLibSTILDB |
271
439d08a11365
Add support for STIL database in output. The output format is probably going
Matti Hamalainen <ccr@tnsp.org>
parents:
266
diff
changeset
|
113 |
310 | 114 // Internal use only |
271
439d08a11365
Add support for STIL database in output. The output format is probably going
Matti Hamalainen <ccr@tnsp.org>
parents:
266
diff
changeset
|
115 SIDLibSLDBNode *lengths; |
241
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
116 } SIDLibSTILNode; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
117 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
118 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
119 typedef struct |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
120 { |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
121 SIDLibSTILNode *nodes, **pindex; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
122 size_t nnodes; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
123 } SIDLibSTILDB; |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
124 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
125 |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
126 typedef struct |
c9b57c8fd058
Begin work on STIL database parsing and handling.
Matti Hamalainen <ccr@tnsp.org>
parents:
236
diff
changeset
|
127 { |
223
a76276ff7ba8
Rename PSID_* constant defines to SIDLIB_PSID_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
222
diff
changeset
|
128 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
|
129 uint16_t |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
130 version, // Version number |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
131 dataOffset, // Start of actual c64 data in file |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
132 loadAddress, // Loading address |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
133 initAddress, // Initialization address |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
134 playAddress, // Play one frame |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
135 nSongs, // Number of subsongs |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
136 startSong; // Default starting song |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
137 uint32_t speed; // Speed |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
138 |
128
2636185649c6
Add si_fread_str() helper function.
Matti Hamalainen <ccr@tnsp.org>
parents:
126
diff
changeset
|
139 char *sidName; // Descriptive text-fields, ASCIIZ |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
140 char *sidAuthor; // Converted through SIDLibChConvCtx if conversion is used |
385
1049033c6bbd
Backwards-incompatible change in UX: renamed the 'Copyright'
Matti Hamalainen <ccr@tnsp.org>
parents:
383
diff
changeset
|
141 char *sidReleased; |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
142 |
144 | 143 // PSIDv2+ data |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
144 uint16_t flags; // Flags |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
145 uint8_t startPage, pageLength; |
133
9cfa0553e7f9
Add support for reading PSID/RSID v4 in sidlib.
Matti Hamalainen <ccr@tnsp.org>
parents:
132
diff
changeset
|
146 uint8_t sid2Addr, sid3Addr; |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
147 |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
148 // Extra data |
393
db64a58314a9
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
388
diff
changeset
|
149 bool isRSID, isInvalidRSID; |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 size_t dataSize; // Total size of data - header |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 th_md5hash_t hash; // Songlength database hash |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
152 |
310 | 153 // Internal use only |
393
db64a58314a9
Renaming BOOL->bool and TRUE/FALSE to true/false, and using stdbool.h if available.
Matti Hamalainen <ccr@tnsp.org>
parents:
388
diff
changeset
|
154 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
|
155 SIDLibSLDBNode *lengths; // Songlength information node pointer |
271
439d08a11365
Add support for STIL database in output. The output format is probably going
Matti Hamalainen <ccr@tnsp.org>
parents:
266
diff
changeset
|
156 SIDLibSTILNode *stil; // STIL database node pointer |
226
c32015f4969e
Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
157 } SIDLibPSIDHeader; |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
158 |
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
159 |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
160 typedef struct SIDLibChConvCtx |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
161 { |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
162 void *data; |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
163 char* (*convert)(struct SIDLibChConvCtx *ctx, const char *str); |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
164 } SIDLibChConvCtx; |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
165 |
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
166 |
74 | 167 // |
266
254828e9213b
Make sidlib_stil_fields[] public.
Matti Hamalainen <ccr@tnsp.org>
parents:
264
diff
changeset
|
168 // Globals |
254828e9213b
Make sidlib_stil_fields[] public.
Matti Hamalainen <ccr@tnsp.org>
parents:
264
diff
changeset
|
169 // |
361
5711c23e40cc
Oops, forgot to mark sidlib_stil_fields_{uc,lc} arrays extern in the header file. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
352
diff
changeset
|
170 extern const char * sidlib_stil_fields_uc[STF_LAST]; |
5711c23e40cc
Oops, forgot to mark sidlib_stil_fields_{uc,lc} arrays extern in the header file. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
352
diff
changeset
|
171 extern const char * sidlib_stil_fields_lc[STF_LAST]; |
319
6d0143e43edf
Add functionality and API changes for doing on-the-fly character set
Matti Hamalainen <ccr@tnsp.org>
parents:
311
diff
changeset
|
172 |
266
254828e9213b
Make sidlib_stil_fields[] public.
Matti Hamalainen <ccr@tnsp.org>
parents:
264
diff
changeset
|
173 |
254828e9213b
Make sidlib_stil_fields[] public.
Matti Hamalainen <ccr@tnsp.org>
parents:
264
diff
changeset
|
174 // |
74 | 175 // Functions |
176 // | |
402
95a8e05dae27
Sync with th-libs API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
177 int sidlib_read_sid_file(th_ioctx_t *ctx, SIDLibPSIDHeader *psid, const int flags, SIDLibChConvCtx *chconv); |
95a8e05dae27
Sync with th-libs API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
178 int sidlib_read_sid_file_alloc(th_ioctx_t *ctx, SIDLibPSIDHeader **ppsid, const int flags, SIDLibChConvCtx *chconv); |
226
c32015f4969e
Rename PSIDHeader struct to SIDLibPSIDHeader to conform with the SIDLib
Matti Hamalainen <ccr@tnsp.org>
parents:
224
diff
changeset
|
179 void sidlib_free_sid_file(SIDLibPSIDHeader *psid); |
74 | 180 |
402
95a8e05dae27
Sync with th-libs API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
181 int sidlib_write_sid_header(th_ioctx_t *ctx, const SIDLibPSIDHeader *psid); |
386
94ff750679a6
Implement sidlib_write_sid_header() function.
Matti Hamalainen <ccr@tnsp.org>
parents:
385
diff
changeset
|
182 |
222
3a01518fffe0
Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
183 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
|
184 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
|
185 |
236
609bfc1bd628
Change sidlib_sldb_new() API to int sidlib_sldb_new(SIDLibSLDB **pdbh).
Matti Hamalainen <ccr@tnsp.org>
parents:
231
diff
changeset
|
186 int sidlib_sldb_new(SIDLibSLDB **pdbh); |
402
95a8e05dae27
Sync with th-libs API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
187 int sidlib_sldb_read(th_ioctx_t *ctx, SIDLibSLDB *dbh); |
222
3a01518fffe0
Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
188 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
|
189 void sidlib_sldb_free(SIDLibSLDB *dbh); |
3a01518fffe0
Rename sidlib functions from si_* prefix to sidlib_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
221
diff
changeset
|
190 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
|
191 |
245
6cb01bf6c8c8
Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents:
242
diff
changeset
|
192 int sidlib_stildb_new(SIDLibSTILDB **pdbh); |
402
95a8e05dae27
Sync with th-libs API changes.
Matti Hamalainen <ccr@tnsp.org>
parents:
393
diff
changeset
|
193 int sidlib_stildb_read(th_ioctx_t *ctx, SIDLibSTILDB *dbh, SIDLibChConvCtx *chconv); |
245
6cb01bf6c8c8
Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents:
242
diff
changeset
|
194 int sidlib_stildb_build_index(SIDLibSTILDB *dbh); |
6cb01bf6c8c8
Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents:
242
diff
changeset
|
195 void sidlib_stildb_free(SIDLibSTILDB *dbh); |
6cb01bf6c8c8
Make the STILdb functions public.
Matti Hamalainen <ccr@tnsp.org>
parents:
242
diff
changeset
|
196 SIDLibSTILNode * sidlib_stildb_get_node(SIDLibSTILDB *dbh, const char *filename); |
311
ee56f1f2b528
Change how the STIL subtune are handled internally. Also fix a bug that
Matti Hamalainen <ccr@tnsp.org>
parents:
310
diff
changeset
|
197 SIDLibSTILSubTune *sidlib_stildb_find_subtune(SIDLibSTILNode *node, const int nsubtune); |
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
|
198 |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
199 |
72 | 200 #ifdef __cplusplus |
201 } | |
202 #endif | |
70
4779bbec2f28
Split some functionality into sidlib.[ch].
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
203 #endif // SIDLIB_H |