ldns(3)
β¨ ldns β the ldns_rdf glow-up guide β¨
okay bestie, so this is the ldns library functions manual, and today's episode is all about ldns_rdf β making them, copying them, destroying them, and showing them off. π
the functions we're covering: ldns_rdf_new, ldns_rdf_clone, ldns_rdf_new_frm_data, ldns_rdf_new_frm_str, ldns_rdf_new_frm_fp, ldns_rdf_free, ldns_rdf_deep_free, and ldns_rdf_print. that's the whole squad. π«Ά
πΈ SYNOPSIS πΈ
so first things first, you gotta bring the headers in:
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
and here's every single signature, verbatim, no cap:
ldns_rdf* ldns_rdf_new(ldns_rdf_type type, size_t size, void *data);
ldns_rdf* ldns_rdf_clone(const ldns_rdf *rd);
ldns_rdf* ldns_rdf_new_frm_data(ldns_rdf_type type, size_t size, const
void *data);
ldns_rdf* ldns_rdf_new_frm_str(ldns_rdf_type type, const char *str);
ldns_status ldns_rdf_new_frm_fp(ldns_rdf **r, ldns_rdf_type type, FILE
*fp);
void ldns_rdf_free(ldns_rdf *rd);
void ldns_rdf_deep_free(ldns_rdf *rd);
void ldns_rdf_print(FILE *output, const ldns_rdf *rdf);
π DESCRIPTION π
this is the main character section, let's go function by function. π
ldns_rdf_new()
allocates a new rdf structure and fills it. but listen β this function DOES NOT copy the contents from the buffer, unlike ldns_rdf_new_frm_data(). that's the whole plot twist, remember it. π
typeβ type of the rdfsizeβ size of the bufferdataβ pointer to the buffer to be copied
Returns the new rdf structure or NULL on failure.
ldns_rdf_clone()
clones a rdf structure. the data is copied. it's giving photocopy machine energy. π¦
rdβ rdf to be copied
Returns a new rdf structure.
ldns_rdf_new_frm_data()
allocates a new rdf structure and fills it. this one _does_ copy the contents from the buffer, unlike ldns_rdf_new(). the two are literally opposites, iykyk. π
typeβ type of the rdfsizeβ size of the bufferdataβ pointer to the buffer to be copied
Returns the new rdf structure or NULL on failure.
ldns_rdf_new_frm_str()
creates a new rdf from a string. string in, rdf out, slay. β¨
typeβ type to usestrβ string to use
Returns ldns_rdf* or NULL in case of an error.
ldns_rdf_new_frm_fp()
creates a new rdf from a file containing a string. very "reading the assignment off the file" of it. π
rβ the new rdftypeβ type to usefpβ the file pointer to use
Returns LDNS_STATUS_OK or the error.
ldns_rdf_free()
frees a rdf structure, leaving the data pointer intact. it's a shallow goodbye, not a deep one. π
rdβ the pointer to be freed
Returns void.
ldns_rdf_deep_free()
frees a rdf structure _and_ frees the data. so this one goes all the way. rdf should be created with _new_frm_data β remember that, because if you didn't make it that way, that's a whole situation. π
rdβ the rdf structure to be freed
Returns void.
ldns_rdf_print()
prints the data in the rdata field to the given file stream (in presentation format). the rdf's little red-carpet moment. π
outputβ the file stream to print tordfβ the rdata field to print
Returns void.
π AUTHOR π
the ldns team at NLnet Labs. iconic behaviour, honestly.
π REPORTING BUGS π
please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues. besties, tell them everything, they want to know. π«Ά
π COPYRIGHT π
Copyright (c) 2004 - 2006 NLnet Labs.
Licensed under the BSD License.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. fr fr, none. zero. don't come for them. π
π¦ SEE ALSO π¦
π REMARKS π
This manpage was automatically generated from the ldns source code. not me getting a whole page written about me by a robot, we love a hands-off queen. β
and that's the tea, bestie β this little love letter came from the 30 May 2006 release of the ldns(3) manual. go forth and rdf responsibly. ππΈβ¨
π¦ where this page comes from
- alpine 3.22: ldns-doc 1.8.4-r0 Β· BSD-3-Clause
- alpine 3.23: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- alpine 3.24: ldns-doc 1.8.4-r1 Β· BSD-3-Clause
- arch rolling: ldns 1.9.2-1 Β· custom:BSD
- debian trixie: libldns-dev 1.8.4-2+b1
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.8.4-8.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 43: ldns-devel 1.9.2-1.fc43 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.0-2.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- fedora 44: ldns-devel 1.9.2-1.fc44 Β· BSD-3-Clause
- nixos 26.05: ldns 1.9.2
- nixpkgs unstable: ldns 1.9.2
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- opensuse-leap 16.0: ldns-devel 1.8.4-160000.3.1 Β· BSD-3-Clause
- ubuntu questing: libldns-dev 1.8.4-2build1
- ubuntu resolute: libldns-dev 1.8.4-2build3
- ubuntu stonking: libldns-dev 1.9.2-1ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms