}
int
-evbuffer_reserve_space(struct evbuffer *buf, ssize_t size,
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
struct evbuffer_iovec *vec, int n_vecs)
{
struct evbuffer_chain *chain;
}
unsigned char *
-evbuffer_pullup(struct evbuffer *buf, ssize_t size)
+evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size)
{
struct evbuffer_chain *chain, *next, *tmp;
unsigned char *buffer, *result = NULL;
- ssize_t remaining;
+ ev_ssize_t remaining;
EVBUFFER_LOCK(buf, EVTHREAD_WRITE);
@return The number of buffers we're using.
*/
int
-_evbuffer_read_setup_vecs(struct evbuffer *buf, ssize_t howmuch,
+_evbuffer_read_setup_vecs(struct evbuffer *buf, ev_ssize_t howmuch,
struct evbuffer_iovec *vecs, struct evbuffer_chain **chainp, int exact)
{
struct evbuffer_chain *chain;
return nvecs;
}
-/* TODO(niels): should this function return ssize_t and take ssize_t
+/* TODO(niels): should this function return ev_ssize_t and take ev_ssize_t
* as howmuch? */
int
evbuffer_read(struct evbuffer *buf, evutil_socket_t fd, int howmuch)
#ifdef USE_IOVEC_IMPL
if (nvecs == 2) {
- ssize_t space = CHAIN_SPACE_LEN(chain);
+ ev_ssize_t space = CHAIN_SPACE_LEN(chain);
if (space < n) {
chain->off += space;
chain->next->off += n-space;
#ifdef USE_SENDFILE
static inline int
evbuffer_write_sendfile(struct evbuffer *buffer, evutil_socket_t fd,
- ssize_t howmuch)
+ ev_ssize_t howmuch)
{
struct evbuffer_chain *chain = buffer->first;
struct evbuffer_chain_fd *info =
int res;
off_t len = chain->off;
#elif SENDFILE_IS_LINUX
- ssize_t res;
+ ev_ssize_t res;
off_t offset = chain->misalign;
#endif
int
evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
- ssize_t howmuch)
+ ev_ssize_t howmuch)
{
int n = -1;
{
/* the default implementation */
struct evbuffer *tmp = evbuffer_new();
- ssize_t read;
+ ev_ssize_t read;
if (tmp == NULL)
return (-1);
/** IOCP callback invoked when a read operation is finished. */
static void
-read_completed(struct event_overlapped *eo, uintptr_t _, ssize_t nBytes)
+read_completed(struct event_overlapped *eo, uintptr_t _, ev_ssize_t nBytes)
{
struct buffer_overlapped *buf_o = upcast_overlapped(eo);
struct evbuffer_overlapped *buf = buf_o->buf;
/** IOCP callback invoked when a write operation is finished. */
static void
-write_completed(struct event_overlapped *eo, uintptr_t _, ssize_t nBytes)
+write_completed(struct event_overlapped *eo, uintptr_t _, ev_ssize_t nBytes)
{
struct buffer_overlapped *buf_o = upcast_overlapped(eo);
struct evbuffer_overlapped *buf = buf_o->buf;
}
int
-evbuffer_launch_write(struct evbuffer *buf, ssize_t at_most)
+evbuffer_launch_write(struct evbuffer *buf, ev_ssize_t at_most)
{
struct evbuffer_overlapped *buf_o = upcast_evbuffer(buf);
int r = -1;
/* Filter to use when we're created with a NULL filter. */
static enum bufferevent_filter_result
-be_null_filter(struct evbuffer *src, struct evbuffer *dst, ssize_t lim,
+be_null_filter(struct evbuffer *src, struct evbuffer *dst, ev_ssize_t lim,
enum bufferevent_flush_mode state, void *ctx)
{
(void)state;
}
do {
- ssize_t limit = -1;
+ ev_ssize_t limit = -1;
if (state == BEV_NORMAL && bev->wm_read.high)
limit = bev->wm_read.high -
evbuffer_get_length(bev->input);
again = 0;
do {
- ssize_t limit = -1;
+ ev_ssize_t limit = -1;
if (state == BEV_NORMAL &&
bevf->underlying->wm_write.high)
limit = bevf->underlying->wm_write.high -
* extent, and *chainp to poitn to the first chain that we'll try to read into.
* Returns the number of vecs used.
*/
-int _evbuffer_read_setup_vecs(struct evbuffer *buf, ssize_t howmuch,
+int _evbuffer_read_setup_vecs(struct evbuffer *buf, ev_ssize_t howmuch,
struct evbuffer_iovec *vecs, struct evbuffer_chain **chainp, int exact);
/* Helper macro: copies an evbuffer_iovec in ei to a win32 WSABUF in i. */
@see evbuffer_commit_space
*/
int
-evbuffer_reserve_space(struct evbuffer *buf, ssize_t size,
+evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
struct evbuffer_iovec *vec, int n_vecs);
/**
struct event_overlapped;
struct event_iocp_port;
struct evbuffer;
-typedef void (*iocp_callback)(struct event_overlapped *, uintptr_t, ssize_t);
+typedef void (*iocp_callback)(struct event_overlapped *, uintptr_t, ev_ssize_t);
/* This whole file is actually win32 only. We wrap the structures in a win32
* ifdef so that we can test-compile code that uses these interfaces on
@param n The number of bytes to try to read.
@return 0 on success, -1 on error.
*/
-int evbuffer_launch_write(struct evbuffer *, ssize_t n);
+int evbuffer_launch_write(struct evbuffer *, ev_ssize_t n);
/** Create an IOCP, and launch its worker threads. Internal use only.
evsig_cb(evutil_socket_t fd, short what, void *arg)
{
static char signals[1];
-#ifdef WIN32
- SSIZE_T n;
-#else
- ssize_t n;
-#endif
+ ev_ssize_t n;
+
(void)arg; /* Suppress "unused variable" warning. */
n = recv(fd, signals, sizeof(signals), 0);
static enum bufferevent_filter_result
bufferevent_input_filter(struct evbuffer *src, struct evbuffer *dst,
- ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
{
const unsigned char *buffer;
int i;
static enum bufferevent_filter_result
bufferevent_output_filter(struct evbuffer *src, struct evbuffer *dst,
- ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
{
const unsigned char *buffer;
int i;
void *lock;
int call_count;
uintptr_t keys[MAX_CALLS];
- ssize_t sizes[MAX_CALLS];
+ ev_ssize_t sizes[MAX_CALLS];
};
static void
-dummy_cb(struct event_overlapped *o, uintptr_t key, ssize_t n)
+dummy_cb(struct event_overlapped *o, uintptr_t key, ev_ssize_t n)
{
struct dummy_overlapped *d_o =
EVUTIL_UPCAST(o, struct dummy_overlapped, eo);
}
static int
-pair_is_in(struct dummy_overlapped *o, uintptr_t key, ssize_t n)
+pair_is_in(struct dummy_overlapped *o, uintptr_t key, ev_ssize_t n)
{
int i;
int result = 0;
*/
static enum bufferevent_filter_result
zlib_input_filter(struct evbuffer *src, struct evbuffer *dst,
- ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
{
struct evbuffer_iovec v_in[1];
struct evbuffer_iovec v_out[1];
static enum bufferevent_filter_result
zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
- ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
+ ev_ssize_t lim, enum bufferevent_flush_mode state, void *ctx)
{
struct evbuffer_iovec v_in[1];
struct evbuffer_iovec v_out[1];
#ifdef _EVENT___func__
#define __func__ _EVENT___func__
#endif
-#ifdef _EVENT_ssize_t
-#define ssize_t _EVENT_ssize_t
-#endif
/* A good no-op to use in macro definitions. */
#define _EVUTIL_NIL_STMT ((void)0)