~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/clib/memcmp.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

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-2002
5
 
 *      Sleepycat Software.  All rights reserved.
6
 
 */
7
 
/*
8
 
 * Copyright (c) 1990, 1993
9
 
 *      The Regents of the University of California.  All rights reserved.
10
 
 *
11
 
 * Redistribution and use in source and binary forms, with or without
12
 
 * modification, are permitted provided that the following conditions
13
 
 * are met:
14
 
 * 1. Redistributions of source code must retain the above copyright
15
 
 *    notice, this list of conditions and the following disclaimer.
16
 
 * 2. Redistributions in binary form must reproduce the above copyright
17
 
 *    notice, this list of conditions and the following disclaimer in the
18
 
 *    documentation and/or other materials provided with the distribution.
19
 
 * 3. Neither the name of the University nor the names of its contributors
20
 
 *    may be used to endorse or promote products derived from this software
21
 
 *    without specific prior written permission.
22
 
 *
23
 
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24
 
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25
 
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26
 
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27
 
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28
 
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29
 
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30
 
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31
 
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32
 
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33
 
 * SUCH DAMAGE.
34
 
 */
35
 
 
36
 
#include "db_config.h"
37
 
 
38
 
#ifndef lint
39
 
static const char revid[] = "$Id$";
40
 
#endif /* not lint */
41
 
 
42
 
#ifndef NO_SYSTEM_INCLUDES
43
 
#include <sys/types.h>
44
 
#endif
45
 
 
46
 
/*
47
 
 * memcmp --
48
 
 *
49
 
 * PUBLIC: #ifndef HAVE_MEMCMP
50
 
 * PUBLIC: int memcmp __P((const void *, const void *, size_t));
51
 
 * PUBLIC: #endif
52
 
 */
53
 
int
54
 
memcmp(s1, s2, n)
55
 
        char *s1, *s2;
56
 
        size_t n;
57
 
{
58
 
        if (n != 0) {
59
 
                unsigned char *p1 = (unsigned char *)s1,
60
 
                              *p2 = (unsigned char *)s2;
61
 
                do {
62
 
                        if (*p1++ != *p2++)
63
 
                                return (*--p1 - *--p2);
64
 
                } while (--n != 0);
65
 
        }
66
 
        return (0);
67
 
}