ldns(3)
π ldns(3) β the library functions manual, bestie edition π
okay so welcome to ldns(3), the Library Functions Manual page, and today's lineup is genuinely iconic: ldns_bget_token, ldns_bgetc, and ldns_bskipcs β aka get tokens from buffers. yes. that's the whole vibe. let's get into it π«Ά
β¨ NAME β¨
ldns_bget_token, ldns_bgetc, ldns_bskipcs β get tokens from buffers
πΈ SYNOPSIS πΈ
#include <stdint.h>
#include <stdbool.h>
#include <ldns/ldns.h>
ssize_t ldns_bget_token(ldns_buffer *b, char *token, const char *delim,
size_t limit);
int ldns_bgetc(ldns_buffer *buffer);
void ldns_bskipcs(ldns_buffer *buffer, const char *s);
like. look at those signatures. gorgeous. no notes π
π¦ DESCRIPTION π¦
okay bestie, three functions, three little moments of buffer-reading magic. here we go:
ldns_bget_token()
ldns_bget_token() returns a token/char from the buffer b. she's the main character here fr fr.
- she deals with
(and)in the buffer, and ignores when she finds them. so they're just... not the drama. she moves on. iconic behavior honestly. *b: the buffer to read from*token: the token is put here*delim: chars at which the parsing should stop*limit: how much to read. if0, the builtin maximum is used- Returns
s0on error of EOF ofb. otherwise, return the length of what is read
not me rereading "Returns s 0 on error of EOF of b" like five times π it's in the original, so it's staying, periodt.
ldns_bgetc()
ldns_bgetc() returns the next character from a buffer. she advances the position pointer with 1 β one step at a time, queen.
- when end of buffer is reached, returns
EOF - this is the buffer's equivalent for
getc(). yes, the glow-up is real β¨ *buffer: buffer to read from- Returns
EOFon failure, otherwise return the character
ldns_bskipcs()
ldns_bskipcs()... no wait, ldns_bskipcs() skips all of the characters in the given string in the buffer, moving the position to the first character that is not in *s. she's not ignoring you, she's just skipping the ones you named. it's giving selective β¨
*buffer: buffer to use*s: characters to skip- Returns
voidβ she gives you nothing back and that's the point π
π AUTHOR π
The ldns team at NLnet Labs.
π REPORTING BUGS π
Please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues
(if you find a bug, tell them, don't suffer in silence bestie π«Ά)
π 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.
no warranty fr fr. none. zero. don't come for them if it breaks, that's the deal π
π SEE ALSO π
ldns_buffer. And perldoc Net::DNS, RFC1034, RFC1035, RFC4033, RFC4034 and RFC4035.
iykyk, go read the RFCs, they're right there π§
β REMARKS β
This manpage was automatically generated from the ldns source code.
(so if the prose is a little feral, blame the generator, not me π )
and that's the page!! thank you for coming to my ted talk πΈ
this whole thing is ldns(3) from 30 May 2006 β yes, the date at the bottom of the original, and she's still slaying in the library functions manual. bye bestie, go read a buffer πβ¨ππ¦
π¦ 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