1
0
Fork 0
libweb/doc/man3/http_alloc.3

63 lines
1.4 KiB
Groff

.TH HTTP_ALLOC 3 2023-09-06 0.1.0 "libweb Library Reference"
.SH NAME
http_alloc \- allocate a HTTP context object
.SH SYNOPSIS
.LP
.nf
#include <libweb/http.h>
.P
struct http *http_alloc(const struct http_cfg *\fIcfg\fP);
.fi
.SH DESCRIPTION
The
.IR http_alloc (3)
function allocates a
.I "struct http_ctx"
object, containing the required data by
.I libweb
to handle a HTTP connection. This object is meant to be consumed by
other functions from
.IR libweb .
.I cfg
defines the configuration for the HTTP context, whose structure is defined by
.IR libweb_http (7).
.I "struct http_ctx"
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 http_ctx
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 NOTES
This function is designed for internal use by
\fIlibweb\fR.
.SH SEE ALSO
.BR http_free (3),
.BR http_update (3),
.BR libweb_http (7).
.SH COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.
.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.