stralloc_starts(3)
β¨ stralloc_starts β bestie, is this string a prefix or not β¨
okay so this one's a lil function from the libowfat girlies, and she's literally just a yes-or-no girlie. no cap.
πΈ NAME πΈ
stralloc_starts β check if a string is a prefix of a stralloc π
π SYNTAX π
#include <libowfat/stralloc.h>
int stralloc_starts(stralloc* sa,const char* in);
that's it. that's the whole vibe. two args, one int, zero drama. π¦
π DESCRIPTION π
okay so stralloc_starts returns 1 if the \0-terminated string in in β like, without the terminating \0, bestie, we're not counting the little guy β is a prefix of the string stored in sa.
otherwise? she returns 0. that's it. that's the whole thing. π
β οΈ okay important one:samust already be allocated. like, do not come to her with an unallocatedsa, she will not be helping you, fr fr. this is not a maybe, this is a must. π
so like, think of it as: does sa start with in? if yes β 1, if no β 0. slay. π
β RETURN VALUE β
1ifinis a prefix ofsaπ0otherwise π
no in-between, no "it depends", no "well actually". just the two. iconic behaviour, honestly. β¨
π SEE ALSO π
str_starts(3)
this page lives in the Library Functions Manual, and it's the stralloc_starts(3) girlie herself β that's the whole header/footer situation, no extra version or date tag along for the ride. anyway ily, go allocate your sa first, mwah ππ
π«ΆπΈ
π¦ 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