Import BSDDB 4.7.25 (as of svn r89086)

This commit is contained in:
Zachary Ware
2017-09-04 13:40:25 -05:00
parent 4b29e0458f
commit 8f590873d0
4781 changed files with 2241032 additions and 6 deletions

11
docs_src/dbc/Makefile Normal file
View File

@@ -0,0 +1,11 @@
# $Id: Makefile,v 1.4 2007/05/08 21:37:19 bostic Exp $
COMMON= dbc_class.html \
dbc_close.html \
dbc_count.html \
dbc_del.html \
dbc_dup.html \
dbc_get.html \
dbc_list.html \
dbc_put.html \
dbc_set_priority.html

26
docs_src/dbc/dbc_class.so Normal file
View File

@@ -0,0 +1,26 @@
m4_comment([$Id: dbc_class.so,v 10.19 2004/08/13 03:38:56 bostic Exp $])
define(M4PAGELOCAL, Dbc)
include(m4/m4.seealso)
m4_pf_header(m4_ref(Dbc),
ifelse(M4API, C_API, [dnl
typedef struct __dbc DBC;
])
ifelse(M4API, CXX_API, [dnl
class Dbc { ... };
]))
m4_p([dnl
The m4_ref(Dbc) object is the handle for a cursor into a m4_db database.
The handle is not free-threaded. Cursor handles may be used by multiple
threads, but only serially, that is, the application must serialize
access to the m4_ref(Dbc) handle.])
m4_p([dnl
If the cursor is to be used to perform operations on behalf of a
transaction, the cursor must be opened and closed within the context of
that single transaction. Once m4_ref(dbc_close) has been called, the
handle may not be accessed again, regardless of the method's return.])
m4_page_footer

35
docs_src/dbc/dbc_close.so Normal file
View File

@@ -0,0 +1,35 @@
m4_comment([$Id: dbc_close.so,v 10.35 2006/10/24 13:26:50 bostic Exp $])
define(M4PAGELOCAL, dbc_close)
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_close),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__close(DBC *DBcursor);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::close(void);
]))
m4_p([dnl
The m4_refT(dbc_close) discards the cursor.])
m4_p([dnl
It is possible for the m4_refT(dbc_close) to return
m4_ref(DB_LOCK_DEADLOCK), signaling that any enclosing transaction should
be aborted. If the application is already intending to abort the
transaction, this error should be ignored, and the application should
proceed.])
m4_p([dnl
After m4_ref(dbc_close) has been called, regardless of its return, the
cursor handle may not be used again.])
m4_return(dbc_close, std)
m4_err(dbc_close, deadlock, einval, [the cursor is already closed])
m4_seealso(Dbc)
m4_page_footer

31
docs_src/dbc/dbc_count.so Normal file
View File

@@ -0,0 +1,31 @@
m4_comment([$Id: dbc_count.so,v 10.27 2007/10/24 16:06:07 bostic Exp $])
define(M4PAGELOCAL, dbc_count)
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_count),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__count(DBC *DBcursor, db_recno_t *countp, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::count(db_recno_t *countp, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(dbc_count) returns a count of the number of data items for
the key to which the cursor refers.])
m4_return(dbc_count, std)
m4_parambegin
m4_param_co(countp, count of the number of duplicate data items)
m4_unusedflags
m4_paramend
m4_err(dbc_count,
rephandle, replockout, einval, [the cursor has not been initialized])
m4_seealso(Dbc)
m4_page_footer

42
docs_src/dbc/dbc_del.so Normal file
View File

