ksgi

Форк
0
/
khttp_printf.3 
95 строк · 2.3 Кб
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 KHTTP_PRINTF 3
19
.Os
20
.Sh NAME
21
.Nm khttp_printf
22
.Nd put variable content for kcgi
23
.Sh LIBRARY
24
.Lb libkcgi
25
.Sh SYNOPSIS
26
.In sys/types.h
27
.In stdarg.h
28
.In stdint.h
29
.In kcgi.h
30
.Ft enum kcgi_err
31
.Fo khttp_printf
32
.Fa "struct kreq *req"
33
.Fa "const char *fmt"
34
.Fa "..."
35
.Fc
36
.Sh DESCRIPTION
37
Writes output according to the given
38
.Fa fmt
39
to a
40
.Xr kcgi 3
41
context
42
.Fa req
43
as allocated with
44
.Xr khttp_parse 3
45
or
46
.Xr khttp_fcgi_parse 3 .
47
The format is as for
48
.Xr printf 3 .
49
It should only be called after
50
.Xr khttp_body 3 .
51
.Pp
52
If
53
.Fa fmt
54
is
55
.Dv NULL ,
56
it does nothing and returns success.
57
.Pp
58
If
59
.Xr kcgi_writer_disable 3
60
has been previously invoked, this function will
61
.Xr abort 3 .
62
.Sh RETURN VALUES
63
Returns an
64
.Ft enum kcgi_err
65
indicating the error state.
66
.Bl -tag -width -Ds
67
.It Dv KCGI_OK
68
Success (not an error).
69
.It Dv KCGI_ENOMEM
70
Internal memory allocation failure.
71
.It Dv KCGI_HUP
72
The output connection has been terminated.
73
For FastCGI connections, the current connection should be released with
74
.Xr khttp_free 3
75
and parse loop reentered.
76
.It Dv KCGI_FORM
77
The connection is still expecting headers with
78
.Xr khttp_head 3 .
79
Indicates that
80
.Xr khttp_body 3
81
did not return with success or was not invoked.
82
For FastCGI connections, the current connection should be released with
83
.Xr khttp_free 3
84
and parse loop reentered.
85
.It Dv KCGI_SYSTEM
86
Internal system error writing to the output stream.
87
.El
88
.Sh SEE ALSO
89
.Xr kcgi 3 ,
90
.Xr kcgi_writer_disable 3 ,
91
.Xr khttp_body 3 ,
92
.Xr khttp_parse 3
93
.Sh AUTHORS
94
Written by
95
.An Kristaps Dzonsons Aq Mt kristaps@bsd.lv .
96

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

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

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

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