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