*/
if ((ctx->style.flags & DNS_STYLEFLAG_MULTILINE) != 0) {
isc_buffer_t buf;
- isc_region_t r;
unsigned int col = 0;
isc_buffer_init(&buf, ctx->linebreak_buf,
sizeof(ctx->linebreak_buf));
- isc_buffer_availableregion(&buf, &r);
- if (r.length < 1)
+ if (isc_buffer_availablelength(&buf) < 1) {
return (DNS_R_TEXTTOOLONG);
- r.base[0] = '\n';
- isc_buffer_add(&buf, 1);
+ }
+ isc_buffer_putuint8(&buf, '\n');
if ((ctx->style.flags & DNS_STYLEFLAG_INDENT) != 0 ||
(ctx->style.flags & DNS_STYLEFLAG_YAML) != 0)
}
if ((ctx->style.flags & DNS_STYLEFLAG_COMMENTDATA) != 0) {
- isc_buffer_availableregion(&buf, &r);
- if (r.length < 1)
+ if (isc_buffer_availablelength(&buf) < 1) {
return (DNS_R_TEXTTOOLONG);
- r.base[0] = ';';
- isc_buffer_add(&buf, 1);
+ }
+ isc_buffer_putuint8(&buf, ';');
}
result = indent(&col, ctx->style.rdata_column,
if (result != ISC_R_SUCCESS)
return (result);
- isc_buffer_availableregion(&buf, &r);
- if (r.length < 1)
+ if (isc_buffer_availablelength(&buf) < 1) {
return (DNS_R_TEXTTOOLONG);
- r.base[0] = '\0';
- isc_buffer_add(&buf, 1);
+ }
+ isc_buffer_putuint8(&buf, '\0');
ctx->linebreak = ctx->linebreak_buf;
} else {
ctx->linebreak = NULL;
break;
} else {
dns_rdata_t rdata = DNS_RDATA_INIT;
- isc_region_t r;
dns_rdataset_current(rdataset, &rdata);
ctx->linebreak,
target));
- isc_buffer_availableregion(target, &r);
- if (r.length < 1)
+ if (isc_buffer_availablelength(target) < 1) {
return (ISC_R_NOSPACE);
- r.base[0] = '\n';
- isc_buffer_add(target, 1);
+ }
+ isc_buffer_putuint8(target, '\n');
}
first = false;
{
unsigned int column;
isc_result_t result;
- isc_region_t r;
REQUIRE(DNS_RDATASET_VALID(rdataset));
result = dns_rdataset_first(rdataset);
column += (target->used - type_start);
}
- isc_buffer_availableregion(target, &r);
- if (r.length < 1)
+ if (isc_buffer_availablelength(target) < 1) {
return (ISC_R_NOSPACE);
- r.base[0] = '\n';
- isc_buffer_add(target, 1);
+ }
+ isc_buffer_putuint8(target, '\n');
return (ISC_R_SUCCESS);
}
};
typedef struct isc__appctx {
- isc_appctx_t common;
- isc_mem_t *mctx;
- isc_eventlist_t on_run;
- isc_mutex_t lock;
+ isc_appctx_t common;
+ isc_mem_t *mctx;
+ isc_eventlist_t on_run;
+ isc_mutex_t lock;
bool shutdown_requested;
bool running;
/*
bool blocked;
- HANDLE hEvents[NUM_EVENTS];
+ HANDLE hEvents[NUM_EVENTS];
- isc_taskmgr_t *taskmgr;
- isc_socketmgr_t *socketmgr;
- isc_timermgr_t *timermgr;
+ isc_taskmgr_t *taskmgr;
+ isc_socketmgr_t *socketmgr;
+ isc_timermgr_t *timermgr;
} isc__appctx_t;
static isc__appctx_t isc_g_appctx;
isc_result_t
isc_app_ctxstart(isc_appctx_t *ctx0) {
isc__appctx_t *ctx = (isc__appctx_t *)ctx0;
- isc_result_t result;
REQUIRE(VALID_APPCTX(ctx));