libtags: upstream updates
This commit is contained in:
parent
b66bffe91c
commit
5e81cc48bd
5 changed files with 16 additions and 15 deletions
|
@ -3,12 +3,12 @@
|
|||
int
|
||||
tagit(Tagctx *ctx)
|
||||
{
|
||||
char d[4+26+1], o[26*UTFmax+1];
|
||||
uchar d[4+26+1], o[26*2+1];
|
||||
|
||||
if(ctx->read(ctx, d, 4+26) != 4+26 || memcmp(d, "IMPM", 4) != 0)
|
||||
return -1;
|
||||
d[4+26] = 0;
|
||||
if(cp437toutf8(o, sizeof(o), d+4, 26) > 0)
|
||||
if(iso88591toutf8(o, sizeof(o), d+4, 26) > 0)
|
||||
txtcb(ctx, Ttitle, "", o);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -16,6 +16,7 @@ static char *variants[] =
|
|||
"CD81",
|
||||
"OCTA",
|
||||
"OKTA",
|
||||
"10CH",
|
||||
"16CN",
|
||||
"32CN",
|
||||
nil,
|
||||
|
@ -24,7 +25,7 @@ static char *variants[] =
|
|||
int
|
||||
tagmod(Tagctx *ctx)
|
||||
{
|
||||
char d[20], o[20*UTFmax+1];
|
||||
uchar d[20], o[20*2+1];
|
||||
int i;
|
||||
|
||||
if(ctx->seek(ctx, 1080, 0) != 1080)
|
||||
|
@ -41,7 +42,7 @@ tagmod(Tagctx *ctx)
|
|||
return -1;
|
||||
if(ctx->read(ctx, d, 20) != 20)
|
||||
return -1;
|
||||
if(cp437toutf8(o, sizeof(o), d, 20) > 0)
|
||||
if(iso88591toutf8(o, sizeof(o), d, 20) > 0)
|
||||
txtcb(ctx, Ttitle, "", o);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -41,19 +41,20 @@ tagscallcb(Tagctx *ctx, int type, const char *k, char *s, int offset, int size,
|
|||
char *e;
|
||||
|
||||
if(f == nil && size == 0){
|
||||
while(*s <= ' ' && *s)
|
||||
while((uchar)*s <= ' ' && *s)
|
||||
s++;
|
||||
e = s + strlen(s);
|
||||
while(e != s && e[-1] <= ' ')
|
||||
while(e != s && (uchar)e[-1] <= ' ')
|
||||
e--;
|
||||
*e = 0;
|
||||
}
|
||||
if(type != Tunknown){
|
||||
ctx->found |= 1<<type;
|
||||
ctx->num++;
|
||||
}
|
||||
if(*s)
|
||||
if(*s){
|
||||
ctx->tag(ctx, type, k, s, offset, size, f);
|
||||
if(type != Tunknown){
|
||||
ctx->found |= 1<<type;
|
||||
ctx->num++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -41,4 +41,4 @@ void cbvorbiscomment(Tagctx *ctx, char *k, char *v);
|
|||
|
||||
void tagscallcb(Tagctx *ctx, int type, const char *k, char *s, int offset, int size, Tagread f);
|
||||
|
||||
#define txtcb(ctx, type, k, s) tagscallcb(ctx, type, k, (const char*)s, 0, 0, nil)
|
||||
#define txtcb(ctx, type, k, s) tagscallcb(ctx, type, k, (char*)s, 0, 0, nil)
|
||||
|
|
|
@ -3,12 +3,11 @@
|
|||
int
|
||||
tagxm(Tagctx *ctx)
|
||||
{
|
||||
char d[17+20+1], o[20*UTFmax+1], *s;
|
||||
char d[17+20+1], o[20*UTFmax+1];
|
||||
|
||||
if(ctx->read(ctx, d, 17+20) != 17+20 || memcmp(d, "Extended Module: ", 17) != 0)
|
||||
if(ctx->read(ctx, d, 17+20) != 17+20 || cistrncmp(d, "Extended Module: ", 17) != 0)
|
||||
return -1;
|
||||
d[17+20] = 0;
|
||||
for(s = d+17; *s == ' '; s++);
|
||||
if(cp437toutf8(o, sizeof(o), d+17, 20) > 0)
|
||||
txtcb(ctx, Ttitle, "", o);
|
||||
|
||||
|
|
Loading…
Reference in a new issue