/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 1998
* Sleepycat Software. All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "config.h"
#ifndef lint
#endif /* not lint */
#ifndef NO_SYSTEM_INCLUDES
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#endif
#include "db_int.h"
#include "shqueue.h"
#include "db_page.h"
#include "db_shash.h"
#include "mp.h"
#include "btree.h"
#include "hash.h"
#include "db_am.h"
#include "db_ext.h"
/*
* __db_init_wrapper --
* Wrapper layer to implement generic DB functions.
*
* PUBLIC: int __db_init_wrapper __P((DB *));
*/
int
{
return (0);
}
/*
* __db_cursor --
* Allocate and return a cursor.
*/
static int
{
int ret;
/* Take one from the free list if it's available. */
else {
return (ret);
/* Set up locking information. */
/*
* If we are not threaded, then there is no need to
* create new locker ids. We know that no one else
* is running concurrently using this DB, so we can
* take a peek at any cursors on the active queue.
*/
else
goto err;
} else {
}
}
case DB_BTREE:
case DB_RECNO:
goto err;
break;
case DB_HASH:
goto err;
break;
default:
goto err;
}
}
else
/*
* If this is the concurrent DB product, then we do all locking
* in the interface, which is right here.
*/
(void)__db_c_close(dbc);
return (EAGAIN);
}
if (op == DB_WRITELOCK)
}
return (0);
return (ret);
}
/*
* __db_c_close --
* Close the cursor (recycle for later use).
*/
static int
{
ret = 0;
/*
* We cannot release the lock until after we've called the
* access method specific routine, since btrees may have pending
* deletes.
*/
/* Remove the cursor from the active queue. */
/* Call the access specific cursor close routine. */
/* Release the lock. */
}
/* Clean up the cursor. */
#ifdef DEBUG
/*
* Check for leftover locks, unless we're running with transactions.
*
* If we're running tests, display any locks currently held. It's
* possible that some applications may hold locks for long periods,
* e.g., conference room locks, but the DB tests should never close
* holding locks.
*/
}
#endif
/* Move the cursor to the free queue. */
return (ret);
}
#ifdef DEBUG
/*
* __db_cprint --
* Display the current cursor list.
*
* PUBLIC: int __db_cprint __P((DB *));
*/
int
{
{ DBC_RECOVER, "recover" },
{ DBC_RMW, "read-modify-write" },
{ 0 },
};
"%#0x: dbp: %#0x txn: %#0x lid: %lu locker: %lu",
}
return (0);
}
#endif /* DEBUG */
/*
* __db_c_destroy --
* Destroy the cursor.
*
* PUBLIC: int __db_c_destroy __P((DBC *));
*/
int
{
int ret;
/* Remove the cursor from the free queue. */
/* Call the access specific cursor destroy routine. */
/* Free up allocated memory. */
return (0);
}
/*
* db_fd --
* Return a file descriptor for flock'ing.
*/
static int
int *fdp;
{
/*
* XXX
* Truly spectacular layering violation.
*/
}
/*
* __db_get --
*/
static int
{
return (ret);
return (ret);
return (ret);
}
/*
* __db_put --
*/
static int
{
return (ret);
return (ret);
if (flags == DB_NOOVERWRITE) {
/*
* Set DB_DBT_USERMEM, this might be a threaded application and
* the flags checking will catch us. We don't want the actual
* data, so request a partial of length 0.
*/
ret = DB_KEYEXIST;
else if (ret == DB_NOTFOUND)
ret = 0;
}
if (ret == 0)
return (ret);
}
/*
* __db_sync --
* Flush the database cache.
*
* PUBLIC: int __db_sync __P((DB *, u_int32_t));
*/
int
{
int ret;
return (ret);
/* If it wasn't possible to modify the file, we're done. */
return (0);
/* Flush any dirty pages from the cache to the backing file. */
ret = 0;
return (ret);
}