annotate src/xs_length.h @ 509:81756f412b43

Changes based on patch from Heikki 'shd' Orsila: Fix a crash on 64-bit big-endian platforms due to inproper mixing of guint and size_t types; Use bsearch() instead of my own implementation of binary search in xs_length.c and xs_stil.c; Remove useless(?) use of feof().
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 28 Jan 2007 15:09:04 +0000
parents c67a7f2fd586
children fa95d942f226
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
1 #ifndef _XS_LENGTH_H
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
2 #define _XS_LENGTH_H
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
3
214
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
4 #include "xmms-sid.h"
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
5 #include "xs_md5.h"
575686094eb1 Portability fixes
Matti Hamalainen <ccr@tnsp.org>
parents: 87
diff changeset
6
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
7 #ifdef __cplusplus
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
8 extern "C" {
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
9 #endif
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
10
457
693baa150eea Cosmetics
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
11 /* Types
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
12 */
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
13 typedef struct _t_xs_sldb_node {
14
f5d82424b0ed Made song-length database support FINALLY work!
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
14 t_xs_md5hash md5Hash; /* 128-bit MD5 hash-digest */
f5d82424b0ed Made song-length database support FINALLY work!
Matti Hamalainen <ccr@tnsp.org>
parents: 4
diff changeset
15 gint nLengths; /* Number of lengths */
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
16 gint *sLengths; /* Lengths in seconds */
87
94497283affa Various fixes and improvements
Matti Hamalainen <ccr@tnsp.org>
parents: 62
diff changeset
17 struct _t_xs_sldb_node *pPrev, *pNext;
62
0d1df20745dd Started to rewrite STIL-support
Matti Hamalainen <ccr@tnsp.org>
parents: 39
diff changeset
18 } t_xs_sldb_node;
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
19
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
20
227
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
21 typedef struct {
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
22 t_xs_sldb_node *pNodes,
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
23 **ppIndex;
509
81756f412b43 Changes based on patch from Heikki 'shd' Orsila: Fix a crash on 64-bit
Matti Hamalainen <ccr@tnsp.org>
parents: 476
diff changeset
24 size_t n;
227
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
25 } t_xs_sldb;
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
26
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
27
457
693baa150eea Cosmetics
Matti Hamalainen <ccr@tnsp.org>
parents: 402
diff changeset
28 /* Functions
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
29 */
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
30 gint xs_sldb_read(t_xs_sldb *, const gchar *);
227
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
31 gint xs_sldb_index(t_xs_sldb *);
92bad4c7b998 Improved modularization of STIL and song-length database subsystems.
Matti Hamalainen <ccr@tnsp.org>
parents: 214
diff changeset
32 void xs_sldb_free(t_xs_sldb *);
402
f997b79a7251 More work on merging of improved STIL/SLDB handling code with completely
Matti Hamalainen <ccr@tnsp.org>
parents: 392
diff changeset
33 t_xs_sldb_node * xs_sldb_get(t_xs_sldb *, const gchar *);
4
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
34
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
35 #ifdef __cplusplus
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
36 }
4bb09e405eab Added new files for 0.8
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
37 #endif
392
b09d74eb71e6 Working on getting STIL and SLDB using completely dynamically allocated
Matti Hamalainen <ccr@tnsp.org>
parents: 334
diff changeset
38 #endif /* _XS_LENGTH_H */