Lines Matching refs:flags

24 // bits for flags argument
35 static int listpath(const char *name, int flags);
99 static int show_total_size(const char *dirname, DIR *d, int flags)
110 if (de->d_name[0] == '.' && (flags & LIST_ALL) == 0)
132 static int listfile_size(const char *path, const char *filename, int flags)
142 if ((flags & LIST_SIZE) != 0) {
146 if ((flags & LIST_CLASSIFY) != 0) {
166 static int listfile_long(const char *path, int flags)
188 if (flags & LIST_LONG_NUMERIC) {
242 static int listfile_maclabel(const char *path, int flags)
308 static int listfile(const char *dirname, const char *filename, int flags)
310 if ((flags & LIST_LONG | LIST_SIZE | LIST_CLASSIFY | LIST_MACLABEL) == 0) {
325 if ((flags & LIST_MACLABEL) != 0) {
326 return listfile_maclabel(pathname, flags);
327 } else if ((flags & LIST_LONG) != 0) {
328 return listfile_long(pathname, flags);
329 } else /*((flags & LIST_SIZE) != 0)*/ {
330 return listfile_size(pathname, filename, flags);
334 static int listdir(const char *name, int flags)
347 if ((flags & LIST_SIZE) != 0) {
348 show_total_size(name, d, flags);
353 if(de->d_name[0] == '.' && (flags & LIST_ALL) == 0) continue;
359 STRLIST_FOREACH(&files, filename, listfile(name, filename, flags));
362 if (flags & LIST_RECURSIVE) {
373 if (de->d_name[0] == '.' && (flags & LIST_ALL) == 0)
403 listdir(path, flags);
412 static int listpath(const char *name, int flags)
431 if ((flags & LIST_DIRECTORIES) == 0 && S_ISDIR(s.st_mode)) {
432 if (flags & LIST_RECURSIVE)
434 return listdir(name, flags);
437 return listfile(NULL, name, flags);
443 int flags = 0;
457 case 'l': flags |= LIST_LONG; break;
458 case 'n': flags |= LIST_LONG | LIST_LONG_NUMERIC; break;
459 case 's': flags |= LIST_SIZE; break;
460 case 'R': flags |= LIST_RECURSIVE; break;
461 case 'd': flags |= LIST_DIRECTORIES; break;
462 case 'Z': flags |= LIST_MACLABEL; break;
463 case 'a': flags |= LIST_ALL; break;
464 case 'F': flags |= LIST_CLASSIFY; break;
479 if (listpath(path, flags) != 0) {
489 return listpath(".", flags);