@@ -0,0 +1,42 @@
m4_comment([$Id: dbc_del.so,v 10.49 2007/10/24 16:06:07 bostic Exp $])
define(M4PAGELOCAL, [dbc_del])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_del),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__del(DBC *DBcursor, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::del(u_int32_t flags);
]))
m4_p([dnl
The m4_refT(dbc_del) deletes the key/data pair to which the cursor
refers.])
m4_p([dnl
When called on a cursor opened on a database that has been made into a
secondary index using the m4_refT(dbh_associate), the m4_refT(dbh_del)
deletes the key/data pair from the primary database and all secondary
indices.])
m4_p([dnl
The cursor position is unchanged after a delete, and subsequent calls to
cursor functions expecting the cursor to refer to an existing key will
fail.])
m4_return(dbc_del,
specific, DB_KEYEMPTY, [if the element has already been deleted], prev)
m4_parambegin
m4_unusedflags
m4_paramend
m4_err(dbc_del, deadlock, rephandle, replockout, secondary_bad, readonly,
einval, [the cursor has not been initialized], cdbperm)
m4_seealso(Dbc)
m4_page_footer

42
docs_src/dbc/dbc_dup.so Normal file
View File

@@ -0,0 +1,42 @@
m4_comment([$Id: dbc_dup.so,v 10.34 2007/10/24 16:06:07 bostic Exp $])
define(M4PAGELOCAL, [dbc_dup, DB_POSITION])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_dup),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__dup(DBC *DBcursor, DBC **cursorp, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::dup(Dbc **cursorp, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(dbc_dup) creates a new cursor that uses the same transaction
and locker ID as the original cursor. This is useful when an application
is using locking and requires two or more cursors in the same thread of
control.])
m4_return(dbc_dup, std)
m4_parambegin
m4_param(flags, [dnl
m4_sf_or_may
m4_tagbegin
m4_tag(m4_idef(DB_POSITION), [dnl
The newly created cursor is initialized to refer to the same position
in the database as the original cursor (if any) and hold the same locks
(if any). If the m4_ref(DB_POSITION) flag is not specified, or the
original cursor does not hold a database position and locks, the created
cursor is uninitialized and will behave like a cursor newly created
using m4_ref(dbh_cursor).])
m4_tagend])
m4_paramend
m4_err(dbc_dup, rephandle, replockout, einval)
m4_seealso(Dbc)
m4_page_footer

344
docs_src/dbc/dbc_get.so Normal file
View File

