Commit b8862d51 authored by Bob Halley's avatar Bob Halley

add dns_db_attachversion()

parent f8dd2e93
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment