2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-09-01 15:05:23 +00:00

dns_rdata_textctx_t is internal and should not appear in dns_rdata_totext() argument list

This commit is contained in:
Andreas Gustafsson
1999-06-08 20:47:31 +00:00
parent fad44a20ee
commit 7ab0e69f61
3 changed files with 30 additions and 6 deletions

View File

@@ -127,7 +127,7 @@ struct dns_rdata {
};
/*
* Context structure for dns_rdata_totext(). Defines
* Context structure for the totext_ functions. Defines
* the way the rdata part of a master file line is
* formatted.
*/
@@ -323,7 +323,7 @@ dns_result_t dns_rdata_fromtext(dns_rdata_t *rdata,
* Resource Limit: Not enough space
*/
dns_result_t dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
dns_result_t dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin,
isc_buffer_t *target);
/*
* Convert 'rdata' into text format, storing the result in 'target'.

View File

@@ -43,6 +43,11 @@
#include <dns/ttl.h>
#include <dns/masterdump.h>
/* XXX */
dns_result_t
__dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
isc_buffer_t *target);
#define RETERR(x) do { \
dns_result_t __r = (x); \
if (__r != DNS_R_SUCCESS) \
@@ -159,6 +164,8 @@ char spaces[N_SPACES] = " ";
#define N_TABS 10
char tabs[N_TABS] = "\t\t\t\t\t\t\t\t\t\t";
/*
* Output tabs and spaces to go from column '*current' to
* column 'to', and update '*current' to reflect the new
@@ -396,7 +403,7 @@ rdataset_totext(dns_rdataset_t *rdataset,
INDENT_TO(rdata_column);
dns_rdataset_current(rdataset, &rdata);
RETERR(dns_rdata_totext(&rdata, &ctx->rdata_ctx, target));
RETERR(__dns_rdata_totext(&rdata, &ctx->rdata_ctx, target));
isc_buffer_available(target, &r);
if (r.length < 1)

View File

@@ -15,7 +15,7 @@
* SOFTWARE.
*/
/* $Id: rdata.c,v 1.48 1999/06/08 10:35:06 gson Exp $ */
/* $Id: rdata.c,v 1.49 1999/06/08 20:46:43 gson Exp $ */
#include <config.h>
@@ -88,6 +88,10 @@ static void fromtext_error(void (*callback)(dns_rdatacallbacks_t *,
isc_token_t *token,
dns_result_t result);
/* XXX */
dns_result_t __dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
isc_buffer_t *target);
static const char hexdigits[] = "0123456789abcdef";
static const char decdigits[] = "0123456789";
static const char octdigits[] = "01234567";
@@ -413,7 +417,7 @@ dns_rdata_fromtext(dns_rdata_t *rdata, dns_rdataclass_t class,
}
dns_result_t
dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
__dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
isc_buffer_t *target)
{
dns_result_t result = DNS_R_NOTIMPLEMENTED;
@@ -432,6 +436,19 @@ dns_rdata_totext(dns_rdata_t *rdata, dns_rdata_textctx_t *tctx,
return (result);
}
dns_result_t
dns_rdata_totext(dns_rdata_t *rdata, dns_name_t *origin,
isc_buffer_t *target)
{
/* Set up formatting options for single-line output. */
dns_rdata_textctx_t tctx;
tctx.origin = origin;
tctx.flags = 0;
tctx.width = 60;
tctx.linebreak = " ";
return (__dns_rdata_totext(rdata, &tctx, target));
}
dns_result_t
dns_rdata_fromstruct(dns_rdata_t *rdata, dns_rdataclass_t class,
dns_rdatatype_t type, void *source,