#include <stdio.h>#include <string.h>#include <sys/types.h>#include <sys/stat.h>#include <stddef.h>#include <stdlib.h>#include <unistd.h>#include <dirent.h>#include <time.h>#include <pwd.h>#include <grp.h>#include <errno.h>#include <fcntl.h>#include <limits.h>#include <termios.h>#include <sys/ioctl.h>Go to the source code of this file.
Classes | |
| struct | idname |
| struct | file |
Defines | |
| #define | ifmt(mode) l_ifmt[((mode) >> 12) & 0xF] |
| #define | nil 0 |
| #define | major(dev) ((int) (((dev) >> 8) & 0xFF)) |
| #define | minor(dev) ((int) (((dev) >> 0) & 0xFF)) |
| #define | SUPER_ID uid |
| #define | status stat |
| #define | BLOCK 512 |
| #define | ST_BLOCKS 1 |
| #define | NSEP 3 |
| #define | MAXCOLS 128 |
| #define | NNAMES (1 << (sizeof(int) + sizeof(char *))) |
| #define | uidname(uid) idname((uid), PASSWD) |
| #define | gidname(gid) idname((gid), GROUP) |
| #define | delpath(didx) (path[pidx= didx]= 0) |
| #define | L_INODE 0x0001 |
| #define | L_BLOCKS 0x0002 |
| #define | L_EXTRA 0x0004 |
| #define | L_MODE 0x0008 |
| #define | L_LONG 0x0010 |
| #define | L_GROUP 0x0020 |
| #define | L_BYTIME 0x0040 |
| #define | L_ATIME 0x0080 |
| #define | L_CTIME 0x0100 |
| #define | L_MARK 0x0200 |
| #define | L_MARKDIR 0x0400 |
| #define | L_TYPE 0x0800 |
| #define | L_LONGTIME 0x1000 |
| #define | L_DIR 0x2000 |
| #define | L_KMG 0x4000 |
| #define | PAST (26*7*24*3600L) |
| #define | FUTURE ( 1*7*24*3600L) |
| #define | K 1024L |
| #define | T 1000L |
| #define | nblocks(f) ((f)->blocks) |
| #define | nblk2k(nb) (((nb) + (1024 / BLOCK - 1)) / (1024 / BLOCK)) |
| #define | spaces(n) (nsp= (n)) |
| #define | terpri() (nsp= 0, putchar('\n')) |
Enumerations | |
| enum | whatmap { PASSWD, GROUP } |
| enum | { W_COL, W_INO, W_BLK, W_NLINK, W_UID, W_GID, W_SIZE, W_NAME, MAXFLDS } |
| enum | depth { SURFACE, SURFACE1, SUBMERGED } |
| enum | state { BOTTOM, SINKING, FLOATING } |
Functions | |
| void | heaperr (void) |
| void * | allocate (size_t n) |
| void * | reallocate (void *a, size_t n) |
| void | setflags (char *flgs) |
| int | present (int f) |
| void | report (char *f) |
| char * | idname (unsigned id, enum whatmap map) |
| void | addpath (int *didx, char *name) |
| void | setstat (struct file *f, struct stat *stp) |
| char * | permissions (struct file *f) |
| void | numeral (int i, char **pp) |
| char * | cxsize (struct file *f) |
| int | namecmp (struct file *f1, struct file *f2) |
| int | mtimecmp (struct file *f1, struct file *f2) |
| int | atimecmp (struct file *f1, struct file *f2) |
| int | ctimecmp (struct file *f1, struct file *f2) |
| int | typecmp (struct file *f1, struct file *f2) |
| int | revcmp (struct file *f1, struct file *f2) |
| struct file * | newfile (char *name) |
| void | pushfile (struct file **flist, struct file *new) |
| void | delfile (struct file *old) |
| struct file * | popfile (struct file **flist) |
| int | dotflag (char *name) |
| int | adddir (struct file **aflist, char *name) |
| off_t | countblocks (struct file *flist) |
| void | printname (char *name) |
| int | mark (struct file *f, int doit) |
| void | maxise (unsigned char *aw, int w) |
| int | numwidth (unsigned long n) |
| int | numxwidth (unsigned long n) |
| void | print1 (struct file *f, int col, int doit) |
| int | countfiles (struct file *flist) |
| void | columnise (struct file *flist, int nplin) |
| int | print (struct file *flist, int nplin, int doit) |
| void | listfiles (struct file *flist, enum depth depth, enum state state) |
| int | main (int argc, char **argv) |
Variables | |
| char | l_ifmt [] = "0pcCd?bB-?l?s???" |
| int | ncols = 79 |
| char * | arg0 |
| int | uid |
| int | gid |
| int | ex = 0 |
| int | istty |
| char | allowed [] = "acdfghilnpqrstu1ACDFLMRTX" |
| char | flags [sizeof(allowed)] |
| char | arg0flag [] = "cdfmrtx" |
| struct idname * | uids [NNAMES] |
| struct idname * | gids [NNAMES] |
| char * | path |
| int | plen = 0 |
| int | pidx = 0 |
| int | field = 0 |
| unsigned char | fieldwidth [MAXCOLS][MAXFLDS] |
| struct file * | filecol [MAXCOLS] |
| int | nfiles |
| int | nlines |
| #define nblk2k | ( | nb | ) | (((nb) + (1024 / BLOCK - 1)) / (1024 / BLOCK)) |
| anonymous enum |
| unsigned char fieldwidth[MAXCOLS][MAXFLDS] |
1.5.8