|
NAMEkcgi_buf_write —
put binary data into a kcgi buffer
LIBRARYlibrary “libkcgi”SYNOPSIS#include <sys/types.h>
#include <stdarg.h>
#include <stdint.h>
#include <kcgi.h>
enum kcgi_err
DESCRIPTIONAppends binary data buf of size sz to arg, which is cast to a struct kcgi_buf *. Buffers must be initialised to zero with memset(3) prior to first use. The buffer will always be NUL-terminated. Does nothing if buf isNULL or
sz is zero.
The struct kcgi_buf structure has the following fields:
RETURN VALUESThese functions return an enum kcgi_err indicating the error state:KCGI_OK for no error,
KCGI_ENOMEM for an internal memory allocation failure.
EXAMPLESThe following creates a simple NUL-terminated buffer. It does not perform any error checking.struct kcgi_buf buf; memset(&buf, 0, sizeof(struct kcgi_buf)); kcgi_buf_write("xyzzy", 5, &buf); puts(buf.buf); /* Emits "xyzzy" */ free(buf.buf); SEE ALSOkcgi_buf_printf(3), kcgi_buf_putc(3), kcgi_buf_puts(3)AUTHORSWritten by Kristaps Dzonsons <kristaps@bsd.lv>.
Visit the GSP FreeBSD Man Page Interface. |