xref: /titanic_44/usr/src/cmd/sendmail/db/log/log_compare.c (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*-
2*7c478bd9Sstevel@tonic-gate  * See the file LICENSE for redistribution information.
3*7c478bd9Sstevel@tonic-gate  *
4*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1996, 1997
5*7c478bd9Sstevel@tonic-gate  *	Sleepycat Software.  All rights reserved.
6*7c478bd9Sstevel@tonic-gate  */
7*7c478bd9Sstevel@tonic-gate /*
8*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1998 by Sun Microsystems, Inc.
9*7c478bd9Sstevel@tonic-gate  * All rights reserved.
10*7c478bd9Sstevel@tonic-gate  */
11*7c478bd9Sstevel@tonic-gate 
12*7c478bd9Sstevel@tonic-gate #include "config.h"
13*7c478bd9Sstevel@tonic-gate 
14*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
15*7c478bd9Sstevel@tonic-gate 
16*7c478bd9Sstevel@tonic-gate #ifndef lint
17*7c478bd9Sstevel@tonic-gate static const char sccsid[] = "@(#)log_compare.c	10.2 (Sleepycat) 6/21/97";
18*7c478bd9Sstevel@tonic-gate static const char sccsi2[] = "%W% (Sun) %G%";
19*7c478bd9Sstevel@tonic-gate #endif /* not lint */
20*7c478bd9Sstevel@tonic-gate 
21*7c478bd9Sstevel@tonic-gate #ifndef NO_SYSTEM_INCLUDES
22*7c478bd9Sstevel@tonic-gate #include <sys/types.h>
23*7c478bd9Sstevel@tonic-gate #endif
24*7c478bd9Sstevel@tonic-gate 
25*7c478bd9Sstevel@tonic-gate #include "db_int.h"
26*7c478bd9Sstevel@tonic-gate 
27*7c478bd9Sstevel@tonic-gate /*
28*7c478bd9Sstevel@tonic-gate  * log_compare --
29*7c478bd9Sstevel@tonic-gate  *	Compare two LSN's.
30*7c478bd9Sstevel@tonic-gate  */
31*7c478bd9Sstevel@tonic-gate int
log_compare(lsn0,lsn1)32*7c478bd9Sstevel@tonic-gate log_compare(lsn0, lsn1)
33*7c478bd9Sstevel@tonic-gate 	const DB_LSN *lsn0, *lsn1;
34*7c478bd9Sstevel@tonic-gate {
35*7c478bd9Sstevel@tonic-gate 	if (lsn0->file != lsn1->file)
36*7c478bd9Sstevel@tonic-gate 		return (lsn0->file < lsn1->file ? -1 : 1);
37*7c478bd9Sstevel@tonic-gate 
38*7c478bd9Sstevel@tonic-gate 	if (lsn0->offset != lsn1->offset)
39*7c478bd9Sstevel@tonic-gate 		return (lsn0->offset < lsn1->offset ? -1 : 1);
40*7c478bd9Sstevel@tonic-gate 
41*7c478bd9Sstevel@tonic-gate 	return (0);
42*7c478bd9Sstevel@tonic-gate }
43