ksgi

Форк
0
/
khtml_entity.3 
101 строка · 2.7 Кб
1
.\"	$Id$
2
.\"
3
.\" Copyright (c) 2020 Kristaps Dzonsons <kristaps@bsd.lv>
4
.\"
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.
8
.\"
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.
16
.\"
17
.Dd $Mdocdate$
18
.Dt KHTML_ENTITY 3
19
.Os
20
.Sh NAME
21
.Nm khtml_entity
22
.Nd put named character entity content for kcgihtml
23
.Sh LIBRARY
24
.Lb libkcgihtml
25
.Sh SYNOPSIS
26
.In sys/types.h
27
.In stdarg.h
28
.In stdint.h
29
.In kcgi.h
30
.In kcgihtml.h
31
.Ft enum kcgi_err
32
.Fo khttp_entity
33
.Fa "struct kreq *req"
34
.Fa "enum entity v"
35
.Fc
36
.Sh DESCRIPTION
37
Writes a named character entity
38
.Fa v
39
to a context
40
.Fa req
41
initialised with
42
.Xr khtml_open 3 .
43
The value is formatted as
44
.Qq &#xNNNN; .
45
.Sh RETURN VALUES
46
Returns an
47
.Ft enum kcgi_err
48
indicating the error state.
49
.Bl -tag -width -Ds
50
.It Dv KCGI_OK
51
Success (not an error).
52
.It Dv KCGI_ENOMEM
53
Internal memory allocation failure.
54
.It Dv KCGI_HUP
55
The output connection has been terminated.
56
For FastCGI connections, the current connection should be released with
57
.Xr khttp_free 3
58
and parse loop reentered.
59
.It Dv KCGI_FORM
60
The connection is still expecting headers with
61
.Xr khttp_head 3 .
62
Indicates that
63
.Xr khttp_body 3
64
did not return with success or was not invoked.
65
For FastCGI connections, the current connection should be released with
66
.Xr khttp_free 3
67
and parse loop reentered.
68
.It Dv KCGI_SYSTEM
69
Internal system error writing to the output stream.
70
.El
71
.Sh EXAMPLES
72
The following outputs a simple HTML page.
73
It assumes
74
.Va r
75
is a
76
.Vt struct kreq
77
pointer.
78
For brevity, it does not do any error checking.
79
.Bd -literal -offset indent
80
khttp_head(r, kresps[KRESP_STATUS],
81
  "%s", khttps[KHTTP_200]);
82
khttp_head(r, kresps[KRESP_CONTENT_TYPE],
83
  "%s", kmimetypes[KMIME_TEXT_HTML]);
84
khttp_body(r);
85
khtml_open(&req, r, 0);
86
khtml_elem(&req, KELEM_DOCTYPE);
87
khtml_elem(&req, KELEM_HTML);
88
khtml_elem(&req, KELEM_BODY);
89
khtml_elem(&req, KELEM_P);
90
khtml_puts(&req, "Hello");
91
khtml_ncr(&req, KENTITY_hellip); /* ... */
92
khtml_close(&req);
93
.Ed
94
.Sh SEE ALSO
95
.Xr kcgihtml 3
96
.Sh STANDARDS
97
The referenced HTML5 standard is
98
.Lk https://www.w3.org/TR/html52 HTML5.2 .
99
.Sh AUTHORS
100
Written by
101
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
102

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.