scan_uuencoded(3)

✨ scan_uuencoded β€” the manual, but make it cute ✨

okay bestie, so this page is from the Library Functions Manual, and it's literally all about scan_uuencoded(3). it decodes uuencoded data. yes THAT uuencode. the vintage one. she's old but she ate πŸ’…


πŸ’– NAME πŸ’–

scan_uuencoded β€” decode uuencoded data. that's the whole job description. no cap.


🌸 SYNTAX 🌸

#include <libowfat/textcode.h>

size_t scan_uuencoded(const char *src,char *dest,size_t* destlen);

like, you gotta pull in <libowfat/textcode.h> first or she simply will not know what you're talking about 🫢


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the vibe: scan_uuencoded decodes uuencoded data from src into dest. that's the main character move.

the way it works is it will stop the second it encounters any non-valid input characters. like, she has boundaries. 🚧 and when she stops, she writes the number of decoded bytes that landed in dest into *destlen, and returns the number of bytes she decoded out of src. two numbers, two places, keep track of both, i promise it's not that deep.

⚠️ heads up fr fr: real world uuencoded data is sometimes permitted to contain whitespace characters or new lines. this function will not allow those, and will return the decoded data up until then. so like, if your input is being a little sloppy with spaces, she's gonna tap out early. that's just the deal. 😭

now, the lore: uudecoding works on lines, and the first byte in each line contains the length of the line (encoded, obviously πŸ’…). scan_uuencoded expects one such line as input, and it will decode all the bytes in it. one line in, all the bytes out. periodt.

also important: uuencoded data can contain bytes from 0x21 to 0x96, which means it is not "string safe" β€” it can contain single and double quotes and backslash. so pls do not just yeet this into a string and expect everything to be chill, because it will not be. πŸ™ˆ

and the flexible queen energy: dest can be NULL. destlen can be NULL. dest can be src. in-place decoding, we love to see it πŸ‘‘


πŸ”₯ RETURN VALUE πŸ”₯

scan_uuencoded returns the number of bytes successfully scanned and processed from src. that's it. that's the number. take it, use it, slay. ✨


πŸŽ€ EXAMPLES πŸŽ€

here's the little demo, exactly as written:

scan_uuencoded("&9FYO<F0*",buf,&i) -> return 9, i=5, buf="fnord"

so: she returns 9, i becomes 5, and buf ends up as "fnord". iconic honestly. fnord. no notes. 🌈


πŸ’œ SEE ALSO πŸ’œ

go read those too, they're the friend group 🫢


and that's the whole page bestie πŸ’– this was scan_uuencoded(3) from the Library Functions Manual β€” no extra version stamps or dates to hand you, just the manual name itself, so take that as the sign-off. stay string-unsafe-aware, decode one line at a time, and drink some water. mwah πŸ’…βœ¨