DC_BUFFER_PREPEND(3)

πŸ“¦ version 0.9.0, in nixos 26.05, nixpkgs unstable

✨ NAME ✨

okay so bestie, welcome to dc_buffer_prepend(3) from the Library Functions Manual πŸ’–. The name is literally:

dc_buffer_prepend β€” prepend to a binary buffer

That’s the whole vibe: we’re prepending to a binary buffer, no cap. πŸŽ€

πŸŽ€ LIBRARY πŸŽ€

This one lives in the library β€œlibdivecomputer”. 🫢

🌸 SYNOPSIS 🌸

#include <libdivecomputer/buffer.h>

int
dc_buffer_prepend(dc_buffer_t *buffer, const unsigned char data[],
    size_t size);

πŸ’… DESCRIPTION πŸ’…

Here’s the tea: dc_buffer_prepend prepends size bytes of data to the beginning of buffer πŸ”₯. And buffer has to be one that was previously allocated with dc_buffer_new(3) β€” like, that’s the whole prerequisite, iykyk. ✨

πŸ¦‹ RETURN VALUES πŸ¦‹

The return value is giving:

  • non-zero on success πŸ‘‘
  • zero on memory exhaustion 😭
  • zero if buffer is NULL πŸ™ˆ

periodt. πŸ’…

🌈 SEE ALSO 🌈

πŸ‘‘ AUTHORS πŸ‘‘

The library β€œlibdivecomputer” library was written by Jef Driesen, jef@libdivecomputer.org. 🫢

The manpages were written by Kristaps Dzonsons, kristaps@bsd.lv. 🌸

🫢 cute sign-off: this page came from Debian, dated January 5, 2017, and yes bestie, it’s DC_BUFFER_PREPEND(3) πŸ’–βœ¨
πŸ“¦ where this page comes from