blob: 040bc986aa7433bacd25f583bfc8ce5648c51c6c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
.TH HANDLER_ALLOC 3 2023-11-16 0.2.0 "libweb Library Reference"
.SH NAME
handler_alloc \- allocate a web server handler object
.SH SYNOPSIS
.LP
.nf
#include <libweb/handler.h>
.P
struct handler *handler_alloc(const struct handler_cfg *\fIcfg\fP);
.fi
.SH DESCRIPTION
The
.IR handler_alloc (3)
function allocates a
.I "struct handler"
object, containing the required data by
.I libweb
to handle a web server. This object is meant to be consumed by
other functions from
.IR libweb_handler (7).
.I cfg
defines the initial configuration, whose structure is defined by
.IR libweb_handler (7).
.I "struct handler"
is an opaque object internal to
.I libweb
and therefore is not accessible to callers.
.SH RETURN VALUE
On success, an opaque pointer to a
.I struct handler
object is returned. On error,
a null pointer is returned, and
.I errno
might be set by the internal call to
.IR malloc (3).
.SH ERRORS
Refer to
.IR malloc (3)
for a list of possible errors.
.SH SEE ALSO
.BR handler_free (3),
.BR handler_add (3),
.BR handler_listen (3),
.BR handler_loop (3),
.BR libweb_handler (7).
.SH COPYRIGHT
Copyright (C) 2023 libweb contributors.
.P
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
|