mariadb/storage/bdb/log/log_compare.c

36 lines
706 B
C
Raw Normal View History

2001-03-04 19:42:05 -05:00
/*-
* See the file LICENSE for redistribution information.
*
2005-12-05 10:27:46 -08:00
* Copyright (c) 1996-2005
2001-03-04 19:42:05 -05:00
* Sleepycat Software. All rights reserved.
2005-07-20 15:48:22 -07:00
*
2005-12-05 10:27:46 -08:00
* $Id: log_compare.c,v 12.1 2005/06/16 20:23:12 bostic Exp $
2001-03-04 19:42:05 -05:00
*/
2005-07-20 15:48:22 -07:00
#include "db_config.h"
2001-03-04 19:42:05 -05:00
#ifndef NO_SYSTEM_INCLUDES
#include <sys/types.h>
#endif
#include "db_int.h"
/*
* log_compare --
* Compare two LSN's; return 1, 0, -1 if first is >, == or < second.
2002-10-30 15:57:05 +04:00
*
* EXTERN: int log_compare __P((const DB_LSN *, const DB_LSN *));
2001-03-04 19:42:05 -05:00
*/
int
log_compare(lsn0, lsn1)
const DB_LSN *lsn0, *lsn1;
{
if (lsn0->file != lsn1->file)
return (lsn0->file < lsn1->file ? -1 : 1);
if (lsn0->offset != lsn1->offset)
return (lsn0->offset < lsn1->offset ? -1 : 1);
return (0);
}