Imported Upstream version 3.2
[platform/upstream/libwebsockets.git] / lib / plat / optee / private.h
1 /*
2  * libwebsockets - small server side websockets and web server implementation
3  *
4  * Copyright (C) 2010 - 2018 Andy Green <andy@warmcat.com>
5  *
6  *  This library is free software; you can redistribute it and/or
7  *  modify it under the terms of the GNU Lesser General Public
8  *  License as published by the Free Software Foundation:
9  *  version 2.1 of the License.
10  *
11  *  This library is distributed in the hope that it will be useful,
12  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14  *  Lesser General Public License for more details.
15  *
16  *  You should have received a copy of the GNU Lesser General Public
17  *  License along with this library; if not, write to the Free Software
18  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  *  MA  02110-1301  USA
20  *
21  *  Included from lib/core/private.h if LWS_WITH_OPTEE
22  */
23
24  #include <unistd.h>
25  #include <sys/types.h>
26
27  #define LWS_ERRNO errno
28  #define LWS_EAGAIN EAGAIN
29  #define LWS_EALREADY EALREADY
30  #define LWS_EINPROGRESS EINPROGRESS
31  #define LWS_EINTR EINTR
32  #define LWS_EISCONN EISCONN
33  #define LWS_ENOTCONN ENOTCONN
34  #define LWS_EWOULDBLOCK EWOULDBLOCK
35  #define LWS_EADDRINUSE EADDRINUSE
36
37  #define lws_set_blocking_send(wsi)
38
39 #define compatible_close(x) close(x)
40 #define lws_plat_socket_offset() (0)
41 #define wsi_from_fd(A,B)  A->lws_lookup[B - lws_plat_socket_offset()]
42 #define insert_wsi(A,B)   assert(A->lws_lookup[B->desc.sockfd - \
43                                   lws_plat_socket_offset()] == 0); \
44                                  A->lws_lookup[B->desc.sockfd - \
45                                   lws_plat_socket_offset()] = B
46 #define delete_from_fd(A,B) A->lws_lookup[B - lws_plat_socket_offset()] = 0
47