… | |
… | |
151 | struct bufferevent *bufferevent_new(int fd, |
151 | struct bufferevent *bufferevent_new(int fd, |
152 | evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg); |
152 | evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg); |
153 | int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev); |
153 | int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev); |
154 | int bufferevent_priority_set(struct bufferevent *bufev, int pri); |
154 | int bufferevent_priority_set(struct bufferevent *bufev, int pri); |
155 | void bufferevent_free(struct bufferevent *bufev); |
155 | void bufferevent_free(struct bufferevent *bufev); |
156 | int bufferevent_write(struct bufferevent *bufev, void *data, size_t size); |
156 | int bufferevent_write(struct bufferevent *bufev, const void *data, size_t size); |
157 | int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf); |
157 | int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf); |
158 | size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size); |
158 | size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size); |
159 | int bufferevent_enable(struct bufferevent *bufev, short event); |
159 | int bufferevent_enable(struct bufferevent *bufev, short event); |
160 | int bufferevent_disable(struct bufferevent *bufev, short event); |
160 | int bufferevent_disable(struct bufferevent *bufev, short event); |
161 | void bufferevent_settimeout(struct bufferevent *bufev, |
161 | void bufferevent_settimeout(struct bufferevent *bufev, |
… | |
… | |
187 | * known ones - and we can just ignore the end of an event buffer. |
187 | * known ones - and we can just ignore the end of an event buffer. |
188 | */ |
188 | */ |
189 | |
189 | |
190 | void evtag_init(void); |
190 | void evtag_init(void); |
191 | |
191 | |
192 | void evtag_marshal(struct evbuffer *evbuf, uint8_t tag, const void *data, |
192 | void evtag_marshal(struct evbuffer *evbuf, uint32_t tag, const void *data, |
193 | uint32_t len); |
193 | uint32_t len); |
194 | |
194 | |
195 | void encode_int(struct evbuffer *evbuf, uint32_t number); |
195 | void encode_int(struct evbuffer *evbuf, uint32_t number); |
196 | |
196 | |
197 | void evtag_marshal_int(struct evbuffer *evbuf, uint8_t tag, uint32_t integer); |
197 | void evtag_marshal_int(struct evbuffer *evbuf, uint32_t tag, uint32_t integer); |
198 | |
198 | |
199 | void evtag_marshal_string(struct evbuffer *buf, uint8_t tag, |
199 | void evtag_marshal_string(struct evbuffer *buf, uint32_t tag, |
200 | const char *string); |
200 | const char *string); |
201 | |
201 | |
202 | void evtag_marshal_timeval(struct evbuffer *evbuf, uint8_t tag, |
202 | void evtag_marshal_timeval(struct evbuffer *evbuf, uint32_t tag, |
203 | struct timeval *tv); |
203 | struct timeval *tv); |
204 | |
204 | |
205 | void evtag_test(void); |
|
|
206 | |
|
|
207 | int evtag_unmarshal(struct evbuffer *src, uint8_t *ptag, struct evbuffer *dst); |
205 | int evtag_unmarshal(struct evbuffer *src, uint32_t *ptag, struct evbuffer *dst); |
208 | int evtag_peek(struct evbuffer *evbuf, uint8_t *ptag); |
206 | int evtag_peek(struct evbuffer *evbuf, uint32_t *ptag); |
209 | int evtag_peek_length(struct evbuffer *evbuf, uint32_t *plength); |
207 | int evtag_peek_length(struct evbuffer *evbuf, uint32_t *plength); |
210 | int evtag_payload_length(struct evbuffer *evbuf, uint32_t *plength); |
208 | int evtag_payload_length(struct evbuffer *evbuf, uint32_t *plength); |
211 | int evtag_consume(struct evbuffer *evbuf); |
209 | int evtag_consume(struct evbuffer *evbuf); |
212 | |
210 | |
213 | int evtag_unmarshal_int(struct evbuffer *evbuf, uint8_t need_tag, |
211 | int evtag_unmarshal_int(struct evbuffer *evbuf, uint32_t need_tag, |
214 | uint32_t *pinteger); |
212 | uint32_t *pinteger); |
215 | |
213 | |
216 | int evtag_unmarshal_fixed(struct evbuffer *src, uint8_t need_tag, void *data, |
214 | int evtag_unmarshal_fixed(struct evbuffer *src, uint32_t need_tag, void *data, |
217 | size_t len); |
215 | size_t len); |
218 | |
216 | |
219 | int evtag_unmarshal_string(struct evbuffer *evbuf, uint8_t need_tag, |
217 | int evtag_unmarshal_string(struct evbuffer *evbuf, uint32_t need_tag, |
220 | char **pstring); |
218 | char **pstring); |
221 | |
219 | |
222 | int evtag_unmarshal_timeval(struct evbuffer *evbuf, uint8_t need_tag, |
220 | int evtag_unmarshal_timeval(struct evbuffer *evbuf, uint32_t need_tag, |
223 | struct timeval *ptv); |
221 | struct timeval *ptv); |
224 | |
222 | |
225 | #ifdef __cplusplus |
223 | #ifdef __cplusplus |
226 | } |
224 | } |
227 | #endif |
225 | #endif |