Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

log_compare.c

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 1996-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: log_compare.c,v 12.1 2005/06/16 20:23:12 bostic Exp $
00008  */
00009 
00010 #include "db_config.h"
00011 
00012 #ifndef NO_SYSTEM_INCLUDES
00013 #include <sys/types.h>
00014 #endif
00015 
00016 #include "db_int.h"
00017 
00018 /*
00019  * log_compare --
00020  *      Compare two LSN's; return 1, 0, -1 if first is >, == or < second.
00021  *
00022  * EXTERN: int log_compare __P((const DB_LSN *, const DB_LSN *));
00023  */
00024 int
00025 log_compare(lsn0, lsn1)
00026         const DB_LSN *lsn0, *lsn1;
00027 {
00028         if (lsn0->file != lsn1->file)
00029                 return (lsn0->file < lsn1->file ? -1 : 1);
00030 
00031         if (lsn0->offset != lsn1->offset)
00032                 return (lsn0->offset < lsn1->offset ? -1 : 1);
00033 
00034         return (0);
00035 }

Generated on Sun Dec 25 12:14:40 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2