Lines Matching defs:ftw

320 	Ftw_t*		ftw;		/* ftw info			*/
336 int comma; /* LS_COMMAS ftw.level crossing */
459 register Ftw_t* ftw;
476 ftw = lp->ftw;
477 st = &ftw->statb;
481 ftw = 0;
565 if (ftw != state.top)
598 if (ftw && ftw->info == FTW_SL)
612 if (*ftw->name == '/' || !lp->dirnam)
613 dirnam = ftw->name;
616 sfprintf(state.tmp, "%s/%s", lp->dirnam + streq(lp->dirnam, "/"), ftw->name);
628 if (ftw && ftw->info == FTW_SL)
678 if (ftw)
679 s = PRINTABLE(ftw->name);
686 if (ftw)
687 s = ftw->path ? PRINTABLE(ftw->path) : PRINTABLE(ftw->name);
787 pr(register List_t* lp, Ftw_t* ftw, register int fill)
791 ftw->statb.st_size <<= state.testsize;
792 ftw->statb.st_blocks = ftw->statb.st_size / LS_BLOCKSIZE;
802 if (ftw->level == 0 && (state.ftwflags & (FTW_META|FTW_PHYSICAL)) == (FTW_META|FTW_PHYSICAL) && !(ftw->info & FTW_D) && !lstat(ftw->path ? ftw->path : ftw->name, &ftw->statb) && S_ISLNK(ftw->statb.st_mode))
803 ftw->info = FTW_SL;
805 lp->ftw = ftw;
819 * pr() ftw directory child list in column order
826 col(register List_t* lp, register Ftw_t* ftw, int length)
836 lp->ftw = ftw;
837 if (keys[KEY_header].macro && ftw->level >= 0)
848 i = ftw->name[1];
849 ftw->name[1] = 0;
855 ftw->name[1] = i;
863 for (p = ftw->link; p; p = p->link)
894 for (p = ftw->link; p; p = p->link)
932 for (p = ftw->link; p; p = p->link)
1020 if (keys[KEY_trailer].macro && ftw->level >= 0)
1154 dir(register Ftw_t* ftw)
1161 if (ftw->status == FTW_NAME)
1163 list.dirlen = ftw->namelen;
1164 list.dirnam = ftw->path + ftw->pathlen - list.dirlen;
1168 list.dirlen = ftw->pathlen;
1169 list.dirnam = ftw->path;
1171 if (ftw->level >= 0)
1174 state.top = ftw;
1179 for (p = ftw->link; p; p = p->link)
1190 if (ftw->level < 0 || !(state.lsflags & LS_NOSTAT))
1192 if (ftw->path[0] == '.' && !ftw->path[1])
1195 error(2, "%s/%s: not found", ftw->path, p->name);
1220 col(&list, ftw, length);
1232 state.top = ftw->link;
1233 for (p = ftw->link; p; p = p->link)
1244 ls(register Ftw_t* ftw)
1246 if (!VISIBLE(ftw))
1248 ftw->status = FTW_SKIP;
1251 switch (ftw->info)
1254 if (ftw->parent->info == FTW_DNX)
1256 error(2, "%s: not found", ftw->path);
1261 error(2, "%s: directory causes cycle", ftw->path);
1266 error(2, "%s: cannot read directory", ftw->path);
1270 if ((state.lsflags & LS_DIRECTORY) && ftw->level >= 0)
1273 ftw->status = FTW_SKIP;
1274 else if (ftw->info == FTS_DNX)
1276 error(2, "%s: cannot search directory", ftw->path, ftw->level);
1277 ftw->status = FTW_SKIP;
1278 if (ftw->level > 0 && !(state.lsflags & LS_NOSTAT))
1281 dir(ftw);
1284 ftw->status = FTW_SKIP;
1285 if (!ftw->level)
1289 list.ftw = ftw;
1290 pr(&list, ftw, 0);