mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 14:07:59 +00:00
add dns_db_attachversion()
This commit is contained in:
parent
f8dd2e939e
commit
b8862d5130
18
lib/dns/db.c
18
lib/dns/db.c
@ -201,6 +201,24 @@ dns_db_newversion(dns_db_t *db, dns_dbversion_t **versionp) {
|
||||
return ((db->methods->newversion)(db, versionp));
|
||||
}
|
||||
|
||||
void
|
||||
dns_db_attachversion(dns_db_t *db, dns_dbversion_t *source,
|
||||
dns_dbversion_t **targetp)
|
||||
{
|
||||
/*
|
||||
* Attach '*targetp' to 'source'.
|
||||
*/
|
||||
|
||||
REQUIRE(DNS_DB_VALID(db));
|
||||
REQUIRE((db->attributes & DNS_DBATTR_CACHE) == 0);
|
||||
REQUIRE(source != NULL);
|
||||
REQUIRE(targetp != NULL && *targetp != NULL);
|
||||
|
||||
(db->methods->attachversion)(db, source, targetp);
|
||||
|
||||
ENSURE(*targetp != NULL);
|
||||
}
|
||||
|
||||
void
|
||||
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
isc_boolean_t commit)
|
||||
|
@ -78,6 +78,8 @@ typedef struct dns_dbmethods {
|
||||
dns_dbversion_t **versionp);
|
||||
dns_result_t (*newversion)(dns_db_t *db,
|
||||
dns_dbversion_t **versionp);
|
||||
void (*attachversion)(dns_db_t *db, dns_dbversion_t *source,
|
||||
dns_dbversion_t **targetp);
|
||||
void (*closeversion)(dns_db_t *db,
|
||||
dns_dbversion_t **versionp,
|
||||
isc_boolean_t commit);
|
||||
@ -346,6 +348,25 @@ dns_db_newversion(dns_db_t *db, dns_dbversion_t **versionp);
|
||||
* implementation used.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_db_attachversion(dns_db_t *db, dns_dbversion_t *source,
|
||||
dns_dbversion_t **targetp);
|
||||
/*
|
||||
* Attach '*targetp' to 'source'.
|
||||
*
|
||||
* Requires:
|
||||
*
|
||||
* 'db' is a valid database with zone semantics.
|
||||
*
|
||||
* source is a valid open version
|
||||
*
|
||||
* targetp != NULL && *targetp == NULL
|
||||
*
|
||||
* Ensures:
|
||||
*
|
||||
* '*targetp' is attached to source.
|
||||
*/
|
||||
|
||||
void
|
||||
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||
isc_boolean_t commit);
|
||||
|
Loading…
x
Reference in New Issue
Block a user