# HG changeset patch # User Matti Hamalainen # Date 1455504202 -7200 # Node ID ff6d1a9a2fdeff311836fbf3dd34f0899bc24f19 # Parent 1362f00e4368901f436c9ae83147ab1ace27580f Move definitions to start of the file. diff -r 1362f00e4368 -r ff6d1a9a2fde sidlib.c --- a/sidlib.c Mon Feb 15 04:43:06 2016 +0200 +++ b/sidlib.c Mon Feb 15 04:43:22 2016 +0200 @@ -8,6 +8,24 @@ #include "th_string.h" +#define SIDLIB_DB_MAGIC "SIDLibDB" +#define SIDLIB_DB_VERSION 0x0100 + + +typedef struct +{ + char magic[8]; // File magic ID + uint16_t version; // Version + uint32_t nnodes; // Number of song nodes +// struct { +// th_md5hash_t hash; // Hash for this SID file +// uint16_t nlengths; // Number of song (lengths) +// uint16_t length[nlengths]; // Length in seconds +// } * nnodes; + th_md5hash_t hash; +} PSIDLibHdr; + + int si_read_sid_file(th_ioctx *ctx, PSIDHeader *psid) { th_md5state_t state; @@ -480,23 +498,9 @@ } -#define SIDLIB_DB_MAGIC "SIDLibDB" -#define SIDLIB_DB_VERSION 0x0100 - -typedef struct -{ - char magic[8]; // File magic ID - uint16_t version; // Version - uint32_t nnodes; // Number of song nodes -// struct { -// th_md5hash_t hash; // Hash for this SID file -// uint16_t nlengths; // Number of song (lengths) -// uint16_t length[nlengths]; // Length in seconds -// } * nnodes; - th_md5hash_t hash; -} PSIDLibHdr; - - +// +// Read binary format SLDB +// int si_sldb_read_bin(th_ioctx *ctx, SIDLibSLDB *dbh) { PSIDLibHdr hdr;