supla-device
Loading...
Searching...
No Matches
src
supla-common
eh.h
1
// SPDX-FileCopyrightText: AC SOFTWARE SP. Z O.O.
2
// SPDX-License-Identifier: GPL-2.0-or-later
3
4
#ifndef EH_H_
5
#define EH_H_
6
7
#if !defined(ESP8266) && !defined(__AVR__) && !defined(_WIN32) && \
8
!defined(ESP32) && !defined(ARDUINO) && !defined(SUPLA_DEVICE)
9
#include <sys/select.h>
10
#endif
11
12
#if !defined(__AVR__) && !defined(_WIN32)
13
#include <sys/time.h>
14
#endif
15
16
#ifdef __AVR__
17
#include "proto.h"
18
#endif
19
20
#ifdef __cplusplus
21
extern
"C"
{
22
#endif
23
24
typedef
struct
{
25
int
nfds;
26
27
#ifndef _WIN32
28
29
#ifdef __linux__
30
int
epoll_fd;
31
int
fd1;
32
#else
33
int
fd1[2];
34
#endif
35
36
int
fd2;
37
int
fd3;
38
39
struct
timeval tv;
40
41
#endif
42
}
TEventHandler
;
43
44
TEventHandler
*eh_init(
void
);
45
void
eh_add_fd(
TEventHandler
*eh,
int
fd);
46
void
eh_raise_event(
TEventHandler
*eh);
47
int
eh_wait(
TEventHandler
*eh,
int
usec);
48
void
eh_free(
TEventHandler
*eh);
49
50
#ifdef __cplusplus
51
}
52
#endif
53
54
#endif
/* EH_H_ */
TEventHandler
Definition
eh.h:24
Generated by
1.12.0