7 dirpackage(uchar *buf, long ts, Dir **d)
13 * first find number of all stats, check they look like stats, & size all associated strings
16 for(i = 0; i < ts; i += m){
19 m = BIT16SZ + GBIT16(&buf[i]);
20 if(i+m > ts || statcheck(&buf[i], m) < 0)
25 *d = malloc(n * sizeof(Dir) + ts);
30 * then convert all buffers
32 s = (char*)*d + n * sizeof(Dir);
34 for(i = 0; i < ts; i += m){
35 m = BIT16SZ + GBIT16(&buf[i]);
36 if(i+m > ts || nn >= n || convM2D(&buf[i], m, *d + nn, s) != m){
49 dirread(int fd, Dir **d)
58 ts = read(fd, buf, DIRMAX);
60 ts = dirpackage(buf, ts, d);
66 dirreadall(int fd, Dir **d)
75 nbuf = realloc(buf, ts+DIRMAX);
81 n = read(fd, buf+ts, DIRMAX);
87 ts = dirpackage(buf, ts, d);