diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2007-07-16 16:48:14 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2007-07-16 16:48:14 +0300 |
commit | 2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79 (patch) | |
tree | e12ee52087506ac8c7a5eee83b17497d98df2d40 /db/db185 | |
parent | b754fe19fd387ca5fe8e7c00ddaa25c898fa192f (diff) | |
download | rpm-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.tar.gz rpm-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.tar.bz2 rpm-2cfd3012bfcb5c5c61bbaf662ef084e0ab789d79.zip |
Update internal BDB to version 4.5.20
Diffstat (limited to 'db/db185')
-rw-r--r-- | db/db185/db185.c | 45 | ||||
-rw-r--r-- | db/db185/db185_int.in | 14 |
2 files changed, 31 insertions, 28 deletions
diff --git a/db/db185/db185.c b/db/db185/db185.c index 8399eac42..484b43676 100644 --- a/db/db185/db185.c +++ b/db/db185/db185.c @@ -1,27 +1,21 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1996-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1996-2006 + * Oracle Corporation. All rights reserved. * - * $Id: db185.c,v 11.35 2004/03/24 20:37:35 bostic Exp $ + * $Id: db185.c,v 12.7 2006/08/31 17:59:25 bostic Exp $ */ #include "db_config.h" +#include "db_int.h" + #ifndef lint static const char copyright[] = - "Copyright (c) 1996-2004\nSleepycat Software Inc. All rights reserved.\n"; + "Copyright (c) 1996-2006\nOracle Corporation. All rights reserved.\n"; #endif -#ifndef NO_SYSTEM_INCLUDES -#include <sys/types.h> - -#include <fcntl.h> -#include <string.h> -#endif - -#include "db_int.h" #include "db185_int.h" static int db185_close __P((DB185 *)); @@ -89,12 +83,6 @@ __db185_open(file, oflags, mode, type, openinfo) (void)dbp->set_bt_minkey(dbp, bi->minkeypage); if (bi->psize != 0) (void)dbp->set_pagesize(dbp, bi->psize); - /* - * !!! - * Comparisons and prefix calls work because the DBT - * structures in 1.85 and 2.0 have the same initial - * fields. - */ if (bi->prefix != NULL) { db185p->prefix = bi->prefix; dbp->set_bt_prefix(dbp, db185_prefix); @@ -156,7 +144,8 @@ __db185_open(file, oflags, mode, type, openinfo) * that in DB 2.0, so do that cast. */ if (file != NULL) { - if (oflags & O_CREAT && __os_exists(file, NULL) != 0) + if (oflags & O_CREAT && + __os_exists(NULL, file, NULL) != 0) if (__os_openhandle(NULL, file, oflags, mode, &fhp) == 0) (void)__os_closehandle(NULL, fhp); @@ -546,7 +535,14 @@ db185_compare(dbp, a, b) DB *dbp; const DBT *a, *b; { - return (((DB185 *)dbp->api_internal)->compare(a, b)); + DBT185 a185, b185; + + a185.data = a->data; + a185.size = a->size; + b185.data = b->data; + b185.size = b->size; + + return (((DB185 *)dbp->api_internal)->compare(&a185, &b185)); } /* @@ -558,7 +554,14 @@ db185_prefix(dbp, a, b) DB *dbp; const DBT *a, *b; { - return (((DB185 *)dbp->api_internal)->prefix(a, b)); + DBT185 a185, b185; + + a185.data = a->data; + a185.size = a->size; + b185.data = b->data; + b185.size = b->size; + + return (((DB185 *)dbp->api_internal)->prefix(&a185, &b185)); } /* diff --git a/db/db185/db185_int.in b/db/db185/db185_int.in index f9bfdbba0..acc44c91a 100644 --- a/db/db185/db185_int.in +++ b/db/db185/db185_int.in @@ -1,8 +1,8 @@ /*- * See the file LICENSE for redistribution information. * - * Copyright (c) 1997-2004 - * Sleepycat Software. All rights reserved. + * Copyright (c) 1997-2006 + * Oracle Corporation. All rights reserved. */ /* * Copyright (c) 1990, 1993, 1994, 1995, 1996 @@ -36,7 +36,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: db185_int.in,v 11.14 2004/01/28 03:35:59 bostic Exp $ + * $Id: db185_int.in,v 12.4 2006/08/24 14:45:17 bostic Exp $ */ #ifndef _DB185_INT_H_ @@ -82,8 +82,8 @@ typedef struct __db185 { */ DBC *dbc; /* DB cursor. */ /* Various callback functions. */ - int (*compare) __P((const DBT *, const DBT *)); - size_t (*prefix) __P((const DBT *, const DBT *)); + int (*compare) __P((const DBT185 *, const DBT185 *)); + size_t (*prefix) __P((const DBT185 *, const DBT185 *)); u_int32_t (*hash) __P((const void *, size_t)); } DB185; @@ -96,9 +96,9 @@ typedef struct { u_int32_t minkeypage; /* minimum keys per page */ u_int32_t psize; /* page size */ int (*compare) /* comparison function */ - __P((const DBT *, const DBT *)); + __P((const DBT185 *, const DBT185 *)); size_t (*prefix) /* prefix function */ - __P((const DBT *, const DBT *)); + __P((const DBT185 *, const DBT185 *)); int lorder; /* byte order */ } BTREEINFO; |