tagscan: some funny messages
[k8muffin.git] / dox / tagdb_fmt.txt
blob8adc4bce0c5a46859bd57bb9af16b88dc780dc28
1 'dq' means uint64_t
3 stringidx is just an offset in 'string data'; all strings are 0-terminated;
4 before each string one can found it's length without trailing zero as dw.
7 db 'MTD0'
8 dd file_count
9 dd tag_count
10 dd string_bytes  ; # of bytes in 'string data'
11 dd ofs_bytes     ; # of bytes in 'offsets'
12 dd o_tag_count   ; # of 'original' tags
13 dd t_tag_count   ; # of 'transliterated' tags
16 string data (see above):
17 db ?(string_bytes)
20 tag lists (for 'original' and for 'transliterated'):
21 ; offsets in tag block
22 dd tagidx(o_tag_count)
23 dd tagidx(t_tag_count)
26 file info (for each file, names should be unique):
27 dd real_name_stringidx
28 dd short_name_stringidx      ; this MUST be unique, it's used as 'file id' everywhere
29 ; file info (this fields are taken from stat() directry)
30 dq devid                     ; can be 0, it means 'undefined/unknown'
31 dq inode                     ; can be 0, it means 'undefined/unknown'
32 dq size                      ; can be 0, it means 'undefined/unknown'
33 dq mtime                     ; can be 0, it means 'undefined/unknown'
34 db tracknum                  ; 0: unknown; this can be used to generate short file names
35 dw year                      ; 0: unknown; else: should be normalized
36 dd year_tagid                ; yes, years have their own textual tags, along with 'unknown year'
37 ; pair of tags; there can't be undefined tags, all undefined ones will be mapped to 'unknown_xxx'
38 ; this is INDICIES
39 dd artist_o, artist_t
40 dd album_o, album_t
41 dd title_o, title_t
42 dd genre_o, genre_t
45 tag info (for each tag, names should be unique), repeats twice -- first for 'o', then for 't':
46 dd name_stringidx
47 the following repeats 9 times, for year, artist_o, artist_t, album_o, album_t, title_o, title_t, genre_o, genre_t:
48  dd used_count           ; # of files that used this tag at least once
49  dd ofsidx               ; index in 'offsets'
52 ofs info:
53 dd fileidx(ofs_bytes/4)
56 this way we can simply mmap the whole tagdb if fusedrv.
58 note that badly crafted file will certainly crash the driver. i don't care. just don't trust other people
59 files (why you should use such files anyway? build your own database!)