Lines Matching refs:dirp
103 static RST_DIR *dirp; variable
183 dirp = opendirfile(dirfile); in extractdirs()
184 if (dirp == NULL) in extractdirs()
238 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in treescan()
239 dp = rst_readdir(dirp); /* "." */ in treescan()
241 dp = rst_readdir(dirp); /* ".." */ in treescan()
246 dp = rst_readdir(dirp); /* first real entry */ in treescan()
250 bpt = rst_telldir(dirp); in treescan()
262 rst_seekdir(dirp, bpt, itp->t_seekpt); in treescan()
264 dp = rst_readdir(dirp); in treescan()
265 bpt = rst_telldir(dirp); in treescan()
307 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in searchdir()
310 dp = rst_readdir(dirp); in searchdir()
431 rst_seekdir(RST_DIR *dirp, long loc, long base) in rst_seekdir() argument
434 if (loc == rst_telldir(dirp)) in rst_seekdir()
439 (void) lseek(dirp->dd_fd, base + rounddown2(loc, DIRBLKSIZ), SEEK_SET); in rst_seekdir()
440 dirp->dd_loc = loc & (DIRBLKSIZ - 1); in rst_seekdir()
441 if (dirp->dd_loc != 0) in rst_seekdir()
442 dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, DIRBLKSIZ); in rst_seekdir()
449 rst_readdir(RST_DIR *dirp) in rst_readdir() argument
454 if (dirp->dd_loc == 0) { in rst_readdir()
455 dirp->dd_size = read(dirp->dd_fd, dirp->dd_buf, in rst_readdir()
457 if (dirp->dd_size <= 0) { in rst_readdir()
462 if (dirp->dd_loc >= dirp->dd_size) { in rst_readdir()
463 dirp->dd_loc = 0; in rst_readdir()
466 dp = (struct direct *)(dirp->dd_buf + dirp->dd_loc); in rst_readdir()
468 dp->d_reclen > DIRBLKSIZ + 1 - dirp->dd_loc) { in rst_readdir()
473 dirp->dd_loc += dp->d_reclen; in rst_readdir()
492 RST_DIR *dirp; in rst_opendir() local
497 dirp = opendirfile(dirfile); in rst_opendir()
498 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in rst_opendir()
499 return (dirp); in rst_opendir()
510 RST_DIR *dirp; in rst_closedir() local
512 dirp = arg; in rst_closedir()
513 (void)close(dirp->dd_fd); in rst_closedir()
514 free(dirp); in rst_closedir()
522 rst_telldir(RST_DIR *dirp) in rst_telldir() argument
524 return ((long)lseek(dirp->dd_fd, in rst_telldir()
525 (off_t)0, SEEK_CUR) - dirp->dd_size + dirp->dd_loc); in rst_telldir()
534 RST_DIR *dirp; in opendirfile() local
539 if ((dirp = malloc(sizeof(RST_DIR))) == NULL) { in opendirfile()
543 dirp->dd_fd = fd; in opendirfile()
544 dirp->dd_loc = 0; in opendirfile()
545 return (dirp); in opendirfile()
685 rst_seekdir(dirp, itp->t_seekpt, itp->t_seekpt); in genliteraldir()
686 dp = dup(dirp->dd_fd); in genliteraldir()