diff sidlib.h @ 86:e1ff9cd27a84

Initial port of songlength database (SLDB) handling code from XMMS-SID to here. Needs refactoring.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 11 Feb 2016 23:21:26 +0200
parents 4c0ecb078591
children c5ff71d64e53
line wrap: on
line diff
--- a/sidlib.h	Thu Feb 11 23:18:58 2016 +0200
+++ b/sidlib.h	Thu Feb 11 23:21:26 2016 +0200
@@ -20,6 +20,24 @@
 #define PSID_MAGIC_LEN    4
 #define PSID_STR_LEN      32
 #define PSID_BUFFER_SIZE  (1024 * 16)
+#define PSID_BUFFER2_SIZE (1024)
+
+
+typedef struct _SIDLibSLDBNode
+{
+    th_md5hash_t    hash;       // MD5 hash-digest
+    int             nlengths;   // Number of lengths
+    int             *lengths;   // Lengths in seconds
+    struct _SIDLibSLDBNode *prev, *next;
+} SIDLibSLDBNode;
+
+
+typedef struct
+{
+    SIDLibSLDBNode  *nodes,
+                    **pindex;
+    size_t          n;
+} SIDLibSLDB;
 
 
 typedef struct
@@ -78,6 +96,11 @@
 const char *    si_get_sid_clock_str(const int flags);
 const char *    si_get_sid_model_str(const int flags);
 
+int             si_sldb_read(th_ioctx *ctx, SIDLibSLDB *dbh);
+int             si_sldb_build_index(SIDLibSLDB *dbh);
+void            si_sldb_free(SIDLibSLDB *dbh);
+SIDLibSLDBNode *si_sldb_get_by_hash(SIDLibSLDB *dbh, th_md5hash_t hash);
+
 
 #ifdef __cplusplus
 }