cake
/
libp7
Archived
1
0
Fork 1
This repository has been archived on 2024-03-16. You can view files and clone it, but cannot push or open issues or pull requests.
libp7/include/libp7/server.h

51 lines
2.0 KiB
C

/* *****************************************************************************
* libp7/server.h -- libp7 server header.
* Copyright (C) 2016-2017 Thomas "Cakeisalie5" Touhey <thomas@touhey.fr>
*
* This file is part of libp7.
* libp7 is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3.0 of the License,
* or (at your option) any later version.
*
* libp7 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
* See the GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with libp7; if not, see <http://www.gnu.org/licenses/>.
* ************************************************************************** */
#ifndef LIBP7_SERVER_H
# define LIBP7_SERVER_H
# include <libp7.h>
# ifdef __cplusplus
extern "C" {
# endif
/* libp7 allow you to be a server. There are different levels:
* - one level where you answer to the command and roleswap directly;
* - one level where libp7 answers to the commands, using your callbacks
* and information (more appropriate for making a classical calculator
* server).
*
* Here is the function for serving directly: */
# define p7_attrs_serve_directly p7_attribute_nonnull(1) p7_attribute_nonnull(2)
p7_declare_ufunc(p7_serve_directly, p7_attrs_serve_directly,
p7_handle_t *p7_arg_handle,
p7_server_callback_t **p7_arg_callbacks, void *p7_arg_cookie)
/* And here is the function for serving a 'classical' server: */
# define p7_attrs_serve \
p7_attribute_nonnull(1) p7_attribute_nonnull(2) p7_attribute_nonnull(3)
p7_declare_ufunc(p7_serve, p7_attrs_serve,
p7_handle_t *p7_arg_handle, p7_server_t *p7_arg_info,
p7_filesystem_t *p7_arg_filesystems)
# ifdef __cplusplus
}
# endif
#endif /* LIBP7_SERVER_H */