3
.\" Copyright (c) 2020 Kristaps Dzonsons <kristaps@bsd.lv>
5
.\" Permission to use, copy, modify, and distribute this software for any
6
.\" purpose with or without fee is hereby granted, provided that the above
7
.\" copyright notice and this permission notice appear in all copies.
9
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22
.Nd put string content into a kcgi buffer
32
.Fa "struct kcgi_buf *buf"
36
Appends a NUL-terminated string
40
Buffers must be initialised to zero with
47
It does not append a newline like
52
indicating the error state.
55
Success (not an error).
57
Internal memory allocation failure.
59
The output connection has been terminated.
60
For FastCGI connections, the current connection should be released with
62
and parse loop reentered.
64
The connection is still expecting headers with
68
did not return with success or was not invoked.
69
For FastCGI connections, the current connection should be released with
71
and parse loop reentered.
73
Internal system error writing to the output stream.
76
The following creates a simple NUL-terminated buffer and outputs its
78
It does not perform any error checking.
79
.Bd -literal -offset indent
82
memset(&buf, 0, sizeof(struct kcgi_buf));
83
kcgi_buf_puts(&buf, "Hello, world!");
84
puts(buf.buf); /* Emits "Hello, world!" */
88
.Xr kcgi_buf_printf 3 ,
93
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .