~donmcc/ood

ref: 1182412fd4ece0cb55c4b3ebefee78b22c8c15bd ood/src/libood/ood/select_sets.h -rw-r--r-- 933 bytes
1182412fDon McCaughey Add `ood_halt()` function. 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef OOD_SELECT_H_INCLUDED
#define OOD_SELECT_H_INCLUDED


#include <stdbool.h>
#include <sys/select.h>
#include "ood.h"


struct ood_select_sets {
    int max_fd;
    fd_set read;
    fd_set write;
    fd_set error;
};


void
ood_select_sets_clear(struct ood_select_sets *select_sets);


void
ood_select_sets_add_errorable(struct ood_select_sets *select_sets, int socket);


void
ood_select_sets_add_reader(struct ood_select_sets *select_sets, int socket);


void
ood_select_sets_add_writer(struct ood_select_sets *select_sets, int socket);


bool
ood_select_sets_has_error(struct ood_select_sets *select_sets, int socket);


bool
ood_select_sets_is_readable(struct ood_select_sets *select_sets, int socket);


bool
ood_select_sets_is_writable(struct ood_select_sets *select_sets, int socket);


enum ood_result
ood_select_sets_select(struct ood_select_sets *select_sets, unsigned timout_millis, bool *interrupted_out);


#endif