2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-23 10:39:16 +00:00
bind/lib/dns/rdatasetiter.c

75 lines
1.6 KiB
C
Raw Normal View History

1999-03-11 00:43:43 +00:00
/*
* Copyright (C) Internet Systems Consortium, Inc. ("ISC")
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* See the COPYRIGHT file distributed with this work for additional
* information regarding copyright ownership.
1999-03-11 00:43:43 +00:00
*/
2007-06-19 23:47:24 +00:00
/* $Id: rdatasetiter.c,v 1.16 2007/06/19 23:47:16 tbox Exp $ */
/*! \file */
2000-06-22 22:00:42 +00:00
1999-03-11 00:43:43 +00:00
#include <config.h>
#include <stddef.h>
2000-04-28 01:12:23 +00:00
#include <isc/util.h>
1999-03-11 00:43:43 +00:00
1999-03-11 05:59:40 +00:00
#include <dns/rdataset.h>
1999-03-11 00:43:43 +00:00
#include <dns/rdatasetiter.h>
void
dns_rdatasetiter_destroy(dns_rdatasetiter_t **iteratorp) {
/*
* Destroy '*iteratorp'.
*/
REQUIRE(iteratorp != NULL);
REQUIRE(DNS_RDATASETITER_VALID(*iteratorp));
(*iteratorp)->methods->destroy(iteratorp);
ENSURE(*iteratorp == NULL);
}
isc_result_t
1999-03-11 00:43:43 +00:00
dns_rdatasetiter_first(dns_rdatasetiter_t *iterator) {
/*
* Move the rdataset cursor to the first rdataset at the node (if any).
*/
REQUIRE(DNS_RDATASETITER_VALID(iterator));
return (iterator->methods->first(iterator));
}
isc_result_t
1999-03-11 00:43:43 +00:00
dns_rdatasetiter_next(dns_rdatasetiter_t *iterator) {
/*
* Move the rdataset cursor to the next rdataset at the node (if any).
*/
REQUIRE(DNS_RDATASETITER_VALID(iterator));
return (iterator->methods->next(iterator));
}
1999-03-11 05:59:40 +00:00
void
dns_rdatasetiter_current(dns_rdatasetiter_t *iterator,
1999-03-11 00:43:43 +00:00
dns_rdataset_t *rdataset)
{
/*
* Return the current rdataset.
*/
REQUIRE(DNS_RDATASETITER_VALID(iterator));
REQUIRE(DNS_RDATASET_VALID(rdataset));
REQUIRE(! dns_rdataset_isassociated(rdataset));
1999-03-11 00:43:43 +00:00
1999-03-11 05:59:40 +00:00
iterator->methods->current(iterator, rdataset);
1999-03-11 00:43:43 +00:00
}