1N/A * See the file LICENSE for redistribution information. 1N/A * Copyright (c) 1998 1N/A * Sleepycat Software. All rights reserved. 1N/A#
pragma ident "%Z%%M% %I% %E% SMI" 1N/A#
endif /* not lint */ 1N/A * __db_init_wrapper -- 1N/A * Wrapper layer to implement generic DB functions. 1N/A * PUBLIC: int __db_init_wrapper __P((DB *)); 1N/A * Allocate and return a cursor. 1N/A /* Take one from the free list if it's available. */ 1N/A /* Set up locking information. */ 1N/A * If we are not threaded, then there is no need to 1N/A * create new locker ids. We know that no one else 1N/A * is running concurrently using this DB, so we can 1N/A * take a peek at any cursors on the active queue. 1N/A * If this is the concurrent DB product, then we do all locking 1N/A * in the interface, which is right here. 1N/A * Close the cursor (recycle for later use). 1N/A * We cannot release the lock until after we've called the 1N/A * access method specific routine, since btrees may have pending 1N/A /* Remove the cursor from the active queue. */ 1N/A /* Call the access specific cursor close routine. */ 1N/A /* Release the lock. */ 1N/A /* Clean up the cursor. */ 1N/A * Check for leftover locks, unless we're running with transactions. 1N/A * If we're running tests, display any locks currently held. It's 1N/A * possible that some applications may hold locks for long periods, 1N/A * e.g., conference room locks, but the DB tests should never close 1N/A /* Move the cursor to the free queue. */ 1N/A * Display the current cursor list. 1N/A * PUBLIC: int __db_cprint __P((DB *)); 1N/A "%#0x: dbp: %#0x txn: %#0x lid: %lu locker: %lu",
1N/A * Destroy the cursor. 1N/A * PUBLIC: int __db_c_destroy __P((DBC *)); 1N/A /* Remove the cursor from the free queue. */ 1N/A /* Call the access specific cursor destroy routine. */ 1N/A /* Free up allocated memory. */ 1N/A * Return a file descriptor for flock'ing. 1N/A * Truly spectacular layering violation. 1N/A * Set DB_DBT_USERMEM, this might be a threaded application and 1N/A * the flags checking will catch us. We don't want the actual 1N/A * data, so request a partial of length 0. 1N/A * Flush the database cache. 1N/A * PUBLIC: int __db_sync __P((DB *, u_int32_t)); 1N/A /* If it wasn't possible to modify the file, we're done. */ 1N/A /* Flush any dirty pages from the cache to the backing file. */