stralloc_chop(3)
π stralloc_chop β the manual page, but make it cute π
okay bestie, welcome to stralloc_chop(3) from the Library Functions Manual β¨ this one is short, sweet, and honestly iconic β she pops the last character off a string and hands it to you. no cap. π
πΈ NAME πΈ
stralloc_chop β remove and return last char π«Ά
β¨ SYNTAX β¨
lowkey just this, bestie:
#include <libowfat/stralloc.h>
int stralloc_chop(stralloc* sa);
π¦ DESCRIPTION π¦
so here's the vibe: stralloc_chop removes the last char in the stralloc. that's it. that's the whole job. π
and if the stralloc is empty? she simply does nothing and returns -1. not dramatic, just unbothered. π
the character she chops off gets cast to unsigned char and then returned to you. yes, cast to unsigned char β remember that part, it's giving "details matter". π
π RETURN VALUE π
- the chopped character π β that's your girl, handed right back to you
- or
-1if the string was empty π (nothing to chop, nothing to give)
π SEE ALSO π
stralloc_chomp(3)β her sibling, the one who eats trailing newlines instead. iykyk. π§
and that's the page, bestie! this lil' gem lives in the Library Functions Manual and goes by stralloc_chop(3). go forth and chop responsibly. πβ¨
π¦ 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