cgiGetFiles(3)

πŸ“¦ version 0.6, in ubuntu jammy

πŸ’– cgiGetFiles(3) β€” the Programmer's Manual era πŸ’–

okay so bestie, this one lives in section 3 of the Programmer's Manual, and it's genuinely one of the chillest little functions in the CGI library. it's giving "tiny helper, big slay" ✨


🌸 NAME 🌸

cgiGetFiles β€” returns a list of CGI file variables πŸŽ€


✨ SYNOPSYS ✨

(yes bestie, that's literally how it's spelled in the manual. we don't make the rules, we just respect the source πŸ’…)

#include <cgi.h>

char **cgiGetFiles (s_cgi *parms);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so what does this do? this routine hands you back a NULL terminated array of the names of the CGI file variables that are available. that's it, that's the whole vibe. it's a little name-drop list, not the actual contents πŸ‘‘

if you want the details, those are provided with the cgiGetFile(3) function β€” that's the one that actually spills the tea about each file. cgiGetFiles is just the girl who tells you who's coming to the party 🫢

and the important bit, bestie: to free the memory allocated for the array, use cgiFreeList(3). do not skip this. she allocated that memory for you and she expects it back. it's literally the polite thing to do 😭


🌈 RETURN VALUE 🌈

  • on success β†’ a NULL terminated array of strings is returned, and the last element is set to NULL. classic sentinel behaviour, we love to see it ✨
  • if an error occurred, or if no files variables are available β†’ NULL is returned. so if you get NULL, it's either a yikes or a "there's just nothing here", and honestly both are valid πŸ₯²
lowkey always check for NULL before you go looping through that array, bestie. main character energy means reading the return value πŸ’…

πŸ‘‘ AUTHOR πŸ‘‘

this CGI library is written by Martin Schulze <joey@infodrom.org>. if you have additions or improvements, please get in touch with him β€” he's literally accepting fan mail and patch notes πŸŽ€


πŸ”₯ SEE ALSO πŸ”₯

go read them, they're all part of the same friend group fr fr πŸ¦‹


and that's the whole page, bestie β€” this one's from the CGI Library, dated 6 April 2008. a vintage icon, no cap. now go free your lists πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from
  • ubuntu jammy: cgilib 0.6-1.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms