fmt_plusminus(3)
π fmt_plusminus(3) π
okay so bestie, we're in the Library Functions Manual and today's main character is fmt_plusminus β the tiniest, most unbothered little formatter in all of libowfat. she does ONE thing and she does it flawlessly. periodt. π
β¨ NAME β¨
fmt_plusminus β write '+' or '-'
like... that's it. that's the whole job. and honestly? iconic.
πΈ SYNTAX πΈ
#include <libowfat/fmt.h>
size_t fmt_plusminus(char *dest,signed int source);
no cap, that's the whole signature. two args, one size_t back. we love a low-maintenance queen. π«Ά
π¦ DESCRIPTION π¦
okay so here's the vibe check. fmt_plusminus looks at source and writes exactly one character into dest:
- if
sourceis negative β it writes'-'π - if
sourceis positive β it writes'+'β¨ - if
sourceis neither (aka zero, aka the neutral icon) β it writes nothing at all π
then it returns the number of bytes written. that's the return value, bestie, don't sleep on it.
heads up fr fr:fmt_plusminusdoes not append\0. no null terminator, no little goodbye note, nothing. if you were expecting a cute lil string ending you're gonna have to handle that yourself. π
and here's the fun part β if dest equals FMT_LEN (i.e. is zero), fmt_plusminus returns the number of bytes it would have written. it's giving "window shopping" energy. no actual writing happens, she's just telling you how much space she'd need. π
β SEE ALSO β
go read those too, iykyk, they're the friend group. π
and that's the whole page, babe!! this was fmt_plusminus(3) from the Library Functions Manual β mwah, go format something cute, ily, bye!! ππ¦πΈ
π¦ 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