-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathoutlet.c
124 lines (105 loc) · 2.23 KB
/
outlet.c
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
//
//
//
#include "outlet.h"
term_t outlet_id(outlet_t *self)
{
return tag_short_oid(self->serial);
}
int outlet_want_read(outlet_t *self)
{
if (self->want_read == 0)
return 0;
return self->want_read(self);
}
int outlet_want_write(outlet_t *self)
{
if (self->want_write == 0)
return 0;
return self->want_write(self);
}
int outlet_is_socket(outlet_t *self)
{
if (self->is_socket == 0)
return 0;
return self->is_socket(self);
}
apr_socket_t *outlet_get_socket(outlet_t *self)
{
if (self->get_socket == 0)
return 0;
return self->get_socket(self);
}
int outlet_is_file(outlet_t *self)
{
if (self->is_file == 0)
return 0;
return self->is_file(self);
}
apr_file_t *outlet_get_file(outlet_t *self)
{
if (self->get_file == 0)
return 0;
return self->get_file(self);
}
apr_status_t outlet_try_read(outlet_t *self, apr_interval_time_t tick)
{
if (self->try_read == 0)
return APR_EOF;
return self->try_read(self, tick);
}
apr_status_t outlet_try_write(outlet_t *self, apr_interval_time_t tick)
{
if (self->try_write == 0)
return APR_EOF;
return self->try_write(self, tick);
}
apr_status_t outlet_do_readable(outlet_t *self)
{
if (self->do_readable == 0)
return APR_ENOTIMPL;
return self->do_readable(self);
}
apr_status_t outlet_do_writable(outlet_t *self)
{
if (self->do_writable == 0)
return APR_ENOTIMPL;
return self->do_writable(self);
}
apr_status_t outlet_send(outlet_t *self, term_t io)
{
if (self->send == 0)
return APR_ENOTIMPL;
return self->send(self, io);
}
apr_status_t outlet_set_option(outlet_t *self, term_t opt, term_t value)
{
if (self->set_option == 0)
return APR_ENOTIMPL;
return self->set_option(self, opt, value);
}
apr_status_t outlet_read(outlet_t *self, apr_byte_t *buf, apr_size_t *len)
{
if (self->read == 0)
return APR_ENOTIMPL;
return self->read(self, buf, len);
}
apr_status_t outlet_write(outlet_t *self, apr_byte_t *buf, apr_size_t *len)
{
if (self->write == 0)
return APR_ENOTIMPL;
return self->write(self, buf, len);
}
apr_status_t outlet_close(outlet_t *self)
{
if (self->close == 0)
return APR_ENOTIMPL;
return self->close(self);
}
apr_status_t outlet_close0(outlet_t *self) //error, no lingering
{
if (self->close0 == 0)
return APR_ENOTIMPL;
return self->close0(self);
}
//EOF