/*
* ISO 9660 file names must be uppercase, digits, or underscore.
* We use lowercase, digits, and underscore, translating lower to upper
* in mkisostring, and upper to lower in isostring.
* Files with uppercase letters in their names are thus nonconforming.
* Conforming files also must have a basename
* at most 8 letters and at most one suffix of at most 3 letters.
*/
char*
isostring(uchar *buf, int len)
{
char *p, *q;
/*
* we rename files of the form [FD]dddddd
* so they don't interfere with us.
*/
if(strlen(s) == 7 && (s[0] == 'D' || s[0] == 'F')) {
for(i=1; i<7; i++)
if(s[i] < '0' || s[i] > '9')
break;
if(i == 7)
return 1;
}
}
return 0;
}
/*
* ISO9660 name comparison
*
* The standard algorithm is as follows:
* Take the filenames without extensions, pad the shorter with 0x20s (spaces),
* and do strcmp. If they are equal, go on.
* Take the extensions, pad the shorter with 0x20s (spaces),
* and do strcmp. If they are equal, go on.
* Compare the version numbers.
*
* Since Plan 9 names are not allowed to contain characters 0x00-0x1F,
* the padded comparisons are equivalent to using strcmp directly.
* We still need to handle the base and extension differently,
* so that .foo sorts before !foo.foo.
*/
int
isocmp(const void *va, const void *vb)
{
int i;
char s1[32], s2[32], *b1, *b2, *e1, *e2;
const Direc *a, *b;