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