cgiwrap_read(3)

πŸ’– cgiwrap_read β€” cgiwrap input function πŸ’–

okay bestie, welcome to the cgi/cgiwrap.h section of the manual, page cgiwrap_read(3), and yes you're gonna be obsessed. this one's short and sweet, like a little strawberry πŸ“ of a function. let's get into it.


✨ NAME ✨

cgiwrap_read β€” the cgiwrap input function. it reads stuff in. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <cgi/cgiwrap.h>

void cgiwrap_read (char *buf, int buf_len, int *read_len);

look at that. three args. no cap. πŸŽ€


πŸ¦‹ ARGUMENTS πŸ¦‹

  • buf β€” a pre-allocated buffer that you're reading the data into. you gotta bring your own buffer, bestie, this function is not about to make one for you. πŸ™ˆ
  • buf_len β€” the size of that pre-allocated buffer. it needs to know how much room it's working with, obviously. ✨
not me noticing read_len isn't in the ARGUMENTS list… it's down in RETURN VALUE, iykyk, keep reading πŸ‘‘

πŸ’œ DESCRIPTION πŸ’œ

so cgiwrap_read is what you use to read incoming data from the client β€” usually the stuff coming in from a POST or a PUT HTTP request. 🌈

it wraps the part of fread(stdin). literally that's it. it's giving "glorified fread but make it cgiwrap" and honestly? iconic. πŸ‘‘


⭐ RETURN VALUE ⭐

  • read_len β€” the number of bytes read into buf. so after it runs, that pointer is holding how much actually landed in your buffer. πŸ’–

πŸ”₯ SEE ALSO πŸ”₯

go read these too, bestie, they're all in the same friend group:


and that's the page!! πŸ’œ this was brought to you by the ClearSilver era, dated 12 July 2007 β€” yeah she's a vintage queen πŸ‘‘ and she still slays. mwah, go read your stdin responsibly, ily, bye 🫢✨