scan_plusminus(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ scan_plusminus(3) ✨

okay so bestie, welcome to scan_plusminus(3) from the Library Functions Manual πŸ’– this one is short and sweet and honestly kind of iconic for it.


🌸 NAME 🌸

scan_plusminus β€” parse '+' or '-' πŸŽ€


🌈 SYNTAX 🌈

#include <libowfat/scan.h>

size_t scan_plusminus(const char *src,int *dest);

πŸ’… DESCRIPTION πŸ’…

so here's the vibe: scan_plusminus looks at src and checks for an ASCII '+' or '-' sign. that's it. that's the whole job. no cap πŸ’«

  • if it finds a '+', it sets *dest to 1 and returns 1 ✨
  • if it finds a '-', it sets *dest to -1 and returns 1 ✨

and if neither one is there? lowkey chill about it β€” '+' is assumed, and 0 is returned instead. 🫢

fr fr: return value 0 β‰  error, it just means "no sign, and I'm assuming '+' for you". bestie behaviour honestly 😭

and that's the whole page, this was scan_plusminus(3) from the Library Functions Manual, section 3 πŸ’œ she's small, she's perfect, she does exactly one thing and she ate πŸ‘‘