2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

add dns_db_attachversion()

This commit is contained in:
Bob Halley 1999-04-19 22:51:48 +00:00
parent f8dd2e939e
commit b8862d5130
2 changed files with 39 additions and 0 deletions

View File

@ -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)

View File

@ -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);