ldns(3)

πŸ“¦
version 1.9.2 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, debian trixie, fedora 43, fedora 44, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– 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. if 0, the builtin maximum is used
  • Returns s 0 on error of EOF of b. 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 EOF on 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 (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 πŸ’–βœ¨πŸŽ€πŸ¦‹