@@ -0,0 +1,344 @@
m4_comment([$Id: dbc_get.so,v 10.121 2007/10/24 16:06:07 bostic Exp $])
define(M4PAGELOCAL,
[dbc_get, dbc_pget, DB_CURRENT, DB_FIRST, DB_GET_BOTH,
DB_GET_BOTH_RANGE, DB_GET_RECNO, DB_IGNORE_LEASE, DB_JOIN_ITEM,
DB_LAST, DB_MULTIPLE, DB_MULTIPLE_KEY, DB_NEXT, DB_NEXT_DUP,
DB_NEXT_NODUP, DB_PREV, DB_PREV_DUP, DB_PREV_NODUP, DB_SET,
DB_SET_RANGE, DB_SET_RECNO])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_get),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__get(DBC *DBcursor,
DBT *key, DBT *data, u_int32_t flags);
m4_blank
int
DBcursor-__GT__pget(DBC *DBcursor,
DBT *key, DBT *pkey, DBT *data, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::get(Dbt *key, Dbt *data, u_int32_t flags);
m4_blank
int
Dbc::pget(Dbt *key, Dbt *pkey, Dbt *data, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(dbc_get) retrieves key/data pairs from the database. The
address and length of the key are returned in the object to which
m4_arg(key) refers (except for the case of the m4_ref(DB_SET) flag, in
which the m4_arg(key) object is unchanged), and the address and length
of the data are returned in the object to which m4_arg(data) refers.])
m4_p([dnl
When called on a cursor opened on a database that has been made into a
secondary index using the m4_refT(dbh_associate), the m4_ref(dbc_get)
and m4_refT(dbc_pget)s return the key from the secondary index and the
data item from the primary database. In addition, the m4_refT(dbc_pget)
returns the key from the primary database. In databases that are not
secondary indices, the m4_refT(dbc_pget) will always fail.])
m4_p([dnl
Modifications to the database during a sequential scan will be reflected
in the scan; that is, records inserted behind a cursor will not be
returned while records inserted in front of a cursor will be returned.])
m4_p([dnl
In Queue and Recno databases, missing entries (that is, entries that
were never explicitly created or that were created and then deleted)
will be skipped during a sequential scan.])
m4_return(dbc_get, prev)
m4_p([dnl
If m4_ref(dbc_get) fails for any reason, the state of the cursor will be
unchanged.])
m4_parambegin
m4_param_data
m4_param(flags, [dnl
m4_sf_must
m4_tagbegin
m4_tag(m4_idef(DB_CURRENT), [dnl
Return the key/data pair to which the cursor refers.
m4_return(dbc_get, specific, DB_KEYEMPTY,
[if m4_ref(DB_CURRENT) is set and the cursor key/data pair was deleted])])
m4_tag([m4_idef(DB_FIRST)], [dnl
The cursor is set to refer to the first key/data pair of the database,
and that pair is returned. If the first key has duplicate values, the
first data item in the set of duplicates is returned.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_FIRST) flag will ignore any keys that exist but were never
explicitly created by the application, or were created and later
deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_FIRST) is set and the database is empty])])
m4_tag(m4_idef(DB_GET_BOTH), [dnl
The m4_ref(DB_GET_BOTH) flag is identical to the m4_ref(DB_SET) flag,
except that both the key and the data parameters must be matched by the
key and data item in the database.
m4_p([dnl
When used with the m4_refT(dbc_pget) version of this method on a
secondary index handle, both the secondary and primary keys must be
matched by the secondary and primary key item in the database. It is
an error to use the m4_ref(DB_GET_BOTH) flag with the m4_ref(dbc_get)
version of this method and a cursor that has been opened on a secondary
index handle.])])
m4_tag(m4_idef(DB_GET_BOTH_RANGE), [dnl
The m4_ref(DB_GET_BOTH_RANGE) flag is identical to the m4_ref(DB_GET_BOTH)
flag, except that, in the case of any database supporting sorted
duplicate sets, the returned key/data pair is the smallest data item
greater than or equal to the specified data item (as determined by the
comparison function), permitting partial matches and range searches in
duplicate data sets.])
m4_tag(m4_idef(DB_GET_RECNO), [dnl
Return the record number associated with the cursor. The record number
will be returned in m4_arg(data), as described in m4_ref(Dbt). The
m4_arg(key) parameter is ignored.
m4_p([dnl
For m4_ref(DB_GET_RECNO) to be specified, the underlying database must be
of type Btree, and it must have been created with the m4_ref(DB_RECNUM)
flag.])
m4_p([dnl
When called on a cursor opened on a database that has been made into a
secondary index, the m4_ref(dbc_get) and m4_refT(dbc_pget)s return the
record number of the primary database in m4_arg(data). In addition, the
m4_refT(dbc_pget) returns the record number of the secondary index in
m4_arg(pkey). If either underlying database is not of type Btree or is
not created with the m4_ref(DB_RECNUM) flag, the out-of-band record
number of 0 is returned.])])
m4_tag(m4_idef(DB_JOIN_ITEM), [dnl
Do not use the data value found in all of the cursors as a lookup key for
the primary database, but simply return it in the key parameter instead.
The data parameter is left unchanged.
m4_p([dnl
For m4_ref(DB_JOIN_ITEM) to be specified, the underlying cursor must have
been returned from the m4_refT(dbh_join).])])
m4_tag([m4_idef(DB_LAST)], [dnl
The cursor is set to refer to the last key/data pair of the database,
and that pair is returned. If the last key has duplicate values, the
last data item in the set of duplicates is returned.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_LAST) flag will ignore any keys that exist but were never
explicitly created by the application, or were created and later
deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_LAST) is set and the database is empty])])
m4_tag([m4_idef(DB_NEXT)], [dnl
If the cursor is not yet initialized, m4_ref(DB_NEXT) is identical to
m4_ref(DB_FIRST). Otherwise, the cursor is moved to the next key/data
pair of the database, and that pair is returned. In the presence of
duplicate key values, the value of the key may not change.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_NEXT) flag will skip any keys that exist but were never
explicitly created by the application, or those that were created and
later deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_NEXT) is set and the cursor is already on the last record
in the database])])
m4_tag(m4_idef(DB_NEXT_DUP), [dnl
If the next key/data pair of the database is a duplicate data record for
the current key/data pair, the cursor is moved to the next key/data pair
of the database, and that pair is returned.
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_NEXT_DUP) is set and the next key/data pair of the
database is not a duplicate data record for the current key/data pair])])
m4_tag([dnl
m4_idef(DB_NEXT_NODUP)], [dnl
If the cursor is not yet initialized, m4_ref(DB_NEXT_NODUP) is identical
to m4_ref(DB_FIRST). Otherwise, the cursor is moved to the next
non-duplicate key of the database, and that key/data pair is returned.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_NEXT_NODUP) flag will ignore any keys that exist but were
never explicitly created by the application, or those that were created
and later deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_NEXT_NODUP) is set and no non-duplicate key/data pairs
occur after the cursor position in the database])])
m4_tag([m4_idef(DB_PREV)], [dnl
If the cursor is not yet initialized, m4_ref(DB_PREV) is identical to
m4_ref(DB_LAST). Otherwise, the cursor is moved to the previous
key/data pair of the database, and that pair is returned. In the
presence of duplicate key values, the value of the key may not change.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_PREV) flag will skip any keys that exist but were never
explicitly created by the application, or those that were created and
later deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_PREV) is set and the cursor is already on the first record
in the database])])
m4_tag(m4_idef(DB_PREV_DUP), [dnl
If the previous key/data pair of the database is a duplicate data record
for the current key/data pair, the cursor is moved to the previous key/data
pair of the database, and that pair is returned.
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_PREV_DUP) is set and the previous key/data pair of the
database is not a duplicate data record for the current key/data pair])])
m4_tag([dnl
m4_idef(DB_PREV_NODUP)], [dnl
If the cursor is not yet initialized, m4_ref(DB_PREV_NODUP) is identical
to m4_ref(DB_LAST). Otherwise, the cursor is moved to the previous
non-duplicate key of the database, and that key/data pair is returned.
m4_p([dnl
If the database is a Queue or Recno database, m4_ref(dbc_get) using the
m4_ref(DB_PREV_NODUP) flag will ignore any keys that exist but were
never explicitly created by the application, or those that were created
and later deleted.])
m4_return(dbc_get, specific, DB_NOTFOUND,
[if m4_ref(DB_PREV_NODUP) is set and no non-duplicate key/data pairs
occur before the cursor position in the database])])
m4_tag(m4_idef(DB_SET), [dnl
Move the cursor to the specified key/data pair of the database, and
return the datum associated with the given key.
m4_return(dbc_get, specific, DB_NOTFOUND, [if m4_ref(DB_SET) is set and
no matching keys are found],
specific, DB_KEYEMPTY, [if m4_ref(DB_SET) is set and the database is a
Queue or Recno database, and the specified key exists, but was never
explicitly created by the application or was later deleted],
[In the presence of duplicate key values, m4_ref(dbc_get) will return the
first data item for the given key.])])
m4_tag(m4_idef(DB_SET_RANGE), [dnl
The m4_ref(DB_SET_RANGE) flag is identical to the m4_ref(DB_SET) flag,
except that in the case of the Btree access method, the key is returned
as well as the data item and the returned key/data pair is the smallest
key greater than or equal to the specified key (as determined by the
Btree comparison function), permitting partial key matches and range
searches.])
m4_tag(m4_idef(DB_SET_RECNO), [dnl
Move the cursor to the specific numbered record of the database, and
return the associated key/data pair. The m4_arg(data) field of the
specified m4_arg(key) must be a pointer to a memory location from which
a m4_ref(db_recno_t) may be read, as described in m4_ref(Dbt). This
memory location will be read to determine the record to be retrieved.
m4_p([dnl
For m4_ref(DB_SET_RECNO) to be specified, the underlying database must be
of type Btree, and it must have been created with the m4_ref(DB_RECNUM)
flag.])])
m4_tagend
m4_sf_or_add(1)
m4_tagbegin
m4_tag(m4_idef(DB_IGNORE_LEASE), [dnl
Return the data item irrespective of the state of master leases. The
item will be returned under all conditions: if master leases are not
configured, if the request is made to a client, if the request is made
to a master with a valid lease, or if the request is made to a master
without a valid lease.])
m4_tag(m4_idef(DB_READ_UNCOMMITTED), [dnl
Database items read during a transactional call will have degree 1
isolation, including modified but not yet committed data. Silently
ignored if the m4_ref(DB_READ_UNCOMMITTED) flag was not specified when
the underlying database was opened.])
m4_tag(m4_idef(DB_MULTIPLE), [dnl
Return multiple data items in the m4_arg(data) parameter.
m4_p([dnl
In the case of Btree or Hash databases, duplicate data items for the
current key, starting at the current cursor position, are entered into
the buffer. Subsequent calls with both the m4_ref(DB_NEXT_DUP) and
m4_ref(DB_MULTIPLE) flags specified will return additional duplicate
data items associated with the current key or m4_ref(DB_NOTFOUND) if
there are no additional duplicate data items to return. Subsequent
calls with both the m4_ref(DB_NEXT) and m4_ref(DB_MULTIPLE) flags
specified will return additional duplicate data items associated with
the current key or if there are no additional duplicate data items will
return the next key and its data items or m4_ref(DB_NOTFOUND) if there
are no additional keys in the database.])
m4_p([dnl
In the case of Queue or Recno databases, data items starting at the
current cursor position are entered into the buffer. The record number
of the first record will be returned in the m4_arg(key) parameter. The
record number of each subsequent returned record must be calculated from
this value. Subsequent calls with the m4_ref(DB_MULTIPLE) flag
specified will return additional data items or m4_ref(DB_NOTFOUND) if
there are no additional data items to return.])
m4_p([dnl
m4_bulk_mem])
m4_p([dnl
The multiple data items can be iterated over using the
ifelse(M4API, C_API, m4_ref(DB_MULTIPLE_NEXT) macro,
m4_ref(DbMultipleDataIterator) class).])
m4_p([dnl
The m4_ref(DB_MULTIPLE) flag may only be used with the
m4_ref(DB_CURRENT), m4_ref(DB_FIRST), m4_ref(DB_GET_BOTH),
m4_ref(DB_GET_BOTH_RANGE), m4_ref(DB_NEXT), m4_ref(DB_NEXT_DUP),
m4_ref(DB_NEXT_NODUP), m4_ref(DB_SET), m4_ref(DB_SET_RANGE), and
m4_ref(DB_SET_RECNO) options. The m4_ref(DB_MULTIPLE) flag may not be
used when accessing databases made into secondary indices using the
m4_refT(dbh_associate).])])
m4_tag(m4_idef(DB_MULTIPLE_KEY), [dnl
Return multiple key and data pairs in the m4_arg(data) parameter.
m4_p([dnl
Key and data pairs, starting at the current cursor position, are entered
into the buffer. Subsequent calls with both the m4_ref(DB_NEXT) and
m4_ref(DB_MULTIPLE_KEY) flags specified will return additional key and data
pairs or m4_ref(DB_NOTFOUND) if there are no additional key and data
items to return.])
m4_p([dnl
In the case of Btree or Hash databases,
the multiple key and data pairs can be iterated over using the
ifelse(M4API, C_API, m4_ref(DB_MULTIPLE_KEY_NEXT) macro,
m4_ref(DbMultipleKeyDataIterator) class).])
m4_p([dnl
In the case of Queue or Recno databases,
the multiple record number and data pairs can be iterated over using the
ifelse(M4API, C_API, m4_ref(DB_MULTIPLE_RECNO_NEXT) macro,
m4_ref(DbMultipleRecnoDataIterator) class).])
m4_p([dnl
m4_bulk_mem])
m4_p([dnl
The m4_ref(DB_MULTIPLE_KEY) flag may only be used with the
m4_ref(DB_CURRENT), m4_ref(DB_FIRST), m4_ref(DB_GET_BOTH),
m4_ref(DB_GET_BOTH_RANGE), m4_ref(DB_NEXT), m4_ref(DB_NEXT_DUP),
m4_ref(DB_NEXT_NODUP), m4_ref(DB_SET), m4_ref(DB_SET_RANGE), and
m4_ref(DB_SET_RECNO) options. The m4_ref(DB_MULTIPLE_KEY) flag may not
be used when accessing databases made into secondary indices using the
m4_refT(dbh_associate).])])
m4_rmw_flag()
m4_tagend])
m4_param_key
m4_param(pkey, [The secondary index key m4_ref(Dbt) operated on.])
m4_paramend
m4_err(dbc_get,
buffersmall,
[requested item could not be returned due to undersized buffer],
deadlock, rephandle, replease, replockout, secondary_bad, einval,
[the m4_ref(DB_CURRENT), m4_ref(DB_NEXT_DUP) or m4_ref(DB_PREV_DUP) flags
were specified and the cursor has not been initialized;
the m4_refT(dbc_pget) was called with a cursor that does not refer to a
secondary index])
m4_seealso(Dbc)
m4_page_footer

