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 character entity content for kcgihtml
37
Writes a character entity
43
The value is formatted as
45
It is not checked for being a valid entity number.
49
indicating the error state.
52
Success (not an error).
54
Internal memory allocation failure.
56
The output connection has been terminated.
57
For FastCGI connections, the current connection should be released with
59
and parse loop reentered.
61
The connection is still expecting headers with
65
did not return with success or was not invoked.
66
For FastCGI connections, the current connection should be released with
68
and parse loop reentered.
70
Internal system error writing to the output stream.
73
The following outputs a simple HTML page.
79
For brevity, it does not do any error checking.
80
.Bd -literal -offset indent
81
khttp_head(r, kresps[KRESP_STATUS],
82
"%s", khttps[KHTTP_200]);
83
khttp_head(r, kresps[KRESP_CONTENT_TYPE],
84
"%s", kmimetypes[KMIME_TEXT_HTML]);
86
khtml_open(&req, r, 0);
87
khtml_elem(&req, KELEM_DOCTYPE);
88
khtml_elem(&req, KELEM_HTML);
89
khtml_elem(&req, KELEM_BODY);
90
khtml_elem(&req, KELEM_P);
91
khtml_ncr(&req, 0x1F601); /* smiley */
97
The referenced HTML5 standard is
98
.Lk https://www.w3.org/TR/html52 HTML5.2 .
101
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .