5 static char channames[] = "rgbkamx";
7 chantostr(char *buf, ulong cc)
12 if(chantodepth(cc) == 0)
15 /* reverse the channel descriptor so we can easily generate the string in the right order */
24 *p++ = channames[TYPE(c)];
32 /* avoid pulling in ctype when using with drawterm etc. */
36 return c==' ' || c== '\t' || c=='\r' || c=='\n';
49 while(*p && isspace(*p))
52 while(*p && !isspace(*p)){
53 if((q = strchr(channames, p[0])) == nil)
56 if(p[1] < '0' || p[1] > '9')
60 c = (c<<8) | __DC(t, n);
63 if(d==0 || (d>8 && d%8) || (d<8 && 8%d))
74 if(TYPE(c) >= NChan || NBITS(c) > 8 || NBITS(c) <= 0)
78 if(n==0 || (n>8 && n%8) || (n<8 && 8%n))