7
docs_src/dbc/dbc_list.so Normal file
View File

@@ -0,0 +1,7 @@
m4_comment([$Id: dbc_list.so,v 1.1 2002/08/30 20:00:49 bostic Exp $])
m4_page_title([m4_db: Database Cursors and Related Methods])
include(dbc/m4.methods)
m4_page_footer

140
docs_src/dbc/dbc_put.so Normal file
View File

@@ -0,0 +1,140 @@
m4_comment([$Id: dbc_put.so,v 10.64 2007/10/24 16:06:07 bostic Exp $])
define(M4PAGELOCAL,
[dbc_put, DB_AFTER, DB_BEFORE, DB_CURRENT, DB_KEYFIRST,
DB_KEYLAST, DB_NODUPDATA])
include(m4/m4.seealso)
m4_pf_header(m4_ref(dbc_put),
ifelse(M4API, C_API, [dnl
int
DBcursor-__GT__put(DBC *DBcursor, DBT *key, DBT *data, u_int32_t flags);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::put(Dbt *key, Dbt *data, u_int32_t flags);
]))
m4_p([dnl
The m4_refT(dbc_put) stores key/data pairs into the database.])
m4_return(dbc_put, prev)
m4_p([dnl
If m4_ref(dbc_put) fails for any reason, the state of the cursor will be
unchanged. If m4_ref(dbc_put) succeeds and an item is inserted into the
database, the cursor is always positioned to refer to the newly inserted
item.])
m4_parambegin
m4_param_data
m4_param(flags, [dnl
m4_sf_must
m4_tagbegin
m4_tag(m4_idef(DB_AFTER), [dnl
In the case of the Btree and Hash access methods, insert the data
element as a duplicate element of the key to which the cursor refers.
The new element appears immediately after the current cursor position.
It is an error to specify m4_ref(DB_AFTER) if the underlying Btree or
Hash database is not configured for unsorted duplicate data items. The
m4_arg(key) parameter is ignored.
m4_p([dnl
In the case of the Recno access method, it is an error to specify
m4_ref(DB_AFTER) if the underlying Recno database was not created with
the m4_ref(DB_RENUMBER) flag. If the m4_ref(DB_RENUMBER) flag was
specified, a new key is created, all records after the inserted item
are automatically renumbered, and the key of the new record is returned
in the structure to which the m4_arg(key) parameter refers. The initial
value of the m4_arg(key) parameter is ignored. See m4_ref(dbh_open)
for more information.])
m4_p([dnl
The m4_ref(DB_AFTER) flag may not be specified to the Queue access method.])
m4_return(dbc_put,
specific, DB_NOTFOUND,
[if the current cursor record has already been deleted and the
underlying access method is Hash])])
m4_tag(m4_idef(DB_BEFORE), [dnl
In the case of the Btree and Hash access methods, insert the data
element as a duplicate element of the key to which the cursor refers.
The new element appears immediately before the current cursor position.
It is an error to specify m4_ref(DB_AFTER) if the underlying Btree or
Hash database is not configured for unsorted duplicate data items. The
m4_arg(key) parameter is ignored.
m4_p([dnl
In the case of the Recno access method, it is an error to specify
m4_ref(DB_BEFORE) if the underlying Recno database was not created with
the m4_ref(DB_RENUMBER) flag. If the m4_ref(DB_RENUMBER) flag was
specified, a new key is created, the current record and all records
after it are automatically renumbered, and the key of the new record is
returned in the structure to which the m4_arg(key) parameter refers.
The initial value of the m4_arg(key) parameter is ignored. See
m4_ref(dbh_open) for more information.])
m4_p([dnl
The m4_ref(DB_BEFORE) flag may not be specified to the Queue access method.])
m4_return(dbc_put,
specific, DB_NOTFOUND,
[if the current cursor record has already been deleted and the underlying
access method is Hash])])
m4_tag(m4_idef(DB_CURRENT), [dnl
Overwrite the data of the key/data pair to which the cursor refers with
the specified data item. The m4_arg(key) parameter is ignored.
m4_return(dbc_put,
specific, DB_NOTFOUND,
[if the current cursor record has already been deleted])])
m4_tag(m4_idef(DB_KEYFIRST), [dnl
Insert the specified key/data pair into the database.
m4_p([dnl
If the underlying database supports duplicate data items, and if the
key already exists in the database and a duplicate sort function has
been specified, the inserted data item is added in its sorted location.
If the key already exists in the database and no duplicate sort function
has been specified, the inserted data item is added as the first of the
data items for that key.])])
m4_tag(m4_idef(DB_KEYLAST), [dnl
Insert the specified key/data pair into the database.
m4_p([dnl
If the underlying database supports duplicate data items, and if the
key already exists in the database and a duplicate sort function has
been specified, the inserted data item is added in its sorted location.
If the key already exists in the database, and no duplicate sort
function has been specified, the inserted data item is added as the last
of the data items for that key.])])
m4_tag(m4_idef(DB_NODUPDATA), [dnl
In the case of the Btree and Hash access methods, insert the specified
key/data pair into the database, unless a key/data pair comparing
equally to it already exists in the database. If a matching key/data
pair already exists in the database, m4_ref(DB_KEYEXIST) is returned.
The DB_NODUPDATA flag may only be specified if the underlying
database has been configured to support sorted duplicate data items.
m4_p([dnl
The DB_NODUPDATA flag may not be specified to the Queue or Recno
access methods.])])
m4_tagend])
m4_param_key
m4_paramend
m4_err(dbc_put, deadlock, rephandle, replockout, readonly, einval,
[the m4_ref(DB_AFTER), m4_ref(DB_BEFORE) or m4_ref(DB_CURRENT) flags
were specified and the cursor has not been initialized;
the m4_ref(DB_AFTER) or m4_ref(DB_BEFORE) flags were specified and a
duplicate sort function has been specified;
the m4_ref(DB_CURRENT) flag was specified, a duplicate sort function has
been specified, and the data item of the referenced key/data pair does
not compare equally to the m4_arg(data) parameter;
the m4_ref(DB_AFTER) or m4_ref(DB_BEFORE) flags were specified, and the
underlying access method is Queue;
an attempt was made to add a record to a fixed-length database that was too
large to fit;
an attempt was made to add a record to a secondary index],
cdbperm)
m4_seealso(Dbc)
m4_page_footer

