Lines Matching +defs:current +defs:buffer
24 #include <isc/buffer.h>
273 dns_totext_ctx_t *ctx, isc_buffer_t *buffer,
283 * Output tabs and spaces to go from column '*current' to
284 * column 'to', and update '*current' to reflect the new
285 * current column.
288 indent(unsigned int *current, unsigned int to, int tabwidth,
295 from = *current;
348 *current = to;
415 * buffer is too small, because that would just make
417 * bigger target buffers. That's a different buffer,
488 /* NUL terminate buffer for string operations below */
816 * times with increasing buffer sizes until it succeeds,
965 * Print an rdataset. 'buffer' is a scratch buffer, which must have been
968 * the buffer will be grown automatically.
973 dns_totext_ctx_t *ctx, isc_buffer_t *buffer, FILE *f) {
977 REQUIRE(buffer->length > 0);
988 isc_buffer_clear(buffer);
990 true, buffer);
992 isc_buffer_usedregion(buffer, &r);
1003 isc_buffer_clear(buffer);
1007 * the buffer. If the buffer is too small, grow it.
1012 result = rdataset_totext(rdataset, name, ctx, false, buffer);
1017 newlength = buffer->length * 2;
1019 isc_mem_put(mctx, buffer->base, buffer->length);
1020 isc_buffer_init(buffer, newmem, newlength);
1027 * Write the buffer contents to the master file.
1029 isc_buffer_usedregion(buffer, &r);
1096 isc_buffer_t *buffer, FILE *f) {
1107 isc_buffer_clear(buffer);
1108 itresult = dns_name_totext(ctx->neworigin, 0, buffer);
1110 isc_buffer_usedregion(buffer, &r);
1172 result = dump_rdataset(mctx, name, rds, ctx, buffer, f);
1226 dns_rdataset_t *rdataset, isc_buffer_t *buffer, FILE *f) {
1232 REQUIRE(buffer->length > 0);
1241 isc_buffer_clear(buffer);
1246 * can store all of them in the initial buffer.
1248 isc_buffer_availableregion(buffer, &r_hdr);
1250 isc_buffer_putuint32(buffer, totallen); /* XXX: leave space */
1251 isc_buffer_putuint16(buffer, rdataset->rdclass); /* 16-bit class */
1252 isc_buffer_putuint16(buffer, rdataset->type); /* 16-bit type */
1253 isc_buffer_putuint16(buffer, rdataset->covers); /* same as type */
1254 isc_buffer_putuint32(buffer, rdataset->ttl); /* 32-bit TTL */
1255 isc_buffer_putuint32(buffer, dns_rdataset_count(rdataset));
1256 totallen = isc_buffer_usedlength(buffer);
1260 INSIST(isc_buffer_availablelength(buffer) >= (sizeof(dlen) + r.length));
1262 isc_buffer_putuint16(buffer, dlen);
1263 isc_buffer_copyregion(buffer, &r);
1275 * Copy the rdata into the buffer. If the buffer is too small,
1280 if (isc_buffer_availablelength(buffer) <
1286 newlength = buffer->length * 2;
1288 isc_mem_put(mctx, buffer->base, buffer->length);
1289 isc_buffer_init(buffer, newmem, newlength);
1292 isc_buffer_putuint16(buffer, dlen);
1293 isc_buffer_copyregion(buffer, &r);
1306 * for the total length in the buffer, we first remember the entire
1307 * buffer length in the region, "rewind", and then write the value.
1309 isc_buffer_usedregion(buffer, &r);
1310 isc_buffer_clear(buffer);
1311 isc_buffer_putuint32(buffer, totallen);
1312 INSIST(isc_buffer_usedlength(buffer) < totallen);
1315 * Write the buffer contents to the raw master file.
1331 isc_buffer_t *buffer, FILE *f) {
1353 buffer, f);
1369 * Initial size of text conversion buffer. The buffer is used
1647 isc_buffer_t buffer;
1655 isc_buffer_init(&buffer, bufmem, initial_buffer_length);
1670 result = dns_time32_totext(dctx->now, &buffer);
1672 isc_buffer_usedregion(&buffer, &r);
1680 isc_buffer_region(&buffer, &r);
1687 isc_buffer_putuint32(&buffer, dctx->format);
1688 isc_buffer_putuint32(&buffer, rawversion);
1689 isc_buffer_putuint32(&buffer, now32);
1692 isc_buffer_putuint32(&buffer, dctx->header.flags);
1693 isc_buffer_putuint32(&buffer,
1695 isc_buffer_putuint32(&buffer, dctx->header.lastxfrin);
1698 INSIST(isc_buffer_usedlength(&buffer) <= sizeof(rawheader));
1699 result = isc_stdio_write(buffer.base, 1,
1700 isc_buffer_usedlength(&buffer),
1711 isc_mem_put(dctx->mctx, buffer.base, buffer.length);
1718 isc_buffer_t buffer;
1730 isc_buffer_init(&buffer, bufmem, initial_buffer_length);
1772 &dctx->tctx, &buffer, dctx->f);
1787 isc_mem_put(dctx->mctx, buffer.base, buffer.length);