2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00

Simplify dns_name_init()

Remove the now-unused offsets parameter from dns_name_init().
This commit is contained in:
Ondřej Surý
2025-02-21 12:09:39 +01:00
parent 08e966df82
commit 04c2c2cbc8
95 changed files with 531 additions and 544 deletions

View File

@@ -610,19 +610,6 @@ both dynamically and statically allocated, relative and absolute,
compressed and not, with straightforward conversions from text to
wire format and vice versa.
##### Initializing
When a name object is initialized, a pointer to an "offset table"
(`dns_offsets_t`) may optionally be supplied; this will improve
performance of most name operations if the name is used more than
once.
dns_name_t name1, name2;
dns_offsets_t offsets1;
dns_name_init(&name1, &offsets1);
dns_name_init(&name2, NULL);
##### Copying
There are three methods for copying name objects:
@@ -641,7 +628,7 @@ There are three methods for copying name objects:
isc_buffer_t buffer;
isc_buffer_init(&buffer, namedata, sizeof(namedata));
dns_name_init(&target, NULL);
dns_name_init(&target);
dns_name_setbuffer(target, &buffer);
dns_name_copy(source, &target);
@@ -687,7 +674,7 @@ name.
isc_buffer_t buf;
dns_name_t name;
dns_name_init(&name, NULL);
dns_name_init(&name);
isc_buffer_init(&buf, namedata, sizeof(namedata));
isc_buffer_add(&buf, strlen(text));
result = dns_name_fromtext(&name, &buf, dns_rootname, 0, NULL);

View File

@@ -366,8 +366,8 @@ Typical use:
dns_name_t name, prefix;
bool sub;
dns_name_init(&name, NULL);
dns_name_init(&prefix, NULL);
dns_name_init(&name);
dns_name_init(&prefix);
dns_rdata_toregion(rdata, &region);
dns_name_fromregion(&name, &region);
sub = name_prefix(&name, origin, &prefix);