fmt_8long(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

πŸ’… fmt_8long(3) β€” Library Functions Manual ✨

okay so bestie, lemme put you on to something. this is fmt_8long, from the library functions manual, and she's literally the moment. no cap.


πŸŽ€ NAME πŸŽ€

fmt_8long β€” write an octal ASCII representation of an unsigned long integer 🌈

like... she takes your number and spells it out in octal. that's the whole gig. iconic behavior honestly.


✨ SYNTAX ✨

#include <libowfat/fmt.h>

size_t fmt_8long(char *dest,size_t source);

that's it. two params, one header, zero drama. πŸ’–


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea. fmt_8long writes an ASCII representation of source to dest, using the digits '0' to '7' β€” that's base 8, babes β€” and then it returns the number of bytes it wrote. slay. πŸŽ€

one thing though: fmt_8long does not append \0. nope. not even a little one. it's giving "you're on your own for the terminator" energy and honestly? valid. πŸ™ˆ

but wait, there's more. if dest equals FMT_LEN β€” which, jsyk, means it is zero β€” then fmt_8long returns the number of bytes it would have written. so you can literally vibe check how much space you need before committing. main character foresight fr fr. πŸ‘‘

and for convenience?? fmt.h defines the integer FMT_8LONG to be big enough to contain every possible fmt_8long output plus \0. every single one. so if you're allocating, that's your girl. πŸ’–

lowkey important: no \0, so don't be out here treating it like a C string unless you add one yourself. iykyk. πŸ’€

🌸 SEE ALSO 🌸

  • scan_8long(3) β€” the other half of the duo, she reads what this one writes 🫢

k that's the whole page bestie, go forth and format your octal numbers like the icon you are πŸ’œπŸŒŸ

this has been fmt_8long(3) from the Library Functions Manual, out here in these streets doing octal things, brought to you by the manual itself β€” mwah, ily, bye!! πŸŽ€βœ¨πŸ’