#ifndef RDATA_GENERIC_TXT_16_C
#define RDATA_GENERIC_TXT_16_C
static inline isc_result_t
generic_totext_txt(ARGS_TOTEXT) {
isc_region_t region;
UNUSED(tctx);
dns_rdata_toregion(rdata, ®ion);
while (region.length > 0) {
RETERR(txt_totext(®ion, 1, target));
if (region.length > 0)
RETERR(isc_str_tobuffer(" ", target));
}
return (ISC_R_SUCCESS);
}
static inline isc_result_t
generic_fromwire_txt(ARGS_FROMWIRE) {
isc_result_t result;
UNUSED(type);
UNUSED(dctx);
UNUSED(rdclass);
UNUSED(options);
do {
result = txt_fromwire(source, target);
if (result != ISC_R_SUCCESS)
return (result);
} while (!buffer_empty(source));
return (ISC_R_SUCCESS);
}
static inline isc_result_t
totext_txt(ARGS_TOTEXT) {
REQUIRE(rdata->type == dns_rdatatype_txt);
return (generic_totext_txt(rdata, tctx, target));
}
static inline isc_result_t
fromwire_txt(ARGS_FROMWIRE) {
REQUIRE(type == dns_rdatatype_txt);
return (generic_fromwire_txt(rdclass, type, source, dctx, options,
target));
}
static inline isc_result_t
towire_txt(ARGS_TOWIRE) {
REQUIRE(rdata->type == dns_rdatatype_txt);
UNUSED(cctx);
return (isc_mem_tobuffer(target, rdata->data, rdata->length));
}
#endif