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) β€” buffer positioning, but make it cute πŸ’–

okay bestie, so this is a page from the ldns library functions manual (the ldns(3) one, iykyk) and it's literally all about where you are inside a buffer. position, flip, rewind, skip β€” the whole choreography. let's get into it πŸ¦‹


✨ NAME ✨

ldns_buffer_flip, ldns_buffer_rewind, ldns_buffer_position, ldns_buffer_set_position, ldns_buffer_skip β€” buffer positioning, aka knowing exactly where u stand πŸ’…


🌸 SYNOPSIS 🌸

#include <stdint.h>
#include <stdbool.h>

#include <ldns/ldns.h>

void ldns_buffer_flip(ldns_buffer *buffer);

void ldns_buffer_rewind(ldns_buffer *buffer);

size_t ldns_buffer_position(const ldns_buffer *buffer);

void ldns_buffer_set_position(ldns_buffer *buffer, size_t mark);

void ldns_buffer_skip(ldns_buffer *buffer, ssize_t count);

πŸ’œ DESCRIPTION πŸ’œ

🌈 ldns_buffer_flip()

ldns_buffer_flip() makes the buffer ready for reading the data that has been written to the buffer. the way it does this?? the buffer's limit is set to the current position, and the position is set to 0. it's giving "we're done writing, now we read" energy ✨

  • buffer β€” the buffer to flip 🫢
  • Returns void

πŸŽ€ ldns_buffer_rewind()

ldns_buffer_rewind() makes the buffer ready for re-reading the data. the buffer's position is reset to 0. no cap, it just rewinds u right back to the start πŸ”

  • buffer β€” the buffer to rewind

πŸ¦‹ ldns_buffer_position()

ldns_buffer_position() returns the current position in the buffer, measured as a number of bytes. this is ur little "where am i rn" check-in πŸ₯Ί

  • buffer β€” the buffer
  • Returns the current position

🌸 ldns_buffer_set_position()

ldns_buffer_set_position() sets the buffer's position to MARK. heads up though: the position must be less than or equal to the buffer's limit. don't be out here setting positions past the limit, that's not the vibe πŸ™ˆ

  • buffer β€” the buffer
  • mark β€” the mark to use

πŸ‘‘ ldns_buffer_skip()

ldns_buffer_skip() changes the buffer's position by COUNT bytes. and again, the position must not be moved behind the buffer's limit or before the beginning of the buffer. so like… stay in bounds, bestie πŸ’€

  • buffer β€” the buffer
  • count β€” the count to use

🌟 AUTHOR 🌟

The ldns team at NLnet Labs. iconic behaviour, honestly πŸ‘‘


πŸ› REPORTING BUGS πŸ›

found a bug?? don't just scream into the group chat β€” please report bugs to dns-team@nlnetlabs.nl or on GitHub at https://github.com/NLnetLabs/ldns/issues πŸ’Œ


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, no warranty. none. zero. don't come for them 😭

πŸ” SEE ALSO πŸ”


🧚 REMARKS 🧚

This manpage was automatically generated from the ldns source code. so like, a robot wrote it. and then i rewrote it. slay πŸ’…βœ¨


and that's the whole page!! πŸ’– this one's from the ldns(3) manual, dated 30 May 2006 β€” yes it's an elder but it ATE, and it's still serving buffer positioning realness to this day. mwah 🫢🌸