~ubuntu-branches/ubuntu/edgy/rpm/edgy

« back to all changes in this revision

Viewing changes to db/log/log_compare.c

  • Committer: Bazaar Package Importer
  • Author(s): Joey Hess
  • Date: 2002-01-22 20:56:57 UTC
  • Revision ID: james.westby@ubuntu.com-20020122205657-l74j50mr9z8ofcl5
Tags: upstream-4.0.3
ImportĀ upstreamĀ versionĀ 4.0.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*-
 
2
 * See the file LICENSE for redistribution information.
 
3
 *
 
4
 * Copyright (c) 1996-2001
 
5
 *      Sleepycat Software.  All rights reserved.
 
6
 */
 
7
#include "db_config.h"
 
8
 
 
9
#ifndef lint
 
10
static const char revid[] = "$Id: log_compare.c,v 11.5 2001/04/10 20:44:29 bostic Exp $";
 
11
#endif /* not lint */
 
12
 
 
13
#ifndef NO_SYSTEM_INCLUDES
 
14
#include <sys/types.h>
 
15
#endif
 
16
 
 
17
#include "db_int.h"
 
18
 
 
19
/*
 
20
 * log_compare --
 
21
 *      Compare two LSN's; return 1, 0, -1 if first is >, == or < second.
 
22
 *
 
23
 * EXTERN: int log_compare __P((const DB_LSN *, const DB_LSN *));
 
24
 */
 
25
int
 
26
log_compare(lsn0, lsn1)
 
27
        const DB_LSN *lsn0, *lsn1;
 
28
{
 
29
        if (lsn0->file != lsn1->file)
 
30
                return (lsn0->file < lsn1->file ? -1 : 1);
 
31
 
 
32
        if (lsn0->offset != lsn1->offset)
 
33
                return (lsn0->offset < lsn1->offset ? -1 : 1);
 
34
 
 
35
        return (0);
 
36
}