KHTTP_WRITE(3) Library Functions Manual KHTTP_WRITE(3)

NAME

khttp_putc, khttp_puts, khttp_writewrite HTTP content data for kcgi

LIBRARY

library “libkcgi”

SYNOPSIS

#include <sys/types.h>
#include <stdarg.h>
#include <stddef.h>
#include <stdint.h>
#include <kcgi.h>
void
khttp_putc(struct kreq *req, int c);
void
khttp_puts(struct kreq *req, const char *cp);
void
khttp_write(struct kreq *req, const char *buf, size_t sz);

DESCRIPTION

The khttp_putc, khttp_puts, and khttp_write functions write HTTP content for a kcgi(3) context allocated with khttp_parse(3) or khttp_fcgi_parse(3). These functions may only be invoked after khttp_body(3), else their behaviour is undefined. khttp_putc emits a single character; khttp_puts emits a nil-terminated character string (note, this does not append a newline like puts(3)), and khttp_write emits a binary buffer buf of size sz.

SEE ALSO

kcgi(3), khttp_body(3), khttp_parse(3)

AUTHORS

The khttp_putc library was written by Kristaps Dzonsons <kristaps@bsd.lv>.
September 22, 2017 OpenBSD 5.8