dtinfo subdirectory DtMmdb

This commit is contained in:
Ulrich Wilkens
2013-08-28 19:16:37 +02:00
committed by Jon Trulson
parent 0be684281d
commit fbd81ef151
159 changed files with 735 additions and 588 deletions

View File

@@ -141,7 +141,7 @@ __bt_sync(dbp, flags)
BTREE *t;
int status;
PAGE *h;
void *p;
void *p = NULL;
t = dbp->internal;

View File

@@ -143,7 +143,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
*/
if (b.psize &&
(b.psize < MINPSIZE || b.psize > MAX_PAGE_OFFSET + 1 ||
b.psize & sizeof(indx_t) - 1))
b.psize & (sizeof(indx_t) - 1)))
goto einval;
/* Minimum number of keys per page; absolute minimum is 2. */
@@ -268,7 +268,7 @@ __bt_open(fname, flags, mode, openinfo, dflags)
if (m.m_magic != BTREEMAGIC || m.m_version != BTREEVERSION)
goto eftype;
if (m.m_psize < MINPSIZE || m.m_psize > MAX_PAGE_OFFSET + 1 ||
m.m_psize & sizeof(indx_t) - 1)
m.m_psize & (sizeof(indx_t) - 1))
goto eftype;
if (m.m_flags & ~SAVEMETA)
goto eftype;
@@ -301,8 +301,8 @@ __bt_open(fname, flags, mode, openinfo, dflags)
t->bt_psize = b.psize;
/* Set the cache size; must be a multiple of the page size. */
if (b.cachesize && b.cachesize & b.psize - 1)
b.cachesize += (~b.cachesize & b.psize - 1) + 1;
if (b.cachesize && b.cachesize & (b.psize - 1))
b.cachesize += (~b.cachesize & (b.psize - 1)) + 1;
if (b.cachesize < b.psize * MINCACHE)
b.cachesize = b.psize * MINCACHE;

View File

@@ -95,7 +95,7 @@ __bt_put(dbp, key, data, flags)
{
BTREE *t;
DBT tkey, tdata;
EPG *e;
EPG *e = NULL;
PAGE *h;
indx_t index, nxtindex;
pgno_t pg;
@@ -243,7 +243,7 @@ delete: if (__bt_dleaf(t, h, index) == RET_ERROR) {
dest = (char *)h + h->upper;
WR_BLEAF(dest, key, data, dflags);
if (t->bt_order == NOT)
if (t->bt_order == NOT) {
if (h->nextpg == P_INVALID) {
if (index == NEXTINDEX(h) - 1) {
t->bt_order = FORWARD;
@@ -257,6 +257,7 @@ delete: if (__bt_dleaf(t, h, index) == RET_ERROR) {
t->bt_last.pgno = h->pgno;
}
}
}
mpool_put(t->bt_mp, h, MPOOL_DIRTY);

View File

@@ -111,13 +111,15 @@ __bt_split(t, sp, key, data, flags, ilen, skip)
size_t ilen;
u_int skip;
{
BINTERNAL *bi;
BLEAF *bl, *tbl;
BINTERNAL *bi = NULL;
BLEAF *bl = NULL;
BLEAF *tbl;
DBT a, b;
EPGNO *parent;
PAGE *h, *l, *r, *lchild, *rchild;
indx_t nxtindex;
size_t n, nbytes, nksize;
size_t n, nbytes;
size_t nksize = 0;
int parentsplit;
char *dest;
@@ -640,7 +642,7 @@ bt_psplit(t, h, l, r, pskip, ilen)
RLEAF *rl;
EPGNO *c;
PAGE *rval;
void *src;
void *src = NULL;
indx_t full, half, nxt, off, skip, top, used;
size_t nbytes;
int bigkeycnt, isbigkey;

View File

@@ -229,7 +229,7 @@ __bt_defcmp(a, b)
len = MIN(a->size, b->size);
for (p1 = a->data, p2 = b->data; len--; ++p1, ++p2)
if (diff = *p1 - *p2)
if ((diff = *p1 - *p2))
return (diff);
return (a->size - b->size);
}

View File

@@ -67,7 +67,9 @@
#define __END_DECLS };
#endif
#else
#undef __BEGIN_DECLS
#define __BEGIN_DECLS
#undef __END_DECLS
#define __END_DECLS
#endif
@@ -119,6 +121,7 @@
* define them only if compiling without this.
*/
#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
#undef __dead
#define __dead __volatile
#ifndef __pure
#define __pure __const

View File

@@ -86,10 +86,10 @@ typedef unsigned int sigset_t;
#endif
/*
* If your system's vsprintf returns a char *, not an int,
* If your system's vsnprintf returns a char *, not an int,
* change the 0 to a 1.
*/
#if !defined(_AIX) && !defined(__osf__)
#if !defined(_AIX) && !defined(__osf__) && !defined(linux) && !defined(CSRG_BASED)
#define VSPRINTF_CHARSTAR
#endif

View File

@@ -94,6 +94,8 @@ dbopen(fname, flags, mode, type, openinfo)
return (__rec_open(fname, flags & USE_OPEN_FLAGS,
mode, openinfo, flags & DB_FLAGS));
*/
default:
break;
}
errno = EINVAL;
return (NULL);

View File

@@ -60,6 +60,7 @@ static char sccsid[] = "@(#)mktemp.c 8.1 (Berkeley) 6/4/93";
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <stdio.h>
@@ -72,7 +73,7 @@ extern int errno;
static int _gettemp();
mkstemp(path)
int mkstemp(path)
char *path;
{
int fd;
@@ -87,7 +88,7 @@ mktemp(path)
return(_gettemp(path, (int *)NULL) ? path : (char *)NULL);
}
static
static int
_gettemp(path, doopen)
char *path;
register int *doopen;

View File

@@ -215,7 +215,7 @@ mpool_get(mp, pgno, flags)
* If asking for a specific page that is already in the cache, find
* it and return it.
*/
if (b = mpool_look(mp, pgno)) {
if ((b = mpool_look(mp, pgno))) {
#ifdef STATISTICS
++mp->pageget;
#endif

View File

@@ -26,6 +26,7 @@
#include <compat.h>
#include <string.h>
#include <stdio.h>
#ifdef __STDC__
#include <stdarg.h>
@@ -45,24 +46,30 @@ snprintf(str, n, fmt, va_alist)
#endif
{
va_list ap;
#ifdef VSPRINTF_CHARSTAR
char *rp;
#else
int rval;
#endif
#ifdef __STDC__
va_start(ap, fmt);
#else
va_start(ap);
#endif
#ifdef VSPRINTF_CHARSTAR
rp = (char*)(size_t)vsprintf(str, fmt, ap);
rp = (char*)(size_t)vsnprintf(str, n, fmt, ap);
va_end(ap);
return (strlen(rp));
#else
rval = vsprintf(str, fmt, ap);
rval = vsnprintf(str, n, fmt, ap);
va_end(ap);
return (rval);
#endif
}
#if 0
int
vsnprintf(str, n, fmt, ap)
char *str;
@@ -71,8 +78,9 @@ vsnprintf(str, n, fmt, ap)
va_list ap;
{
#ifdef VSPRINTF_CHARSTAR
return (strlen((char*)(size_t)vsprintf(str, fmt, ap)));
return (strlen((char*)(size_t)vsnprintf(str, fmt, ap)));
#else
return (vsprintf(str, fmt, ap));
return (vsnprintf(str, fmt, ap));
#endif
}
#endif