~mcf/plan9front

04f7955f19d0eff03a518ee1c5207bf45e9bd271 — Sigrid 5 months ago f5188b0
libtags: upstream updates
M sys/src/cmd/audio/libtags/it.c => sys/src/cmd/audio/libtags/it.c +2 -2
@@ 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;

M sys/src/cmd/audio/libtags/mod.c => sys/src/cmd/audio/libtags/mod.c +3 -2
@@ 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;

M sys/src/cmd/audio/libtags/tags.c => sys/src/cmd/audio/libtags/tags.c +8 -7
@@ 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

M sys/src/cmd/audio/libtags/tagspriv.h => sys/src/cmd/audio/libtags/tagspriv.h +1 -1
@@ 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)

M sys/src/cmd/audio/libtags/xm.c => sys/src/cmd/audio/libtags/xm.c +2 -3
@@ 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);