View File

@@ -0,0 +1,64 @@
m4_comment([$Id: dbc_set_priority.so,v 1.3 2007/05/22 18:06:05 bostic Exp $])
include(m4/m4.seealso)
ifdef([M4INTERFACE],, [dnl
define(M4INTERFACE, dbc_set_priority)
define(M4PAGELOCAL, [dbc_get_priority, dbc_set_priority,
DB_PRIORITY_VERY_LOW, DB_PRIORITY_LOW, DB_PRIORITY_DEFAULT,
DB_PRIORITY_HIGH, DB_PRIORITY_VERY_HIGH])
m4_pf_header(m4_ref(dbc_set_priority),
ifelse(M4API, C_API, [dnl
int
DbCursor-__GT__set_priority(DBC *DbCursor, DB_CACHE_PRIORITY priority);
m4_blank
int
DbCursor-__GT__get_priority(DBC *DbCursor, DB_CACHE_PRIORITY *priorityp);
])
ifelse(M4API, CXX_API, [dnl
int
Dbc::set_priority(DB_CACHE_PRIORITY priority);
m4_blank
int
Dbc::get_priority(DB_CACHE_PRIORITY *priorityp);
]))])
m4_p([dnl
Set the cache priority for pages referenced by the
ifelse(M4INTERFACE, dbh_set_priority, m4_ref(Db),
M4INTERFACE, memp_set_priority, m4_ref(DbMpoolFile), m4_ref(Dbc))
handle.])
m4_cache_priority_explain(M4INTERFACE)
ifelse(M4INTERFACE, memp_set_priority,[dnl
m4_p([dnl
To set the priority for the pages belonging to a particular database,
call the m4_refT(memp_set_priority) using the m4_ref(DbMpoolFile) handle
returned by the m4_refT(dbh_get_mpf).])
m4_scope_mpf(memp_set_priority)])
m4_when_any(M4INTERFACE)
m4_return(M4INTERFACE, std)
m4_parambegin
m4_cache_priority_parameter
m4_paramend
ifelse(M4INTERFACE, memp_set_priority,
m4_pf_getter(memp_get_priority,
cache priority for the file referenced by the m4_ref(DbMpoolFile) handle,,
priorityp, reference),
m4_pf_getter(
ifelse(M4INTERFACE, dbh_set_priority, dbh_get_priority, dbc_get_priority),
cache priority for pages referenced by the
ifelse(M4INTERFACE, dbh_set_priority, m4_ref(Db), m4_ref(Dbc))
handle,, priorityp, reference))
m4_seealso(
ifelse(M4INTERFACE, dbh_set_priority, Db,
M4INTERFACE, memp_set_priority, DbMpool, Dbc))
m4_page_footer

15
docs_src/dbc/m4.methods Normal file
View File

@@ -0,0 +1,15 @@
m4_comment([$Id: m4.methods,v 1.5 2007/05/08 21:37:19 bostic Exp $])
m4_table_begin(, _center)
m4_table_header(Database Cursors and Related Methods, Description)
m4_comment([Db::cursor])m4_table_element(m4_ref(dbh_cursor), Create a cursor)
m4_comment([DbCursor::close])m4_table_element(m4_ref(dbc_close), Close a cursor)
m4_comment([DbCursor::count])m4_table_element(m4_ref(dbc_count), Return count of duplicates)
m4_comment([DbCursor::del])m4_table_element(m4_ref(dbc_del), Delete by cursor)
m4_comment([DbCursor::dup])m4_table_element(m4_ref(dbc_dup), Duplicate a cursor)
m4_comment([DbCursor::get])m4_table_element([m4_ref(dbc_get), m4_ref(dbc_pget)], Retrieve by cursor)
m4_comment([DbCursor::put])m4_table_element(m4_ref(dbc_put), Store by cursor)
m4_comment([DbCursor::set_priority])m4_table_element(m4_ref(dbc_set_priority), Set the cursor's cache priority)
m4_table_end