STRUNTABIFY(3pub)

πŸ’– STRUNTABIFY πŸ’–

okay bestie, welcome to the publib corner of the C Programmer's Manual, where we turn your chaotic tab situation into something the timeline can actually render ✨


🌸 NAME 🌸

struntabify β€” literally just convert tabs to spaces, no cap 🫢


πŸŽ€ SYNOPSIS πŸŽ€

#include <publib.h>
char *struntabify(char *str, size_t tabsize);

✨ DESCRIPTION ✨

so here's the vibe: struntabify will convert all tab characters ('\t') in the string str to spaces. every single one. not a single tab survives, periodt πŸ’…

tab positions are at every tabsize columns. that's the whole layout logic, iykyk.

⚠️ important bestie: the string is supposed to be big enough to hold the conversion, because the whole thing is done in place. no new buffer, no escape hatch, no take-backs. if it's not big enough… that's on you, not me 😭

πŸ”₯ RETURN VALUE πŸ”₯

struntabify will return its first argument. that's it. that's the return. iconic, honestly πŸ‘‘


πŸ¦‹ SEE ALSO πŸ¦‹


πŸ’œ AUTHOR πŸ’œ

Lars Wirzenius (lars.wirzenius@helsinki.fi) β€” the main character who wrote this fr fr πŸŽ€


and that's the whole page, bestie! this little love letter lives in Publib, under the C Programmer's Manual, as STRUNTABIFY(3pub) β€” go forth and untabify responsibly πŸŒˆπŸ’–

πŸ“¦ where this page comes from