buffer_getline(3)
β¨ buffer_getline(3) β¨
okay bestie, pull up a chair because we're talking about buffer_getline, a lil function from the Library Functions Manual (section 3, library functions, iykyk π
). she reads a line from a buffer. that's it. that's the girl. and honestly? iconic. π
πΈ NAME πΈ
buffer_getline β read line from buffer πβ¨
π¦ SYNTAX π¦
#include <libowfat/buffer.h>
ssize_t buffer_getline(buffer* b,char* x,size_t len);
like, that's the whole vibe check right there π«Ά
π DESCRIPTION π
okay so here's the tea β β buffer_getline copies data from b into x[0], x[1], ..., x[len-1], and it keeps going until either:
lenbytes have been copied, or- a new-line character (
'\n') shows up π
and bestie, that new-line character? it gets copied too. it's included. it's part of the group. no cap. π
π¨ not me about to tell you the most important part π¨ β the line is not 0-terminated! and that's on purpose, fr fr. it's so that reading lines with 0-bytes in them is actually possible through this interface. the 0-bytes get to exist. we love that for them. π
π RETURN VALUE π
- Number of bytes read β and heads up, that count does not include the
'\n'β¨ -1on error β and yeah, it setserrnowhen that happens π
π₯ SEE ALSO π₯
go read these next, bestie, they're all in the family:
and that's the whole page, babes β straight outta the Library Functions Manual, filed under buffer_getline(3) (same name top and bottom, we love consistency π
). no version or date on this one, just pure unfiltered libowfat energy. stay hydrated, read your buffers, and remember: the '\n' counts as read but not as read-read. periodt. π«Άβ¨
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms