History

dumb s3m tags parser

Sigrid Solveig Haflínudóttir committed 5 years ago

Commit f4bd0181 parent 5f031525 files · +23 −2Browse files

Unified · Split

5 files
  1. README.md +1 −0
  2. mkfile +1 −0
  3. s3m.c +16 −0
  4. tags.c +4 −2
  5. tags.h +1 −0
README.md+1−0
@@ -15,6 +15,7 @@ Comparison to id3lib and taglib: · 14 unmodified lines
1515 | WAV | yes | no | yes |
1616 | IT | yes | no | ??? |
1717 | XM | yes | no | ??? |
18+| S3M | yes | no | ??? |
1819 | replay gain | yes | no | ??? |
1920 | size | tiny | bloated | more bloated |
2021 | license | MIT | LGPL | LGPL/MPL |
mkfile+1−0
@@ -10,6 +10,7 @@ OFILES=\ · 9 unmodified lines
1010 it.$O\
1111 m4a.$O\
1212 opus.$O\
13+ s3m.$O\
1314 tags.$O\
1415 utf16.$O\
1516 vorbis.$O\
s3m.c+16−0
@@ -0,0 +1,16 @@
1+#include "tagspriv.h"
2+
3+int
4+tags3m(Tagctx *ctx)
5+{
6+ char d[28+1+1], *s;
7+
8+ if(ctx->read(ctx, d, 28+1+1) != 28+1+1 || (d[28] != 0x1a && d[28] != 0) || d[29] != 0x10)
9+ return -1;
10+ d[28] = 0;
11+ for(s = d+27; s != d-1 && (*s == ' ' || *s == 0); s--);
12+ s[1] = 0;
13+ txtcb(ctx, Ttitle, "", d);
14+
15+ return 0;
16+}
tags.c+4−2
@@ -8,13 +8,14 @@ struct Getter · 7 unmodified lines
88 int format;
99 };
1010
11−extern int tagvorbis(Tagctx *ctx);
1211 extern int tagflac(Tagctx *ctx);
13−extern int tagid3v2(Tagctx *ctx);
1412 extern int tagid3v1(Tagctx *ctx);
13+extern int tagid3v2(Tagctx *ctx);
1514 extern int tagit(Tagctx *ctx);
1615 extern int tagm4a(Tagctx *ctx);
1716 extern int tagopus(Tagctx *ctx);
17+extern int tags3m(Tagctx *ctx);
18+extern int tagvorbis(Tagctx *ctx);
1819 extern int tagwav(Tagctx *ctx);
1920 extern int tagxm(Tagctx *ctx);
2021
@@ -29,6 +30,7 @@ static const Getter g[] = · 8 unmodified lines
2930 {tagwav, Fwav},
3031 {tagit, Fit},
3132 {tagxm, Fxm},
33+ {tags3m, Fs3m},
3234 };
3335
3436 void
tags.h+1−0
@@ -34,6 +34,7 @@ enum · 33 unmodified lines
3434 Fwav,
3535 Fit,
3636 Fxm,
37+ Fs3m,
3738
3839 Fmax,
3940 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t