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 intobuf. 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:
cgiwrap_iterenv(3)cgiwrap_putenv(3)cgiwrap_init_emu(3)cgiwrap_writef(3)cgiwrap_init_std(3)cgiwrap_writevf(3)cgiwrap_read(3)cgiwrap_write(3)cgiwrap_getenv
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 π«Άβ¨
π¦ where this page comes from
- debian bookworm: clearsilver-dev 0.10.5-4+b5
- debian trixie: clearsilver-dev 0.10.5-6+b1
- epel 10: clearsilver 0.10.5-80.el10_2 Β· Apache-1.1
- epel 9: clearsilver 0.10.5-74.el9 Β· Apache-1.1
- fedora 43: clearsilver 0.10.5-80.fc43 Β· Apache-1.1
- fedora 44: clearsilver 0.10.5-82.fc44 Β· Apache-1.1
- ubuntu jammy: clearsilver-dev 0.10.5-4build3
- ubuntu noble: clearsilver-dev 0.10.5-4build7
- ubuntu questing: clearsilver-dev 0.10.5-6build1
- ubuntu resolute: clearsilver-dev 0.10.5-7
- ubuntu stonking: clearsilver-dev 0.10.5-7build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms