Minor typos, additional clarification

vmware
Howard Chu 13 years ago
parent 0c487538cf
commit a7edb95e64
  1. 6
      libraries/libmdb/mdb.c
  2. 26
      libraries/libmdb/mdb.h

@ -316,8 +316,8 @@ typedef uint16_t indx_t;
* Since the database uses multi-version concurrency control, readers don't * Since the database uses multi-version concurrency control, readers don't
* actually need any locking. This table is used to keep track of which * actually need any locking. This table is used to keep track of which
* readers are using data from which old transactions, so that we'll know * readers are using data from which old transactions, so that we'll know
* when a particular old transaction is no longer in use, Old transactions * when a particular old transaction is no longer in use. Old transactions
* that have freed any data pages can then have their freed pages reclaimed * that have discarded any data pages can then have those pages reclaimed
* for use by a later write transaction. * for use by a later write transaction.
* *
* The lock table is constructed such that reader slots are aligned with the * The lock table is constructed such that reader slots are aligned with the
@ -886,7 +886,7 @@ mdb_strerror(int err)
* @param[in] buf the buffer to write into. Should always be #DKBUF. * @param[in] buf the buffer to write into. Should always be #DKBUF.
* @return The key in hexadecimal form. * @return The key in hexadecimal form.
*/ */
static char * char *
mdb_dkey(MDB_val *key, char *buf) mdb_dkey(MDB_val *key, char *buf)
{ {
char *ptr = buf; char *ptr = buf;

@ -152,11 +152,7 @@ typedef void (MDB_rel_func)(void *newptr, void *oldptr, size_t size);
/** use sorted duplicates */ /** use sorted duplicates */
#define MDB_DUPSORT 0x04 #define MDB_DUPSORT 0x04
/** numeric keys in native byte order. /** numeric keys in native byte order.
* @note The keys size must actually be equal to * The keys must all be of the same size. */
* sizeof(int) or sizeof(long) otherwise there will be
* alignment issues. On some processors, accessing misaligned
* data will cause a SIGBUS.
*/
#define MDB_INTEGERKEY 0x08 #define MDB_INTEGERKEY 0x08
/** with #MDB_DUPSORT, sorted dup items have fixed size */ /** with #MDB_DUPSORT, sorted dup items have fixed size */
#define MDB_DUPFIXED 0x10 #define MDB_DUPFIXED 0x10
@ -205,7 +201,7 @@ typedef enum MDB_cursor_op {
MDB_PREV_DUP, /**< Position at previous data item of current key. MDB_PREV_DUP, /**< Position at previous data item of current key.
Only for #MDB_DUPSORT */ Only for #MDB_DUPSORT */
MDB_PREV_NODUP, /**< Position at last data item of previous key. MDB_PREV_NODUP, /**< Position at last data item of previous key.
only for #MDB_DUPSORT */ Only for #MDB_DUPSORT */
MDB_SET, /**< Position at specified key */ MDB_SET, /**< Position at specified key */
MDB_SET_RANGE /**< Position at first key greater than or equal to specified key. */ MDB_SET_RANGE /**< Position at first key greater than or equal to specified key. */
} MDB_cursor_op; } MDB_cursor_op;
@ -498,7 +494,7 @@ void mdb_txn_abort(MDB_txn *txn);
/** Reset a read-only transaction. /** Reset a read-only transaction.
* This releases the current reader lock but doesn't free the * This releases the current reader lock but doesn't free the
* transaction handle, allowing it to be used again later by #mdb_txn_renew(). * transaction handle, allowing it to be used again later by #mdb_txn_renew().
* It otherwise has the same affect as #mdb_txn_abort() but saves some memory * It otherwise has the same effect as #mdb_txn_abort() but saves some memory
* allocation/deallocation overhead if a thread is going to start a new * allocation/deallocation overhead if a thread is going to start a new
* read-only transaction again soon. * read-only transaction again soon.
* All cursors opened within the transaction must be closed before the transaction * All cursors opened within the transaction must be closed before the transaction
@ -544,11 +540,9 @@ int mdb_txn_renew(MDB_txn *txn);
* keys may have multiple data items, stored in sorted order.) By default * keys may have multiple data items, stored in sorted order.) By default
* keys must be unique and may have only a single data item. * keys must be unique and may have only a single data item.
* <li>#MDB_INTEGERKEY * <li>#MDB_INTEGERKEY
* Keys are binary integers in native byte order. On Big-Endian systems * Keys are binary integers in native byte order. Setting this option
* this flag has no effect. On Little-Endian systems this flag behaves * requires all keys to be the same size, typically sizeof(int)
* the same as #MDB_REVERSEKEY. This flag is simply provided as a * or sizeof(long).
* convenience so that applications don't need to detect Endianness themselves
* when using integers as keys.
* <li>#MDB_DUPFIXED * <li>#MDB_DUPFIXED
* This flag may only be used in combination with #MDB_DUPSORT. This option * This flag may only be used in combination with #MDB_DUPSORT. This option
* tells the library that the data items for this database are all the same * tells the library that the data items for this database are all the same
@ -558,6 +552,9 @@ int mdb_txn_renew(MDB_txn *txn);
* <li>#MDB_INTEGERDUP * <li>#MDB_INTEGERDUP
* This option specifies that duplicate data items are also integers, and * This option specifies that duplicate data items are also integers, and
* should be sorted as such. * should be sorted as such.
* <li>#MDB_REVERSEDUP
* This option specifies that duplicate data items should be compared as
* strings in reverse order.
* <li>#MDB_CREATE * <li>#MDB_CREATE
* Create the named database if it doesn't exist. This option is not * Create the named database if it doesn't exist. This option is not
* allowed in a read-only transaction or a read-only environment. * allowed in a read-only transaction or a read-only environment.
@ -660,6 +657,11 @@ int mdb_set_relfunc(MDB_txn *txn, MDB_dbi dbi, MDB_rel_func *rel);
* If the database supports duplicate keys (#MDB_DUPSORT) then the * If the database supports duplicate keys (#MDB_DUPSORT) then the
* first data item for the key will be returned. Retrieval of other * first data item for the key will be returned. Retrieval of other
* items requires the use of #mdb_cursor_get(). * items requires the use of #mdb_cursor_get().
*
* @note The memory pointed to by the returned values is owned by the
* database. The caller need not dispose of the memory, and may not
* modify it in any way. For values returned in a read-only transaction
* any modification attempts will cause a SIGSEGV.
* @param[in] txn A transaction handle returned by #mdb_txn_begin() * @param[in] txn A transaction handle returned by #mdb_txn_begin()
* @param[in] dbi A database handle returned by #mdb_open() * @param[in] dbi A database handle returned by #mdb_open()
* @param[in] key The key to search for in the database * @param[in] key The key to search for in the database

Loading…
Cancel
Save