Fix License in spec
[platform/upstream/libwebsockets.git] / lib / event-libs / 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  *  This is included from core/private.h
22  */
23
24 struct lws_event_loop_ops {
25         const char *name;
26         /* event loop-specific context init during context creation */
27         int (*init_context)(struct lws_context *context,
28                             const struct lws_context_creation_info *info);
29         /* called during lws_destroy_context */
30         int (*destroy_context1)(struct lws_context *context);
31         /* called during lws_destroy_context2 */
32         int (*destroy_context2)(struct lws_context *context);
33         /* init vhost listening wsi */
34         int (*init_vhost_listen_wsi)(struct lws *wsi);
35         /* init the event loop for a pt */
36         int (*init_pt)(struct lws_context *context, void *_loop, int tsi);
37         /* called at end of first phase of close_free_wsi()  */
38         int (*wsi_logical_close)(struct lws *wsi);
39         /* return nonzero if client connect not allowed  */
40         int (*check_client_connect_ok)(struct lws *wsi);
41         /* close handle manually  */
42         void (*close_handle_manually)(struct lws *wsi);
43         /* event loop accept processing  */
44         int (*accept)(struct lws *wsi);
45         /* control wsi active events  */
46         void (*io)(struct lws *wsi, int flags);
47         /* run the event loop for a pt */
48         void (*run_pt)(struct lws_context *context, int tsi);
49         /* called before pt is destroyed */
50         void (*destroy_pt)(struct lws_context *context, int tsi);
51         /* called just before wsi is freed  */
52         void (*destroy_wsi)(struct lws *wsi);
53
54         unsigned int periodic_events_available:1;
55 };
56
57 /* bring in event libs private declarations */
58
59 #if defined(LWS_WITH_POLL)
60 #include "event-libs/poll/private.h"
61 #endif
62
63 #if defined(LWS_WITH_LIBUV)
64 #include "event-libs/libuv/private.h"
65 #endif
66
67 #if defined(LWS_WITH_LIBEVENT)
68 #include "event-libs/libevent/private.h"
69 #endif
70
71 #if defined(LWS_WITH_LIBEV)
72 #include "event-libs/libev/private.h"
73 #endif
74