Commit | Line | Data |
---|---|---|
dd195a2f KB |
1 | /* |
2 | * Copyright (c) 1989 The Regents of the University of California. | |
3 | * All rights reserved. | |
4 | * | |
5 | * This code is derived from software contributed to Berkeley by | |
6 | * Michael Fischbein. | |
7 | * | |
ff47ce84 | 8 | %sccs.include.redist.c% |
dd195a2f KB |
9 | */ |
10 | ||
11 | #ifndef lint | |
aa476d71 | 12 | static char sccsid[] = "@(#)cmp.c 5.4 (Berkeley) %G%"; |
dd195a2f KB |
13 | #endif /* not lint */ |
14 | ||
15 | #include <sys/types.h> | |
16 | #include <sys/stat.h> | |
17 | #include "ls.h" | |
18 | ||
19 | namecmp(a, b) | |
20 | LS *a, *b; | |
21 | { | |
22 | return(strcmp(a->name, b->name)); | |
23 | } | |
24 | ||
25 | revnamecmp(a, b) | |
26 | LS *a, *b; | |
27 | { | |
28 | return(strcmp(b->name, a->name)); | |
29 | } | |
30 | ||
31 | modcmp(a, b) | |
32 | LS *a, *b; | |
33 | { | |
aa476d71 | 34 | return(b->lstat.st_mtime - a->lstat.st_mtime); |
dd195a2f KB |
35 | } |
36 | ||
37 | revmodcmp(a, b) | |
38 | LS *a, *b; | |
39 | { | |
aa476d71 | 40 | return(a->lstat.st_mtime - b->lstat.st_mtime); |
dd195a2f KB |
41 | } |
42 | ||
43 | acccmp(a, b) | |
44 | LS *a, *b; | |
45 | { | |
aa476d71 | 46 | return(b->lstat.st_atime - a->lstat.st_atime); |
dd195a2f KB |
47 | } |
48 | ||
49 | revacccmp(a, b) | |
50 | LS *a, *b; | |
51 | { | |
aa476d71 | 52 | return(a->lstat.st_atime - b->lstat.st_atime); |
dd195a2f KB |
53 | } |
54 | ||
55 | statcmp(a, b) | |
56 | LS *a, *b; | |
57 | { | |
aa476d71 | 58 | return(b->lstat.st_ctime - a->lstat.st_ctime); |
dd195a2f KB |
59 | } |
60 | ||
61 | revstatcmp(a, b) | |
62 | LS *a, *b; | |
63 | { | |
aa476d71 | 64 | return(a->lstat.st_ctime - b->lstat.st_ctime); |
dd195a2f | 65 | } |