TERMKEY_SET_BUFFER_SIZE(3)

πŸ’– TERMKEY_SET_BUFFER_SIZE(3) πŸ’–

okay bestie, welcome to the Library Functions Manual ✨ this one's short and sweet, it's literally just about how big the buffer inside your termkey thing is. two lil functions, one job. we love a focused queen πŸ‘‘


🌸 NAME 🌸

termkey_set_buffer_size, termkey_get_buffer_size β€” control the buffer size πŸŽ€


✨ SYNOPSIS ✨

#include <termkey.h>

int termkey_set_buffer_size(TermKey *tk, size_t size);
size_t termkey_get_buffer_size(TermKey *tk);

Link with -ltermkey.

don't forget the link flag bestie, the linker will NOT be forgiving 😭


πŸ¦‹ DESCRIPTION πŸ¦‹

so termkey_set_buffer_size() changes the size of the buffer space inside your termkey(7) instance to whatever size you hand it. glow-up for your buffer, no cap πŸ’…

and here's the cute part: any bytes still pending in the buffer are preserved when you resize 🫢 but β€” and this is the plot twist β€” they get truncated if your new size is smaller than the total number of bytes currently chillin' in the buffer. so if you shrink it too hard, data goes poof. be mindful, queen πŸ™ˆ

then termkey_get_buffer_size() just tells you the size of the buffer set by the last call to termkey_set_buffer_size(). and if you never called it? it returns the default initial size of 256 bytes. the factory setting. the OG. periodt ⭐


πŸ‘‘ RETURN VALUE πŸ‘‘

  • termkey_set_buffer_size() returns a true value, or zero if an error occurs. so like, zero = it's giving error energy πŸ’€
  • termkey_get_buffer_size() returns the current buffer size in bytes. simple. iconic. no notes ✨

🌈 SEE ALSO 🌈

go read those next bestie, they're all in the same friend group πŸ§šπŸ’œ


k byeeee πŸ’– this was TERMKEY_SET_BUFFER_SIZE(3) from the Library Functions Manual β€” that's the whole source/version vibe we got, and no date on this one so I'm not gonna make one up, slay responsibly βœ¨πŸŽ€πŸ¦‹