summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--buffer.c4
-rw-r--r--bufferevent.c4
-rw-r--r--event.c2
-rw-r--r--http.c14
-rw-r--r--include/event2/buffer.h7
-rw-r--r--include/event2/bufferevent.h8
-rw-r--r--include/event2/event.h2
-rw-r--r--test/regress.c4
-rw-r--r--test/regress_zlib.c12
9 files changed, 28 insertions, 29 deletions
diff --git a/buffer.c b/buffer.c
index eec9b783..58869140 100644
--- a/buffer.c
+++ b/buffer.c
@@ -118,13 +118,13 @@ evbuffer_free(struct evbuffer *buffer)
}
size_t
-evbuffer_length(struct evbuffer *buffer)
+evbuffer_get_length(struct evbuffer *buffer)
{
return (buffer->total_len);
}
size_t
-evbuffer_contiguous_space(struct evbuffer *buf)
+evbuffer_get_contiguous_space(struct evbuffer *buf)
{
struct evbuffer_chain *chain = buf->first;
diff --git a/bufferevent.c b/bufferevent.c
index 36a182ec..4d74de26 100644
--- a/bufferevent.c
+++ b/bufferevent.c
@@ -360,13 +360,13 @@ bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd)
}
struct evbuffer *
-bufferevent_input(struct bufferevent *bufev)
+bufferevent_get_input(struct bufferevent *bufev)
{
return (bufev->input);
}
struct evbuffer *
-bufferevent_output(struct bufferevent *bufev)
+bufferevent_get_output(struct bufferevent *bufev)
{
return TAILQ_FIRST(&bufev->output_filters) != NULL ?
TAILQ_FIRST(&bufev->output_filters)->buffer :
diff --git a/event.c b/event.c
index 0ec713bb..4c8d21f2 100644
--- a/event.c
+++ b/event.c
@@ -345,7 +345,7 @@ event_reinit(struct event_base *base)
}
const char **
-event_supported_methods()
+event_get_supported_methods(void)
{
static const char **methods;
const struct eventop **method;
diff --git a/http.c b/http.c
index f5d6169b..a8d60fa7 100644
--- a/http.c
+++ b/http.c
@@ -322,7 +322,7 @@ evhttp_make_header_request(struct evhttp_connection *evcon,
/* Generate request line */
method = evhttp_method(req->type);
- evbuffer_add_printf(bufferevent_output(evcon->bufev),
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
"%s %s HTTP/%d.%d\r\n",
method, req->uri, req->major, req->minor);
@@ -400,7 +400,7 @@ static void
evhttp_make_header_response(struct evhttp_connection *evcon,
struct evhttp_request *req)
{
- evbuffer_add_printf(bufferevent_output(evcon->bufev),
+ evbuffer_add_printf(bufferevent_get_output(evcon->bufev),
"HTTP/%d.%d %d %s\r\n",
req->major, req->minor, req->response_code,
req->response_code_line);
@@ -442,7 +442,7 @@ void
evhttp_make_header(struct evhttp_connection *evcon, struct evhttp_request *req)
{
struct evkeyval *header;
- struct evbuffer *output = bufferevent_output(evcon->bufev);
+ struct evbuffer *output = bufferevent_get_output(evcon->bufev);
/*
* Depending if this is a HTTP request or response, we might need to
@@ -670,7 +670,7 @@ evhttp_handle_chunked_read(struct evhttp_request *req, struct evbuffer *buf)
static void
evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
{
- struct evbuffer *buf = bufferevent_input(evcon->bufev);
+ struct evbuffer *buf = bufferevent_get_input(evcon->bufev);
if (req->chunked) {
int res = evhttp_handle_chunked_read(req, buf);
@@ -1333,7 +1333,7 @@ evhttp_read_header_cb(struct bufferevent *bufev, void *arg)
int res;
int fd = evcon->fd;
- res = evhttp_parse_lines(req, bufferevent_input(evcon->bufev));
+ res = evhttp_parse_lines(req, bufferevent_get_input(evcon->bufev));
if (res == -1) {
/* Error while reading, terminate */
event_debug(("%s: bad header lines on %d\n", __func__, fd));
@@ -1697,7 +1697,7 @@ evhttp_send_reply_start(struct evhttp_request *req, int code,
void
evhttp_send_reply_chunk(struct evhttp_request *req, struct evbuffer *databuf)
{
- struct evbuffer *output = bufferevent_output(req->evcon->bufev);
+ struct evbuffer *output = bufferevent_get_output(req->evcon->bufev);
if (req->chunked) {
evbuffer_add_printf(output, "%x\r\n",
(unsigned)EVBUFFER_LENGTH(databuf));
@@ -1713,7 +1713,7 @@ void
evhttp_send_reply_end(struct evhttp_request *req)
{
struct evhttp_connection *evcon = req->evcon;
- struct evbuffer *output = bufferevent_output(evcon->bufev);
+ struct evbuffer *output = bufferevent_get_output(evcon->bufev);
if (req->chunked) {
evbuffer_add(output, "0\r\n\r\n", 5);
diff --git a/include/event2/buffer.h b/include/event2/buffer.h
index 9d70555b..7d7e1b53 100644
--- a/include/event2/buffer.h
+++ b/include/event2/buffer.h
@@ -91,7 +91,7 @@ void evbuffer_free(struct evbuffer *buf);
@param buf pointer to the evbuffer
@return the number of bytes stored in the event buffer
*/
-size_t evbuffer_length(struct evbuffer *buf);
+size_t evbuffer_get_length(struct evbuffer *buf);
/**
Returns the contiguous number of available bytes in the first buffer chain.
@@ -104,7 +104,7 @@ size_t evbuffer_length(struct evbuffer *buf);
@return 0 if no data is available, otherwise the number of available bytes
in the first buffer chain.
*/
-size_t evbuffer_contiguous_space(struct evbuffer *buf);
+size_t evbuffer_get_contiguous_space(struct evbuffer *buf);
/**
Expands the available space in an event buffer.
@@ -362,10 +362,9 @@ void evbuffer_prepend_buffer(struct evbuffer *dst, struct evbuffer* src);
*/
/** deprecated in favor of calling the functions directly */
-#define EVBUFFER_LENGTH(x) evbuffer_length(x)
+#define EVBUFFER_LENGTH(x) evbuffer_get_length(x)
#define EVBUFFER_DATA(x) evbuffer_pullup(x, -1)
-
#ifdef __cplusplus
}
#endif
diff --git a/include/event2/bufferevent.h b/include/event2/bufferevent.h
index 69665a92..f0c9f672 100644
--- a/include/event2/bufferevent.h
+++ b/include/event2/bufferevent.h
@@ -251,7 +251,7 @@ int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
@return the evbuffer object for the input buffer
*/
-struct evbuffer *bufferevent_input(struct bufferevent *bufev);
+struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
/**
Returns the outut buffer.
@@ -263,7 +263,7 @@ struct evbuffer *bufferevent_input(struct bufferevent *bufev);
@return the evbuffer object for the output buffer
*/
-struct evbuffer *bufferevent_output(struct bufferevent *bufev);
+struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
/**
Enable a bufferevent.
@@ -316,9 +316,9 @@ void bufferevent_setwatermark(struct bufferevent *bufev, short events,
size_t lowmark, size_t highmark);
/** macro for getting access to the input buffer of a bufferevent */
-#define EVBUFFER_INPUT(x) bufferevent_input(x)
+#define EVBUFFER_INPUT(x) bufferevent_get_input(x)
/** macro for getting access to the output buffer of a bufferevent */
-#define EVBUFFER_OUTPUT(x) bufferevent_output(x)
+#define EVBUFFER_OUTPUT(x) bufferevent_get_output(x)
/**
Support for filtering input and output of bufferevents.
diff --git a/include/event2/event.h b/include/event2/event.h
index 9bb8438b..1827fc67 100644
--- a/include/event2/event.h
+++ b/include/event2/event.h
@@ -110,7 +110,7 @@ const char *event_base_get_method(struct event_base *);
The end of the array is indicated by a NULL pointer. If an
error is encountered NULL is returned.
*/
-const char **event_supported_methods(void);
+const char **event_get_supported_methods(void);
/**
Allocates a new event configuration object.
diff --git a/test/regress.c b/test/regress.c
index fa5202b0..b823d6ac 100644
--- a/test/regress.c
+++ b/test/regress.c
@@ -1074,7 +1074,7 @@ test_evbuffer(void)
assert(evbuffer_commit_space(evb, 10000) == 0);
evbuffer_validate(evb);
- assert(evbuffer_length(evb) >= 10000);
+ assert(evbuffer_get_length(evb) >= 10000);
evbuffer_drain(evb, j * 5000);
evbuffer_validate(evb);
@@ -2069,7 +2069,7 @@ test_evutil_strtoll(void)
static void
test_methods(void)
{
- const char **methods = event_supported_methods();
+ const char **methods = event_get_supported_methods();
struct event_config *cfg;
struct event_base *base;
const char *backend;
diff --git a/test/regress_zlib.c b/test/regress_zlib.c
index 49bd053b..9de66967 100644
--- a/test/regress_zlib.c
+++ b/test/regress_zlib.c
@@ -113,7 +113,7 @@ zlib_input_filter(struct evbuffer *src, struct evbuffer *dst,
do {
/* let's do some decompression */
- p->avail_in = evbuffer_contiguous_space(src);
+ p->avail_in = evbuffer_get_contiguous_space(src);
p->next_in = evbuffer_pullup(src, p->avail_in);
p->next_out = evbuffer_reserve_space(dst, 4096);
@@ -125,7 +125,7 @@ zlib_input_filter(struct evbuffer *src, struct evbuffer *dst,
assert(res == Z_OK || res == Z_STREAM_END);
/* let's figure out how much was compressed */
- nread = evbuffer_contiguous_space(src) - p->avail_in;
+ nread = evbuffer_get_contiguous_space(src) - p->avail_in;
nwrite = 4096 - p->avail_out;
evbuffer_drain(src, nread);
@@ -148,7 +148,7 @@ zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
do {
/* let's do some compression */
- p->avail_in = evbuffer_contiguous_space(src);
+ p->avail_in = evbuffer_get_contiguous_space(src);
p->next_in = evbuffer_pullup(src, p->avail_in);
p->next_out = evbuffer_reserve_space(dst, 4096);
@@ -159,7 +159,7 @@ zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
assert(res == Z_OK || res == Z_STREAM_END);
/* let's figure out how much was compressed */
- nread = evbuffer_contiguous_space(src) - p->avail_in;
+ nread = evbuffer_get_contiguous_space(src) - p->avail_in;
nwrite = 4096 - p->avail_out;
evbuffer_drain(src, nread);
@@ -178,7 +178,7 @@ zlib_output_filter(struct evbuffer *src, struct evbuffer *dst,
static void
readcb(struct bufferevent *bev, void *arg)
{
- if (EVBUFFER_LENGTH(bufferevent_input(bev)) == 8333) {
+ if (EVBUFFER_LENGTH(bufferevent_get_input(bev)) == 8333) {
struct evbuffer *evbuf = evbuffer_new();
assert(evbuf != NULL);
@@ -197,7 +197,7 @@ readcb(struct bufferevent *bev, void *arg)
static void
writecb(struct bufferevent *bev, void *arg)
{
- if (EVBUFFER_LENGTH(bufferevent_output(bev)) == 0)
+ if (EVBUFFER_LENGTH(bufferevent_get_output(bev)) == 0)
test_ok++;
}