xref: /titanic_50/usr/src/cmd/sendmail/db/log/log_compare.c (revision 24da5b34f49324ed742a340010ed5bd3d4e06625)
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 #pragma ident	"%Z%%M%	%I%	%E% SMI"
15 
16 #ifndef lint
17 static const char sccsid[] = "@(#)log_compare.c	10.2 (Sleepycat) 6/21/97";
18 static const char sccsi2[] = "%W% (Sun) %G%";
19 #endif /* not lint */
20 
21 #ifndef NO_SYSTEM_INCLUDES
22 #include <sys/types.h>
23 #endif
24 
25 #include "db_int.h"
26 
27 /*
28  * log_compare --
29  *	Compare two LSN's.
30  */
31 int
32 log_compare(lsn0, lsn1)
33 	const DB_LSN *lsn0, *lsn1;
34 {
35 	if (lsn0->file != lsn1->file)
36 		return (lsn0->file < lsn1->file ? -1 : 1);
37 
38 	if (lsn0->offset != lsn1->offset)
39 		return (lsn0->offset < lsn1->offset ? -1 : 1);
40 
41 	return (0);
42 }
43