From a01f52a731f03c9d61357ac872f3d228db56a0af Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Fri, 30 Jul 1999 23:33:15 +0000 Subject: [PATCH] callback structure changes --- bin/tests/master/t_master.c | 11 +++++------ bin/tests/master_test.c | 14 +++++++------- lib/dns/callbacks.c | 6 +++--- lib/dns/master.c | 7 ++++--- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/bin/tests/master/t_master.c b/bin/tests/master/t_master.c index d5d3691b13..40fe9018f5 100644 --- a/bin/tests/master/t_master.c +++ b/bin/tests/master/t_master.c @@ -38,22 +38,21 @@ #define BUFLEN 255 #define BIGBUFLEN (64 * 1024) -static dns_result_t t1_commit_callback(dns_rdatacallbacks_t *callbacks, - dns_name_t *owner, dns_rdataset_t *dataset); +static dns_result_t t1_add_callback(void *arg, dns_name_t *owner, + dns_rdataset_t *dataset); static void t1(void); isc_mem_t *T1_mctx; char *Tokens[T_MAXTOKS + 1]; static dns_result_t -t1_commit_callback(dns_rdatacallbacks_t *callbacks, dns_name_t *owner, - dns_rdataset_t *dataset) { +t1_add_callback(void *arg, dns_name_t *owner, dns_rdataset_t *dataset) { char buf[BIGBUFLEN]; isc_buffer_t target; dns_result_t result; - callbacks = callbacks; /*unused*/ + arg = arg; /*unused*/ isc_buffer_init(&target, buf, BIGBUFLEN, ISC_BUFFERTYPE_TEXT); result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE, @@ -106,7 +105,7 @@ test_master(char *testfile, char *origin, char *class, dns_result_t exp_result) } dns_rdatacallbacks_init(&callbacks); - callbacks.commit = t1_commit_callback; + callbacks.add = t1_add_callback; textregion.base = class; textregion.length = strlen(class); diff --git a/bin/tests/master_test.c b/bin/tests/master_test.c index 6a36cd4254..29eabd0e18 100644 --- a/bin/tests/master_test.c +++ b/bin/tests/master_test.c @@ -30,19 +30,18 @@ #include #include -dns_result_t print_dataset(dns_rdatacallbacks_t *callbacks, - dns_name_t *owner, dns_rdataset_t *dataset); +dns_result_t print_dataset(void *arg, dns_name_t *owner, + dns_rdataset_t *dataset); isc_mem_t *mctx; dns_result_t -print_dataset(dns_rdatacallbacks_t *callbacks, dns_name_t *owner, - dns_rdataset_t *dataset) { +print_dataset(void *arg, dns_name_t *owner, dns_rdataset_t *dataset) { char buf[64*1024]; isc_buffer_t target; dns_result_t result; - callbacks = callbacks; /*unused*/ + arg = arg; /*unused*/ isc_buffer_init(&target, buf, 64*1024, ISC_BUFFERTYPE_TEXT); result = dns_rdataset_totext(dataset, owner, ISC_FALSE, ISC_FALSE, @@ -88,9 +87,10 @@ main(int argc, char *argv[]) { } dns_rdatacallbacks_init(&callbacks); - callbacks.commit = print_dataset; + callbacks.add = print_dataset; - result = dns_master_load(argv[1], &origin, &origin, 1, ISC_FALSE, + result = dns_master_load(argv[1], &origin, &origin, 1, + ISC_FALSE, &soacount, &nscount, &callbacks, mctx); fprintf(stdout, "dns_master_load: %s\n", diff --git a/lib/dns/callbacks.c b/lib/dns/callbacks.c index d785489926..343c4f971a 100644 --- a/lib/dns/callbacks.c +++ b/lib/dns/callbacks.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: callbacks.c,v 1.2 1999/03/06 04:08:29 halley Exp $ */ + /* $Id: callbacks.c,v 1.3 1999/07/30 23:32:51 halley Exp $ */ #include @@ -35,10 +35,10 @@ dns_rdatacallbacks_init(dns_rdatacallbacks_t *callbacks) { REQUIRE(callbacks != NULL); - callbacks->commit = NULL; + callbacks->add = NULL; callbacks->error = default_error_warn_callback; callbacks->warn = default_error_warn_callback; - callbacks->commit_private = NULL; + callbacks->add_private = NULL; callbacks->error_private = NULL; callbacks->warn_private = NULL; } diff --git a/lib/dns/master.c b/lib/dns/master.c index 5406176997..c85103c569 100644 --- a/lib/dns/master.c +++ b/lib/dns/master.c @@ -15,7 +15,7 @@ * SOFTWARE. */ - /* $Id: master.c,v 1.20 1999/06/24 17:55:38 halley Exp $ */ + /* $Id: master.c,v 1.21 1999/07/30 23:32:51 halley Exp $ */ #include @@ -195,7 +195,7 @@ dns_master_load(char *master_file, dns_name_t *top, dns_name_t *origin, REQUIRE(dns_name_isabsolute(top)); REQUIRE(dns_name_isabsolute(origin)); REQUIRE(callbacks != NULL); - REQUIRE(callbacks->commit != NULL); + REQUIRE(callbacks->add != NULL); REQUIRE(callbacks->error != NULL); REQUIRE(callbacks->warn != NULL); REQUIRE(nscount != NULL); @@ -934,7 +934,8 @@ commit(dns_rdatacallbacks_t *callbacks, rdatalist_head_t *head, while ((this = ISC_LIST_HEAD(*head)) != NULL) { dns_rdataset_init(&dataset); dns_rdatalist_tordataset(this, &dataset); - result = ((*callbacks->commit)(callbacks, owner, &dataset)); + result = ((*callbacks->add)(callbacks->add_private, owner, + &dataset)); if (result != DNS_R_SUCCESS) return (result); ISC_LIST_UNLINK(*head, this, link);