Lines Matching refs:fp

96 	register struct afile *fp;
172 fp = (struct afile *)calloc(argc, sizeof (struct afile));
173 if (fp == 0) {
177 fp0 = fp;
179 if (gstat(fp, *argv, 1, (off_t *)0)) {
180 fp->fname = *argv;
181 fp->fflags |= ISARG;
182 fp++;
186 fplast = fp;
193 fp = fp0;
195 for (fp = fp0; fp < fplast && fp->ftype != 'd'; fp++)
197 formatf(fp0, fp);
199 if (fp < fplast) {
200 if (fp > fp0)
203 formatd(fp->fname, argc > 1);
213 if (++fp == fplast)
224 register struct afile *fp;
240 for (fp = dfplast - 1; fp >= dfp0; fp--) {
241 if (fp->ftype != 'd' ||
242 strcmp(fp->fname, ".") == 0 ||
243 strcmp(fp->fname, "..") == 0)
246 dp->sd_name = savestr(cat(name, fp->fname));
249 for (fp = dfp0; fp < dfplast; fp++) {
250 if ((fp->fflags&ISARG) == 0 && fp->fname)
251 free(fp->fname);
252 if (fp->flinkto)
253 free(fp->flinkto);
261 register struct afile *fp;
285 fp = *pfp0 = (struct afile *)calloc(nent, sizeof (struct afile));
294 if (gstat(fp, cat(dir, dp->d_name), Fflg+Rflg, &nb) == 0)
296 fp->fnum = dp->d_ino;
297 fp->fname = savestr(dp->d_name);
298 fp++;
299 if (fp == *pfplast) {
306 fp = *pfp0 + nent;
307 *pfplast = fp + nent;
312 *pfplast = fp;
318 gstat(struct afile *fp, char *file, int statarg, off_t *pnb)
330 *fp = azerofile;
331 fp->fflags = 0;
332 fp->fnum = 0;
333 fp->ftype = '-';
349 fp->fblks = stb.st_blocks;
350 fp->fsize = stb.st_size;
353 fp->ftype = 'd'; break;
355 fp->ftype = 'D'; break;
357 fp->ftype = 'b'; fp->fsize = (off_t)stb.st_rdev; break;
359 fp->ftype = 'c'; fp->fsize = (off_t)stb.st_rdev; break;
361 fp->ftype = 's'; fp->fsize = 0LL; break;
363 fp->ftype = 'p'; fp->fsize = 0LL; break;
365 fp->ftype = 'l';
397 fp->flinkto = savestr(buf);
412 fp->ftype = 'd';
413 fp->fsize = stb.st_size;
414 fp->fblks = stb.st_blocks;
418 fp->fnum = stb.st_ino;
419 fp->fflags = stb.st_mode & ~S_IFMT;
420 fp->fnl = stb.st_nlink;
421 fp->fuid = stb.st_uid;
422 fp->fgid = stb.st_gid;
430 fp->acl = '+';
483 fp->fflags &= ~S_IRWXG;
490 fp->fflags |= (groupperm & mask) << 3;
492 fp->acl = ' ';
495 fp->fmtime = stb.st_atime;
497 fp->fmtime = stb.st_ctime;
499 fp->fmtime = stb.st_mtime;
503 return (fp);
509 register struct afile *fp;
519 for (fp = fp0; fp < fplast; fp++) {
520 int len = strlen(fmtentry(fp));
536 fp = fp0 + j * lines + i;
537 cp = fmtentry(fp);
539 if (fp + lines >= fplast) {
620 fmtentry(struct afile *fp)
626 iflg ? fmtinum(fp) : "",
627 sflg ? fmtsize(fp) : "",
628 lflg ? fmtlstuff(fp) : "");
630 for (cp = fp->fname; *cp; cp++)
636 if (Fflg && ! (lflg && fp->flinkto)) {
637 if (fp->ftype == 'd')
639 else if (fp->ftype == 'D')
641 else if (fp->ftype == 'p')
643 else if (fp->ftype == 'l')
645 else if (fp->ftype == 's')
647 else if (fp->fflags & 0111)
650 if (lflg && fp->flinkto) {
652 for (cp = fp->flinkto; *cp; cp++)