aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libevent/include/event2/bufferevent.h
diff options
context:
space:
mode:
authorkikht <kikht@yandex-team.ru>2022-02-10 16:45:14 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:14 +0300
commit194cae0e8855b11be2005e1eff12c660c3ee9774 (patch)
treeed29c437b616690880c017855ebe0be34fdf81a2 /contrib/libs/libevent/include/event2/bufferevent.h
parent49116032d905455a7b1c994e4a696afc885c1e71 (diff)
downloadydb-194cae0e8855b11be2005e1eff12c660c3ee9774.tar.gz
Restoring authorship annotation for <kikht@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/libevent/include/event2/bufferevent.h')
-rw-r--r--contrib/libs/libevent/include/event2/bufferevent.h426
1 files changed, 213 insertions, 213 deletions
diff --git a/contrib/libs/libevent/include/event2/bufferevent.h b/contrib/libs/libevent/include/event2/bufferevent.h
index 48cd153563..87876effec 100644
--- a/contrib/libs/libevent/include/event2/bufferevent.h
+++ b/contrib/libs/libevent/include/event2/bufferevent.h
@@ -24,8 +24,8 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef EVENT2_BUFFEREVENT_H_INCLUDED_
-#define EVENT2_BUFFEREVENT_H_INCLUDED_
+#ifndef EVENT2_BUFFEREVENT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_H_INCLUDED_
/**
@file event2/bufferevent.h
@@ -74,17 +74,17 @@
</dl>
*/
-#include <event2/visibility.h>
-
+#include <event2/visibility.h>
+
#ifdef __cplusplus
extern "C" {
#endif
#include <event2/event-config.h>
-#ifdef EVENT__HAVE_SYS_TYPES_H
+#ifdef EVENT__HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef EVENT__HAVE_SYS_TIME_H
+#ifdef EVENT__HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
@@ -111,7 +111,7 @@ extern "C" {
@see event2/bufferevent.h
*/
struct bufferevent
-#ifdef EVENT_IN_DOXYGEN_
+#ifdef EVENT_IN_DOXYGEN_
{}
#endif
;
@@ -140,9 +140,9 @@ typedef void (*bufferevent_data_cb)(struct bufferevent *bev, void *ctx);
The event callback is triggered if either an EOF condition or another
unrecoverable error was encountered.
- For bufferevents with deferred callbacks, this is a bitwise OR of all errors
- that have happened on the bufferevent since the last callback invocation.
-
+ For bufferevents with deferred callbacks, this is a bitwise OR of all errors
+ that have happened on the bufferevent since the last callback invocation.
+
@param bev the bufferevent for which the error condition was reached
@param what a conjunction of flags: BEV_EVENT_READING or BEV_EVENT_WRITING
to indicate if the error was encountered on the read or write path,
@@ -186,7 +186,7 @@ enum bufferevent_options {
error occurred
@see bufferevent_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socket_t fd, int options);
/**
@@ -208,8 +208,8 @@ struct bufferevent *bufferevent_socket_new(struct event_base *base, evutil_socke
@param socklen The length of the address
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
-int bufferevent_socket_connect(struct bufferevent *, const struct sockaddr *, int);
+EVENT2_EXPORT_SYMBOL
+int bufferevent_socket_connect(struct bufferevent *, const struct sockaddr *, int);
struct evdns_base;
/**
@@ -238,7 +238,7 @@ struct evdns_base;
may block while it waits for a DNS response. This is probably not
what you want.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_socket_connect_hostname(struct bufferevent *,
struct evdns_base *, int, const char *, int);
@@ -250,7 +250,7 @@ int bufferevent_socket_connect_hostname(struct bufferevent *,
@return DNS error code.
@see evutil_gai_strerror()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_socket_get_dns_error(struct bufferevent *bev);
/**
@@ -264,13 +264,13 @@ int bufferevent_socket_get_dns_error(struct bufferevent *bev);
@return 0 if successful, or -1 if an error occurred
@see bufferevent_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_base_set(struct event_base *base, struct bufferevent *bufev);
/**
Return the event_base used by a bufferevent
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *bufferevent_get_base(struct bufferevent *bev);
/**
@@ -282,26 +282,26 @@ struct event_base *bufferevent_get_base(struct bufferevent *bev);
@param pri the priority to be assigned
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_priority_set(struct bufferevent *bufev, int pri);
-/**
- Return the priority of a bufferevent.
-
- Only supported for socket bufferevents
- */
-EVENT2_EXPORT_SYMBOL
-int bufferevent_get_priority(const struct bufferevent *bufev);
+/**
+ Return the priority of a bufferevent.
+ Only supported for socket bufferevents
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_get_priority(const struct bufferevent *bufev);
+
/**
Deallocate the storage associated with a bufferevent structure.
- If there is pending data to write on the bufferevent, it probably won't be
- flushed before the bufferevent is freed.
-
+ If there is pending data to write on the bufferevent, it probably won't be
+ flushed before the bufferevent is freed.
+
@param bufev the bufferevent structure to be freed.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_free(struct bufferevent *bufev);
@@ -319,54 +319,54 @@ void bufferevent_free(struct bufferevent *bufev);
(readcb, writecb, and errorcb)
@see bufferevent_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_setcb(struct bufferevent *bufev,
bufferevent_data_cb readcb, bufferevent_data_cb writecb,
bufferevent_event_cb eventcb, void *cbarg);
/**
- Retrieves the callbacks for a bufferevent.
-
- @param bufev the bufferevent to examine.
- @param readcb_ptr if readcb_ptr is nonnull, *readcb_ptr is set to the current
- read callback for the bufferevent.
- @param writecb_ptr if writecb_ptr is nonnull, *writecb_ptr is set to the
- current write callback for the bufferevent.
- @param eventcb_ptr if eventcb_ptr is nonnull, *eventcb_ptr is set to the
- current event callback for the bufferevent.
- @param cbarg_ptr if cbarg_ptr is nonnull, *cbarg_ptr is set to the current
- callback argument for the bufferevent.
- @see buffervent_setcb()
-*/
-EVENT2_EXPORT_SYMBOL
-void bufferevent_getcb(struct bufferevent *bufev,
- bufferevent_data_cb *readcb_ptr,
- bufferevent_data_cb *writecb_ptr,
- bufferevent_event_cb *eventcb_ptr,
- void **cbarg_ptr);
-
-/**
+ Retrieves the callbacks for a bufferevent.
+
+ @param bufev the bufferevent to examine.
+ @param readcb_ptr if readcb_ptr is nonnull, *readcb_ptr is set to the current
+ read callback for the bufferevent.
+ @param writecb_ptr if writecb_ptr is nonnull, *writecb_ptr is set to the
+ current write callback for the bufferevent.
+ @param eventcb_ptr if eventcb_ptr is nonnull, *eventcb_ptr is set to the
+ current event callback for the bufferevent.
+ @param cbarg_ptr if cbarg_ptr is nonnull, *cbarg_ptr is set to the current
+ callback argument for the bufferevent.
+ @see buffervent_setcb()
+*/
+EVENT2_EXPORT_SYMBOL
+void bufferevent_getcb(struct bufferevent *bufev,
+ bufferevent_data_cb *readcb_ptr,
+ bufferevent_data_cb *writecb_ptr,
+ bufferevent_event_cb *eventcb_ptr,
+ void **cbarg_ptr);
+
+/**
Changes the file descriptor on which the bufferevent operates.
Not supported for all bufferevent types.
@param bufev the bufferevent object for which to change the file descriptor
@param fd the file descriptor to operate on
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_setfd(struct bufferevent *bufev, evutil_socket_t fd);
/**
Returns the file descriptor associated with a bufferevent, or -1 if
no file descriptor is associated with the bufferevent.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
evutil_socket_t bufferevent_getfd(struct bufferevent *bufev);
/**
Returns the underlying bufferevent associated with a bufferevent (if
the bufferevent is a wrapper), or NULL if there is no underlying bufferevent.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *bufferevent_get_underlying(struct bufferevent *bufev);
/**
@@ -382,7 +382,7 @@ struct bufferevent *bufferevent_get_underlying(struct bufferevent *bufev);
@return 0 if successful, or -1 if an error occurred
@see bufferevent_write_buffer()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_write(struct bufferevent *bufev,
const void *data, size_t size);
@@ -396,7 +396,7 @@ int bufferevent_write(struct bufferevent *bufev,
@return 0 if successful, or -1 if an error occurred
@see bufferevent_write()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
@@ -410,7 +410,7 @@ int bufferevent_write_buffer(struct bufferevent *bufev, struct evbuffer *buf);
@param size the size of the data buffer, in bytes
@return the amount of data read, in bytes.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
/**
@@ -421,7 +421,7 @@ size_t bufferevent_read(struct bufferevent *bufev, void *data, size_t size);
@param buf the evbuffer to which to add data
@return 0 if successful, or -1 if an error occurred.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
/**
@@ -433,7 +433,7 @@ int bufferevent_read_buffer(struct bufferevent *bufev, struct evbuffer *buf);
@return the evbuffer object for the input buffer
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
/**
@@ -448,7 +448,7 @@ struct evbuffer *bufferevent_get_input(struct bufferevent *bufev);
@return the evbuffer object for the output buffer
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
/**
@@ -459,7 +459,7 @@ struct evbuffer *bufferevent_get_output(struct bufferevent *bufev);
@return 0 if successful, or -1 if an error occurred
@see bufferevent_disable()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_enable(struct bufferevent *bufev, short event);
/**
@@ -470,7 +470,7 @@ int bufferevent_enable(struct bufferevent *bufev, short event);
@return 0 if successful, or -1 if an error occurred
@see bufferevent_enable()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_disable(struct bufferevent *bufev, short event);
/**
@@ -479,7 +479,7 @@ int bufferevent_disable(struct bufferevent *bufev, short event);
@param bufev the bufferevent to inspect
@return A combination of EV_READ | EV_WRITE
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
short bufferevent_get_enabled(struct bufferevent *bufev);
/**
@@ -491,7 +491,7 @@ short bufferevent_get_enabled(struct bufferevent *bufev);
(In other words, if reading or writing is disabled, or if the
bufferevent's read or write operation has been suspended because
- there's no data to write, or not enough bandwidth, or so on, the
+ there's no data to write, or not enough bandwidth, or so on, the
timeout isn't active. The timeout only becomes active when we we're
willing to actually read or write.)
@@ -508,7 +508,7 @@ short bufferevent_get_enabled(struct bufferevent *bufev);
@param timeout_read the read timeout, or NULL
@param timeout_write the write timeout, or NULL
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_set_timeouts(struct bufferevent *bufev,
const struct timeval *timeout_read, const struct timeval *timeout_write);
@@ -518,9 +518,9 @@ int bufferevent_set_timeouts(struct bufferevent *bufev,
On input, a bufferevent does not invoke the user read callback unless
there is at least low watermark data in the buffer. If the read buffer
is beyond the high watermark, the bufferevent stops reading from the network.
- But be aware that bufferevent input/read buffer can overrun high watermark
- limit (typical example is openssl bufferevent), so you should not relay in
- this.
+ But be aware that bufferevent input/read buffer can overrun high watermark
+ limit (typical example is openssl bufferevent), so you should not relay in
+ this.
On output, the user write callback is invoked whenever the buffered data
falls below the low watermark. Filters that write to this bufev will try
@@ -533,65 +533,65 @@ int bufferevent_set_timeouts(struct bufferevent *bufev,
@param highmark the high watermark to set
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_setwatermark(struct bufferevent *bufev, short events,
size_t lowmark, size_t highmark);
/**
- Retrieves the watermarks for read or write events.
- Returns non-zero if events contains not only EV_READ or EV_WRITE.
- Returns zero if events equal EV_READ or EV_WRITE
-
- @param bufev the bufferevent to be examined
- @param events EV_READ or EV_WRITE
- @param lowmark receives the lower watermark if not NULL
- @param highmark receives the high watermark if not NULL
-*/
-EVENT2_EXPORT_SYMBOL
-int bufferevent_getwatermark(struct bufferevent *bufev, short events,
- size_t *lowmark, size_t *highmark);
-
-/**
+ Retrieves the watermarks for read or write events.
+ Returns non-zero if events contains not only EV_READ or EV_WRITE.
+ Returns zero if events equal EV_READ or EV_WRITE
+
+ @param bufev the bufferevent to be examined
+ @param events EV_READ or EV_WRITE
+ @param lowmark receives the lower watermark if not NULL
+ @param highmark receives the high watermark if not NULL
+*/
+EVENT2_EXPORT_SYMBOL
+int bufferevent_getwatermark(struct bufferevent *bufev, short events,
+ size_t *lowmark, size_t *highmark);
+
+/**
Acquire the lock on a bufferevent. Has no effect if locking was not
enabled with BEV_OPT_THREADSAFE.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_lock(struct bufferevent *bufev);
/**
Release the lock on a bufferevent. Has no effect if locking was not
enabled with BEV_OPT_THREADSAFE.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_unlock(struct bufferevent *bufev);
-
-/**
- * Public interface to manually increase the reference count of a bufferevent
- * this is useful in situations where a user may reference the bufferevent
- * somewhere else (unknown to libevent)
- *
- * @param bufev the bufferevent to increase the refcount on
- *
- */
-EVENT2_EXPORT_SYMBOL
-void bufferevent_incref(struct bufferevent *bufev);
-
-/**
- * Public interface to manually decrement the reference count of a bufferevent
- *
- * Warning: make sure you know what you're doing. This is mainly used in
- * conjunction with bufferevent_incref(). This will free up all data associated
- * with a bufferevent if the reference count hits 0.
- *
- * @param bufev the bufferevent to decrement the refcount on
- *
- * @return 1 if the bufferevent was freed, otherwise 0 (still referenced)
- */
-EVENT2_EXPORT_SYMBOL
-int bufferevent_decref(struct bufferevent *bufev);
-
+
/**
+ * Public interface to manually increase the reference count of a bufferevent
+ * this is useful in situations where a user may reference the bufferevent
+ * somewhere else (unknown to libevent)
+ *
+ * @param bufev the bufferevent to increase the refcount on
+ *
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_incref(struct bufferevent *bufev);
+
+/**
+ * Public interface to manually decrement the reference count of a bufferevent
+ *
+ * Warning: make sure you know what you're doing. This is mainly used in
+ * conjunction with bufferevent_incref(). This will free up all data associated
+ * with a bufferevent if the reference count hits 0.
+ *
+ * @param bufev the bufferevent to decrement the refcount on
+ *
+ * @return 1 if the bufferevent was freed, otherwise 0 (still referenced)
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_decref(struct bufferevent *bufev);
+
+/**
Flags that can be passed into filters to let them know how to
deal with the incoming data.
*/
@@ -614,55 +614,55 @@ enum bufferevent_flush_mode {
@param mode either BEV_NORMAL or BEV_FLUSH or BEV_FINISHED
@return -1 on failure, 0 if no data was produces, 1 if data was produced
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_flush(struct bufferevent *bufev,
short iotype,
enum bufferevent_flush_mode mode);
/**
- Flags for bufferevent_trigger(_event) that modify when and how to trigger
- the callback.
-*/
-enum bufferevent_trigger_options {
- /** trigger the callback regardless of the watermarks */
- BEV_TRIG_IGNORE_WATERMARKS = (1<<16),
-
- /** defer even if the callbacks are not */
- BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS
-
- /* (Note: for internal reasons, these need to be disjoint from
- * bufferevent_options, except when they mean the same thing. */
-};
-
-/**
- Triggers bufferevent data callbacks.
-
- The function will honor watermarks unless options contain
- BEV_TRIG_IGNORE_WATERMARKS. If the options contain BEV_OPT_DEFER_CALLBACKS,
- the callbacks are deferred.
-
- @param bufev the bufferevent object
- @param iotype either EV_READ or EV_WRITE or both.
- @param options
- */
-EVENT2_EXPORT_SYMBOL
-void bufferevent_trigger(struct bufferevent *bufev, short iotype,
- int options);
-
-/**
- Triggers the bufferevent event callback.
-
- If the options contain BEV_OPT_DEFER_CALLBACKS, the callbacks are deferred.
-
- @param bufev the bufferevent object
- @param what the flags to pass onto the event callback
- @param options
- */
-EVENT2_EXPORT_SYMBOL
-void bufferevent_trigger_event(struct bufferevent *bufev, short what,
- int options);
-
-/**
+ Flags for bufferevent_trigger(_event) that modify when and how to trigger
+ the callback.
+*/
+enum bufferevent_trigger_options {
+ /** trigger the callback regardless of the watermarks */
+ BEV_TRIG_IGNORE_WATERMARKS = (1<<16),
+
+ /** defer even if the callbacks are not */
+ BEV_TRIG_DEFER_CALLBACKS = BEV_OPT_DEFER_CALLBACKS
+
+ /* (Note: for internal reasons, these need to be disjoint from
+ * bufferevent_options, except when they mean the same thing. */
+};
+
+/**
+ Triggers bufferevent data callbacks.
+
+ The function will honor watermarks unless options contain
+ BEV_TRIG_IGNORE_WATERMARKS. If the options contain BEV_OPT_DEFER_CALLBACKS,
+ the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param iotype either EV_READ or EV_WRITE or both.
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger(struct bufferevent *bufev, short iotype,
+ int options);
+
+/**
+ Triggers the bufferevent event callback.
+
+ If the options contain BEV_OPT_DEFER_CALLBACKS, the callbacks are deferred.
+
+ @param bufev the bufferevent object
+ @param what the flags to pass onto the event callback
+ @param options
+ */
+EVENT2_EXPORT_SYMBOL
+void bufferevent_trigger_event(struct bufferevent *bufev, short what,
+ int options);
+
+/**
@name Filtering support
@{
@@ -717,7 +717,7 @@ typedef enum bufferevent_filter_result (*bufferevent_filter_cb)(
this bufferevent is freed.
@param ctx A context pointer to pass to the filter functions.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *
bufferevent_filter_new(struct bufferevent *underlying,
bufferevent_filter_cb input_filter,
@@ -737,7 +737,7 @@ bufferevent_filter_new(struct bufferevent *underlying,
@param pair A pointer to an array to hold the two new bufferevent objects.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_pair_new(struct event_base *base, int options,
struct bufferevent *pair[2]);
@@ -745,7 +745,7 @@ int bufferevent_pair_new(struct event_base *base, int options,
Given one bufferevent returned by bufferevent_pair_new(), returns the
other one if it still exists. Otherwise returns NULL.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *bufferevent_pair_get_partner(struct bufferevent *bev);
/**
@@ -779,7 +779,7 @@ struct bufferevent_rate_limit_group;
Note that all rate-limits hare are currently best-effort: future versions
of Libevent may implement them more tightly.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct ev_token_bucket_cfg *ev_token_bucket_cfg_new(
size_t read_rate, size_t read_burst,
size_t write_rate, size_t write_burst,
@@ -790,7 +790,7 @@ struct ev_token_bucket_cfg *ev_token_bucket_cfg_new(
Note: 'cfg' is not currently reference-counted; it is not safe to free it
until no bufferevent is using it.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg);
/**
@@ -802,9 +802,9 @@ void ev_token_bucket_cfg_free(struct ev_token_bucket_cfg *cfg);
They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
bufferevents.
- Return 0 on success, -1 on failure.
+ Return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_set_rate_limit(struct bufferevent *bev,
struct ev_token_bucket_cfg *cfg);
@@ -825,7 +825,7 @@ int bufferevent_set_rate_limit(struct bufferevent *bev,
They are: socket-based bufferevents (normal and IOCP-based), and SSL-based
bufferevents.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent_rate_limit_group *bufferevent_rate_limit_group_new(
struct event_base *base,
const struct ev_token_bucket_cfg *cfg);
@@ -834,7 +834,7 @@ struct bufferevent_rate_limit_group *bufferevent_rate_limit_group_new(
Return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_rate_limit_group_set_cfg(
struct bufferevent_rate_limit_group *,
const struct ev_token_bucket_cfg *);
@@ -853,9 +853,9 @@ int bufferevent_rate_limit_group_set_cfg(
The default min-share is currently 64 bytes.
- Returns 0 on success, -1 on failure.
+ Returns 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_rate_limit_group_set_min_share(
struct bufferevent_rate_limit_group *, size_t);
@@ -863,7 +863,7 @@ int bufferevent_rate_limit_group_set_min_share(
Free a rate-limiting group. The group must have no members when
this function is called.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *);
/**
@@ -876,43 +876,43 @@ void bufferevent_rate_limit_group_free(struct bufferevent_rate_limit_group *);
Return 0 on success and -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_add_to_rate_limit_group(struct bufferevent *bev,
struct bufferevent_rate_limit_group *g);
/** Remove 'bev' from its current rate-limit group (if any). */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_remove_from_rate_limit_group(struct bufferevent *bev);
/**
- Set the size limit for single read operation.
-
- Set to 0 for a reasonable default.
-
- Return 0 on success and -1 on failure.
- */
-EVENT2_EXPORT_SYMBOL
-int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
-
-/**
- Set the size limit for single write operation.
-
- Set to 0 for a reasonable default.
-
- Return 0 on success and -1 on failure.
- */
-EVENT2_EXPORT_SYMBOL
-int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
-
-/** Get the current size limit for single read operation. */
-EVENT2_EXPORT_SYMBOL
-ev_ssize_t bufferevent_get_max_single_read(struct bufferevent *bev);
-
-/** Get the current size limit for single write operation. */
-EVENT2_EXPORT_SYMBOL
-ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
-
-/**
+ Set the size limit for single read operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_read(struct bufferevent *bev, size_t size);
+
+/**
+ Set the size limit for single write operation.
+
+ Set to 0 for a reasonable default.
+
+ Return 0 on success and -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_set_max_single_write(struct bufferevent *bev, size_t size);
+
+/** Get the current size limit for single read operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_read(struct bufferevent *bev);
+
+/** Get the current size limit for single write operation. */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
+
+/**
@name Rate limit inspection
Return the current read or write bucket size for a bufferevent.
@@ -923,20 +923,20 @@ ev_ssize_t bufferevent_get_max_single_write(struct bufferevent *bev);
@{
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_get_read_limit(struct bufferevent *bev);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_get_write_limit(struct bufferevent *bev);
/*@}*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_get_max_to_read(struct bufferevent *bev);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_get_max_to_write(struct bufferevent *bev);
-EVENT2_EXPORT_SYMBOL
-const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct bufferevent * bev);
-
+EVENT2_EXPORT_SYMBOL
+const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct bufferevent * bev);
+
/**
@name Group Rate limit inspection
@@ -946,10 +946,10 @@ const struct ev_token_bucket_cfg *bufferevent_get_token_bucket_cfg(const struct
@{
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_rate_limit_group_get_read_limit(
struct bufferevent_rate_limit_group *);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t bufferevent_rate_limit_group_get_write_limit(
struct bufferevent_rate_limit_group *);
/*@}*/
@@ -968,9 +968,9 @@ ev_ssize_t bufferevent_rate_limit_group_get_write_limit(
@{
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_decrement_read_limit(struct bufferevent *bev, ev_ssize_t decr);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr);
/*@}*/
@@ -987,10 +987,10 @@ int bufferevent_decrement_write_limit(struct bufferevent *bev, ev_ssize_t decr);
@{
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_rate_limit_group_decrement_read(
struct bufferevent_rate_limit_group *, ev_ssize_t);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_rate_limit_group_decrement_write(
struct bufferevent_rate_limit_group *, ev_ssize_t);
/*@}*/
@@ -1002,7 +1002,7 @@ int bufferevent_rate_limit_group_decrement_write(
* Set the variable pointed to by total_read_out to the total number of bytes
* ever read on grp, and the variable pointed to by total_written_out to the
* total number of bytes ever written on grp. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_rate_limit_group_get_totals(
struct bufferevent_rate_limit_group *grp,
ev_uint64_t *total_read_out, ev_uint64_t *total_written_out);
@@ -1012,7 +1012,7 @@ void bufferevent_rate_limit_group_get_totals(
*
* Reset the number of bytes read or written on grp as given by
* bufferevent_rate_limit_group_reset_totals(). */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void
bufferevent_rate_limit_group_reset_totals(
struct bufferevent_rate_limit_group *grp);
@@ -1021,4 +1021,4 @@ bufferevent_rate_limit_group_reset_totals(
}
#endif
-#endif /* EVENT2_BUFFEREVENT_H_INCLUDED_ */
+#endif /* EVENT2_BUFFEREVENT_H_INCLUDED_ */