mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 06:25:31 +00:00
add dns_db_attachversion()
This commit is contained in:
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));
|
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
|
void
|
||||||
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||||
isc_boolean_t commit)
|
isc_boolean_t commit)
|
||||||
|
@@ -78,6 +78,8 @@ typedef struct dns_dbmethods {
|
|||||||
dns_dbversion_t **versionp);
|
dns_dbversion_t **versionp);
|
||||||
dns_result_t (*newversion)(dns_db_t *db,
|
dns_result_t (*newversion)(dns_db_t *db,
|
||||||
dns_dbversion_t **versionp);
|
dns_dbversion_t **versionp);
|
||||||
|
void (*attachversion)(dns_db_t *db, dns_dbversion_t *source,
|
||||||
|
dns_dbversion_t **targetp);
|
||||||
void (*closeversion)(dns_db_t *db,
|
void (*closeversion)(dns_db_t *db,
|
||||||
dns_dbversion_t **versionp,
|
dns_dbversion_t **versionp,
|
||||||
isc_boolean_t commit);
|
isc_boolean_t commit);
|
||||||
@@ -346,6 +348,25 @@ dns_db_newversion(dns_db_t *db, dns_dbversion_t **versionp);
|
|||||||
* implementation used.
|
* 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
|
void
|
||||||
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
dns_db_closeversion(dns_db_t *db, dns_dbversion_t **versionp,
|
||||||
isc_boolean_t commit);
|
isc_boolean_t commit);
|
||||||
|
Reference in New Issue
Block a user