get redist notice from /usr/share/misc
[unix-history] / usr / src / bin / ls / cmp.c
CommitLineData
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
ff47ce84 12static char sccsid[] = "@(#)cmp.c 5.2 (Berkeley) %G%";
dd195a2f
KB
13#endif /* not lint */
14
15#include <sys/types.h>
16#include <sys/stat.h>
17#include "ls.h"
18
19namecmp(a, b)
20 LS *a, *b;
21{
22 return(strcmp(a->name, b->name));
23}
24
25revnamecmp(a, b)
26 LS *a, *b;
27{
28 return(strcmp(b->name, a->name));
29}
30
31modcmp(a, b)
32 LS *a, *b;
33{
34 return(a->lstat.st_mtime < b->lstat.st_mtime);
35}
36
37revmodcmp(a, b)
38 LS *a, *b;
39{
40 return(b->lstat.st_mtime < a->lstat.st_mtime);
41}
42
43acccmp(a, b)
44 LS *a, *b;
45{
46 return(a->lstat.st_atime < b->lstat.st_atime);
47}
48
49revacccmp(a, b)
50 LS *a, *b;
51{
52 return(b->lstat.st_atime < a->lstat.st_atime);
53}
54
55statcmp(a, b)
56 LS *a, *b;
57{
58 return(a->lstat.st_ctime < b->lstat.st_ctime);
59}
60
61revstatcmp(a, b)
62 LS *a, *b;
63{
64 return(b->lstat.st_ctime < a->lstat.st_ctime);
65}