match_number(9)
β¨ 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:
match_one(9)match_token(9)match_u64int(9)match_int(9)match_uint(9)match_u64(9)match_octal(9)match_hex(9)match_wildcard(9)match_strlcpy(9)match_strdup(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms