match_number(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ match_number(9) ✨

okay so this is a page from the Kernel API Manual, and it's literally about match_number β€” the lil function that scans a number in whatever base you want out of a substring_t πŸŽ€


🌸 NAME 🌸

match_number β€” scan a number in the given base from a substring_t πŸ’…

πŸ¦‹ SYNOPSIS πŸ¦‹

int match_number (substring_t *s , int *result , int base );

πŸ’– ARGUMENTS πŸ’–

  • s β€” the substring that's about to get scanned, bestie. it's giving "raw material" ✨
  • result β€” where the resulting integer lands if everything slays πŸŽ€
  • base β€” the base to use when converting the string, iykyk πŸ‘‘

🌈 DESCRIPTION 🌈

so you hand it a substring_t and a base, and it attempts to parse that substring as a number in that base. that's the whole vibe fr fr 🫢

⭐ RETURN ⭐

on success it sets result to the integer that the string represents and returns 0 β€” iconic, no notes πŸ’…

on failure it returns -EINVAL or -ERANGE. so like, if you see one of those, something did not eat 😭

ngl, check your return value. 0 means slay, negative means the parse did not survive the vibe check πŸ’€

🧚 SEE ALSO 🧚

kernel file ./lib/parser.c, plus the whole friend group:


and that's the whole page, bestie πŸ“ this one lives over in ./lib, dated October 2026, and it's filed under match_number(9) in the Kernel API Manual πŸ’œ go parse something cute πŸ’–βœ¨

πŸ“¦ where this page comes from