KHTTP_PUTC(3)

πŸ“¦ version 1.0.1, in alpine 3.24

πŸ’– KHTTP_PUTC(3) β€” put character content for kcgi πŸ’–

Hiii bestie, welcome to KHTTP_PUTC(3) from the Library Functions Manual β€” this is the little character-pusher for kcgi, and yes, she ate. πŸŽ€


🌸 LIBRARY 🌸

library β€œlibkcgi” β€” that's the one, no cap. πŸ¦‹


✨ SYNOPSIS ✨

#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <kcgi.h>

enum kcgi_err
khttp_putc(struct kreq *req, int c);

πŸ’… DESCRIPTION πŸ’…

Okay so khttp_putc writes a character c β€” converted to an unsigned char, bestie, don't forget that glow-up β€” into a kcgi(3) context req that was allocated with khttp_parse(3) or khttp_fcgi_parse(3). 🫢

Call it only after khttp_body(3), okay? That's the vibe check. ✨

⚠️ Bestie warning: if kcgi_writer_disable(3) has been previously invoked, this function will abort(3). Not cute, not slay β€” just facts. πŸ’€

πŸ”₯ RETURN VALUES πŸ”₯

It returns an enum kcgi_err indicating the error state. Here's the whole squad:

  • KCGI_OK β€” Success. Not an error, just main character energy. πŸ‘‘
  • KCGI_ENOMEM β€” Internal memory allocation failure. The memory said "not today." 😭
  • KCGI_HUP β€” The output connection has been terminated. For FastCGI connections, the current connection should be released with khttp_free(3) and the parse loop reentered. πŸ¦‹
  • KCGI_FORM β€” The connection is still expecting headers with khttp_head(3). Indicates that khttp_body(3) did not return with success or was not invoked. For FastCGI connections, the current connection should be released with khttp_free(3) and the parse loop reentered. πŸ™ˆ
  • KCGI_SYSTEM β€” Internal system error writing to the output stream. System said "error" and meant it. πŸ’€

🌈 SEE ALSO 🌈

iykyk β€” go read those too, bestie. πŸ’œ


πŸŽ€ AUTHORS πŸŽ€

Written by Kristaps Dzonsons <kristaps@bsd.lv>. Iconic behavior, periodt. ⭐


kisses and sparkles, this page is KHTTP_PUTC(3), coming at you from Debian and stamped with $Mdocdate$ β€” bye bestie, slay your output πŸ’…πŸ’–

πŸ“¦ where this page comes from
  • alpine 3.24: kcgi-doc 1.0.1-r0 Β· ISC
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms