GETSNARF(3)

πŸ“¦ version 0_git20260208, in alpine 3.24, arch rolling, nixos 26.05, nixpkgs unstable

✨ GETSNARF(3) ✨

okay so bestie, this is GETSNARF(3) from the Library Functions Manual β€” the whole page is about the window system's snarf buffer, aka the cut-and-paste stash. it's giving clipboard lore, and honestly? iconic. πŸŽ€


πŸ’– NAME πŸ’–

  • getsnarf, putsnarf β€” window system snarf (cut and paste) buffer access, fr fr. 🫢

πŸ¦‹ SYNOPSIS πŸ¦‹

#include <draw.h>

char *getsnarf(void)

void putsnarf(char *text)

🌸 DESCRIPTION 🌸

getsnarf and putsnarf access the window system's snarf (cut and paste) buffer. yes, that's the vibe: one function reads the clipboard-ish thing, one function writes it. πŸ’…

  • getsnarf returns a copy of the current buffer. the returned pointer should be freed with free (see malloc(3)) when no longer needed. do not ghost that cleanup, bestie β€” free it when you're done. 🧚
  • putsnarf sets the buffer to the text string text. simple, clean, main character energy. ✨
lowkey important: callers should assume that the snarf buffer is UTF. if the window system does not keep the buffer in UTF, getsnarf and putsnarf will convert as necessary. no cap. 🌈

πŸ“ SOURCE πŸ“

/src/libdraw/snarf.c

πŸ‘‘ SEE ALSO πŸ‘‘


that's the whole page, and the footer vibe is: source /src/libdraw/snarf.c, manual/version GETSNARF(3), and the original footer doesn't print a date, so i'm not inventing one β€” periodt. πŸ’œπŸŽ€