KCGI_WRITER_PUTS(3)

πŸ“¦ version 1.0.1, in alpine 3.24

πŸ¦‹ KCGI_WRITER_PUTS(3) β€” write into a writer πŸ¦‹

okay bestie, welcome to the KCGI_WRITER_PUTS(3) page from the Library Functions Manual. This little icon lives in the library β€œlibkcgi”, and it's all about pushing a string into a writer. Let's go πŸ’…


πŸ’– NAME πŸ’–

kcgi_writer_puts β€” write into a writer

πŸ“š LIBRARY πŸ“š

library β€œlibkcgi”

✨ SYNOPSIS ✨

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

enum kcgi_err
kcgi_writer_puts(struct kcgi_writer *writer, const char *cp);

🌸 DESCRIPTION 🌸

The kcgi_writer_puts() function writes the NUL-terminated string cp to a writer channel opened by kcgi_writer_get(3). This one is lowkey special because it allows writing after kcgi_writer_disable(3), unlike khttp_write(3). And kcgi_writer_puts() is backed by kcgi_writer_write(3) β€” that's the support system, no cap. 🫢

πŸ”₯ RETURN VALUES πŸ”₯

Returns an enum kcgi_err indicating the error state. Here's the whole vibe check:

  • KCGI_OK β€” Success (not an error). Slay. ✨
  • KCGI_ENOMEM β€” Internal memory allocation failure. πŸ’€
  • KCGI_HUP β€” The output connection has been terminated. For FastCGI connections, the current connection should be released with khttp_free(3) and 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 parse loop reentered. πŸ™ˆ
  • KCGI_SYSTEM β€” Internal system error writing to the output stream. 🧚

πŸ‘€ SEE ALSO πŸ‘€

πŸ’œ AUTHORS πŸ’œ

This function was written by Kristaps Dzonsons <kristaps@bsd.lv>.


πŸ’Œ cute sign-off: this page is from Debian, dated $Mdocdate$, and it's the KCGI_WRITER_PUTS(3) page. bye bestie, go write some strings! πŸŽ€

πŸ“¦ where this page comes from