HANDLER_ALLOC(3)

NAME
handler_alloc - allocate a web server handler object

SYNOPSIS

#include <slweb/handler.h>

struct handler *handler_alloc(const struct handler_cfg *cfg);

DESCRIPTION
The handler_alloc(3) function allocates a struct handler object, containing the required data by slweb to handle a web server. This object is meant to be consumed by other functions from slweb_handler(7). cfg defines the initial configuration, whose structure is defined by slweb_handler(7). struct handler is an opaque object internal to slweb and therefore is not accessible to callers.

RETURN VALUE
On success, an opaque pointer to a struct handler object is returned. On error, a null pointer is returned, and errno might be set by the internal call to malloc(3).

ERRORS
Refer to malloc(3) for a list of possible errors.

SEE ALSO
handler_free(3), handler_add(3), handler_listen(3), slweb_handler(7).

COPYRIGHT
Copyright (C) 2023 Xavier Del Campo Romero.

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.