aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/libevent/include/event2
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
commit778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (patch)
treebe835aa92c6248212e705f25388ebafcf84bc7a1 /contrib/libs/libevent/include/event2
parent194cae0e8855b11be2005e1eff12c660c3ee9774 (diff)
downloadydb-778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5.tar.gz
Restoring authorship annotation for <kikht@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/libevent/include/event2')
-rw-r--r--contrib/libs/libevent/include/event2/buffer.h500
-rw-r--r--contrib/libs/libevent/include/event2/buffer_compat.h20
-rw-r--r--contrib/libs/libevent/include/event2/bufferevent.h426
-rw-r--r--contrib/libs/libevent/include/event2/bufferevent_compat.h12
-rw-r--r--contrib/libs/libevent/include/event2/bufferevent_ssl.h64
-rw-r--r--contrib/libs/libevent/include/event2/bufferevent_struct.h10
-rw-r--r--contrib/libs/libevent/include/event2/dns.h236
-rw-r--r--contrib/libs/libevent/include/event2/dns_compat.h58
-rw-r--r--contrib/libs/libevent/include/event2/dns_struct.h10
-rw-r--r--contrib/libs/libevent/include/event2/event-config-linux.h488
-rw-r--r--contrib/libs/libevent/include/event2/event-config-musl.h6
-rw-r--r--contrib/libs/libevent/include/event2/event-config-osx.h284
-rw-r--r--contrib/libs/libevent/include/event2/event-config-win.h228
-rw-r--r--contrib/libs/libevent/include/event2/event-config.h6
-rw-r--r--contrib/libs/libevent/include/event2/event.h1046
-rw-r--r--contrib/libs/libevent/include/event2/event_compat.h30
-rw-r--r--contrib/libs/libevent/include/event2/event_struct.h136
-rw-r--r--contrib/libs/libevent/include/event2/http.h756
-rw-r--r--contrib/libs/libevent/include/event2/http_compat.h24
-rw-r--r--contrib/libs/libevent/include/event2/http_struct.h54
-rw-r--r--contrib/libs/libevent/include/event2/keyvalq_struct.h12
-rw-r--r--contrib/libs/libevent/include/event2/listener.h100
-rw-r--r--contrib/libs/libevent/include/event2/rpc.h94
-rw-r--r--contrib/libs/libevent/include/event2/rpc_compat.h6
-rw-r--r--contrib/libs/libevent/include/event2/rpc_struct.h34
-rw-r--r--contrib/libs/libevent/include/event2/tag.h54
-rw-r--r--contrib/libs/libevent/include/event2/tag_compat.h6
-rw-r--r--contrib/libs/libevent/include/event2/thread.h48
-rw-r--r--contrib/libs/libevent/include/event2/util.h496
-rw-r--r--contrib/libs/libevent/include/event2/visibility.h134
30 files changed, 2689 insertions, 2689 deletions
diff --git a/contrib/libs/libevent/include/event2/buffer.h b/contrib/libs/libevent/include/event2/buffer.h
index fb776f5480..88af3ae141 100644
--- a/contrib/libs/libevent/include/event2/buffer.h
+++ b/contrib/libs/libevent/include/event2/buffer.h
@@ -23,8 +23,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_BUFFER_H_INCLUDED_
-#define EVENT2_BUFFER_H_INCLUDED_
+#ifndef EVENT2_BUFFER_H_INCLUDED_
+#define EVENT2_BUFFER_H_INCLUDED_
/** @file event2/buffer.h
@@ -72,18 +72,18 @@
evbuffer_peek() if you don't require that the memory to be contiguous.
*/
-#include <event2/visibility.h>
-
+#include <event2/visibility.h>
+
#ifdef __cplusplus
extern "C" {
#endif
#include <event2/event-config.h>
#include <stdarg.h>
-#ifdef EVENT__HAVE_SYS_TYPES_H
+#ifdef EVENT__HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef EVENT__HAVE_SYS_UIO_H
+#ifdef EVENT__HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
#include <event2/util.h>
@@ -95,7 +95,7 @@ extern "C" {
@see event2/event.h for more information
*/
struct evbuffer
-#ifdef EVENT_IN_DOXYGEN_
+#ifdef EVENT_IN_DOXYGEN_
{}
#endif
;
@@ -105,23 +105,23 @@ struct evbuffer
Used when repeatedly searching through a buffer. Calling any function
that modifies or re-packs the buffer contents may invalidate all
- evbuffer_ptrs for that buffer. Do not modify or contruct these values
- except with evbuffer_ptr_set.
-
- An evbuffer_ptr can represent any position from the start of a buffer up
- to a position immediately after the end of a buffer.
-
- @see evbuffer_ptr_set()
+ evbuffer_ptrs for that buffer. Do not modify or contruct these values
+ except with evbuffer_ptr_set.
+
+ An evbuffer_ptr can represent any position from the start of a buffer up
+ to a position immediately after the end of a buffer.
+
+ @see evbuffer_ptr_set()
*/
struct evbuffer_ptr {
ev_ssize_t pos;
- /* Do not alter or rely on the values of fields: they are for internal
- * use */
+ /* Do not alter or rely on the values of fields: they are for internal
+ * use */
struct {
void *chain;
size_t pos_in_chain;
- } internal_;
+ } internal_;
};
/** Describes a single extent of memory inside an evbuffer. Used for
@@ -129,10 +129,10 @@ struct evbuffer_ptr {
@see evbuffer_reserve_space, evbuffer_commit_space, evbuffer_peek
*/
-#ifdef EVENT__HAVE_SYS_UIO_H
+#ifdef EVENT__HAVE_SYS_UIO_H
#define evbuffer_iovec iovec
/* Internal use -- defined only if we are using the native struct iovec */
-#define EVBUFFER_IOVEC_IS_NATIVE_
+#define EVBUFFER_IOVEC_IS_NATIVE_
#else
struct evbuffer_iovec {
/** The start of the extent of memory. */
@@ -148,14 +148,14 @@ struct evbuffer_iovec {
@return a pointer to a newly allocated evbuffer struct, or NULL if an error
occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer *evbuffer_new(void);
/**
Deallocate storage for an evbuffer.
@param buf pointer to the evbuffer to be freed
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evbuffer_free(struct evbuffer *buf);
/**
@@ -170,21 +170,21 @@ void evbuffer_free(struct evbuffer *buf);
@param lock A lock object, or NULL if we should allocate our own.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_enable_locking(struct evbuffer *buf, void *lock);
/**
Acquire the lock on an evbuffer. Has no effect if locking was not enabled
with evbuffer_enable_locking.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evbuffer_lock(struct evbuffer *buf);
/**
Release the lock on an evbuffer. Has no effect if locking was not enabled
with evbuffer_enable_locking.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evbuffer_unlock(struct evbuffer *buf);
@@ -212,7 +212,7 @@ void evbuffer_unlock(struct evbuffer *buf);
* @param flags One or more EVBUFFER_FLAG_* options
* @return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags);
/** Change the flags that are set for an evbuffer by removing some.
*
@@ -221,7 +221,7 @@ int evbuffer_set_flags(struct evbuffer *buf, ev_uint64_t flags);
* @param flags One or more EVBUFFER_FLAG_* options
* @return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags);
/**
@@ -230,7 +230,7 @@ int evbuffer_clear_flags(struct evbuffer *buf, ev_uint64_t flags);
@param buf pointer to the evbuffer
@return the number of bytes stored in the evbuffer
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
size_t evbuffer_get_length(const struct evbuffer *buf);
/**
@@ -245,7 +245,7 @@ size_t evbuffer_get_length(const struct evbuffer *buf);
@return 0 if no data is available, otherwise the number of available bytes
in the first buffer chain.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
size_t evbuffer_get_contiguous_space(const struct evbuffer *buf);
/**
@@ -258,7 +258,7 @@ size_t evbuffer_get_contiguous_space(const struct evbuffer *buf);
@param datlen the new minimum length requirement
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_expand(struct evbuffer *buf, size_t datlen);
/**
@@ -294,7 +294,7 @@ int evbuffer_expand(struct evbuffer *buf, size_t datlen);
@return the number of provided extents, or -1 on error.
@see evbuffer_commit_space()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int
evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
struct evbuffer_iovec *vec, int n_vec);
@@ -320,7 +320,7 @@ evbuffer_reserve_space(struct evbuffer *buf, ev_ssize_t size,
@return 0 on success, -1 on error
@see evbuffer_reserve_space()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_commit_space(struct evbuffer *buf,
struct evbuffer_iovec *vec, int n_vecs);
@@ -332,7 +332,7 @@ int evbuffer_commit_space(struct evbuffer *buf,
@param datlen the number of bytes to be copied from the data buffer
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen);
@@ -347,7 +347,7 @@ int evbuffer_add(struct evbuffer *buf, const void *data, size_t datlen);
@param datlen the maximum size of the destination buffer
@return the number of bytes read, or -1 if we can't drain the buffer.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen);
/**
@@ -361,25 +361,25 @@ int evbuffer_remove(struct evbuffer *buf, void *data, size_t datlen);
@param datlen the maximum size of the destination buffer
@return the number of bytes read, or -1 if we can't drain the buffer.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_ssize_t evbuffer_copyout(struct evbuffer *buf, void *data_out, size_t datlen);
/**
- Read data from the middle of an evbuffer, and leave the buffer unchanged.
-
- If more bytes are requested than are available in the evbuffer, we
- only extract as many bytes as were available.
-
- @param buf the evbuffer to be read from
- @param pos the position to start reading from
- @param data_out the destination buffer to store the result
- @param datlen the maximum size of the destination buffer
- @return the number of bytes read, or -1 if we can't drain the buffer.
- */
-EVENT2_EXPORT_SYMBOL
-ev_ssize_t evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, void *data_out, size_t datlen);
-
-/**
+ Read data from the middle of an evbuffer, and leave the buffer unchanged.
+
+ If more bytes are requested than are available in the evbuffer, we
+ only extract as many bytes as were available.
+
+ @param buf the evbuffer to be read from
+ @param pos the position to start reading from
+ @param data_out the destination buffer to store the result
+ @param datlen the maximum size of the destination buffer
+ @return the number of bytes read, or -1 if we can't drain the buffer.
+ */
+EVENT2_EXPORT_SYMBOL
+ev_ssize_t evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr *pos, void *data_out, size_t datlen);
+
+/**
Read data from an evbuffer into another evbuffer, draining
the bytes from the source buffer. This function avoids copy
operations to the extent possible.
@@ -392,7 +392,7 @@ ev_ssize_t evbuffer_copyout_from(struct evbuffer *buf, const struct evbuffer_ptr
@param datlen the maximum numbers of bytes to transfer
@return the number of bytes read
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_remove_buffer(struct evbuffer *src, struct evbuffer *dst,
size_t datlen);
@@ -415,9 +415,9 @@ enum evbuffer_eol_style {
/** An EOL is a CR followed by an LF. */
EVBUFFER_EOL_CRLF_STRICT,
/** An EOL is a LF. */
- EVBUFFER_EOL_LF,
- /** An EOL is a NUL character (that is, a single byte with value 0) */
- EVBUFFER_EOL_NUL
+ EVBUFFER_EOL_LF,
+ /** An EOL is a NUL character (that is, a single byte with value 0) */
+ EVBUFFER_EOL_NUL
};
/**
@@ -434,7 +434,7 @@ enum evbuffer_eol_style {
* @param eol_style the style of line-ending to use.
* @return pointer to a single line, or NULL if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
enum evbuffer_eol_style eol_style);
@@ -450,27 +450,27 @@ char *evbuffer_readln(struct evbuffer *buffer, size_t *n_read_out,
@see evbuffer_remove_buffer()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add_buffer(struct evbuffer *outbuf, struct evbuffer *inbuf);
/**
- Copy data from one evbuffer into another evbuffer.
-
- This is a non-destructive add. The data from one buffer is copied
- into the other buffer. However, no unnecessary memory copies occur.
-
- Note that buffers already containing buffer references can't be added
- to other buffers.
-
- @param outbuf the output buffer
- @param inbuf the input buffer
- @return 0 if successful, or -1 if an error occurred
- */
-EVENT2_EXPORT_SYMBOL
-int evbuffer_add_buffer_reference(struct evbuffer *outbuf,
- struct evbuffer *inbuf);
-
-/**
+ Copy data from one evbuffer into another evbuffer.
+
+ This is a non-destructive add. The data from one buffer is copied
+ into the other buffer. However, no unnecessary memory copies occur.
+
+ Note that buffers already containing buffer references can't be added
+ to other buffers.
+
+ @param outbuf the output buffer
+ @param inbuf the input buffer
+ @return 0 if successful, or -1 if an error occurred
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_buffer_reference(struct evbuffer *outbuf,
+ struct evbuffer *inbuf);
+
+/**
A cleanup function for a piece of memory added to an evbuffer by
reference.
@@ -494,7 +494,7 @@ typedef void (*evbuffer_ref_cleanup_cb)(const void *data,
@param cleanupfn_arg optional argument to the cleanup callback
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add_reference(struct evbuffer *outbuf,
const void *data, size_t datlen,
evbuffer_ref_cleanup_cb cleanupfn, void *cleanupfn_arg);
@@ -513,140 +513,140 @@ int evbuffer_add_reference(struct evbuffer *outbuf,
The results of using evbuffer_remove() or evbuffer_pullup() on
evbuffers whose data was added using this function are undefined.
- For more fine-grained control, use evbuffer_add_file_segment.
-
+ For more fine-grained control, use evbuffer_add_file_segment.
+
@param outbuf the output buffer
@param fd the file descriptor
@param offset the offset from which to read data
- @param length how much data to read, or -1 to read as much as possible.
- (-1 requires that 'fd' support fstat.)
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add_file(struct evbuffer *outbuf, int fd, ev_off_t offset,
ev_off_t length);
/**
- An evbuffer_file_segment holds a reference to a range of a file --
- possibly the whole file! -- for use in writing from an evbuffer to a
- socket. It could be implemented with mmap, sendfile, splice, or (if all
- else fails) by just pulling all the data into RAM. A single
- evbuffer_file_segment can be added more than once, and to more than one
- evbuffer.
- */
-struct evbuffer_file_segment;
-
-/**
- Flag for creating evbuffer_file_segment: If this flag is set, then when
- the evbuffer_file_segment is freed and no longer in use by any
- evbuffer, the underlying fd is closed.
- */
-#define EVBUF_FS_CLOSE_ON_FREE 0x01
-/**
- Flag for creating evbuffer_file_segment: Disable memory-map based
- implementations.
- */
-#define EVBUF_FS_DISABLE_MMAP 0x02
-/**
- Flag for creating evbuffer_file_segment: Disable direct fd-to-fd
- implementations (including sendfile and splice).
-
- You might want to use this option if data needs to be taken from the
- evbuffer by any means other than writing it to the network: the sendfile
- backend is fast, but it only works for sending files directly to the
- network.
- */
-#define EVBUF_FS_DISABLE_SENDFILE 0x04
-/**
- Flag for creating evbuffer_file_segment: Do not allocate a lock for this
- segment. If this option is set, then neither the segment nor any
- evbuffer it is added to may ever be accessed from more than one thread
- at a time.
- */
-#define EVBUF_FS_DISABLE_LOCKING 0x08
-
-/**
- A cleanup function for a evbuffer_file_segment added to an evbuffer
- for reference.
- */
-typedef void (*evbuffer_file_segment_cleanup_cb)(
- struct evbuffer_file_segment const* seg, int flags, void* arg);
-
-/**
- Create and return a new evbuffer_file_segment for reading data from a
- file and sending it out via an evbuffer.
-
- This function avoids unnecessary data copies between userland and
- kernel. Where available, it uses sendfile or splice.
-
- The file descriptor must not be closed so long as any evbuffer is using
- this segment.
-
- The results of using evbuffer_remove() or evbuffer_pullup() or any other
- function that reads bytes from an evbuffer on any evbuffer containing
- the newly returned segment are undefined, unless you pass the
- EVBUF_FS_DISABLE_SENDFILE flag to this function.
-
- @param fd an open file to read from.
- @param offset an index within the file at which to start reading
- @param length how much data to read, or -1 to read as much as possible.
- (-1 requires that 'fd' support fstat.)
- @param flags any number of the EVBUF_FS_* flags
- @return a new evbuffer_file_segment, or NULL on failure.
- **/
-EVENT2_EXPORT_SYMBOL
-struct evbuffer_file_segment *evbuffer_file_segment_new(
- int fd, ev_off_t offset, ev_off_t length, unsigned flags);
-
-/**
- Free an evbuffer_file_segment
-
- It is safe to call this function even if the segment has been added to
- one or more evbuffers. The evbuffer_file_segment will not be freed
- until no more references to it exist.
- */
-EVENT2_EXPORT_SYMBOL
-void evbuffer_file_segment_free(struct evbuffer_file_segment *seg);
-
-/**
- Add cleanup callback and argument for the callback to an
- evbuffer_file_segment.
-
- The cleanup callback will be invoked when no more references to the
- evbuffer_file_segment exist.
- **/
-EVENT2_EXPORT_SYMBOL
-void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
- evbuffer_file_segment_cleanup_cb cb, void* arg);
-
-/**
- Insert some or all of an evbuffer_file_segment at the end of an evbuffer
-
- Note that the offset and length parameters of this function have a
- different meaning from those provided to evbuffer_file_segment_new: When
- you create the segment, the offset is the offset _within the file_, and
- the length is the length _of the segment_, whereas when you add a
- segment to an evbuffer, the offset is _within the segment_ and the
- length is the length of the _part of the segment you want to use.
-
- In other words, if you have a 10 KiB file, and you create an
- evbuffer_file_segment for it with offset 20 and length 1000, it will
- refer to bytes 20..1019 inclusive. If you then pass this segment to
- evbuffer_add_file_segment and specify an offset of 20 and a length of
- 50, you will be adding bytes 40..99 inclusive.
-
- @param buf the evbuffer to append to
- @param seg the segment to add
- @param offset the offset within the segment to start from
- @param length the amount of data to add, or -1 to add it all.
- @return 0 on success, -1 on failure.
- */
-EVENT2_EXPORT_SYMBOL
-int evbuffer_add_file_segment(struct evbuffer *buf,
- struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length);
-
-/**
+ An evbuffer_file_segment holds a reference to a range of a file --
+ possibly the whole file! -- for use in writing from an evbuffer to a
+ socket. It could be implemented with mmap, sendfile, splice, or (if all
+ else fails) by just pulling all the data into RAM. A single
+ evbuffer_file_segment can be added more than once, and to more than one
+ evbuffer.
+ */
+struct evbuffer_file_segment;
+
+/**
+ Flag for creating evbuffer_file_segment: If this flag is set, then when
+ the evbuffer_file_segment is freed and no longer in use by any
+ evbuffer, the underlying fd is closed.
+ */
+#define EVBUF_FS_CLOSE_ON_FREE 0x01
+/**
+ Flag for creating evbuffer_file_segment: Disable memory-map based
+ implementations.
+ */
+#define EVBUF_FS_DISABLE_MMAP 0x02
+/**
+ Flag for creating evbuffer_file_segment: Disable direct fd-to-fd
+ implementations (including sendfile and splice).
+
+ You might want to use this option if data needs to be taken from the
+ evbuffer by any means other than writing it to the network: the sendfile
+ backend is fast, but it only works for sending files directly to the
+ network.
+ */
+#define EVBUF_FS_DISABLE_SENDFILE 0x04
+/**
+ Flag for creating evbuffer_file_segment: Do not allocate a lock for this
+ segment. If this option is set, then neither the segment nor any
+ evbuffer it is added to may ever be accessed from more than one thread
+ at a time.
+ */
+#define EVBUF_FS_DISABLE_LOCKING 0x08
+
+/**
+ A cleanup function for a evbuffer_file_segment added to an evbuffer
+ for reference.
+ */
+typedef void (*evbuffer_file_segment_cleanup_cb)(
+ struct evbuffer_file_segment const* seg, int flags, void* arg);
+
+/**
+ Create and return a new evbuffer_file_segment for reading data from a
+ file and sending it out via an evbuffer.
+
+ This function avoids unnecessary data copies between userland and
+ kernel. Where available, it uses sendfile or splice.
+
+ The file descriptor must not be closed so long as any evbuffer is using
+ this segment.
+
+ The results of using evbuffer_remove() or evbuffer_pullup() or any other
+ function that reads bytes from an evbuffer on any evbuffer containing
+ the newly returned segment are undefined, unless you pass the
+ EVBUF_FS_DISABLE_SENDFILE flag to this function.
+
+ @param fd an open file to read from.
+ @param offset an index within the file at which to start reading
+ @param length how much data to read, or -1 to read as much as possible.
+ (-1 requires that 'fd' support fstat.)
+ @param flags any number of the EVBUF_FS_* flags
+ @return a new evbuffer_file_segment, or NULL on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+struct evbuffer_file_segment *evbuffer_file_segment_new(
+ int fd, ev_off_t offset, ev_off_t length, unsigned flags);
+
+/**
+ Free an evbuffer_file_segment
+
+ It is safe to call this function even if the segment has been added to
+ one or more evbuffers. The evbuffer_file_segment will not be freed
+ until no more references to it exist.
+ */
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_free(struct evbuffer_file_segment *seg);
+
+/**
+ Add cleanup callback and argument for the callback to an
+ evbuffer_file_segment.
+
+ The cleanup callback will be invoked when no more references to the
+ evbuffer_file_segment exist.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evbuffer_file_segment_add_cleanup_cb(struct evbuffer_file_segment *seg,
+ evbuffer_file_segment_cleanup_cb cb, void* arg);
+
+/**
+ Insert some or all of an evbuffer_file_segment at the end of an evbuffer
+
+ Note that the offset and length parameters of this function have a
+ different meaning from those provided to evbuffer_file_segment_new: When
+ you create the segment, the offset is the offset _within the file_, and
+ the length is the length _of the segment_, whereas when you add a
+ segment to an evbuffer, the offset is _within the segment_ and the
+ length is the length of the _part of the segment you want to use.
+
+ In other words, if you have a 10 KiB file, and you create an
+ evbuffer_file_segment for it with offset 20 and length 1000, it will
+ refer to bytes 20..1019 inclusive. If you then pass this segment to
+ evbuffer_add_file_segment and specify an offset of 20 and a length of
+ 50, you will be adding bytes 40..99 inclusive.
+
+ @param buf the evbuffer to append to
+ @param seg the segment to add
+ @param offset the offset within the segment to start from
+ @param length the amount of data to add, or -1 to add it all.
+ @return 0 on success, -1 on failure.
+ */
+EVENT2_EXPORT_SYMBOL
+int evbuffer_add_file_segment(struct evbuffer *buf,
+ struct evbuffer_file_segment *seg, ev_off_t offset, ev_off_t length);
+
+/**
Append a formatted string to the end of an evbuffer.
The string is formated as printf.
@@ -658,7 +658,7 @@ int evbuffer_add_file_segment(struct evbuffer *buf,
@see evutil_printf(), evbuffer_add_vprintf()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
#ifdef __GNUC__
__attribute__((format(printf, 2, 3)))
@@ -673,7 +673,7 @@ int evbuffer_add_printf(struct evbuffer *buf, const char *fmt, ...)
@param ap a varargs va_list argument array that will be passed to vprintf(3)
@return The number of bytes added if successful, or -1 if an error occurred.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
#ifdef __GNUC__
__attribute__((format(printf, 2, 0)))
@@ -688,7 +688,7 @@ int evbuffer_add_vprintf(struct evbuffer *buf, const char *fmt, va_list ap)
@param len the number of bytes to drain from the beginning of the buffer
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_drain(struct evbuffer *buf, size_t len);
@@ -702,7 +702,7 @@ int evbuffer_drain(struct evbuffer *buf, size_t len);
@return the number of bytes written, or -1 if an error occurred
@see evbuffer_read()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd);
/**
@@ -717,7 +717,7 @@ int evbuffer_write(struct evbuffer *buffer, evutil_socket_t fd);
@return the number of bytes written, or -1 if an error occurred
@see evbuffer_read()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
ev_ssize_t howmuch);
@@ -731,7 +731,7 @@ int evbuffer_write_atmost(struct evbuffer *buffer, evutil_socket_t fd,
@return the number of bytes read, or -1 if an error occurred
@see evbuffer_write()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_read(struct evbuffer *buffer, evutil_socket_t fd, int howmuch);
/**
@@ -745,7 +745,7 @@ int evbuffer_read(struct evbuffer *buffer, evutil_socket_t fd, int howmuch);
first occurrence of the string in the buffer after 'start'. The 'pos'
field of the result is -1 if the string was not found.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer_ptr evbuffer_search(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start);
/**
@@ -762,7 +762,7 @@ struct evbuffer_ptr evbuffer_search(struct evbuffer *buffer, const char *what, s
first occurrence of the string in the buffer after 'start'. The 'pos'
field of the result is -1 if the string was not found.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer_ptr evbuffer_search_range(struct evbuffer *buffer, const char *what, size_t len, const struct evbuffer_ptr *start, const struct evbuffer_ptr *end);
/**
@@ -780,25 +780,25 @@ enum evbuffer_ptr_how {
/**
Sets the search pointer in the buffer to position.
- There are two ways to use this function: you can call
- evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
- to move 'pos' to a position 'N' bytes after the start of the buffer, or
- evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_ADD)
- to move 'pos' forward by 'N' bytes.
-
- If evbuffer_ptr is not initialized, this function can only be called
+ There are two ways to use this function: you can call
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_SET)
+ to move 'pos' to a position 'N' bytes after the start of the buffer, or
+ evbuffer_ptr_set(buf, &pos, N, EVBUFFER_PTR_ADD)
+ to move 'pos' forward by 'N' bytes.
+
+ If evbuffer_ptr is not initialized, this function can only be called
with EVBUFFER_PTR_SET.
- An evbuffer_ptr can represent any position from the start of the buffer to
- a position immediately after the end of the buffer.
-
+ An evbuffer_ptr can represent any position from the start of the buffer to
+ a position immediately after the end of the buffer.
+
@param buffer the evbuffer to be search
@param ptr a pointer to a struct evbuffer_ptr
@param position the position at which to start the next search
@param how determines how the pointer should be manipulated.
@returns 0 on success or -1 otherwise
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int
evbuffer_ptr_set(struct evbuffer *buffer, struct evbuffer_ptr *ptr,
size_t position, enum evbuffer_ptr_how how);
@@ -817,7 +817,7 @@ evbuffer_ptr_set(struct evbuffer *buffer, struct evbuffer_ptr *ptr,
first occurrence EOL in the buffer after 'start'. The 'pos'
field of the result is -1 if the string was not found.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer_ptr evbuffer_search_eol(struct evbuffer *buffer,
struct evbuffer_ptr *start, size_t *eol_len_out,
enum evbuffer_eol_style eol_style);
@@ -850,7 +850,7 @@ struct evbuffer_ptr evbuffer_search_eol(struct evbuffer *buffer,
than n_vec if we would need more to return all the data that was
requested.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_peek(struct evbuffer *buffer, ev_ssize_t len,
struct evbuffer_ptr *start_at,
struct evbuffer_iovec *vec_out, int n_vec);
@@ -903,7 +903,7 @@ struct evbuffer_cb_entry;
@param cbarg an argument to be provided to the callback function
@return a handle to the callback on success, or NULL on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer_cb_entry *evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
/** Remove a callback from an evbuffer, given a handle returned from
@@ -914,7 +914,7 @@ struct evbuffer_cb_entry *evbuffer_add_cb(struct evbuffer *buffer, evbuffer_cb_f
@return 0 if a callback was removed, or -1 if no matching callback was
found.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_remove_cb_entry(struct evbuffer *buffer,
struct evbuffer_cb_entry *ent);
@@ -924,7 +924,7 @@ int evbuffer_remove_cb_entry(struct evbuffer *buffer,
@return 0 if a callback was removed, or -1 if no matching callback was
found.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg);
/** If this flag is not set, then a callback is temporarily disabled, and
@@ -941,7 +941,7 @@ int evbuffer_remove_cb(struct evbuffer *buffer, evbuffer_cb_func cb, void *cbarg
@param flags EVBUFFER_CB_ENABLED to re-enable the callback.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_cb_set_flags(struct evbuffer *buffer,
struct evbuffer_cb_entry *cb, ev_uint32_t flags);
@@ -952,7 +952,7 @@ int evbuffer_cb_set_flags(struct evbuffer *buffer,
@param flags EVBUFFER_CB_ENABLED to disable the callback.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_cb_clear_flags(struct evbuffer *buffer,
struct evbuffer_cb_entry *cb, ev_uint32_t flags);
@@ -966,7 +966,7 @@ int evbuffer_cb_clear_flags(struct evbuffer *buffer,
@param the buffer that the callback is watching.
@param cb the callback we want to suspend.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
/** Stop postponing a callback that we postponed with evbuffer_cb_suspend.
@@ -976,7 +976,7 @@ void evbuffer_cb_suspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
@param the buffer that the callback is watching.
@param cb the callback we want to stop suspending.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb);
#endif
@@ -986,11 +986,11 @@ void evbuffer_cb_unsuspend(struct evbuffer *buffer, struct evbuffer_cb_entry *cb
@param buf the evbuffer to make contiguous
@param size the number of bytes to make contiguous, or -1 to make the
entire buffer contiguous.
- @return a pointer to the contiguous memory array, or NULL if param size
- requested more data than is present in the buffer.
+ @return a pointer to the contiguous memory array, or NULL if param size
+ requested more data than is present in the buffer.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
unsigned char *evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size);
/**
@@ -1002,7 +1002,7 @@ unsigned char *evbuffer_pullup(struct evbuffer *buf, ev_ssize_t size);
@return 0 if successful, or -1 otherwise
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_prepend(struct evbuffer *buf, const void *data, size_t size);
/**
@@ -1013,7 +1013,7 @@ int evbuffer_prepend(struct evbuffer *buf, const void *data, size_t size);
@param src the evbuffer to prepend; it will be emptied as a result
@return 0 if successful, or -1 otherwise
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_prepend_buffer(struct evbuffer *dst, struct evbuffer* src);
/**
@@ -1030,7 +1030,7 @@ int evbuffer_prepend_buffer(struct evbuffer *dst, struct evbuffer* src);
we freeze the back.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_freeze(struct evbuffer *buf, int at_front);
/**
Re-enable calls that modify an evbuffer.
@@ -1040,7 +1040,7 @@ int evbuffer_freeze(struct evbuffer *buf, int at_front);
we unfreeze the back.
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_unfreeze(struct evbuffer *buf, int at_front);
struct event_base;
@@ -1051,27 +1051,27 @@ struct event_base;
This can be used to serialize all the callbacks to a single thread
of execution.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evbuffer_defer_callbacks(struct evbuffer *buffer, struct event_base *base);
-/**
- Append data from 1 or more iovec's to an evbuffer
-
- Calculates the number of bytes needed for an iovec structure and guarantees
- all data will fit into a single chain. Can be used in lieu of functionality
- which calls evbuffer_add() constantly before being used to increase
- performance.
-
- @param buffer the destination buffer
- @param vec the source iovec
- @param n_vec the number of iovec structures.
- @return the number of bytes successfully written to the output buffer.
-*/
-EVENT2_EXPORT_SYMBOL
-size_t evbuffer_add_iovec(struct evbuffer * buffer, struct evbuffer_iovec * vec, int n_vec);
-
+/**
+ Append data from 1 or more iovec's to an evbuffer
+
+ Calculates the number of bytes needed for an iovec structure and guarantees
+ all data will fit into a single chain. Can be used in lieu of functionality
+ which calls evbuffer_add() constantly before being used to increase
+ performance.
+
+ @param buffer the destination buffer
+ @param vec the source iovec
+ @param n_vec the number of iovec structures.
+ @return the number of bytes successfully written to the output buffer.
+*/
+EVENT2_EXPORT_SYMBOL
+size_t evbuffer_add_iovec(struct evbuffer * buffer, struct evbuffer_iovec * vec, int n_vec);
+
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_BUFFER_H_INCLUDED_ */
+#endif /* EVENT2_BUFFER_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/buffer_compat.h b/contrib/libs/libevent/include/event2/buffer_compat.h
index 8b55bc6fe6..0ce1025448 100644
--- a/contrib/libs/libevent/include/event2/buffer_compat.h
+++ b/contrib/libs/libevent/include/event2/buffer_compat.h
@@ -24,11 +24,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef EVENT2_BUFFER_COMPAT_H_INCLUDED_
-#define EVENT2_BUFFER_COMPAT_H_INCLUDED_
+#ifndef EVENT2_BUFFER_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFER_COMPAT_H_INCLUDED_
+
+#include <event2/visibility.h>
-#include <event2/visibility.h>
-
/** @file event2/buffer_compat.h
Obsolete and deprecated versions of the functions in buffer.h: provided
@@ -37,7 +37,7 @@
/**
- Obsolete alias for evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY).
+ Obsolete alias for evbuffer_readln(buffer, NULL, EVBUFFER_EOL_ANY).
@deprecated This function is deprecated because its behavior is not correct
for almost any protocol, and also because it's wholly subsumed by
@@ -47,7 +47,7 @@
@return pointer to a single line, or NULL if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evbuffer_readline(struct evbuffer *buffer);
/** Type definition for a callback that is invoked whenever data is added or
@@ -90,10 +90,10 @@ typedef void (*evbuffer_cb)(struct evbuffer *buffer, size_t old_len, size_t new_
@param cb the callback function to invoke when the evbuffer is modified,
or NULL to remove all callbacks.
@param cbarg an argument to be provided to the callback function
- @return 0 if successful, or -1 on error
+ @return 0 if successful, or -1 on error
*/
-EVENT2_EXPORT_SYMBOL
-int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
+EVENT2_EXPORT_SYMBOL
+int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
/**
@@ -104,7 +104,7 @@ int evbuffer_setcb(struct evbuffer *buffer, evbuffer_cb cb, void *cbarg);
@param len the length of the search string
@return a pointer to the beginning of the search string, or NULL if the search failed.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
unsigned char *evbuffer_find(struct evbuffer *buffer, const unsigned char *what, size_t len);
/** deprecated in favor of calling the functions directly */
diff --git a/contrib/libs/libevent/include/event2/bufferevent.h b/contrib/libs/libevent/include/event2/bufferevent.h
index 87876effec..48cd153563 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.
+/**
+ Return the priority of a bufferevent.
+
+ Only supported for socket bufferevents
+ */
+EVENT2_EXPORT_SYMBOL
+int bufferevent_get_priority(const struct bufferevent *bufev);
- 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_ */
diff --git a/contrib/libs/libevent/include/event2/bufferevent_compat.h b/contrib/libs/libevent/include/event2/bufferevent_compat.h
index 22aefba4b8..a5a3c7207d 100644
--- a/contrib/libs/libevent/include/event2/bufferevent_compat.h
+++ b/contrib/libs/libevent/include/event2/bufferevent_compat.h
@@ -25,11 +25,11 @@
* (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_COMPAT_H_INCLUDED_
-#define EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+#ifndef EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_
+
+#include <event2/visibility.h>
-#include <event2/visibility.h>
-
#define evbuffercb bufferevent_data_cb
#define everrorcb bufferevent_event_cb
@@ -74,7 +74,7 @@
error occurred
@see bufferevent_base_set(), bufferevent_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *bufferevent_new(evutil_socket_t fd,
evbuffercb readcb, evbuffercb writecb, everrorcb errorcb, void *cbarg);
@@ -86,7 +86,7 @@ struct bufferevent *bufferevent_new(evutil_socket_t fd,
@param timeout_read the read timeout
@param timeout_write the write timeout
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void bufferevent_settimeout(struct bufferevent *bufev,
int timeout_read, int timeout_write);
diff --git a/contrib/libs/libevent/include/event2/bufferevent_ssl.h b/contrib/libs/libevent/include/event2/bufferevent_ssl.h
index 39b4768562..bf39b844a9 100644
--- a/contrib/libs/libevent/include/event2/bufferevent_ssl.h
+++ b/contrib/libs/libevent/include/event2/bufferevent_ssl.h
@@ -23,14 +23,14 @@
* (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_SSL_H_INCLUDED_
-#define EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+#ifndef EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_SSL_H_INCLUDED_
/** @file event2/bufferevent_ssl.h
OpenSSL support for bufferevents.
*/
-#include <event2/visibility.h>
+#include <event2/visibility.h>
#include <event2/event-config.h>
#include <event2/bufferevent.h>
#include <event2/util.h>
@@ -52,7 +52,7 @@ enum bufferevent_ssl_state {
BUFFEREVENT_SSL_ACCEPTING = 2
};
-#if defined(EVENT__HAVE_OPENSSL) || defined(EVENT_IN_DOXYGEN_)
+#if defined(EVENT__HAVE_OPENSSL) || defined(EVENT_IN_DOXYGEN_)
/**
Create a new SSL bufferevent to send its data over another bufferevent.
@@ -64,7 +64,7 @@ enum bufferevent_ssl_state {
@param options One or more bufferevent_options
@return A new bufferevent on success, or NULL on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *
bufferevent_openssl_filter_new(struct event_base *base,
struct bufferevent *underlying,
@@ -82,7 +82,7 @@ bufferevent_openssl_filter_new(struct event_base *base,
@param options One or more bufferevent_options
@return A new bufferevent on success, or NULL on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct bufferevent *
bufferevent_openssl_socket_new(struct event_base *base,
evutil_socket_t fd,
@@ -90,39 +90,39 @@ bufferevent_openssl_socket_new(struct event_base *base,
enum bufferevent_ssl_state state,
int options);
-/** Control how to report dirty SSL shutdowns.
-
- If the peer (or the network, or an attacker) closes the TCP
- connection before closing the SSL channel, and the protocol is SSL >= v3,
- this is a "dirty" shutdown. If allow_dirty_shutdown is 0 (default),
- this is reported as BEV_EVENT_ERROR.
-
- If instead allow_dirty_shutdown=1, a dirty shutdown is reported as
- BEV_EVENT_EOF.
-
- (Note that if the protocol is < SSLv3, you will always receive
- BEV_EVENT_EOF, since SSL 2 and earlier cannot distinguish a secure
- connection close from a dirty one. This is one reason (among many)
- not to use SSL 2.)
-*/
-
-EVENT2_EXPORT_SYMBOL
-int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev);
-EVENT2_EXPORT_SYMBOL
-void bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
- int allow_dirty_shutdown);
-
+/** Control how to report dirty SSL shutdowns.
+
+ If the peer (or the network, or an attacker) closes the TCP
+ connection before closing the SSL channel, and the protocol is SSL >= v3,
+ this is a "dirty" shutdown. If allow_dirty_shutdown is 0 (default),
+ this is reported as BEV_EVENT_ERROR.
+
+ If instead allow_dirty_shutdown=1, a dirty shutdown is reported as
+ BEV_EVENT_EOF.
+
+ (Note that if the protocol is < SSLv3, you will always receive
+ BEV_EVENT_EOF, since SSL 2 and earlier cannot distinguish a secure
+ connection close from a dirty one. This is one reason (among many)
+ not to use SSL 2.)
+*/
+
+EVENT2_EXPORT_SYMBOL
+int bufferevent_openssl_get_allow_dirty_shutdown(struct bufferevent *bev);
+EVENT2_EXPORT_SYMBOL
+void bufferevent_openssl_set_allow_dirty_shutdown(struct bufferevent *bev,
+ int allow_dirty_shutdown);
+
/** Return the underlying openssl SSL * object for an SSL bufferevent. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct ssl_st *
bufferevent_openssl_get_ssl(struct bufferevent *bufev);
/** Tells a bufferevent to begin SSL renegotiation. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int bufferevent_ssl_renegotiate(struct bufferevent *bev);
/** Return the most recent OpenSSL error reported on an SSL bufferevent. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
unsigned long bufferevent_get_openssl_error(struct bufferevent *bev);
#endif
@@ -131,4 +131,4 @@ unsigned long bufferevent_get_openssl_error(struct bufferevent *bev);
}
#endif
-#endif /* EVENT2_BUFFEREVENT_SSL_H_INCLUDED_ */
+#endif /* EVENT2_BUFFEREVENT_SSL_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/bufferevent_struct.h b/contrib/libs/libevent/include/event2/bufferevent_struct.h
index 862f1d75f3..e84c082c30 100644
--- a/contrib/libs/libevent/include/event2/bufferevent_struct.h
+++ b/contrib/libs/libevent/include/event2/bufferevent_struct.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_STRUCT_H_INCLUDED_
-#define EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+#ifndef EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
+#define EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_
/** @file event2/bufferevent_struct.h
@@ -42,10 +42,10 @@ 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
@@ -113,4 +113,4 @@ struct bufferevent {
}
#endif
-#endif /* EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_ */
+#endif /* EVENT2_BUFFEREVENT_STRUCT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/dns.h b/contrib/libs/libevent/include/event2/dns.h
index 1a59fad056..13ce027e4a 100644
--- a/contrib/libs/libevent/include/event2/dns.h
+++ b/contrib/libs/libevent/include/event2/dns.h
@@ -132,11 +132,11 @@
* with the next probe.
*/
-#ifndef EVENT2_DNS_H_INCLUDED_
-#define EVENT2_DNS_H_INCLUDED_
+#ifndef EVENT2_DNS_H_INCLUDED_
+#define EVENT2_DNS_H_INCLUDED_
+
+#include <event2/visibility.h>
-#include <event2/visibility.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -179,39 +179,39 @@ extern "C" {
#define DNS_QUERY_NO_SEARCH 1
-/* Allow searching */
+/* Allow searching */
#define DNS_OPTION_SEARCH 1
-/* Parse "nameserver" and add default if no such section */
+/* Parse "nameserver" and add default if no such section */
#define DNS_OPTION_NAMESERVERS 2
-/* Parse additional options like:
- * - timeout:
- * - getaddrinfo-allow-skew:
- * - max-timeouts:
- * - max-inflight:
- * - attempts:
- * - randomize-case:
- * - initial-probe-timeout:
- */
+/* Parse additional options like:
+ * - timeout:
+ * - getaddrinfo-allow-skew:
+ * - max-timeouts:
+ * - max-inflight:
+ * - attempts:
+ * - randomize-case:
+ * - initial-probe-timeout:
+ */
#define DNS_OPTION_MISC 4
-/* Load hosts file (i.e. "/etc/hosts") */
+/* Load hosts file (i.e. "/etc/hosts") */
#define DNS_OPTION_HOSTSFILE 8
-/**
- * All above:
- * - DNS_OPTION_SEARCH
- * - DNS_OPTION_NAMESERVERS
- * - DNS_OPTION_MISC
- * - DNS_OPTION_HOSTSFILE
- */
-#define DNS_OPTIONS_ALL ( \
- DNS_OPTION_SEARCH | \
- DNS_OPTION_NAMESERVERS | \
- DNS_OPTION_MISC | \
- DNS_OPTION_HOSTSFILE | \
- 0 \
-)
-/* Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers
- * in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set) */
-#define DNS_OPTION_NAMESERVERS_NO_DEFAULT 16
+/**
+ * All above:
+ * - DNS_OPTION_SEARCH
+ * - DNS_OPTION_NAMESERVERS
+ * - DNS_OPTION_MISC
+ * - DNS_OPTION_HOSTSFILE
+ */
+#define DNS_OPTIONS_ALL ( \
+ DNS_OPTION_SEARCH | \
+ DNS_OPTION_NAMESERVERS | \
+ DNS_OPTION_MISC | \
+ DNS_OPTION_HOSTSFILE | \
+ 0 \
+)
+/* Do not "default" nameserver (i.e. "127.0.0.1:53") if there is no nameservers
+ * in resolv.conf, (iff DNS_OPTION_NAMESERVERS is set) */
+#define DNS_OPTION_NAMESERVERS_NO_DEFAULT 16
/* Obsolete name for DNS_QUERY_NO_SEARCH */
#define DNS_NO_SEARCH DNS_QUERY_NO_SEARCH
@@ -231,16 +231,16 @@ typedef void (*evdns_callback_type) (int result, char type, int count, int ttl,
struct evdns_base;
struct event_base;
-/** Flag for evdns_base_new: process resolv.conf. */
-#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
-/** Flag for evdns_base_new: Do not prevent the libevent event loop from
- * exiting when we have no active dns requests. */
-#define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
-/** Flag for evdns_base_new: If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not
- * add default nameserver if there are no nameservers in resolv.conf
- * @see DNS_OPTION_NAMESERVERS_NO_DEFAULT */
-#define EVDNS_BASE_NAMESERVERS_NO_DEFAULT 0x10000
-
+/** Flag for evdns_base_new: process resolv.conf. */
+#define EVDNS_BASE_INITIALIZE_NAMESERVERS 1
+/** Flag for evdns_base_new: Do not prevent the libevent event loop from
+ * exiting when we have no active dns requests. */
+#define EVDNS_BASE_DISABLE_WHEN_INACTIVE 0x8000
+/** Flag for evdns_base_new: If EVDNS_BASE_INITIALIZE_NAMESERVERS isset, do not
+ * add default nameserver if there are no nameservers in resolv.conf
+ * @see DNS_OPTION_NAMESERVERS_NO_DEFAULT */
+#define EVDNS_BASE_NAMESERVERS_NO_DEFAULT 0x10000
+
/**
Initialize the asynchronous DNS library.
@@ -249,12 +249,12 @@ struct event_base;
evdns_config_windows_nameservers() on Windows.
@param event_base the event base to associate the dns client with
- @param flags any of EVDNS_BASE_INITIALIZE_NAMESERVERS|
- EVDNS_BASE_DISABLE_WHEN_INACTIVE|EVDNS_BASE_NAMESERVERS_NO_DEFAULT
+ @param flags any of EVDNS_BASE_INITIALIZE_NAMESERVERS|
+ EVDNS_BASE_DISABLE_WHEN_INACTIVE|EVDNS_BASE_NAMESERVERS_NO_DEFAULT
@return evdns_base object if successful, or NULL if an error occurred.
@see evdns_base_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize_nameservers);
@@ -270,25 +270,25 @@ struct evdns_base * evdns_base_new(struct event_base *event_base, int initialize
active requests will return DNS_ERR_SHUTDOWN.
@see evdns_base_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_base_free(struct evdns_base *base, int fail_requests);
/**
- Remove all hosts entries that have been loaded into the event_base via
- evdns_base_load_hosts or via event_base_resolv_conf_parse.
-
- @param evdns_base the evdns base to remove outdated host addresses from
- */
-EVENT2_EXPORT_SYMBOL
-void evdns_base_clear_host_addresses(struct evdns_base *base);
-
-/**
+ Remove all hosts entries that have been loaded into the event_base via
+ evdns_base_load_hosts or via event_base_resolv_conf_parse.
+
+ @param evdns_base the evdns base to remove outdated host addresses from
+ */
+EVENT2_EXPORT_SYMBOL
+void evdns_base_clear_host_addresses(struct evdns_base *base);
+
+/**
Convert a DNS error code to a string.
@param err the DNS error code
@return a string containing an explanation of the error code
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evdns_err_to_string(int err);
@@ -303,7 +303,7 @@ const char *evdns_err_to_string(int err);
@return 0 if successful, or -1 if an error occurred
@see evdns_base_nameserver_ip_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_nameserver_add(struct evdns_base *base,
unsigned long int address);
@@ -319,7 +319,7 @@ int evdns_base_nameserver_add(struct evdns_base *base,
@return the number of configured nameservers
@see evdns_base_nameserver_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_count_nameservers(struct evdns_base *base);
/**
@@ -331,7 +331,7 @@ int evdns_base_count_nameservers(struct evdns_base *base);
@return 0 if successful, or -1 if an error occurred
@see evdns_base_resume()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
@@ -345,7 +345,7 @@ int evdns_base_clear_nameservers_and_suspend(struct evdns_base *base);
@return 0 if successful, or -1 if an error occurred
@see evdns_base_clear_nameservers_and_suspend()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_resume(struct evdns_base *base);
/**
@@ -365,14 +365,14 @@ int evdns_base_resume(struct evdns_base *base);
@return 0 if successful, or -1 if an error occurred
@see evdns_base_nameserver_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_nameserver_ip_add(struct evdns_base *base,
const char *ip_as_string);
/**
Add a nameserver by sockaddr.
**/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int
evdns_base_nameserver_sockaddr_add(struct evdns_base *base,
const struct sockaddr *sa, ev_socklen_t len, unsigned flags);
@@ -390,7 +390,7 @@ struct evdns_request;
@return an evdns_request object if successful, or NULL if an error occurred.
@see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
/**
@@ -404,7 +404,7 @@ struct evdns_request *evdns_base_resolve_ipv4(struct evdns_base *base, const cha
@return an evdns_request object if successful, or NULL if an error occurred.
@see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6(), evdns_cancel_request()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_request *evdns_base_resolve_ipv6(struct evdns_base *base, const char *name, int flags, evdns_callback_type callback, void *ptr);
struct in_addr;
@@ -421,7 +421,7 @@ struct in6_addr;
@return an evdns_request object if successful, or NULL if an error occurred.
@see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
@@ -436,7 +436,7 @@ struct evdns_request *evdns_base_resolve_reverse(struct evdns_base *base, const
@return an evdns_request object if successful, or NULL if an error occurred.
@see evdns_resolve_reverse_ipv6(), evdns_cancel_request()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_request *evdns_base_resolve_reverse_ipv6(struct evdns_base *base, const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
/**
@@ -446,7 +446,7 @@ struct evdns_request *evdns_base_resolve_reverse_ipv6(struct evdns_base *base, c
@param req the evdns_request that was returned by calling a resolve function
@see evdns_base_resolve_ipv4(), evdns_base_resolve_ipv6, evdns_base_resolve_reverse
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
/**
@@ -455,8 +455,8 @@ void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
The currently available configuration options are:
ndots, timeout, max-timeouts, max-inflight, attempts, randomize-case,
- bind-to, initial-probe-timeout, getaddrinfo-allow-skew,
- so-rcvbuf, so-sndbuf.
+ bind-to, initial-probe-timeout, getaddrinfo-allow-skew,
+ so-rcvbuf, so-sndbuf.
In versions before Libevent 2.0.3-alpha, the option name needed to end with
a colon.
@@ -466,7 +466,7 @@ void evdns_cancel_request(struct evdns_base *base, struct evdns_request *req);
@param val the value to be set
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_set_option(struct evdns_base *base, const char *option, const char *val);
@@ -486,13 +486,13 @@ int evdns_base_set_option(struct evdns_base *base, const char *option, const cha
@param base the evdns_base to which to apply this operation
@param flags any of DNS_OPTION_NAMESERVERS|DNS_OPTION_SEARCH|DNS_OPTION_MISC|
- DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL|DNS_OPTION_NAMESERVERS_NO_DEFAULT
+ DNS_OPTION_HOSTSFILE|DNS_OPTIONS_ALL|DNS_OPTION_NAMESERVERS_NO_DEFAULT
@param filename the path to the resolv.conf file
@return 0 if successful, or various positive error codes if an error
occurred (see above)
@see resolv.conf(3), evdns_config_windows_nameservers()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char *const filename);
/**
@@ -503,15 +503,15 @@ int evdns_base_resolv_conf_parse(struct evdns_base *base, int flags, const char
Note that only evdns_getaddrinfo uses the /etc/hosts entries.
- This function does not replace previously loaded hosts entries; to do that,
- call evdns_base_clear_host_addresses first.
-
+ This function does not replace previously loaded hosts entries; to do that,
+ call evdns_base_clear_host_addresses first.
+
Return 0 on success, negative on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
-#if defined(EVENT_IN_DOXYGEN_) || defined(_WIN32)
+#if defined(EVENT_IN_DOXYGEN_) || defined(_WIN32)
/**
Obtain nameserver information using the Windows API.
@@ -522,7 +522,7 @@ int evdns_base_load_hosts(struct evdns_base *base, const char *hosts_fname);
@return 0 if successful, or -1 if an error occurred
@see evdns_resolv_conf_parse()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_base_config_windows_nameservers(struct evdns_base *);
#define EVDNS_BASE_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
#endif
@@ -531,7 +531,7 @@ int evdns_base_config_windows_nameservers(struct evdns_base *);
/**
Clear the list of search domains.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_base_search_clear(struct evdns_base *base);
@@ -540,7 +540,7 @@ void evdns_base_search_clear(struct evdns_base *base);
@param domain the domain to be added to the search list
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_base_search_add(struct evdns_base *base, const char *domain);
@@ -552,7 +552,7 @@ void evdns_base_search_add(struct evdns_base *base, const char *domain);
@param ndots the new ndots parameter
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_base_search_ndots_set(struct evdns_base *base, const int ndots);
/**
@@ -571,7 +571,7 @@ typedef void (*evdns_debug_log_fn_type)(int is_warning, const char *msg);
@param fn the callback to be invoked when a log message is generated
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_set_log_fn(evdns_debug_log_fn_type fn);
/**
@@ -584,7 +584,7 @@ void evdns_set_log_fn(evdns_debug_log_fn_type fn);
NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
since Libevent now provides its own secure RNG.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
/**
@@ -596,7 +596,7 @@ void evdns_set_transaction_id_fn(ev_uint16_t (*fn)(void));
NOTE: This function has no effect in Libevent 2.0.4-alpha and later,
since Libevent now provides its own secure RNG.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_set_random_bytes_fn(void (*fn)(char *, size_t));
/*
@@ -648,50 +648,50 @@ typedef void (*evdns_request_callback_fn_type)(struct evdns_server_request *, vo
@param callback A function to invoke whenever we get a DNS request
on the socket.
@param user_data Data to pass to the callback.
- @return an evdns_server_port structure for this server port or NULL if
- an error occurred.
+ @return an evdns_server_port structure for this server port or NULL if
+ an error occurred.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_server_port *evdns_add_server_port_with_base(struct event_base *base, evutil_socket_t socket, int flags, evdns_request_callback_fn_type callback, void *user_data);
/** Close down a DNS server port, and free associated structures. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_close_server_port(struct evdns_server_port *port);
/** Sets some flags in a reply we're building.
Allows setting of the AA or RD flags
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_server_request_set_flags(struct evdns_server_request *req, int flags);
/* Functions to add an answer to an in-progress DNS reply.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_add_reply(struct evdns_server_request *req, int section, const char *name, int type, int dns_class, int ttl, int datalen, int is_name, const char *data);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_add_a_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_add_aaaa_reply(struct evdns_server_request *req, const char *name, int n, const void *addrs, int ttl);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_add_ptr_reply(struct evdns_server_request *req, struct in_addr *in, const char *inaddr_name, const char *hostname, int ttl);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_add_cname_reply(struct evdns_server_request *req, const char *name, const char *cname, int ttl);
/**
Send back a response to a DNS request, and free the request structure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_respond(struct evdns_server_request *req, int err);
/**
Free a DNS request without sending back a reply.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_server_request_drop(struct evdns_server_request *req);
struct sockaddr;
/**
Get the address that made a DNS request.
*/
-EVENT2_EXPORT_SYMBOL
-int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
+EVENT2_EXPORT_SYMBOL
+int evdns_server_request_get_requesting_addr(struct evdns_server_request *req, struct sockaddr *sa, int addr_len);
/** Callback for evdns_getaddrinfo. */
typedef void (*evdns_getaddrinfo_cb)(int result, struct evutil_addrinfo *res, void *arg);
@@ -715,7 +715,7 @@ struct evdns_getaddrinfo_request;
* - For ai_socktype, we only handle SOCKTYPE_STREAM, SOCKTYPE_UDP, and 0.
* - For ai_protocol, we only handle IPPROTO_TCP, IPPROTO_UDP, and 0.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_getaddrinfo_request *evdns_getaddrinfo(
struct evdns_base *dns_base,
const char *nodename, const char *servname,
@@ -725,27 +725,27 @@ struct evdns_getaddrinfo_request *evdns_getaddrinfo(
/* Cancel an in-progress evdns_getaddrinfo. This MUST NOT be called after the
* getaddrinfo's callback has been invoked. The resolves will be canceled,
* and the callback will be invoked with the error EVUTIL_EAI_CANCEL. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_getaddrinfo_cancel(struct evdns_getaddrinfo_request *req);
-/**
- Retrieve the address of the 'idx'th configured nameserver.
-
- @param base The evdns_base to examine.
- @param idx The index of the nameserver to get the address of.
- @param sa A location to receive the server's address.
- @param len The number of bytes available at sa.
-
- @return the number of bytes written into sa on success. On failure, returns
- -1 if idx is greater than the number of configured nameservers, or a
- value greater than 'len' if len was not high enough.
- */
-EVENT2_EXPORT_SYMBOL
-int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
- struct sockaddr *sa, ev_socklen_t len);
-
+/**
+ Retrieve the address of the 'idx'th configured nameserver.
+
+ @param base The evdns_base to examine.
+ @param idx The index of the nameserver to get the address of.
+ @param sa A location to receive the server's address.
+ @param len The number of bytes available at sa.
+
+ @return the number of bytes written into sa on success. On failure, returns
+ -1 if idx is greater than the number of configured nameservers, or a
+ value greater than 'len' if len was not high enough.
+ */
+EVENT2_EXPORT_SYMBOL
+int evdns_base_get_nameserver_addr(struct evdns_base *base, int idx,
+ struct sockaddr *sa, ev_socklen_t len);
+
#ifdef __cplusplus
}
#endif
-#endif /* !EVENT2_DNS_H_INCLUDED_ */
+#endif /* !EVENT2_DNS_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/dns_compat.h b/contrib/libs/libevent/include/event2/dns_compat.h
index 433607220d..a58c4b2937 100644
--- a/contrib/libs/libevent/include/event2/dns_compat.h
+++ b/contrib/libs/libevent/include/event2/dns_compat.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_DNS_COMPAT_H_INCLUDED_
-#define EVENT2_DNS_COMPAT_H_INCLUDED_
+#ifndef EVENT2_DNS_COMPAT_H_INCLUDED_
+#define EVENT2_DNS_COMPAT_H_INCLUDED_
/** @file event2/dns_compat.h
@@ -40,16 +40,16 @@ 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
/* For int types. */
#include <event2/util.h>
-#include <event2/visibility.h>
+#include <event2/visibility.h>
/**
Initialize the asynchronous DNS library.
@@ -67,7 +67,7 @@ extern "C" {
@return 0 if successful, or -1 if an error occurred
@see evdns_shutdown()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_init(void);
struct evdns_base;
@@ -78,7 +78,7 @@ struct evdns_base;
@deprecated This function is deprecated because use of the global
evdns_base is error-prone.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evdns_base *evdns_get_global_base(void);
/**
@@ -96,7 +96,7 @@ struct evdns_base *evdns_get_global_base(void);
active requests will return DNS_ERR_SHUTDOWN.
@see evdns_init()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_shutdown(int fail_requests);
/**
@@ -113,7 +113,7 @@ void evdns_shutdown(int fail_requests);
@return 0 if successful, or -1 if an error occurred
@see evdns_nameserver_ip_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_nameserver_add(unsigned long int address);
/**
@@ -131,7 +131,7 @@ int evdns_nameserver_add(unsigned long int address);
@return the number of configured nameservers
@see evdns_nameserver_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_count_nameservers(void);
/**
@@ -146,7 +146,7 @@ int evdns_count_nameservers(void);
@return 0 if successful, or -1 if an error occurred
@see evdns_resume()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_clear_nameservers_and_suspend(void);
/**
@@ -162,7 +162,7 @@ int evdns_clear_nameservers_and_suspend(void);
@return 0 if successful, or -1 if an error occurred
@see evdns_clear_nameservers_and_suspend()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resume(void);
/**
@@ -178,7 +178,7 @@ int evdns_resume(void);
@return 0 if successful, or -1 if an error occurred
@see evdns_nameserver_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_nameserver_ip_add(const char *ip_as_string);
/**
@@ -195,7 +195,7 @@ int evdns_nameserver_ip_add(const char *ip_as_string);
@return 0 if successful, or -1 if an error occurred
@see evdns_resolve_ipv6(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resolve_ipv4(const char *name, int flags, evdns_callback_type callback, void *ptr);
/**
@@ -208,7 +208,7 @@ int evdns_resolve_ipv4(const char *name, int flags, evdns_callback_type callback
@return 0 if successful, or -1 if an error occurred
@see evdns_resolve_ipv4(), evdns_resolve_reverse(), evdns_resolve_reverse_ipv6()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resolve_ipv6(const char *name, int flags, evdns_callback_type callback, void *ptr);
struct in_addr;
@@ -228,7 +228,7 @@ struct in6_addr;
@return 0 if successful, or -1 if an error occurred
@see evdns_resolve_reverse_ipv6()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_type callback, void *ptr);
/**
@@ -245,7 +245,7 @@ int evdns_resolve_reverse(const struct in_addr *in, int flags, evdns_callback_ty
@return 0 if successful, or -1 if an error occurred
@see evdns_resolve_reverse_ipv6()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callback_type callback, void *ptr);
/**
@@ -264,7 +264,7 @@ int evdns_resolve_reverse_ipv6(const struct in6_addr *in, int flags, evdns_callb
@param flags Ignored.
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_set_option(const char *option, const char *val, int flags);
/**
@@ -292,7 +292,7 @@ int evdns_set_option(const char *option, const char *val, int flags);
occurred (see above)
@see resolv.conf(3), evdns_config_windows_nameservers()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evdns_resolv_conf_parse(int flags, const char *const filename);
/**
@@ -302,7 +302,7 @@ int evdns_resolv_conf_parse(int flags, const char *const filename);
caller to specify which evdns_base it applies to. The recommended
function is evdns_base_search_clear().
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_search_clear(void);
/**
@@ -314,7 +314,7 @@ void evdns_search_clear(void);
@param domain the domain to be added to the search list
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_search_add(const char *domain);
/**
@@ -329,7 +329,7 @@ void evdns_search_add(const char *domain);
@param ndots the new ndots parameter
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evdns_search_ndots_set(const int ndots);
/**
@@ -340,13 +340,13 @@ void evdns_search_ndots_set(const int ndots);
function is evdns_add_server_port_with_base().
*/
-EVENT2_EXPORT_SYMBOL
-struct evdns_server_port *
-evdns_add_server_port(evutil_socket_t socket, int flags,
- evdns_request_callback_fn_type callback, void *user_data);
+EVENT2_EXPORT_SYMBOL
+struct evdns_server_port *
+evdns_add_server_port(evutil_socket_t socket, int flags,
+ evdns_request_callback_fn_type callback, void *user_data);
-#ifdef _WIN32
-EVENT2_EXPORT_SYMBOL
+#ifdef _WIN32
+EVENT2_EXPORT_SYMBOL
int evdns_config_windows_nameservers(void);
#define EVDNS_CONFIG_WINDOWS_NAMESERVERS_IMPLEMENTED
#endif
@@ -355,4 +355,4 @@ int evdns_config_windows_nameservers(void);
}
#endif
-#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/dns_struct.h b/contrib/libs/libevent/include/event2/dns_struct.h
index 18d7196d2f..593a8a70b6 100644
--- a/contrib/libs/libevent/include/event2/dns_struct.h
+++ b/contrib/libs/libevent/include/event2/dns_struct.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_DNS_STRUCT_H_INCLUDED_
-#define EVENT2_DNS_STRUCT_H_INCLUDED_
+#ifndef EVENT2_DNS_STRUCT_H_INCLUDED_
+#define EVENT2_DNS_STRUCT_H_INCLUDED_
/** @file event2/dns_struct.h
@@ -39,10 +39,10 @@ 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
@@ -76,5 +76,5 @@ struct evdns_server_question {
}
#endif
-#endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */
+#endif /* EVENT2_DNS_STRUCT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/event-config-linux.h b/contrib/libs/libevent/include/event2/event-config-linux.h
index 775a2d2171..f8fbfe5c8b 100644
--- a/contrib/libs/libevent/include/event2/event-config-linux.h
+++ b/contrib/libs/libevent/include/event2/event-config-linux.h
@@ -8,41 +8,41 @@
* Do not rely on macros in this file existing in later versions.
*/
-#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_
-#define EVENT2_EVENT_CONFIG_H_INCLUDED_
+#ifndef EVENT2_EVENT_CONFIG_H_INCLUDED_
+#define EVENT2_EVENT_CONFIG_H_INCLUDED_
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if libevent should build without support for a debug mode */
-/* #undef EVENT__DISABLE_DEBUG_MODE */
+/* #undef EVENT__DISABLE_DEBUG_MODE */
/* Define if libevent should not allow replacing the mm functions */
-/* #undef EVENT__DISABLE_MM_REPLACEMENT */
+/* #undef EVENT__DISABLE_MM_REPLACEMENT */
/* Define if libevent should not be compiled with thread support */
-/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+
+/* Define to 1 if you have the `accept4' function. */
+#define EVENT__HAVE_ACCEPT4 1
-/* Define to 1 if you have the `accept4' function. */
-#define EVENT__HAVE_ACCEPT4 1
-
/* Define to 1 if you have the <afunix.h> header file. */
/* #undef EVENT__HAVE_AFUNIX_H */
/* Define to 1 if you have the `arc4random' function. */
-/* #undef EVENT__HAVE_ARC4RANDOM */
+/* #undef EVENT__HAVE_ARC4RANDOM */
+
+/* Define to 1 if you have the `arc4random_addrandom' function. */
+/* #undef EVENT__HAVE_ARC4RANDOM_ADDRANDOM */
-/* Define to 1 if you have the `arc4random_addrandom' function. */
-/* #undef EVENT__HAVE_ARC4RANDOM_ADDRANDOM */
-
/* Define to 1 if you have the `arc4random_buf' function. */
-/* #undef EVENT__HAVE_ARC4RANDOM_BUF */
+/* #undef EVENT__HAVE_ARC4RANDOM_BUF */
/* Define to 1 if you have the <arpa/inet.h> header file. */
-#define EVENT__HAVE_ARPA_INET_H 1
+#define EVENT__HAVE_ARPA_INET_H 1
/* Define to 1 if you have the `clock_gettime' function. */
-#define EVENT__HAVE_CLOCK_GETTIME 1
+#define EVENT__HAVE_CLOCK_GETTIME 1
/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
don't. */
@@ -53,376 +53,376 @@
/* #undef EVENT__HAVE_DECL_KERN_ARND */
/* Define if /dev/poll is available */
-/* #undef EVENT__HAVE_DEVPOLL */
+/* #undef EVENT__HAVE_DEVPOLL */
/* Define to 1 if you have the <dlfcn.h> header file. */
-#define EVENT__HAVE_DLFCN_H 1
+#define EVENT__HAVE_DLFCN_H 1
/* Define if your system supports the epoll system calls */
-#define EVENT__HAVE_EPOLL 1
+#define EVENT__HAVE_EPOLL 1
+
+/* Define to 1 if you have the `epoll_create1' function. */
+#define EVENT__HAVE_EPOLL_CREATE1 1
-/* Define to 1 if you have the `epoll_create1' function. */
-#define EVENT__HAVE_EPOLL_CREATE1 1
-
/* Define to 1 if you have the `epoll_ctl' function. */
-#define EVENT__HAVE_EPOLL_CTL 1
+#define EVENT__HAVE_EPOLL_CTL 1
+
+/* Define to 1 if you have the <errno.h> header file. */
+#define EVENT__HAVE_ERRNO_H 1
-/* Define to 1 if you have the <errno.h> header file. */
-#define EVENT__HAVE_ERRNO_H 1
-
/* Define to 1 if you have the `eventfd' function. */
-#define EVENT__HAVE_EVENTFD 1
+#define EVENT__HAVE_EVENTFD 1
/* Define if your system supports event ports */
-/* #undef EVENT__HAVE_EVENT_PORTS */
+/* #undef EVENT__HAVE_EVENT_PORTS */
/* Define to 1 if you have the `fcntl' function. */
-#define EVENT__HAVE_FCNTL 1
+#define EVENT__HAVE_FCNTL 1
/* Define to 1 if you have the <fcntl.h> header file. */
-#define EVENT__HAVE_FCNTL_H 1
+#define EVENT__HAVE_FCNTL_H 1
/* Define to 1 if the system has the type `fd_mask'. */
-#define EVENT__HAVE_FD_MASK 1
+#define EVENT__HAVE_FD_MASK 1
/* Do we have getaddrinfo()? */
-#define EVENT__HAVE_GETADDRINFO 1
+#define EVENT__HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getegid' function. */
-#define EVENT__HAVE_GETEGID 1
+#define EVENT__HAVE_GETEGID 1
/* Define to 1 if you have the `geteuid' function. */
-#define EVENT__HAVE_GETEUID 1
+#define EVENT__HAVE_GETEUID 1
/* Define this if you have any gethostbyname_r() */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R */
/* Define this if gethostbyname_r takes 3 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */
/* Define this if gethostbyname_r takes 5 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */
/* Define this if gethostbyname_r takes 6 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */
+
+/* Define to 1 if you have the `getifaddrs' function. */
+#define EVENT__HAVE_GETIFADDRS 1
-/* Define to 1 if you have the `getifaddrs' function. */
-#define EVENT__HAVE_GETIFADDRS 1
-
/* Define to 1 if you have the `getnameinfo' function. */
-#define EVENT__HAVE_GETNAMEINFO 1
+#define EVENT__HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `getprotobynumber' function. */
-#define EVENT__HAVE_GETPROTOBYNUMBER 1
+#define EVENT__HAVE_GETPROTOBYNUMBER 1
/* Define to 1 if you have the `getrandom' function. */
#define EVENT__HAVE_GETRANDOM 1
/* Define to 1 if you have the `getservbyname' function. */
-#define EVENT__HAVE_GETSERVBYNAME 1
+#define EVENT__HAVE_GETSERVBYNAME 1
/* Define to 1 if you have the `gettimeofday' function. */
-#define EVENT__HAVE_GETTIMEOFDAY 1
+#define EVENT__HAVE_GETTIMEOFDAY 1
-/* Define to 1 if you have the <ifaddrs.h> header file. */
-#define EVENT__HAVE_IFADDRS_H 1
+/* Define to 1 if you have the <ifaddrs.h> header file. */
+#define EVENT__HAVE_IFADDRS_H 1
/* Define to 1 if you have the `inet_ntop' function. */
-#define EVENT__HAVE_INET_NTOP 1
+#define EVENT__HAVE_INET_NTOP 1
/* Define to 1 if you have the `inet_pton' function. */
-#define EVENT__HAVE_INET_PTON 1
+#define EVENT__HAVE_INET_PTON 1
/* Define to 1 if you have the <inttypes.h> header file. */
-#define EVENT__HAVE_INTTYPES_H 1
+#define EVENT__HAVE_INTTYPES_H 1
/* Define to 1 if you have the `issetugid' function. */
-/* #undef EVENT__HAVE_ISSETUGID */
+/* #undef EVENT__HAVE_ISSETUGID */
/* Define to 1 if you have the `kqueue' function. */
-/* #undef EVENT__HAVE_KQUEUE */
+/* #undef EVENT__HAVE_KQUEUE */
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
/* #undef EVENT__HAVE_LIBWS2_32 */
/* Define if the system has zlib */
-#define EVENT__HAVE_LIBZ 1
+#define EVENT__HAVE_LIBZ 1
+
+/* Define to 1 if you have the `mach_absolute_time' function. */
+/* #undef EVENT__HAVE_MACH_ABSOLUTE_TIME */
-/* Define to 1 if you have the `mach_absolute_time' function. */
-/* #undef EVENT__HAVE_MACH_ABSOLUTE_TIME */
-
/* Define to 1 if you have the <mach/mach.h> header file. */
/* #undef EVENT__HAVE_MACH_MACH_H */
-/* Define to 1 if you have the <mach/mach_time.h> header file. */
-/* #undef EVENT__HAVE_MACH_MACH_TIME_H */
-
+/* Define to 1 if you have the <mach/mach_time.h> header file. */
+/* #undef EVENT__HAVE_MACH_MACH_TIME_H */
+
/* Define to 1 if you have the <memory.h> header file. */
-#define EVENT__HAVE_MEMORY_H 1
+#define EVENT__HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
-#define EVENT__HAVE_MMAP 1
+#define EVENT__HAVE_MMAP 1
+
+/* Define to 1 if you have the `nanosleep' function. */
+#define EVENT__HAVE_NANOSLEEP 1
-/* Define to 1 if you have the `nanosleep' function. */
-#define EVENT__HAVE_NANOSLEEP 1
-
/* Define to 1 if you have the <netdb.h> header file. */
-#define EVENT__HAVE_NETDB_H 1
+#define EVENT__HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in6.h> header file. */
-/* #undef EVENT__HAVE_NETINET_IN6_H */
+/* #undef EVENT__HAVE_NETINET_IN6_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
-#define EVENT__HAVE_NETINET_IN_H 1
+#define EVENT__HAVE_NETINET_IN_H 1
+
+/* Define to 1 if you have the <netinet/tcp.h> header file. */
+#define EVENT__HAVE_NETINET_TCP_H 1
-/* Define to 1 if you have the <netinet/tcp.h> header file. */
-#define EVENT__HAVE_NETINET_TCP_H 1
-
/* Define if the system has openssl */
-#define EVENT__HAVE_OPENSSL 1
+#define EVENT__HAVE_OPENSSL 1
-/* Define to 1 if you have the <openssl/ssl.h> header file. */
-#define EVENT__HAVE_OPENSSL_SSL_H 1
+/* Define to 1 if you have the <openssl/ssl.h> header file. */
+#define EVENT__HAVE_OPENSSL_SSL_H 1
/* Define to 1 if you have the `pipe' function. */
-#define EVENT__HAVE_PIPE 1
+#define EVENT__HAVE_PIPE 1
+
+/* Define to 1 if you have the `pipe2' function. */
+#define EVENT__HAVE_PIPE2 1
-/* Define to 1 if you have the `pipe2' function. */
-#define EVENT__HAVE_PIPE2 1
-
/* Define to 1 if you have the `poll' function. */
-#define EVENT__HAVE_POLL 1
+#define EVENT__HAVE_POLL 1
/* Define to 1 if you have the <poll.h> header file. */
-#define EVENT__HAVE_POLL_H 1
+#define EVENT__HAVE_POLL_H 1
/* Define to 1 if you have the `port_create' function. */
-/* #undef EVENT__HAVE_PORT_CREATE */
+/* #undef EVENT__HAVE_PORT_CREATE */
/* Define to 1 if you have the <port.h> header file. */
-/* #undef EVENT__HAVE_PORT_H */
+/* #undef EVENT__HAVE_PORT_H */
/* Define if you have POSIX threads libraries and header files. */
-/* #undef EVENT__HAVE_PTHREAD */
+/* #undef EVENT__HAVE_PTHREAD */
/* Define if we have pthreads on this system */
-#define EVENT__HAVE_PTHREADS 1
+#define EVENT__HAVE_PTHREADS 1
/* Define to 1 if you have the `putenv' function. */
-#define EVENT__HAVE_PUTENV 1
+#define EVENT__HAVE_PUTENV 1
/* Define to 1 if the system has the type `sa_family_t'. */
-#define EVENT__HAVE_SA_FAMILY_T 1
+#define EVENT__HAVE_SA_FAMILY_T 1
/* Define to 1 if you have the `select' function. */
-#define EVENT__HAVE_SELECT 1
+#define EVENT__HAVE_SELECT 1
/* Define to 1 if you have the `sendfile' function. */
-#define EVENT__HAVE_SENDFILE 1
+#define EVENT__HAVE_SENDFILE 1
/* Define to 1 if you have the `setenv' function. */
-#define EVENT__HAVE_SETENV 1
+#define EVENT__HAVE_SETENV 1
/* Define if F_SETFD is defined in <fcntl.h> */
-#define EVENT__HAVE_SETFD 1
+#define EVENT__HAVE_SETFD 1
+
+/* Define to 1 if you have the `setrlimit' function. */
+#define EVENT__HAVE_SETRLIMIT 1
-/* Define to 1 if you have the `setrlimit' function. */
-#define EVENT__HAVE_SETRLIMIT 1
-
/* Define to 1 if you have the `sigaction' function. */
-#define EVENT__HAVE_SIGACTION 1
+#define EVENT__HAVE_SIGACTION 1
/* Define to 1 if you have the `signal' function. */
-#define EVENT__HAVE_SIGNAL 1
+#define EVENT__HAVE_SIGNAL 1
/* Define to 1 if you have the `splice' function. */
-#define EVENT__HAVE_SPLICE 1
+#define EVENT__HAVE_SPLICE 1
/* Define to 1 if you have the <stdarg.h> header file. */
-#define EVENT__HAVE_STDARG_H 1
+#define EVENT__HAVE_STDARG_H 1
/* Define to 1 if you have the <stddef.h> header file. */
-#define EVENT__HAVE_STDDEF_H 1
+#define EVENT__HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
-#define EVENT__HAVE_STDINT_H 1
+#define EVENT__HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
-#define EVENT__HAVE_STDLIB_H 1
+#define EVENT__HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
-#define EVENT__HAVE_STRINGS_H 1
+#define EVENT__HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
-#define EVENT__HAVE_STRING_H 1
+#define EVENT__HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
-/* #undef EVENT__HAVE_STRLCPY */
+/* #undef EVENT__HAVE_STRLCPY */
/* Define to 1 if you have the `strsep' function. */
-#define EVENT__HAVE_STRSEP 1
+#define EVENT__HAVE_STRSEP 1
/* Define to 1 if you have the `strtok_r' function. */
-#define EVENT__HAVE_STRTOK_R 1
+#define EVENT__HAVE_STRTOK_R 1
/* Define to 1 if you have the `strtoll' function. */
-#define EVENT__HAVE_STRTOLL 1
+#define EVENT__HAVE_STRTOLL 1
/* Define to 1 if the system has the type `struct addrinfo'. */
-#define EVENT__HAVE_STRUCT_ADDRINFO 1
+#define EVENT__HAVE_STRUCT_ADDRINFO 1
/* Define to 1 if the system has the type `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR 1
/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+
+/* Define to 1 if the system has the type `struct linger'. */
+#define EVENT__HAVE_STRUCT_LINGER 1
-/* Define to 1 if the system has the type `struct linger'. */
-#define EVENT__HAVE_STRUCT_LINGER 1
-
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
+
+/* Define to 1 if the system has the type `struct sockaddr_un'. */
+#define EVENT__HAVE_STRUCT_SOCKADDR_UN 1
-/* Define to 1 if the system has the type `struct sockaddr_un'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_UN 1
-
/* Define to 1 if you have the `sysctl' function. */
/* #undef EVENT__HAVE_SYSCTL */
/* Define to 1 if you have the <sys/devpoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
+/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
-#define EVENT__HAVE_SYS_EPOLL_H 1
+#define EVENT__HAVE_SYS_EPOLL_H 1
/* Define to 1 if you have the <sys/eventfd.h> header file. */
-#define EVENT__HAVE_SYS_EVENTFD_H 1
+#define EVENT__HAVE_SYS_EVENTFD_H 1
/* Define to 1 if you have the <sys/event.h> header file. */
-/* #undef EVENT__HAVE_SYS_EVENT_H */
+/* #undef EVENT__HAVE_SYS_EVENT_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define EVENT__HAVE_SYS_IOCTL_H 1
+#define EVENT__HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/mman.h> header file. */
-#define EVENT__HAVE_SYS_MMAN_H 1
+#define EVENT__HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
-#define EVENT__HAVE_SYS_PARAM_H 1
+#define EVENT__HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/queue.h> header file. */
-#define EVENT__HAVE_SYS_QUEUE_H 1
+#define EVENT__HAVE_SYS_QUEUE_H 1
/* Define to 1 if you have the <sys/random.h> header file. */
#define EVENT__HAVE_SYS_RANDOM_H 1
-/* Define to 1 if you have the <sys/resource.h> header file. */
-#define EVENT__HAVE_SYS_RESOURCE_H 1
-
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#define EVENT__HAVE_SYS_RESOURCE_H 1
+
/* Define to 1 if you have the <sys/select.h> header file. */
-#define EVENT__HAVE_SYS_SELECT_H 1
+#define EVENT__HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/sendfile.h> header file. */
-#define EVENT__HAVE_SYS_SENDFILE_H 1
+#define EVENT__HAVE_SYS_SENDFILE_H 1
/* Define to 1 if you have the <sys/socket.h> header file. */
-#define EVENT__HAVE_SYS_SOCKET_H 1
+#define EVENT__HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
-#define EVENT__HAVE_SYS_STAT_H 1
+#define EVENT__HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
/* #undef EVENT__HAVE_SYS_SYSCTL_H */
-/* Define to 1 if you have the <sys/timerfd.h> header file. */
-#define EVENT__HAVE_SYS_TIMERFD_H 1
-
+/* Define to 1 if you have the <sys/timerfd.h> header file. */
+#define EVENT__HAVE_SYS_TIMERFD_H 1
+
/* Define to 1 if you have the <sys/time.h> header file. */
-#define EVENT__HAVE_SYS_TIME_H 1
+#define EVENT__HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
-#define EVENT__HAVE_SYS_TYPES_H 1
+#define EVENT__HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
-#define EVENT__HAVE_SYS_UIO_H 1
+#define EVENT__HAVE_SYS_UIO_H 1
+
+/* Define to 1 if you have the <sys/un.h> header file. */
+#define EVENT__HAVE_SYS_UN_H 1
-/* Define to 1 if you have the <sys/un.h> header file. */
-#define EVENT__HAVE_SYS_UN_H 1
-
/* Define to 1 if you have the <sys/wait.h> header file. */
-#define EVENT__HAVE_SYS_WAIT_H 1
+#define EVENT__HAVE_SYS_WAIT_H 1
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-#define EVENT__HAVE_TAILQFOREACH 1
+#define EVENT__HAVE_TAILQFOREACH 1
/* Define if timeradd is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERADD 1
+#define EVENT__HAVE_TIMERADD 1
/* Define if timerclear is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCLEAR 1
+#define EVENT__HAVE_TIMERCLEAR 1
/* Define if timercmp is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCMP 1
+#define EVENT__HAVE_TIMERCMP 1
+
+/* Define to 1 if you have the `timerfd_create' function. */
+#define EVENT__HAVE_TIMERFD_CREATE 1
-/* Define to 1 if you have the `timerfd_create' function. */
-#define EVENT__HAVE_TIMERFD_CREATE 1
-
/* Define if timerisset is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERISSET 1
+#define EVENT__HAVE_TIMERISSET 1
/* Define to 1 if the system has the type `uint16_t'. */
-#define EVENT__HAVE_UINT16_T 1
+#define EVENT__HAVE_UINT16_T 1
/* Define to 1 if the system has the type `uint32_t'. */
-#define EVENT__HAVE_UINT32_T 1
+#define EVENT__HAVE_UINT32_T 1
/* Define to 1 if the system has the type `uint64_t'. */
-#define EVENT__HAVE_UINT64_T 1
+#define EVENT__HAVE_UINT64_T 1
/* Define to 1 if the system has the type `uint8_t'. */
-#define EVENT__HAVE_UINT8_T 1
+#define EVENT__HAVE_UINT8_T 1
/* Define to 1 if the system has the type `uintptr_t'. */
-#define EVENT__HAVE_UINTPTR_T 1
+#define EVENT__HAVE_UINTPTR_T 1
/* Define to 1 if you have the `umask' function. */
-#define EVENT__HAVE_UMASK 1
+#define EVENT__HAVE_UMASK 1
/* Define to 1 if you have the <unistd.h> header file. */
-#define EVENT__HAVE_UNISTD_H 1
+#define EVENT__HAVE_UNISTD_H 1
/* Define to 1 if you have the `unsetenv' function. */
-#define EVENT__HAVE_UNSETENV 1
+#define EVENT__HAVE_UNSETENV 1
+
+/* Define to 1 if you have the `usleep' function. */
+#define EVENT__HAVE_USLEEP 1
-/* Define to 1 if you have the `usleep' function. */
-#define EVENT__HAVE_USLEEP 1
-
/* Define to 1 if you have the `vasprintf' function. */
-#define EVENT__HAVE_VASPRINTF 1
+#define EVENT__HAVE_VASPRINTF 1
/* Define if kqueue works correctly with pipes */
-/* #undef EVENT__HAVE_WORKING_KQUEUE */
+/* #undef EVENT__HAVE_WORKING_KQUEUE */
/* Define to 1 if you have the <zlib.h> header file. */
-#define EVENT__HAVE_ZLIB_H 1
+#define EVENT__HAVE_ZLIB_H 1
/* Define to 1 if you have the `_gmtime64' function. */
/* #undef EVENT__HAVE__GMTIME64 */
@@ -430,141 +430,141 @@
/* Define to 1 if you have the `_gmtime64_s' function. */
/* #undef EVENT__HAVE__GMTIME64_S */
-/* Define to 1 if compiler have __FUNCTION__ */
-#define EVENT__HAVE___FUNCTION__ 1
+/* Define to 1 if compiler have __FUNCTION__ */
+#define EVENT__HAVE___FUNCTION__ 1
-/* Define to 1 if compiler have __func__ */
-#define EVENT__HAVE___func__ 1
+/* Define to 1 if compiler have __func__ */
+#define EVENT__HAVE___func__ 1
+
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
+#define EVENT__LT_OBJDIR ".libs/"
-/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#define EVENT__LT_OBJDIR ".libs/"
-
/* Numeric representation of the version */
#define EVENT__NUMERIC_VERSION 0x02010c00
/* Name of package */
-#define EVENT__PACKAGE "libevent"
+#define EVENT__PACKAGE "libevent"
/* Define to the address where bug reports for this package should be sent. */
-#define EVENT__PACKAGE_BUGREPORT ""
+#define EVENT__PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
-#define EVENT__PACKAGE_NAME "libevent"
+#define EVENT__PACKAGE_NAME "libevent"
/* Define to the full name and version of this package. */
#define EVENT__PACKAGE_STRING "libevent 2.1.12-stable"
/* Define to the one symbol short name of this package. */
-#define EVENT__PACKAGE_TARNAME "libevent"
+#define EVENT__PACKAGE_TARNAME "libevent"
/* Define to the home page for this package. */
-#define EVENT__PACKAGE_URL ""
+#define EVENT__PACKAGE_URL ""
/* Define to the version of this package. */
#define EVENT__PACKAGE_VERSION "2.1.12-stable"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
-/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
+/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
/* The size of `int', as computed by sizeof. */
-#define EVENT__SIZEOF_INT 4
+#define EVENT__SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG 8
+#define EVENT__SIZEOF_LONG 8
/* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG 8
/* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
+#define EVENT__SIZEOF_OFF_T 8
/* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
+#define EVENT__SIZEOF_PTHREAD_T 8
/* The size of `short', as computed by sizeof. */
-#define EVENT__SIZEOF_SHORT 2
+#define EVENT__SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T 8
+
+/* The size of `time_t', as computed by sizeof. */
+#define EVENT__SIZEOF_TIME_T 8
-/* The size of `time_t', as computed by sizeof. */
-#define EVENT__SIZEOF_TIME_T 8
-
/* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P 8
/* Define to 1 if you have the ANSI C header files. */
-#define STDC_HEADERS 1
+#define STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define EVENT__TIME_WITH_SYS_TIME 1
-
-/* Enable extensions on AIX 3, Interix. */
-#ifndef _ALL_SOURCE
-# define _ALL_SOURCE 1
-#endif
-/* Enable GNU extensions on systems that have them. */
-#ifndef _GNU_SOURCE
-# define _GNU_SOURCE 1
-#endif
-/* Enable threading extensions on Solaris. */
-#ifndef _POSIX_PTHREAD_SEMANTICS
-# define _POSIX_PTHREAD_SEMANTICS 1
-#endif
-/* Enable extensions on HP NonStop. */
-#ifndef _TANDEM_SOURCE
-# define _TANDEM_SOURCE 1
-#endif
-/* Enable general extensions on Solaris. */
-#ifndef __EXTENSIONS__
-# define __EXTENSIONS__ 1
-#endif
-
-
+#define EVENT__TIME_WITH_SYS_TIME 1
+
+/* Enable extensions on AIX 3, Interix. */
+#ifndef _ALL_SOURCE
+# define _ALL_SOURCE 1
+#endif
+/* Enable GNU extensions on systems that have them. */
+#ifndef _GNU_SOURCE
+# define _GNU_SOURCE 1
+#endif
+/* Enable threading extensions on Solaris. */
+#ifndef _POSIX_PTHREAD_SEMANTICS
+# define _POSIX_PTHREAD_SEMANTICS 1
+#endif
+/* Enable extensions on HP NonStop. */
+#ifndef _TANDEM_SOURCE
+# define _TANDEM_SOURCE 1
+#endif
+/* Enable general extensions on Solaris. */
+#ifndef __EXTENSIONS__
+# define __EXTENSIONS__ 1
+#endif
+
+
/* Version number of package */
#define EVENT__VERSION "2.1.12-stable"
-/* Enable large inode numbers on Mac OS X 10.5. */
-#ifndef _DARWIN_USE_64_BIT_INODE
-# define _DARWIN_USE_64_BIT_INODE 1
-#endif
-
-/* Number of bits in a file offset, on hosts where this is settable. */
-/* #undef _FILE_OFFSET_BITS */
-
-/* Define for large files, on AIX-style hosts. */
-/* #undef _LARGE_FILES */
-
-/* Define to 1 if on MINIX. */
-/* #undef _MINIX */
-
-/* Define to 2 if the system does not provide POSIX.1 features except with
- this defined. */
-/* #undef _POSIX_1_SOURCE */
-
-/* Define to 1 if you need to in order for `stat' and other things to work. */
-/* #undef _POSIX_SOURCE */
-
+/* Enable large inode numbers on Mac OS X 10.5. */
+#ifndef _DARWIN_USE_64_BIT_INODE
+# define _DARWIN_USE_64_BIT_INODE 1
+#endif
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+/* #undef _FILE_OFFSET_BITS */
+
+/* Define for large files, on AIX-style hosts. */
+/* #undef _LARGE_FILES */
+
+/* Define to 1 if on MINIX. */
+/* #undef _MINIX */
+
+/* Define to 2 if the system does not provide POSIX.1 features except with
+ this defined. */
+/* #undef _POSIX_1_SOURCE */
+
+/* Define to 1 if you need to in order for `stat' and other things to work. */
+/* #undef _POSIX_SOURCE */
+
/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef const */
+/* #undef const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef __cplusplus
-/* #undef inline */
+#ifndef __cplusplus
+/* #undef inline */
#endif
/* Define to `int' if <sys/types.h> does not define. */
-/* #undef pid_t */
+/* #undef pid_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef size_t */
+/* #undef size_t */
/* Define to unsigned int if you dont have it */
-/* #undef socklen_t */
+/* #undef socklen_t */
/* Define to `int' if <sys/types.h> does not define. */
-/* #undef ssize_t */
+/* #undef ssize_t */
#endif /* event2/event-config.h */
diff --git a/contrib/libs/libevent/include/event2/event-config-musl.h b/contrib/libs/libevent/include/event2/event-config-musl.h
index de6930948e..7b4fabd32d 100644
--- a/contrib/libs/libevent/include/event2/event-config-musl.h
+++ b/contrib/libs/libevent/include/event2/event-config-musl.h
@@ -2,6 +2,6 @@
#include "event-config-linux.h"
-#undef EVENT__HAVE_DECL_CTL_KERN
-#undef EVENT__HAVE_DECL_KERN_RANDOM
-#undef EVENT__HAVE_DECL_RANDOM_UUID
+#undef EVENT__HAVE_DECL_CTL_KERN
+#undef EVENT__HAVE_DECL_KERN_RANDOM
+#undef EVENT__HAVE_DECL_RANDOM_UUID
diff --git a/contrib/libs/libevent/include/event2/event-config-osx.h b/contrib/libs/libevent/include/event2/event-config-osx.h
index 1798ec2d5b..8e6c4f7ea0 100644
--- a/contrib/libs/libevent/include/event2/event-config-osx.h
+++ b/contrib/libs/libevent/include/event2/event-config-osx.h
@@ -8,446 +8,446 @@
* Do not rely on macros in this file existing in later versions.
*/
-#ifndef _EVENT2EVENT__CONFIG_H_
-#define _EVENT2EVENT__CONFIG_H_
+#ifndef _EVENT2EVENT__CONFIG_H_
+#define _EVENT2EVENT__CONFIG_H_
/* config.h. Generated from config.h.in by configure. */
/* config.h.in. Generated from configure.ac by autoheader. */
/* Define if libevent should build without support for a debug mode */
-/* #undef EVENT__DISABLE_DEBUG_MODE */
+/* #undef EVENT__DISABLE_DEBUG_MODE */
/* Define if libevent should not allow replacing the mm functions */
-/* #undef EVENT__DISABLE_MM_REPLACEMENT */
+/* #undef EVENT__DISABLE_MM_REPLACEMENT */
/* Define if libevent should not be compiled with thread support */
-/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+/* #undef EVENT__DISABLE_THREAD_SUPPORT */
/* Define to 1 if you have the `arc4random' function. */
-#define EVENT__HAVE_ARC4RANDOM 1
+#define EVENT__HAVE_ARC4RANDOM 1
/* Define to 1 if you have the `arc4random_buf' function. */
-#define EVENT__HAVE_ARC4RANDOM_BUF 1
+#define EVENT__HAVE_ARC4RANDOM_BUF 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
-#define EVENT__HAVE_ARPA_INET_H 1
+#define EVENT__HAVE_ARPA_INET_H 1
/* Define to 1 if you have the `clock_gettime' function. */
-/* #undef EVENT__HAVE_CLOCK_GETTIME */
+/* #undef EVENT__HAVE_CLOCK_GETTIME */
/* Define to 1 if you have the declaration of `CTL_KERN', and to 0 if you
don't. */
-#define EVENT__HAVE_DECL_CTL_KERN 1
+#define EVENT__HAVE_DECL_CTL_KERN 1
/* Define to 1 if you have the declaration of `KERN_ARND', and to 0 if you
don't. */
-#define EVENT__HAVE_DECL_KERN_ARND 0
+#define EVENT__HAVE_DECL_KERN_ARND 0
/* Define to 1 if you have the declaration of `KERN_RANDOM', and to 0 if you
don't. */
-#define EVENT__HAVE_DECL_KERN_RANDOM 0
+#define EVENT__HAVE_DECL_KERN_RANDOM 0
/* Define to 1 if you have the declaration of `RANDOM_UUID', and to 0 if you
don't. */
-#define EVENT__HAVE_DECL_RANDOM_UUID 0
+#define EVENT__HAVE_DECL_RANDOM_UUID 0
/* Define if /dev/poll is available */
-/* #undef EVENT__HAVE_DEVPOLL */
+/* #undef EVENT__HAVE_DEVPOLL */
/* Define to 1 if you have the <dlfcn.h> header file. */
-#define EVENT__HAVE_DLFCN_H 1
+#define EVENT__HAVE_DLFCN_H 1
/* Define if your system supports the epoll system calls */
-/* #undef EVENT__HAVE_EPOLL */
+/* #undef EVENT__HAVE_EPOLL */
/* Define to 1 if you have the `epoll_ctl' function. */
-/* #undef EVENT__HAVE_EPOLL_CTL */
+/* #undef EVENT__HAVE_EPOLL_CTL */
/* Define to 1 if you have the `eventfd' function. */
-/* #undef EVENT__HAVE_EVENTFD */
+/* #undef EVENT__HAVE_EVENTFD */
/* Define if your system supports event ports */
-/* #undef EVENT__HAVE_EVENT_PORTS */
+/* #undef EVENT__HAVE_EVENT_PORTS */
/* Define to 1 if you have the `fcntl' function. */
-#define EVENT__HAVE_FCNTL 1
+#define EVENT__HAVE_FCNTL 1
/* Define to 1 if you have the <fcntl.h> header file. */
-#define EVENT__HAVE_FCNTL_H 1
+#define EVENT__HAVE_FCNTL_H 1
/* Define to 1 if the system has the type `fd_mask'. */
-#define EVENT__HAVE_FD_MASK 1
+#define EVENT__HAVE_FD_MASK 1
/* Do we have getaddrinfo()? */
-#define EVENT__HAVE_GETADDRINFO 1
+#define EVENT__HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getegid' function. */
-#define EVENT__HAVE_GETEGID 1
+#define EVENT__HAVE_GETEGID 1
/* Define to 1 if you have the `geteuid' function. */
-#define EVENT__HAVE_GETEUID 1
+#define EVENT__HAVE_GETEUID 1
/* Define this if you have any gethostbyname_r() */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R */
/* Define this if gethostbyname_r takes 3 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_3_ARG */
/* Define this if gethostbyname_r takes 5 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_5_ARG */
/* Define this if gethostbyname_r takes 6 arguments */
-/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */
+/* #undef EVENT__HAVE_GETHOSTBYNAME_R_6_ARG */
/* Define to 1 if you have the `getnameinfo' function. */
-#define EVENT__HAVE_GETNAMEINFO 1
+#define EVENT__HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `getprotobynumber' function. */
-#define EVENT__HAVE_GETPROTOBYNUMBER 1
+#define EVENT__HAVE_GETPROTOBYNUMBER 1
/* Define to 1 if you have the `getservbyname' function. */
-/* #undef EVENT__HAVE_GETSERVBYNAME */
+/* #undef EVENT__HAVE_GETSERVBYNAME */
/* Define to 1 if you have the `gettimeofday' function. */
-#define EVENT__HAVE_GETTIMEOFDAY 1
+#define EVENT__HAVE_GETTIMEOFDAY 1
/* Define to 1 if you have the `inet_aton' function. */
-#define EVENT__HAVE_INET_ATON 1
+#define EVENT__HAVE_INET_ATON 1
/* Define to 1 if you have the `inet_ntop' function. */
-#define EVENT__HAVE_INET_NTOP 1
+#define EVENT__HAVE_INET_NTOP 1
/* Define to 1 if you have the `inet_pton' function. */
-#define EVENT__HAVE_INET_PTON 1
+#define EVENT__HAVE_INET_PTON 1
/* Define to 1 if you have the <inttypes.h> header file. */
-#define EVENT__HAVE_INTTYPES_H 1
+#define EVENT__HAVE_INTTYPES_H 1
/* Define to 1 if you have the `issetugid' function. */
-#define EVENT__HAVE_ISSETUGID 1
+#define EVENT__HAVE_ISSETUGID 1
/* Define to 1 if you have the `kqueue' function. */
-#define EVENT__HAVE_KQUEUE 1
+#define EVENT__HAVE_KQUEUE 1
/* Define if the system has zlib */
-#define EVENT__HAVE_LIBZ 1
+#define EVENT__HAVE_LIBZ 1
/* Define to 1 if you have the <memory.h> header file. */
-#define EVENT__HAVE_MEMORY_H 1
+#define EVENT__HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
-#define EVENT__HAVE_MMAP 1
+#define EVENT__HAVE_MMAP 1
/* Define to 1 if you have the <netdb.h> header file. */
-#define EVENT__HAVE_NETDB_H 1
+#define EVENT__HAVE_NETDB_H 1
/* Define to 1 if you have the <netinet/in6.h> header file. */
-/* #undef EVENT__HAVE_NETINET_IN6_H */
+/* #undef EVENT__HAVE_NETINET_IN6_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
-#define EVENT__HAVE_NETINET_IN_H 1
+#define EVENT__HAVE_NETINET_IN_H 1
/* Define if the system has openssl */
-#define EVENT__HAVE_OPENSSL 1
+#define EVENT__HAVE_OPENSSL 1
/* Define to 1 if you have the <openssl/bio.h> header file. */
-#define EVENT__HAVE_OPENSSL_BIO_H 1
+#define EVENT__HAVE_OPENSSL_BIO_H 1
/* Define to 1 if you have the `pipe' function. */
-#define EVENT__HAVE_PIPE 1
+#define EVENT__HAVE_PIPE 1
/* Define to 1 if you have the `poll' function. */
-#define EVENT__HAVE_POLL 1
+#define EVENT__HAVE_POLL 1
/* Define to 1 if you have the <poll.h> header file. */
-#define EVENT__HAVE_POLL_H 1
+#define EVENT__HAVE_POLL_H 1
/* Define to 1 if you have the `port_create' function. */
-/* #undef EVENT__HAVE_PORT_CREATE */
+/* #undef EVENT__HAVE_PORT_CREATE */
/* Define to 1 if you have the <port.h> header file. */
-/* #undef EVENT__HAVE_PORT_H */
+/* #undef EVENT__HAVE_PORT_H */
/* Define if you have POSIX threads libraries and header files. */
-/* #undef EVENT__HAVE_PTHREAD */
+/* #undef EVENT__HAVE_PTHREAD */
/* Define if we have pthreads on this system */
-#define EVENT__HAVE_PTHREADS 1
+#define EVENT__HAVE_PTHREADS 1
/* Define to 1 if you have the `putenv' function. */
-#define EVENT__HAVE_PUTENV 1
+#define EVENT__HAVE_PUTENV 1
/* Define to 1 if the system has the type `sa_family_t'. */
-#define EVENT__HAVE_SA_FAMILY_T 1
+#define EVENT__HAVE_SA_FAMILY_T 1
/* Define to 1 if you have the `select' function. */
-#define EVENT__HAVE_SELECT 1
+#define EVENT__HAVE_SELECT 1
/* Define to 1 if you have the `sendfile' function. */
-#define EVENT__HAVE_SENDFILE 1
+#define EVENT__HAVE_SENDFILE 1
/* Define to 1 if you have the `setenv' function. */
-#define EVENT__HAVE_SETENV 1
+#define EVENT__HAVE_SETENV 1
/* Define if F_SETFD is defined in <fcntl.h> */
-#define EVENT__HAVE_SETFD 1
+#define EVENT__HAVE_SETFD 1
/* Define to 1 if you have the `sigaction' function. */
-#define EVENT__HAVE_SIGACTION 1
+#define EVENT__HAVE_SIGACTION 1
/* Define to 1 if you have the `signal' function. */
-#define EVENT__HAVE_SIGNAL 1
+#define EVENT__HAVE_SIGNAL 1
/* Define to 1 if you have the `splice' function. */
-/* #undef EVENT__HAVE_SPLICE */
+/* #undef EVENT__HAVE_SPLICE */
/* Define to 1 if you have the <stdarg.h> header file. */
-#define EVENT__HAVE_STDARG_H 1
+#define EVENT__HAVE_STDARG_H 1
/* Define to 1 if you have the <stddef.h> header file. */
-#define EVENT__HAVE_STDDEF_H 1
+#define EVENT__HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
-#define EVENT__HAVE_STDINT_H 1
+#define EVENT__HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
-#define EVENT__HAVE_STDLIB_H 1
+#define EVENT__HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
-#define EVENT__HAVE_STRINGS_H 1
+#define EVENT__HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
-#define EVENT__HAVE_STRING_H 1
+#define EVENT__HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
-#define EVENT__HAVE_STRLCPY 1
+#define EVENT__HAVE_STRLCPY 1
/* Define to 1 if you have the `strsep' function. */
-#define EVENT__HAVE_STRSEP 1
+#define EVENT__HAVE_STRSEP 1
/* Define to 1 if you have the `strtok_r' function. */
-#define EVENT__HAVE_STRTOK_R 1
+#define EVENT__HAVE_STRTOK_R 1
/* Define to 1 if you have the `strtoll' function. */
-#define EVENT__HAVE_STRTOLL 1
+#define EVENT__HAVE_STRTOLL 1
/* Define to 1 if the system has the type `struct addrinfo'. */
-#define EVENT__HAVE_STRUCT_ADDRINFO 1
+#define EVENT__HAVE_STRUCT_ADDRINFO 1
/* Define to 1 if the system has the type `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR 1
/* Define to 1 if `s6_addr16' is a member of `struct in6_addr'. */
-/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */
+/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 */
/* Define to 1 if `s6_addr32' is a member of `struct in6_addr'. */
-/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */
+/* #undef EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 */
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
/* Define to 1 if `sin6_len' is a member of `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN 1
/* Define to 1 if `sin_len' is a member of `struct sockaddr_in'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN 1
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY 1
/* Define to 1 if `__ss_family' is a member of `struct sockaddr_storage'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY */
/* Define to 1 if you have the `sysctl' function. */
-#define EVENT__HAVE_SYSCTL 1
+#define EVENT__HAVE_SYSCTL 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
+/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_EPOLL_H */
+/* #undef EVENT__HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/eventfd.h> header file. */
-/* #undef EVENT__HAVE_SYS_EVENTFD_H */
+/* #undef EVENT__HAVE_SYS_EVENTFD_H */
/* Define to 1 if you have the <sys/event.h> header file. */
-#define EVENT__HAVE_SYS_EVENT_H 1
+#define EVENT__HAVE_SYS_EVENT_H 1
/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#define EVENT__HAVE_SYS_IOCTL_H 1
+#define EVENT__HAVE_SYS_IOCTL_H 1
/* Define to 1 if you have the <sys/mman.h> header file. */
-#define EVENT__HAVE_SYS_MMAN_H 1
+#define EVENT__HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the <sys/param.h> header file. */
-#define EVENT__HAVE_SYS_PARAM_H 1
+#define EVENT__HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the <sys/queue.h> header file. */
-#define EVENT__HAVE_SYS_QUEUE_H 1
+#define EVENT__HAVE_SYS_QUEUE_H 1
/* Define to 1 if you have the <sys/select.h> header file. */
-#define EVENT__HAVE_SYS_SELECT_H 1
+#define EVENT__HAVE_SYS_SELECT_H 1
/* Define to 1 if you have the <sys/sendfile.h> header file. */
-/* #undef EVENT__HAVE_SYS_SENDFILE_H */
+/* #undef EVENT__HAVE_SYS_SENDFILE_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
-#define EVENT__HAVE_SYS_SOCKET_H 1
+#define EVENT__HAVE_SYS_SOCKET_H 1
/* Define to 1 if you have the <sys/stat.h> header file. */
-#define EVENT__HAVE_SYS_STAT_H 1
+#define EVENT__HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/sysctl.h> header file. */
-#define EVENT__HAVE_SYS_SYSCTL_H 1
+#define EVENT__HAVE_SYS_SYSCTL_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
-#define EVENT__HAVE_SYS_TIME_H 1
+#define EVENT__HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
-#define EVENT__HAVE_SYS_TYPES_H 1
+#define EVENT__HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
-#define EVENT__HAVE_SYS_UIO_H 1
+#define EVENT__HAVE_SYS_UIO_H 1
/* Define to 1 if you have the <sys/wait.h> header file. */
-#define EVENT__HAVE_SYS_WAIT_H 1
+#define EVENT__HAVE_SYS_WAIT_H 1
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-#define EVENT__HAVE_TAILQFOREACH 1
+#define EVENT__HAVE_TAILQFOREACH 1
/* Define if timeradd is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERADD 1
+#define EVENT__HAVE_TIMERADD 1
/* Define if timerclear is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCLEAR 1
+#define EVENT__HAVE_TIMERCLEAR 1
/* Define if timercmp is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCMP 1
+#define EVENT__HAVE_TIMERCMP 1
/* Define if timerisset is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERISSET 1
+#define EVENT__HAVE_TIMERISSET 1
/* Define to 1 if the system has the type `uint16_t'. */
-#define EVENT__HAVE_UINT16_T 1
+#define EVENT__HAVE_UINT16_T 1
/* Define to 1 if the system has the type `uint32_t'. */
-#define EVENT__HAVE_UINT32_T 1
+#define EVENT__HAVE_UINT32_T 1
/* Define to 1 if the system has the type `uint64_t'. */
-#define EVENT__HAVE_UINT64_T 1
+#define EVENT__HAVE_UINT64_T 1
/* Define to 1 if the system has the type `uint8_t'. */
-#define EVENT__HAVE_UINT8_T 1
+#define EVENT__HAVE_UINT8_T 1
/* Define to 1 if the system has the type `uintptr_t'. */
-#define EVENT__HAVE_UINTPTR_T 1
+#define EVENT__HAVE_UINTPTR_T 1
/* Define to 1 if you have the `umask' function. */
-#define EVENT__HAVE_UMASK 1
+#define EVENT__HAVE_UMASK 1
/* Define to 1 if you have the <unistd.h> header file. */
-#define EVENT__HAVE_UNISTD_H 1
+#define EVENT__HAVE_UNISTD_H 1
/* Define to 1 if you have the `unsetenv' function. */
-#define EVENT__HAVE_UNSETENV 1
+#define EVENT__HAVE_UNSETENV 1
/* Define to 1 if you have the `vasprintf' function. */
-#define EVENT__HAVE_VASPRINTF 1
+#define EVENT__HAVE_VASPRINTF 1
/* Define if kqueue works correctly with pipes */
-#define EVENT__HAVE_WORKING_KQUEUE 1
+#define EVENT__HAVE_WORKING_KQUEUE 1
/* Define to 1 if you have the <zlib.h> header file. */
-#define EVENT__HAVE_ZLIB_H 1
+#define EVENT__HAVE_ZLIB_H 1
/* Define to the sub-directory where libtool stores uninstalled libraries. */
-#define EVENT__LT_OBJDIR ".libs/"
+#define EVENT__LT_OBJDIR ".libs/"
/* Numeric representation of the version */
#define EVENT__NUMERIC_VERSION 0x02010c00
/* Name of package */
-#define EVENT__PACKAGE "libevent"
+#define EVENT__PACKAGE "libevent"
/* Define to the address where bug reports for this package should be sent. */
-#define EVENT__PACKAGE_BUGREPORT ""
+#define EVENT__PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
-#define EVENT__PACKAGE_NAME ""
+#define EVENT__PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define EVENT__PACKAGE_STRING "libevent 2.1.12-stable"
/* Define to the one symbol short name of this package. */
-#define EVENT__PACKAGE_TARNAME ""
+#define EVENT__PACKAGE_TARNAME ""
/* Define to the home page for this package. */
-#define EVENT__PACKAGE_URL ""
+#define EVENT__PACKAGE_URL ""
/* Define to the version of this package. */
#define EVENT__PACKAGE_VERSION "2.1.12-stable"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
-/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
+/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
/* The size of `int', as computed by sizeof. */
-#define EVENT__SIZEOF_INT 4
+#define EVENT__SIZEOF_INT 4
/* The size of `long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG 8
+#define EVENT__SIZEOF_LONG 8
/* The size of `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG 8
/* The size of `off_t', as computed by sizeof. */
-#define EVENT__SIZEOF_OFF_T 8
+#define EVENT__SIZEOF_OFF_T 8
/* The size of `pthread_t', as computed by sizeof. */
-#define EVENT__SIZEOF_PTHREAD_T 8
+#define EVENT__SIZEOF_PTHREAD_T 8
/* The size of `short', as computed by sizeof. */
-#define EVENT__SIZEOF_SHORT 2
+#define EVENT__SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T 8
/* The size of `void *', as computed by sizeof. */
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P 8
/* Define to 1 if you have the ANSI C header files. */
-#define EVENT__STDC_HEADERS 1
+#define EVENT__STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define EVENT__TIME_WITH_SYS_TIME 1
+#define EVENT__TIME_WITH_SYS_TIME 1
/* Version number of package */
#define EVENT__VERSION "2.1.12-stable"
/* Define to appropriate substitue if compiler doesnt have __func__ */
-/* #undef EVENT____func__ */
+/* #undef EVENT____func__ */
/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef EVENT__const */
+/* #undef EVENT__const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef EVENT____cplusplus
-/* #undef EVENT__inline */
+#ifndef EVENT____cplusplus
+/* #undef EVENT__inline */
#endif
/* Define to `int' if <sys/types.h> does not define. */
-/* #undef EVENT__pid_t */
+/* #undef EVENT__pid_t */
/* Define to `unsigned int' if <sys/types.h> does not define. */
-/* #undef EVENT__size_t */
+/* #undef EVENT__size_t */
/* Define to unsigned int if you dont have it */
-/* #undef EVENT__socklen_t */
+/* #undef EVENT__socklen_t */
/* Define to `int' if <sys/types.h> does not define. */
-/* #undef EVENT__ssize_t */
+/* #undef EVENT__ssize_t */
#endif /* event2/event-config.h */
diff --git a/contrib/libs/libevent/include/event2/event-config-win.h b/contrib/libs/libevent/include/event2/event-config-win.h
index 5175bb0ad6..ef4141a720 100644
--- a/contrib/libs/libevent/include/event2/event-config-win.h
+++ b/contrib/libs/libevent/include/event2/event-config-win.h
@@ -7,357 +7,357 @@
*
* Do not rely on macros in this file existing in later versions.
*/
-#ifndef EVENT__CONFIG_H_
-#define EVENT__CONFIG_H_
+#ifndef EVENT__CONFIG_H_
+#define EVENT__CONFIG_H_
/* config.h. Generated by configure. */
/* config.h.in. Generated from configure.in by autoheader. */
/* Define if libevent should not allow replacing the mm functions */
-/* #undef EVENT__DISABLE_MM_REPLACEMENT */
+/* #undef EVENT__DISABLE_MM_REPLACEMENT */
/* Define if libevent should not be compiled with thread support */
-/* #undef EVENT__DISABLE_THREAD_SUPPORT */
+/* #undef EVENT__DISABLE_THREAD_SUPPORT */
/* Define if clock_gettime is available in libc */
-/* #undef EVENT__DNS_USE_CPU_CLOCK_FOR_ID */
+/* #undef EVENT__DNS_USE_CPU_CLOCK_FOR_ID */
/* Define is no secure id variant is available */
-/* #define EVENT__DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
-#define EVENT__DNS_USE_FTIME_FOR_ID 1
+/* #define EVENT__DNS_USE_GETTIMEOFDAY_FOR_ID 1 */
+#define EVENT__DNS_USE_FTIME_FOR_ID 1
/* Define to 1 if you have the <arpa/inet.h> header file. */
-/* #undef EVENT__HAVE_ARPA_INET_H */
+/* #undef EVENT__HAVE_ARPA_INET_H */
/* Define to 1 if you have the `clock_gettime' function. */
-/* #undef EVENT__HAVE_CLOCK_GETTIME */
+/* #undef EVENT__HAVE_CLOCK_GETTIME */
/* Define if /dev/poll is available */
-/* #undef EVENT__HAVE_DEVPOLL */
+/* #undef EVENT__HAVE_DEVPOLL */
/* Define to 1 if you have the <dlfcn.h> header file. */
-/* #undef EVENT__HAVE_DLFCN_H */
+/* #undef EVENT__HAVE_DLFCN_H */
/* Define if your system supports the epoll system calls */
-/* #undef EVENT__HAVE_EPOLL */
+/* #undef EVENT__HAVE_EPOLL */
/* Define to 1 if you have the `epoll_ctl' function. */
-/* #undef EVENT__HAVE_EPOLL_CTL */
+/* #undef EVENT__HAVE_EPOLL_CTL */
/* Define to 1 if you have the `eventfd' function. */
-/* #undef EVENT__HAVE_EVENTFD */
+/* #undef EVENT__HAVE_EVENTFD */
/* Define if your system supports event ports */
-/* #undef EVENT__HAVE_EVENT_PORTS */
+/* #undef EVENT__HAVE_EVENT_PORTS */
/* Define to 1 if you have the `fcntl' function. */
-/* #undef EVENT__HAVE_FCNTL */
+/* #undef EVENT__HAVE_FCNTL */
/* Define to 1 if you have the <fcntl.h> header file. */
-#define EVENT__HAVE_FCNTL_H 1
+#define EVENT__HAVE_FCNTL_H 1
/* Define to 1 if you have the `getaddrinfo' function. */
-#define EVENT__HAVE_GETADDRINFO 1
+#define EVENT__HAVE_GETADDRINFO 1
/* Define to 1 if you have the `getnameinfo' function. */
-#define EVENT__HAVE_GETNAMEINFO 1
+#define EVENT__HAVE_GETNAMEINFO 1
/* Define to 1 if you have the `getprotobynumber' function. */
-#define EVENT__HAVE_GETPROTOBYNUMBER 1
+#define EVENT__HAVE_GETPROTOBYNUMBER 1
/* Define to 1 if you have the `getservbyname' function. */
-#define EVENT__HAVE_GETSERVBYNAME 1
+#define EVENT__HAVE_GETSERVBYNAME 1
/* Define to 1 if you have the `gettimeofday' function. */
-/* #define EVENT__HAVE_GETTIMEOFDAY 1 */
+/* #define EVENT__HAVE_GETTIMEOFDAY 1 */
/* Define to 1 if you have the `inet_aton' function. */
-/* #undef EVENT__HAVE_INET_ATON */
+/* #undef EVENT__HAVE_INET_ATON */
/* Define to 1 if you have the `inet_ntop' function. */
-/* #undef EVENT__HAVE_INET_NTOP */
+/* #undef EVENT__HAVE_INET_NTOP */
/* Define to 1 if you have the `inet_pton' function. */
-/* #undef EVENT__HAVE_INET_PTON */
+/* #undef EVENT__HAVE_INET_PTON */
/* Define to 1 if you have the <inttypes.h> header file. */
-/* #define EVENT__HAVE_INTTYPES_H 1 */
+/* #define EVENT__HAVE_INTTYPES_H 1 */
/* Define to 1 if you have the `kqueue' function. */
-/* #undef EVENT__HAVE_KQUEUE */
+/* #undef EVENT__HAVE_KQUEUE */
/* Define if the system has zlib */
-/* #undef EVENT__HAVE_LIBZ */
+/* #undef EVENT__HAVE_LIBZ */
/* Define to 1 if you have the <memory.h> header file. */
-#define EVENT__HAVE_MEMORY_H 1
+#define EVENT__HAVE_MEMORY_H 1
/* Define to 1 if you have the `mmap' function. */
-/* #undef EVENT__HAVE_MMAP */
+/* #undef EVENT__HAVE_MMAP */
/* Define to 1 if you have the <netinet/in6.h> header file. */
-/* #undef EVENT__HAVE_NETINET_IN6_H */
+/* #undef EVENT__HAVE_NETINET_IN6_H */
/* Define to 1 if you have the <netinet/in.h> header file. */
-/* #undef EVENT__HAVE_NETINET_IN_H */
+/* #undef EVENT__HAVE_NETINET_IN_H */
/* Define to 1 if you have the `pipe' function. */
-/* #undef EVENT__HAVE_PIPE */
+/* #undef EVENT__HAVE_PIPE */
/* Define to 1 if you have the `poll' function. */
-/* #undef EVENT__HAVE_POLL */
+/* #undef EVENT__HAVE_POLL */
/* Define to 1 if you have the <poll.h> header file. */
-/* #undef EVENT__HAVE_POLL_H */
+/* #undef EVENT__HAVE_POLL_H */
/* Define to 1 if you have the `port_create' function. */
-/* #undef EVENT__HAVE_PORT_CREATE */
+/* #undef EVENT__HAVE_PORT_CREATE */
/* Define to 1 if you have the <port.h> header file. */
-/* #undef EVENT__HAVE_PORT_H */
+/* #undef EVENT__HAVE_PORT_H */
/* Define if you have POSIX threads libraries and header files. */
-/* #undef EVENT__HAVE_PTHREAD */
+/* #undef EVENT__HAVE_PTHREAD */
/* Define if we have pthreads on this system */
-/* #undef EVENT__HAVE_PTHREADS */
+/* #undef EVENT__HAVE_PTHREADS */
/* Define to 1 if the system has the type `sa_family_t'. */
-/* #undef EVENT__HAVE_SA_FAMILY_T */
+/* #undef EVENT__HAVE_SA_FAMILY_T */
/* Define to 1 if you have the `select' function. */
-/* #undef EVENT__HAVE_SELECT */
+/* #undef EVENT__HAVE_SELECT */
/* Define to 1 if you have the `sendfile' function. */
-/* #undef EVENT__HAVE_SENDFILE */
+/* #undef EVENT__HAVE_SENDFILE */
/* Define if F_SETFD is defined in <fcntl.h> */
-/* #undef EVENT__HAVE_SETFD */
+/* #undef EVENT__HAVE_SETFD */
/* Define to 1 if you have the `sigaction' function. */
-/* #undef EVENT__HAVE_SIGACTION */
+/* #undef EVENT__HAVE_SIGACTION */
/* Define to 1 if you have the `signal' function. */
-#define EVENT__HAVE_SIGNAL 1
+#define EVENT__HAVE_SIGNAL 1
/* Define to 1 if you have the `splice' function. */
-/* #undef EVENT__HAVE_SPLICE */
+/* #undef EVENT__HAVE_SPLICE */
/* Define to 1 if you have the <stdarg.h> header file. */
-#define EVENT__HAVE_STDARG_H 1
+#define EVENT__HAVE_STDARG_H 1
/* Define to 1 if you have the <stddef.h> header file. */
-#define EVENT__HAVE_STDDEF_H 1
+#define EVENT__HAVE_STDDEF_H 1
/* Define to 1 if you have the <stdint.h> header file. */
-#define EVENT__HAVE_STDINT_H 1
+#define EVENT__HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
-#define EVENT__HAVE_STDLIB_H 1
+#define EVENT__HAVE_STDLIB_H 1
/* Define to 1 if you have the <strings.h> header file. */
-#define EVENT__HAVE_STRINGS_H 1
+#define EVENT__HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
-#define EVENT__HAVE_STRING_H 1
+#define EVENT__HAVE_STRING_H 1
/* Define to 1 if you have the `strlcpy' function. */
-#define EVENT__HAVE_STRLCPY 1
+#define EVENT__HAVE_STRLCPY 1
/* Define to 1 if you have the `strsep' function. */
-/* #undef EVENT__HAVE_STRSEP */
+/* #undef EVENT__HAVE_STRSEP */
/* Define to 1 if you have the `strtok_r' function. */
-/* #undef EVENT__HAVE_STRTOK_R */
+/* #undef EVENT__HAVE_STRTOK_R */
/* Define to 1 if you have the `strtoll' function. */
-/* #define EVENT__HAVE_STRTOLL 1 */
+/* #define EVENT__HAVE_STRTOLL 1 */
-#define EVENT__HAVE_STRUCT_ADDRINFO 1
+#define EVENT__HAVE_STRUCT_ADDRINFO 1
/* Define to 1 if the system has the type `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR 1
/* Define to 1 if `s6_addr16' is member of `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR16 1
/* Define to 1 if `s6_addr32' is member of `struct in6_addr'. */
-#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
+#define EVENT__HAVE_STRUCT_IN6_ADDR_S6_ADDR32 1
/* Define to 1 if the system has the type `struct sockaddr_in6'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_IN6 1
/* Define to 1 if `sin6_len' is member of `struct sockaddr_in6'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN */
/* Define to 1 if `sin_len' is member of `struct sockaddr_in'. */
-/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
+/* #undef EVENT__HAVE_STRUCT_SOCKADDR_IN_SIN_LEN */
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
-#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
+#define EVENT__HAVE_STRUCT_SOCKADDR_STORAGE 1
/* Define to 1 if you have the <sys/devpoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
+/* #undef EVENT__HAVE_SYS_DEVPOLL_H */
/* Define to 1 if you have the <sys/epoll.h> header file. */
-/* #undef EVENT__HAVE_SYS_EPOLL_H */
+/* #undef EVENT__HAVE_SYS_EPOLL_H */
/* Define to 1 if you have the <sys/eventfd.h> header file. */
-/* #undef EVENT__HAVE_SYS_EVENTFD_H */
+/* #undef EVENT__HAVE_SYS_EVENTFD_H */
/* Define to 1 if you have the <sys/event.h> header file. */
-/* #undef EVENT__HAVE_SYS_EVENT_H */
+/* #undef EVENT__HAVE_SYS_EVENT_H */
/* Define to 1 if you have the <sys/ioctl.h> header file. */
-/* #undef EVENT__HAVE_SYS_IOCTL_H */
+/* #undef EVENT__HAVE_SYS_IOCTL_H */
/* Define to 1 if you have the <sys/mman.h> header file. */
-/* #undef EVENT__HAVE_SYS_MMAN_H */
+/* #undef EVENT__HAVE_SYS_MMAN_H */
/* Define to 1 if you have the <sys/param.h> header file. */
-/* #define EVENT__HAVE_SYS_PARAM_H 1 */
+/* #define EVENT__HAVE_SYS_PARAM_H 1 */
/* Define to 1 if you have the <sys/queue.h> header file. */
-/* #undef EVENT__HAVE_SYS_QUEUE_H */
+/* #undef EVENT__HAVE_SYS_QUEUE_H */
/* Define to 1 if you have the <sys/select.h> header file. */
-/* #undef EVENT__HAVE_SYS_SELECT_H */
+/* #undef EVENT__HAVE_SYS_SELECT_H */
/* Define to 1 if you have the <sys/sendfile.h> header file. */
-/* #undef EVENT__HAVE_SYS_SENDFILE_H */
+/* #undef EVENT__HAVE_SYS_SENDFILE_H */
/* Define to 1 if you have the <sys/socket.h> header file. */
-/* #undef EVENT__HAVE_SYS_SOCKET_H */
+/* #undef EVENT__HAVE_SYS_SOCKET_H */
/* Define to 1 if you have the <sys/stat.h> header file. */
-#define EVENT__HAVE_SYS_STAT_H 1
+#define EVENT__HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
-/* #define EVENT__HAVE_SYS_TIME_H 1 */
+/* #define EVENT__HAVE_SYS_TIME_H 1 */
/* Define to 1 if you have the <sys/types.h> header file. */
-#define EVENT__HAVE_SYS_TYPES_H 1
+#define EVENT__HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the <sys/uio.h> header file. */
-/* #undef EVENT__HAVE_SYS_UIO_H */
+/* #undef EVENT__HAVE_SYS_UIO_H */
/* Define if TAILQ_FOREACH is defined in <sys/queue.h> */
-/* #undef EVENT__HAVE_TAILQFOREACH */
+/* #undef EVENT__HAVE_TAILQFOREACH */
/* Define if timeradd is defined in <sys/time.h> */
-/* #undef EVENT__HAVE_TIMERADD */
+/* #undef EVENT__HAVE_TIMERADD */
/* Define if timerclear is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCLEAR 1
+#define EVENT__HAVE_TIMERCLEAR 1
/* Define if timercmp is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERCMP 1
+#define EVENT__HAVE_TIMERCMP 1
/* Define if timerisset is defined in <sys/time.h> */
-#define EVENT__HAVE_TIMERISSET 1
+#define EVENT__HAVE_TIMERISSET 1
/* Define to 1 if the system has the type `uint16_t'. */
-/* #define EVENT__HAVE_UINT16_T 1 */
+/* #define EVENT__HAVE_UINT16_T 1 */
/* Define to 1 if the system has the type `uint32_t'. */
-/* #define EVENT__HAVE_UINT32_T 1 */
+/* #define EVENT__HAVE_UINT32_T 1 */
/* Define to 1 if the system has the type `uint64_t'. */
-/* #define EVENT__HAVE_UINT64_T 1 */
+/* #define EVENT__HAVE_UINT64_T 1 */
/* Define to 1 if the system has the type `uint8_t'. */
-/* #define EVENT__HAVE_UINT8_T 1 */
+/* #define EVENT__HAVE_UINT8_T 1 */
/* Define to 1 if you have the <unistd.h> header file. */
-/* #define EVENT__HAVE_UNISTD_H 1 */
+/* #define EVENT__HAVE_UNISTD_H 1 */
/* Define to 1 if you have the `vasprintf' function. */
-/* #undef EVENT__HAVE_VASPRINTF */
+/* #undef EVENT__HAVE_VASPRINTF */
/* Define if kqueue works correctly with pipes */
-/* #undef EVENT__HAVE_WORKING_KQUEUE */
+/* #undef EVENT__HAVE_WORKING_KQUEUE */
/* Numeric representation of the version */
#define EVENT__NUMERIC_VERSION 0x02010c00
/* Name of package */
-#define EVENT__PACKAGE "libevent"
+#define EVENT__PACKAGE "libevent"
/* Define to the address where bug reports for this package should be sent. */
-#define EVENT__PACKAGE_BUGREPORT ""
+#define EVENT__PACKAGE_BUGREPORT ""
/* Define to the full name of this package. */
-#define EVENT__PACKAGE_NAME ""
+#define EVENT__PACKAGE_NAME ""
/* Define to the full name and version of this package. */
#define EVENT__PACKAGE_STRING "libevent 2.1.12-stable"
/* Define to the one symbol short name of this package. */
-#define EVENT__PACKAGE_TARNAME ""
+#define EVENT__PACKAGE_TARNAME ""
/* Define to the version of this package. */
#define EVENT__PACKAGE_VERSION "2.1.12-stable"
/* Define to necessary symbol if this constant uses a non-standard name on
your system. */
-/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
+/* #undef EVENT__PTHREAD_CREATE_JOINABLE */
/* The size of a `int', as computed by sizeof. */
-#define EVENT__SIZEOF_INT 4
+#define EVENT__SIZEOF_INT 4
/* The size of a `long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG 4
+#define EVENT__SIZEOF_LONG 4
/* The size of a `long long', as computed by sizeof. */
-#define EVENT__SIZEOF_LONG_LONG 8
+#define EVENT__SIZEOF_LONG_LONG 8
/* The size of a `short', as computed by sizeof. */
-#define EVENT__SIZEOF_SHORT 2
+#define EVENT__SIZEOF_SHORT 2
/* The size of `size_t', as computed by sizeof. */
#ifdef _WIN64
-#define EVENT__SIZEOF_SIZE_T 8
+#define EVENT__SIZEOF_SIZE_T 8
#else
-#define EVENT__SIZEOF_SIZE_T 4
+#define EVENT__SIZEOF_SIZE_T 4
#endif
/* The size of `void *', as computed by sizeof. */
#ifdef _WIN64
-#define EVENT__SIZEOF_VOID_P 8
+#define EVENT__SIZEOF_VOID_P 8
#else
-#define EVENT__SIZEOF_VOID_P 4
+#define EVENT__SIZEOF_VOID_P 4
#endif
/* Define to 1 if you have the ANSI C header files. */
-#define EVENT__STDC_HEADERS 1
+#define EVENT__STDC_HEADERS 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define EVENT__TIME_WITH_SYS_TIME 1
+#define EVENT__TIME_WITH_SYS_TIME 1
/* Version number of package */
#define EVENT__VERSION "2.1.12-stable"
/* Define to appropriate substitue if compiler doesnt have __func__ */
-#define EVENT____func__ __FUNCTION__
+#define EVENT____func__ __FUNCTION__
/* Define to empty if `const' does not conform to ANSI C. */
-/* #undef EVENT__const */
+/* #undef EVENT__const */
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
-#ifndef EVENT____cplusplus
-#define EVENT__inline __inline
+#ifndef EVENT____cplusplus
+#define EVENT__inline __inline
#endif
/* Define to `int' if <sys/types.h> does not define. */
-/* #undef EVENT__pid_t */
+/* #undef EVENT__pid_t */
/* Define to `unsigned' if <sys/types.h> does not define. */
-/* #undef EVENT__size_t */
+/* #undef EVENT__size_t */
/* Define to unsigned int if you dont have it */
-#define EVENT__socklen_t unsigned int
+#define EVENT__socklen_t unsigned int
/* Define to `int' if <sys/types.h> does not define. */
-#define EVENT__ssize_t SSIZE_T
+#define EVENT__ssize_t SSIZE_T
#endif
diff --git a/contrib/libs/libevent/include/event2/event-config.h b/contrib/libs/libevent/include/event2/event-config.h
index 44473fab49..8a6043c9ba 100644
--- a/contrib/libs/libevent/include/event2/event-config.h
+++ b/contrib/libs/libevent/include/event2/event-config.h
@@ -1,13 +1,13 @@
#pragma once
-#if defined(__APPLE__)
+#if defined(__APPLE__)
# include "event-config-osx.h"
#elif defined(_MSC_VER)
# include "event-config-win.h"
#else
# include "event-config-linux.h"
-#endif
-
+#endif
+
#if defined(_musl_)
# include "event-config-musl.h"
#endif
diff --git a/contrib/libs/libevent/include/event2/event.h b/contrib/libs/libevent/include/event2/event.h
index c432250a24..a6b6144a92 100644
--- a/contrib/libs/libevent/include/event2/event.h
+++ b/contrib/libs/libevent/include/event2/event.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_EVENT_H_INCLUDED_
-#define EVENT2_EVENT_H_INCLUDED_
+#ifndef EVENT2_EVENT_H_INCLUDED_
+#define EVENT2_EVENT_H_INCLUDED_
/**
@mainpage
@@ -39,7 +39,7 @@
to signals or regular timeouts.
Libevent is meant to replace the event loop found in event driven network
- servers. An application just needs to call event_base_dispatch() and then add or
+ servers. An application just needs to call event_base_dispatch() and then add or
remove events dynamically without having to change the event loop.
@@ -54,7 +54,7 @@
@section usage Standard usage
- Every program that uses Libevent must include the <event2/event.h>
+ Every program that uses Libevent must include the <event2/event.h>
header, and pass the -levent flag to the linker. (You can instead link
-levent_core if you only want the main event and buffered IO-based code,
and don't want to link any protocol code.)
@@ -90,7 +90,7 @@
remain allocated as long as it is active, so it should generally be
allocated on the heap.
- @section loop Dispatching events.
+ @section loop Dispatching events.
Finally, you call event_base_dispatch() to loop and dispatch events.
You can also use event_base_loop() for more fine-grained control.
@@ -124,11 +124,11 @@
@section timers Timers
Libevent can also be used to create timers that invoke a callback after a
- certain amount of time has expired. The evtimer_new() macro returns
+ certain amount of time has expired. The evtimer_new() macro returns
an event struct to use as a timer. To activate the timer, call
evtimer_add(). Timers can be deactivated by calling evtimer_del().
- (These macros are thin wrappers around event_new(), event_add(),
- and event_del(); you can also use those instead.)
+ (These macros are thin wrappers around event_new(), event_add(),
+ and event_del(); you can also use those instead.)
@section evdns Asynchronous DNS resolution
@@ -182,17 +182,17 @@
Core functions for waiting for and receiving events, and using event bases.
*/
-#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
@@ -215,7 +215,7 @@ extern "C" {
* event_base_new_with_config()
*/
struct event_base
-#ifdef EVENT_IN_DOXYGEN_
+#ifdef EVENT_IN_DOXYGEN_
{/*Empty body so that doxygen will generate documentation here.*/}
#endif
;
@@ -232,7 +232,7 @@ struct event_base
*
* Generally, you can create events with event_new(), then make them
* pending with event_add(). As your event_base runs, it will run the
- * callbacks of an events whose conditions are triggered. When you no
+ * callbacks of an events whose conditions are triggered. When you no
* longer want the event, free it with event_free().
*
* In more depth:
@@ -274,7 +274,7 @@ struct event_base
* event_priority_set()
*/
struct event
-#ifdef EVENT_IN_DOXYGEN_
+#ifdef EVENT_IN_DOXYGEN_
{/*Empty body so that doxygen will generate documentation here.*/}
#endif
;
@@ -285,7 +285,7 @@ struct event
* There are many options that can be used to alter the behavior and
* implementation of an event_base. To avoid having to pass them all in a
* complex many-argument constructor, we provide an abstract data type
- * where you set up configuration information before passing it to
+ * where you set up configuration information before passing it to
* event_base_new_with_config().
*
* @see event_config_new(), event_config_free(), event_base_new_with_config(),
@@ -293,7 +293,7 @@ struct event
* event_config_set_flag(), event_config_set_num_cpus_hint()
*/
struct event_config
-#ifdef EVENT_IN_DOXYGEN_
+#ifdef EVENT_IN_DOXYGEN_
{/*Empty body so that doxygen will generate documentation here.*/}
#endif
;
@@ -318,7 +318,7 @@ struct event_config
*
* @see event_debug_unassign()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_enable_debug_mode(void);
/**
@@ -330,7 +330,7 @@ void event_enable_debug_mode(void);
*
* @see event_enable_debug_mode()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_debug_unassign(struct event *);
/**
@@ -340,7 +340,7 @@ void event_debug_unassign(struct event *);
*
* @see event_base_free(), event_base_new_with_config()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *event_base_new(void);
/**
@@ -353,7 +353,7 @@ struct event_base *event_base_new(void);
@return 0 if successful, or -1 if some events could not be re-added.
@see event_base_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_reinit(struct event_base *base);
/**
@@ -369,7 +369,7 @@ int event_reinit(struct event_base *base);
no events were pending or active.
@see event_base_loop()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_dispatch(struct event_base *);
/**
@@ -378,7 +378,7 @@ int event_base_dispatch(struct event_base *);
@param eb the event_base structure returned by event_base_new()
@return a string identifying the kernel event mechanism (kqueue, epoll, etc.)
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *event_base_get_method(const struct event_base *);
/**
@@ -393,67 +393,67 @@ const char *event_base_get_method(const struct event_base *);
The end of the array is indicated by a NULL pointer. If an
error is encountered NULL is returned.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char **event_get_supported_methods(void);
-/** Query the current monotonic time from a the timer for a struct
- * event_base.
- */
-EVENT2_EXPORT_SYMBOL
-int event_gettime_monotonic(struct event_base *base, struct timeval *tp);
-
-/**
- @name event type flag
-
- Flags to pass to event_base_get_num_events() to specify the kinds of events
- we want to aggregate counts for
-*/
-/**@{*/
-/** count the number of active events, which have been triggered.*/
-#define EVENT_BASE_COUNT_ACTIVE 1U
-/** count the number of virtual events, which is used to represent an internal
- * condition, other than a pending event, that keeps the loop from exiting. */
-#define EVENT_BASE_COUNT_VIRTUAL 2U
-/** count the number of events which have been added to event base, including
- * internal events. */
-#define EVENT_BASE_COUNT_ADDED 4U
-/**@}*/
-
-/**
- Gets the number of events in event_base, as specified in the flags.
-
- Since event base has some internal events added to make some of its
- functionalities work, EVENT_BASE_COUNT_ADDED may return more than the
- number of events you added using event_add().
-
- If you pass EVENT_BASE_COUNT_ACTIVE and EVENT_BASE_COUNT_ADDED together, an
- active event will be counted twice. However, this might not be the case in
- future libevent versions. The return value is an indication of the work
- load, but the user shouldn't rely on the exact value as this may change in
- the future.
-
- @param eb the event_base structure returned by event_base_new()
- @param flags a bitwise combination of the kinds of events to aggregate
- counts for
- @return the number of events specified in the flags
-*/
-EVENT2_EXPORT_SYMBOL
-int event_base_get_num_events(struct event_base *, unsigned int);
-
-/**
- Get the maximum number of events in a given event_base as specified in the
- flags.
-
- @param eb the event_base structure returned by event_base_new()
- @param flags a bitwise combination of the kinds of events to aggregate
- counts for
- @param clear option used to reset the maximum count.
- @return the number of events specified in the flags
- */
-EVENT2_EXPORT_SYMBOL
-int event_base_get_max_events(struct event_base *, unsigned int, int);
-
-/**
+/** Query the current monotonic time from a the timer for a struct
+ * event_base.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_gettime_monotonic(struct event_base *base, struct timeval *tp);
+
+/**
+ @name event type flag
+
+ Flags to pass to event_base_get_num_events() to specify the kinds of events
+ we want to aggregate counts for
+*/
+/**@{*/
+/** count the number of active events, which have been triggered.*/
+#define EVENT_BASE_COUNT_ACTIVE 1U
+/** count the number of virtual events, which is used to represent an internal
+ * condition, other than a pending event, that keeps the loop from exiting. */
+#define EVENT_BASE_COUNT_VIRTUAL 2U
+/** count the number of events which have been added to event base, including
+ * internal events. */
+#define EVENT_BASE_COUNT_ADDED 4U
+/**@}*/
+
+/**
+ Gets the number of events in event_base, as specified in the flags.
+
+ Since event base has some internal events added to make some of its
+ functionalities work, EVENT_BASE_COUNT_ADDED may return more than the
+ number of events you added using event_add().
+
+ If you pass EVENT_BASE_COUNT_ACTIVE and EVENT_BASE_COUNT_ADDED together, an
+ active event will be counted twice. However, this might not be the case in
+ future libevent versions. The return value is an indication of the work
+ load, but the user shouldn't rely on the exact value as this may change in
+ the future.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @return the number of events specified in the flags
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_num_events(struct event_base *, unsigned int);
+
+/**
+ Get the maximum number of events in a given event_base as specified in the
+ flags.
+
+ @param eb the event_base structure returned by event_base_new()
+ @param flags a bitwise combination of the kinds of events to aggregate
+ counts for
+ @param clear option used to reset the maximum count.
+ @return the number of events specified in the flags
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_get_max_events(struct event_base *, unsigned int, int);
+
+/**
Allocates a new event configuration object.
The event configuration object can be used to change the behavior of
@@ -463,7 +463,7 @@ int event_base_get_max_events(struct event_base *, unsigned int, int);
NULL if an error is encountered.
@see event_base_new_with_config(), event_config_free(), event_config
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_config *event_config_new(void);
/**
@@ -471,7 +471,7 @@ struct event_config *event_config_new(void);
@param cfg the event configuration object to be freed.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_config_free(struct event_config *cfg);
/**
@@ -486,7 +486,7 @@ void event_config_free(struct event_config *cfg);
@param method the name of the event method to avoid
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_config_avoid_method(struct event_config *cfg, const char *method);
/**
@@ -508,14 +508,14 @@ enum event_method_feature {
EV_FEATURE_O1 = 0x02,
/** Require an event method that allows file descriptors as well as
* sockets. */
- EV_FEATURE_FDS = 0x04,
- /** Require an event method that allows you to use EV_CLOSED to detect
- * connection close without the necessity of reading all the pending data.
- *
- * Methods that do support EV_CLOSED may not be able to provide support on
- * all kernel versions.
- **/
- EV_FEATURE_EARLY_CLOSE = 0x08
+ EV_FEATURE_FDS = 0x04,
+ /** Require an event method that allows you to use EV_CLOSED to detect
+ * connection close without the necessity of reading all the pending data.
+ *
+ * Methods that do support EV_CLOSED may not be able to provide support on
+ * all kernel versions.
+ **/
+ EV_FEATURE_EARLY_CLOSE = 0x08
};
/**
@@ -528,11 +528,11 @@ enum event_method_feature {
*/
enum event_base_config_flag {
/** Do not allocate a lock for the event base, even if we have
- locking set up.
-
- Setting this option will make it unsafe and nonfunctional to call
- functions on the base concurrently from multiple threads.
- */
+ locking set up.
+
+ Setting this option will make it unsafe and nonfunctional to call
+ functions on the base concurrently from multiple threads.
+ */
EVENT_BASE_FLAG_NOLOCK = 0x01,
/** Do not check the EVENT_* environment variables when configuring
an event_base */
@@ -557,20 +557,20 @@ enum event_base_config_flag {
if you have any fds cloned by dup() or its variants. Doing so
will produce strange and hard-to-diagnose bugs.
- This flag can also be activated by setting the
+ This flag can also be activated by setting the
EVENT_EPOLL_USE_CHANGELIST environment variable.
This flag has no effect if you wind up using a backend other than
epoll.
*/
- EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST = 0x10,
-
- /** Ordinarily, Libevent implements its time and timeout code using
- the fastest monotonic timer that we have. If this flag is set,
- however, we use less efficient more precise timer, assuming one is
- present.
- */
- EVENT_BASE_FLAG_PRECISE_TIMER = 0x20
+ EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST = 0x10,
+
+ /** Ordinarily, Libevent implements its time and timeout code using
+ the fastest monotonic timer that we have. If this flag is set,
+ however, we use less efficient more precise timer, assuming one is
+ present.
+ */
+ EVENT_BASE_FLAG_PRECISE_TIMER = 0x20
};
/**
@@ -580,7 +580,7 @@ enum event_base_config_flag {
@see event_method_feature
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_get_features(const struct event_base *base);
/**
@@ -605,7 +605,7 @@ int event_base_get_features(const struct event_base *base);
@return 0 on success, -1 on failure.
@see event_method_feature, event_base_new_with_config()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_config_require_features(struct event_config *cfg, int feature);
/**
@@ -614,7 +614,7 @@ int event_config_require_features(struct event_config *cfg, int feature);
*
* @see event_base_config_flags, event_base_new_with_config()
**/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_config_set_flag(struct event_config *cfg, int flag);
/**
@@ -626,43 +626,43 @@ int event_config_set_flag(struct event_config *cfg, int flag);
* @param cpus the number of cpus
* @return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_config_set_num_cpus_hint(struct event_config *cfg, int cpus);
/**
- * Record an interval and/or a number of callbacks after which the event base
- * should check for new events. By default, the event base will run as many
- * events are as activated at the highest activated priority before checking
- * for new events. If you configure it by setting max_interval, it will check
- * the time after each callback, and not allow more than max_interval to
- * elapse before checking for new events. If you configure it by setting
- * max_callbacks to a value >= 0, it will run no more than max_callbacks
- * callbacks before checking for new events.
- *
- * This option can decrease the latency of high-priority events, and
- * avoid priority inversions where multiple low-priority events keep us from
- * polling for high-priority events, but at the expense of slightly decreasing
- * the throughput. Use it with caution!
- *
- * @param cfg The event_base configuration object.
- * @param max_interval An interval after which Libevent should stop running
- * callbacks and check for more events, or NULL if there should be
- * no such interval.
- * @param max_callbacks A number of callbacks after which Libevent should
- * stop running callbacks and check for more events, or -1 if there
- * should be no such limit.
- * @param min_priority A priority below which max_interval and max_callbacks
- * should not be enforced. If this is set to 0, they are enforced
- * for events of every priority; if it's set to 1, they're enforced
- * for events of priority 1 and above, and so on.
- * @return 0 on success, -1 on failure.
- **/
-EVENT2_EXPORT_SYMBOL
-int event_config_set_max_dispatch_interval(struct event_config *cfg,
- const struct timeval *max_interval, int max_callbacks,
- int min_priority);
-
-/**
+ * Record an interval and/or a number of callbacks after which the event base
+ * should check for new events. By default, the event base will run as many
+ * events are as activated at the highest activated priority before checking
+ * for new events. If you configure it by setting max_interval, it will check
+ * the time after each callback, and not allow more than max_interval to
+ * elapse before checking for new events. If you configure it by setting
+ * max_callbacks to a value >= 0, it will run no more than max_callbacks
+ * callbacks before checking for new events.
+ *
+ * This option can decrease the latency of high-priority events, and
+ * avoid priority inversions where multiple low-priority events keep us from
+ * polling for high-priority events, but at the expense of slightly decreasing
+ * the throughput. Use it with caution!
+ *
+ * @param cfg The event_base configuration object.
+ * @param max_interval An interval after which Libevent should stop running
+ * callbacks and check for more events, or NULL if there should be
+ * no such interval.
+ * @param max_callbacks A number of callbacks after which Libevent should
+ * stop running callbacks and check for more events, or -1 if there
+ * should be no such limit.
+ * @param min_priority A priority below which max_interval and max_callbacks
+ * should not be enforced. If this is set to 0, they are enforced
+ * for events of every priority; if it's set to 1, they're enforced
+ * for events of priority 1 and above, and so on.
+ * @return 0 on success, -1 on failure.
+ **/
+EVENT2_EXPORT_SYMBOL
+int event_config_set_max_dispatch_interval(struct event_config *cfg,
+ const struct timeval *max_interval, int max_callbacks,
+ int min_priority);
+
+/**
Initialize the event API.
Use event_base_new_with_config() to initialize a new event base, taking
@@ -674,7 +674,7 @@ int event_config_set_max_dispatch_interval(struct event_config *cfg,
or NULL if no event base can be created with the requested event_config.
@see event_base_new(), event_base_free(), event_init(), event_assign()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *event_base_new_with_config(const struct event_config *);
/**
@@ -683,20 +683,20 @@ struct event_base *event_base_new_with_config(const struct event_config *);
Note that this function will not close any fds or free any memory passed
to event_new as the argument to callback.
- If there are any pending finalizer callbacks, this function will invoke
- them.
-
+ If there are any pending finalizer callbacks, this function will invoke
+ them.
+
@param eb an event_base to be freed
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_base_free(struct event_base *);
-/**
- As event_base_free, but do not run finalizers.
- */
-EVENT2_EXPORT_SYMBOL
-void event_base_free_nofinalize(struct event_base *);
-
+/**
+ As event_base_free, but do not run finalizers.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_free_nofinalize(struct event_base *);
+
/** @name Log severities
*/
/**@{*/
@@ -723,13 +723,13 @@ typedef void (*event_log_cb)(int severity, const char *msg);
Redirect Libevent's log messages.
@param cb a function taking two arguments: an integer severity between
- EVENT_LOG_DEBUG and EVENT_LOG_ERR, and a string. If cb is NULL,
+ EVENT_LOG_DEBUG and EVENT_LOG_ERR, and a string. If cb is NULL,
then the default log is used.
NOTE: The function you provide *must not* call any other libevent
functionality. Doing so can produce undefined behavior.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_set_log_callback(event_log_cb cb);
/**
@@ -748,33 +748,33 @@ typedef void (*event_fatal_cb)(int err);
something is wrong with your program, or with Libevent: any subsequent calls
to Libevent may result in undefined behavior.
- Libevent will (almost) always log an EVENT_LOG_ERR message before calling
+ Libevent will (almost) always log an EVENT_LOG_ERR message before calling
this function; look at the last log message to see why Libevent has died.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_set_fatal_callback(event_fatal_cb cb);
-#define EVENT_DBG_ALL 0xffffffffu
-#define EVENT_DBG_NONE 0
-
-/**
- Turn on debugging logs and have them sent to the default log handler.
-
- This is a global setting; if you are going to call it, you must call this
- before any calls that create an event-base. You must call it before any
- multithreaded use of Libevent.
-
- Debug logs are verbose.
-
- @param which Controls which debug messages are turned on. This option is
- unused for now; for forward compatibility, you must pass in the constant
- "EVENT_DBG_ALL" to turn debugging logs on, or "EVENT_DBG_NONE" to turn
- debugging logs off.
- */
-EVENT2_EXPORT_SYMBOL
-void event_enable_debug_logging(ev_uint32_t which);
-
-/**
+#define EVENT_DBG_ALL 0xffffffffu
+#define EVENT_DBG_NONE 0
+
+/**
+ Turn on debugging logs and have them sent to the default log handler.
+
+ This is a global setting; if you are going to call it, you must call this
+ before any calls that create an event-base. You must call it before any
+ multithreaded use of Libevent.
+
+ Debug logs are verbose.
+
+ @param which Controls which debug messages are turned on. This option is
+ unused for now; for forward compatibility, you must pass in the constant
+ "EVENT_DBG_ALL" to turn debugging logs on, or "EVENT_DBG_NONE" to turn
+ debugging logs off.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_enable_debug_logging(ev_uint32_t which);
+
+/**
Associate a different event base with an event.
The event to be associated must not be currently active or pending.
@@ -783,7 +783,7 @@ void event_enable_debug_logging(ev_uint32_t which);
@param ev the event
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_set(struct event_base *, struct event *);
/** @name Loop flags
@@ -797,11 +797,11 @@ int event_base_set(struct event_base *, struct event *);
/** Do not block: see which events are ready now, run the callbacks
* of the highest-priority ones, then exit. */
#define EVLOOP_NONBLOCK 0x02
-/** Do not exit the loop because we have no pending events. Instead, keep
- * running until event_base_loopexit() or event_base_loopbreak() makes us
- * stop.
- */
-#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
+/** Do not exit the loop because we have no pending events. Instead, keep
+ * running until event_base_loopexit() or event_base_loopbreak() makes us
+ * stop.
+ */
+#define EVLOOP_NO_EXIT_ON_EMPTY 0x04
/**@}*/
/**
@@ -822,7 +822,7 @@ int event_base_set(struct event_base *, struct event *);
@see event_base_loopexit(), event_base_dispatch(), EVLOOP_ONCE,
EVLOOP_NONBLOCK
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_loop(struct event_base *, int);
/**
@@ -840,7 +840,7 @@ int event_base_loop(struct event_base *, int);
@return 0 if successful, or -1 if an error occurred
@see event_base_loopbreak()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_loopexit(struct event_base *, const struct timeval *);
/**
@@ -850,38 +850,38 @@ int event_base_loopexit(struct event_base *, const struct timeval *);
event_base_loopbreak() is typically invoked from this event's callback.
This behavior is analogous to the "break;" statement.
- Subsequent invocations of event_base_loop() will proceed normally.
+ Subsequent invocations of event_base_loop() will proceed normally.
@param eb the event_base structure returned by event_init()
@return 0 if successful, or -1 if an error occurred
@see event_base_loopexit()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_loopbreak(struct event_base *);
/**
- Tell the active event_base_loop() to scan for new events immediately.
-
- Calling this function makes the currently active event_base_loop()
- start the loop over again (scanning for new events) after the current
- event callback finishes. If the event loop is not running, this
- function has no effect.
-
- event_base_loopbreak() is typically invoked from this event's callback.
- This behavior is analogous to the "continue;" statement.
-
- Subsequent invocations of event loop will proceed normally.
-
- @param eb the event_base structure returned by event_init()
- @return 0 if successful, or -1 if an error occurred
- @see event_base_loopbreak()
- */
-EVENT2_EXPORT_SYMBOL
-int event_base_loopcontinue(struct event_base *);
-
-/**
- Checks if the event loop was told to exit by event_base_loopexit().
-
+ Tell the active event_base_loop() to scan for new events immediately.
+
+ Calling this function makes the currently active event_base_loop()
+ start the loop over again (scanning for new events) after the current
+ event callback finishes. If the event loop is not running, this
+ function has no effect.
+
+ event_base_loopbreak() is typically invoked from this event's callback.
+ This behavior is analogous to the "continue;" statement.
+
+ Subsequent invocations of event loop will proceed normally.
+
+ @param eb the event_base structure returned by event_init()
+ @return 0 if successful, or -1 if an error occurred
+ @see event_base_loopbreak()
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_loopcontinue(struct event_base *);
+
+/**
+ Checks if the event loop was told to exit by event_base_loopexit().
+
This function will return true for an event_base at every point after
event_loopexit() is called, until the event loop is next entered.
@@ -891,14 +891,14 @@ int event_base_loopcontinue(struct event_base *);
@see event_base_loopexit()
@see event_base_got_break()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_got_exit(struct event_base *);
/**
- Checks if the event loop was told to abort immediately by event_base_loopbreak().
+ Checks if the event loop was told to abort immediately by event_base_loopbreak().
This function will return true for an event_base at every point after
- event_base_loopbreak() is called, until the event loop is next entered.
+ event_base_loopbreak() is called, until the event loop is next entered.
@param eb the event_base structure returned by event_init()
@return true if event_base_loopbreak() was called on this event base,
@@ -906,7 +906,7 @@ int event_base_got_exit(struct event_base *);
@see event_base_loopbreak()
@see event_base_got_exit()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_got_break(struct event_base *);
/**
@@ -933,37 +933,37 @@ int event_base_got_break(struct event_base *);
*/
#define EV_PERSIST 0x10
/** Select edge-triggered behavior, if supported by the backend. */
-#define EV_ET 0x20
-/**
- * If this option is provided, then event_del() will not block in one thread
- * while waiting for the event callback to complete in another thread.
- *
- * To use this option safely, you may need to use event_finalize() or
- * event_free_finalize() in order to safely tear down an event in a
- * multithreaded application. See those functions for more information.
- **/
-#define EV_FINALIZE 0x40
-/**
- * Detects connection close events. You can use this to detect when a
- * connection has been closed, without having to read all the pending data
- * from a connection.
- *
- * Not all backends support EV_CLOSED. To detect or require it, use the
- * feature flag EV_FEATURE_EARLY_CLOSE.
- **/
-#define EV_CLOSED 0x80
+#define EV_ET 0x20
+/**
+ * If this option is provided, then event_del() will not block in one thread
+ * while waiting for the event callback to complete in another thread.
+ *
+ * To use this option safely, you may need to use event_finalize() or
+ * event_free_finalize() in order to safely tear down an event in a
+ * multithreaded application. See those functions for more information.
+ **/
+#define EV_FINALIZE 0x40
+/**
+ * Detects connection close events. You can use this to detect when a
+ * connection has been closed, without having to read all the pending data
+ * from a connection.
+ *
+ * Not all backends support EV_CLOSED. To detect or require it, use the
+ * feature flag EV_FEATURE_EARLY_CLOSE.
+ **/
+#define EV_CLOSED 0x80
/**@}*/
/**
@name evtimer_* macros
- Aliases for working with one-shot timer events
- If you need EV_PERSIST timer use event_*() functions.
- */
+ Aliases for working with one-shot timer events
+ If you need EV_PERSIST timer use event_*() functions.
+ */
/**@{*/
#define evtimer_assign(ev, b, cb, arg) \
event_assign((ev), (b), -1, 0, (cb), (arg))
-#define evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
+#define evtimer_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
#define evtimer_add(ev, tv) event_add((ev), (tv))
#define evtimer_del(ev) event_del(ev)
#define evtimer_pending(ev, tv) event_pending((ev), EV_TIMEOUT, (tv))
@@ -987,20 +987,20 @@ int event_base_got_break(struct event_base *);
/**@}*/
/**
- @name evuser_* macros
-
- Aliases for working with user-triggered events
- If you need EV_PERSIST event use event_*() functions.
- */
-/**@{*/
-#define evuser_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
-#define evuser_del(ev) event_del(ev)
-#define evuser_pending(ev, tv) event_pending((ev), 0, (tv))
-#define evuser_initialized(ev) event_initialized(ev)
-#define evuser_trigger(ev) event_active((ev), 0, 0)
-/**@}*/
-
-/**
+ @name evuser_* macros
+
+ Aliases for working with user-triggered events
+ If you need EV_PERSIST event use event_*() functions.
+ */
+/**@{*/
+#define evuser_new(b, cb, arg) event_new((b), -1, 0, (cb), (arg))
+#define evuser_del(ev) event_del(ev)
+#define evuser_pending(ev, tv) event_pending((ev), 0, (tv))
+#define evuser_initialized(ev) event_initialized(ev)
+#define evuser_trigger(ev) event_active((ev), 0, 0)
+/**@}*/
+
+/**
A callback function for an event.
It receives three arguments:
@@ -1014,33 +1014,33 @@ int event_base_got_break(struct event_base *);
typedef void (*event_callback_fn)(evutil_socket_t, short, void *);
/**
- Return a value used to specify that the event itself must be used as the callback argument.
-
- The function event_new() takes a callback argument which is passed
- to the event's callback function. To specify that the argument to be
- passed to the callback function is the event that event_new() returns,
- pass in the return value of event_self_cbarg() as the callback argument
- for event_new().
-
- For example:
- <pre>
- struct event *ev = event_new(base, sock, events, callback, %event_self_cbarg());
- </pre>
-
- For consistency with event_new(), it is possible to pass the return value
- of this function as the callback argument for event_assign() &ndash; this
- achieves the same result as passing the event in directly.
-
- @return a value to be passed as the callback argument to event_new() or
- event_assign().
- @see event_new(), event_assign()
- */
-EVENT2_EXPORT_SYMBOL
-void *event_self_cbarg(void);
-
-/**
- Allocate and assign a new event structure, ready to be added.
-
+ Return a value used to specify that the event itself must be used as the callback argument.
+
+ The function event_new() takes a callback argument which is passed
+ to the event's callback function. To specify that the argument to be
+ passed to the callback function is the event that event_new() returns,
+ pass in the return value of event_self_cbarg() as the callback argument
+ for event_new().
+
+ For example:
+ <pre>
+ struct event *ev = event_new(base, sock, events, callback, %event_self_cbarg());
+ </pre>
+
+ For consistency with event_new(), it is possible to pass the return value
+ of this function as the callback argument for event_assign() &ndash; this
+ achieves the same result as passing the event in directly.
+
+ @return a value to be passed as the callback argument to event_new() or
+ event_assign().
+ @see event_new(), event_assign()
+ */
+EVENT2_EXPORT_SYMBOL
+void *event_self_cbarg(void);
+
+/**
+ Allocate and assign a new event structure, ready to be added.
+
The function event_new() returns a new event that can be used in
future calls to event_add() and event_del(). The fd and events
arguments determine which conditions will trigger the event; the
@@ -1065,10 +1065,10 @@ void *event_self_cbarg(void);
The EV_TIMEOUT flag has no effect here.
It is okay to have multiple events all listening on the same fds; but
- they must either all be edge-triggered, or all not be edge triggered.
+ they must either all be edge-triggered, or all not be edge triggered.
When the event becomes active, the event loop will run the provided
- callback function, with three arguments. The first will be the provided
+ callback function, with three arguments. The first will be the provided
fd value. The second will be a bitfield of the events that triggered:
EV_READ, EV_WRITE, or EV_SIGNAL. Here the EV_TIMEOUT flag indicates
that a timeout occurred, and EV_ET indicates that an edge-triggered
@@ -1083,10 +1083,10 @@ void *event_self_cbarg(void);
@param callback_arg an argument to be passed to the callback function
@return a newly allocated struct event that must later be freed with
- event_free() or NULL if an error occurred.
+ event_free() or NULL if an error occurred.
@see event_free(), event_add(), event_del(), event_assign()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event *event_new(struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
@@ -1128,71 +1128,71 @@ struct event *event_new(struct event_base *, evutil_socket_t, short, event_callb
@see event_new(), event_add(), event_del(), event_base_once(),
event_get_struct_event_size()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_assign(struct event *, struct event_base *, evutil_socket_t, short, event_callback_fn, void *);
/**
Deallocate a struct event * returned by event_new().
- If the event is pending or active, this function makes it non-pending
- and non-active first.
+ If the event is pending or active, this function makes it non-pending
+ and non-active first.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_free(struct event *);
/**
- * Callback type for event_finalize and event_free_finalize().
- **/
-typedef void (*event_finalize_callback_fn)(struct event *, void *);
-/**
- @name Finalization functions
-
- These functions are used to safely tear down an event in a multithreaded
- application. If you construct your events with EV_FINALIZE to avoid
- deadlocks, you will need a way to remove an event in the certainty that
- it will definitely not be running its callback when you deallocate it
- and its callback argument.
-
- To do this, call one of event_finalize() or event_free_finalize with
- 0 for its first argument, the event to tear down as its second argument,
- and a callback function as its third argument. The callback will be
- invoked as part of the event loop, with the event's priority.
-
- After you call a finalizer function, event_add() and event_active() will
- no longer work on the event, and event_del() will produce a no-op. You
- must not try to change the event's fields with event_assign() or
- event_set() while the finalize callback is in progress. Once the
- callback has been invoked, you should treat the event structure as
- containing uninitialized memory.
-
- The event_free_finalize() function frees the event after it's finalized;
- event_finalize() does not.
-
- A finalizer callback must not make events pending or active. It must not
- add events, activate events, or attempt to "resuscitate" the event being
- finalized in any way.
-
- @return 0 on success, -1 on failure.
- */
-/**@{*/
-EVENT2_EXPORT_SYMBOL
-int event_finalize(unsigned, struct event *, event_finalize_callback_fn);
-EVENT2_EXPORT_SYMBOL
-int event_free_finalize(unsigned, struct event *, event_finalize_callback_fn);
-/**@}*/
-
-/**
+ * Callback type for event_finalize and event_free_finalize().
+ **/
+typedef void (*event_finalize_callback_fn)(struct event *, void *);
+/**
+ @name Finalization functions
+
+ These functions are used to safely tear down an event in a multithreaded
+ application. If you construct your events with EV_FINALIZE to avoid
+ deadlocks, you will need a way to remove an event in the certainty that
+ it will definitely not be running its callback when you deallocate it
+ and its callback argument.
+
+ To do this, call one of event_finalize() or event_free_finalize with
+ 0 for its first argument, the event to tear down as its second argument,
+ and a callback function as its third argument. The callback will be
+ invoked as part of the event loop, with the event's priority.
+
+ After you call a finalizer function, event_add() and event_active() will
+ no longer work on the event, and event_del() will produce a no-op. You
+ must not try to change the event's fields with event_assign() or
+ event_set() while the finalize callback is in progress. Once the
+ callback has been invoked, you should treat the event structure as
+ containing uninitialized memory.
+
+ The event_free_finalize() function frees the event after it's finalized;
+ event_finalize() does not.
+
+ A finalizer callback must not make events pending or active. It must not
+ add events, activate events, or attempt to "resuscitate" the event being
+ finalized in any way.
+
+ @return 0 on success, -1 on failure.
+ */
+/**@{*/
+EVENT2_EXPORT_SYMBOL
+int event_finalize(unsigned, struct event *, event_finalize_callback_fn);
+EVENT2_EXPORT_SYMBOL
+int event_free_finalize(unsigned, struct event *, event_finalize_callback_fn);
+/**@}*/
+
+/**
Schedule a one-time event
- The function event_base_once() is similar to event_new(). However, it
+ The function event_base_once() is similar to event_new(). However, it
schedules a callback to be called exactly once, and does not require the
caller to prepare an event structure.
- Note that in Libevent 2.0 and earlier, if the event is never triggered, the
- internal memory used to hold it will never be freed. In Libevent 2.1,
- the internal memory will get freed by event_base_free() if the event
- is never triggered. The 'arg' value, however, will not get freed in either
- case--you'll need to free that on your own if you want it to go away.
+ Note that in Libevent 2.0 and earlier, if the event is never triggered, the
+ internal memory used to hold it will never be freed. In Libevent 2.1,
+ the internal memory will get freed by event_base_free() if the event
+ is never triggered. The 'arg' value, however, will not get freed in either
+ case--you'll need to free that on your own if you want it to go away.
@param base an event_base
@param fd a file descriptor to monitor, or -1 for no fd.
@@ -1202,18 +1202,18 @@ int event_free_finalize(unsigned, struct event *, event_finalize_callback_fn);
@param arg an argument to be passed to the callback function
@param timeout the maximum amount of time to wait for the event. NULL
makes an EV_READ/EV_WRITE event make forever; NULL makes an
- EV_TIMEOUT event success immediately.
+ EV_TIMEOUT event success immediately.
@return 0 if successful, or -1 if an error occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_fn, void *, const struct timeval *);
/**
Add an event to the set of pending events.
- The function event_add() schedules the execution of the event 'ev' when the
- condition specified by event_assign() or event_new() occurs, or when the time
- specified in timeout has elapsed. If a timeout is NULL, no timeout
+ The function event_add() schedules the execution of the event 'ev' when the
+ condition specified by event_assign() or event_new() occurs, or when the time
+ specified in timeout has elapsed. If a timeout is NULL, no timeout
occurs and the function will only be
called if a matching event occurs. The event in the
ev argument must be already initialized by event_assign() or event_new()
@@ -1221,30 +1221,30 @@ int event_base_once(struct event_base *, evutil_socket_t, short, event_callback_
in calls to event_assign() until it is no longer pending.
If the event in the ev argument already has a scheduled timeout, calling
- event_add() replaces the old timeout with the new one if tv is non-NULL.
+ event_add() replaces the old timeout with the new one if tv is non-NULL.
- @param ev an event struct initialized via event_assign() or event_new()
+ @param ev an event struct initialized via event_assign() or event_new()
@param timeout the maximum amount of time to wait for the event, or NULL
to wait forever
@return 0 if successful, or -1 if an error occurred
@see event_del(), event_assign(), event_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_add(struct event *ev, const struct timeval *timeout);
/**
- Remove a timer from a pending event without removing the event itself.
-
- If the event has a scheduled timeout, this function unschedules it but
- leaves the event otherwise pending.
-
- @param ev an event struct initialized via event_assign() or event_new()
- @return 0 on success, or -1 if an error occurred.
-*/
-EVENT2_EXPORT_SYMBOL
-int event_remove_timer(struct event *ev);
-
-/**
+ Remove a timer from a pending event without removing the event itself.
+
+ If the event has a scheduled timeout, this function unschedules it but
+ leaves the event otherwise pending.
+
+ @param ev an event struct initialized via event_assign() or event_new()
+ @return 0 on success, or -1 if an error occurred.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_remove_timer(struct event *ev);
+
+/**
Remove an event from the set of monitored events.
The function event_del() will cancel the event in the argument ev. If the
@@ -1255,23 +1255,23 @@ int event_remove_timer(struct event *ev);
@return 0 if successful, or -1 if an error occurred
@see event_add()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_del(struct event *);
-/**
- As event_del(), but never blocks while the event's callback is running
- in another thread, even if the event was constructed without the
- EV_FINALIZE flag.
- */
-EVENT2_EXPORT_SYMBOL
-int event_del_noblock(struct event *ev);
-/**
- As event_del(), but always blocks while the event's callback is running
- in another thread, even if the event was constructed with the
- EV_FINALIZE flag.
- */
-EVENT2_EXPORT_SYMBOL
-int event_del_block(struct event *ev);
+/**
+ As event_del(), but never blocks while the event's callback is running
+ in another thread, even if the event was constructed without the
+ EV_FINALIZE flag.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_noblock(struct event *ev);
+/**
+ As event_del(), but always blocks while the event's callback is running
+ in another thread, even if the event was constructed with the
+ EV_FINALIZE flag.
+ */
+EVENT2_EXPORT_SYMBOL
+int event_del_block(struct event *ev);
/**
Make an event active.
@@ -1287,7 +1287,7 @@ int event_del_block(struct event *ev);
@param res a set of flags to pass to the event's callback.
@param ncalls an obsolete argument: this is ignored.
**/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_active(struct event *ev, int res, short ncalls);
/**
@@ -1303,25 +1303,25 @@ void event_active(struct event *ev, int res, short ncalls);
@return true if the event is pending on any of the events in 'what', (that
is to say, it has been added), or 0 if the event is not added.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_pending(const struct event *ev, short events, struct timeval *tv);
-/**
- If called from within the callback for an event, returns that event.
+/**
+ If called from within the callback for an event, returns that event.
+
+ The behavior of this function is not defined when called from outside the
+ callback function for an event.
+ */
+EVENT2_EXPORT_SYMBOL
+struct event *event_base_get_running_event(struct event_base *base);
- The behavior of this function is not defined when called from outside the
- callback function for an event.
- */
-EVENT2_EXPORT_SYMBOL
-struct event *event_base_get_running_event(struct event_base *base);
-
/**
Test if an event structure might be initialized.
The event_initialized() function can be used to check if an event has been
initialized.
- Warning: This function is only useful for distinguishing a zeroed-out
+ Warning: This function is only useful for distinguishing a zeroed-out
piece of memory from an initialized event, it can easily be confused by
uninitialized memory. Thus, it should ONLY be used to distinguish an
initialized event from zero.
@@ -1330,7 +1330,7 @@ struct event *event_base_get_running_event(struct event_base *base);
@return 1 if the structure might be initialized, or 0 if it has not been
initialized
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_initialized(const struct event *ev);
/**
@@ -1342,48 +1342,48 @@ int event_initialized(const struct event *ev);
Get the socket or signal assigned to an event, or -1 if the event has
no socket.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
evutil_socket_t event_get_fd(const struct event *ev);
/**
Get the event_base associated with an event.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *event_get_base(const struct event *ev);
/**
Return the events (EV_READ, EV_WRITE, etc) assigned to an event.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
short event_get_events(const struct event *ev);
/**
Return the callback assigned to an event.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
event_callback_fn event_get_callback(const struct event *ev);
/**
Return the callback argument assigned to an event.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void *event_get_callback_arg(const struct event *ev);
/**
- Return the priority of an event.
- @see event_priority_init(), event_get_priority()
-*/
-EVENT2_EXPORT_SYMBOL
-int event_get_priority(const struct event *ev);
-
-/**
+ Return the priority of an event.
+ @see event_priority_init(), event_get_priority()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_get_priority(const struct event *ev);
+
+/**
Extract _all_ of arguments given to construct a given event. The
event_base is copied into *base_out, the fd is copied into *fd_out, and so
on.
If any of the "_out" arguments is NULL, it will be ignored.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_get_assignment(const struct event *event,
struct event_base **base_out, evutil_socket_t *fd_out, short *events_out,
event_callback_fn *callback_out, void **arg_out);
@@ -1401,7 +1401,7 @@ void event_get_assignment(const struct event *event,
We might do this to help ensure ABI-compatibility between different
versions of Libevent.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
size_t event_get_struct_event_size(void);
/**
@@ -1413,7 +1413,7 @@ size_t event_get_struct_event_size(void);
@return a string containing the version number of Libevent
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *event_get_version(void);
/**
@@ -1427,14 +1427,14 @@ const char *event_get_version(void);
the version number. The low-order byte is unused. For example, version
2.0.1-alpha has a numeric representation of 0x02000100
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_uint32_t event_get_version_number(void);
/** As event_get_version, but gives the version of Libevent's headers. */
-#define LIBEVENT_VERSION EVENT__VERSION
+#define LIBEVENT_VERSION EVENT__VERSION
/** As event_get_version_number, but gives the version number of Libevent's
* headers. */
-#define LIBEVENT_VERSION_NUMBER EVENT__NUMERIC_VERSION
+#define LIBEVENT_VERSION_NUMBER EVENT__NUMERIC_VERSION
/** Largest number of priorities that Libevent can support. */
#define EVENT_MAX_PRIORITIES 256
@@ -1465,28 +1465,28 @@ ev_uint32_t event_get_version_number(void);
@return 0 if successful, or -1 if an error occurred
@see event_priority_set()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_priority_init(struct event_base *, int);
/**
- Get the number of different event priorities.
-
- @param eb the event_base structure returned by event_base_new()
- @return Number of different event priorities
- @see event_base_priority_init()
-*/
-EVENT2_EXPORT_SYMBOL
-int event_base_get_npriorities(struct event_base *eb);
-
-/**
+ Get the number of different event priorities.
+
+ @param eb the event_base structure returned by event_base_new()
+ @return Number of different event priorities
+ @see event_base_priority_init()
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_get_npriorities(struct event_base *eb);
+
+/**
Assign a priority to an event.
@param ev an event struct
@param priority the new priority to be assigned
@return 0 if successful, or -1 if an error occurred
- @see event_priority_init(), event_get_priority()
+ @see event_priority_init(), event_get_priority()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_priority_set(struct event *, int);
/**
@@ -1508,11 +1508,11 @@ int event_priority_set(struct event *, int);
(This optimization probably will not be worthwhile until you have thousands
or tens of thousands of events with the same timeout.)
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const struct timeval *event_base_init_common_timeout(struct event_base *base,
const struct timeval *duration);
-#if !defined(EVENT__DISABLE_MM_REPLACEMENT) || defined(EVENT_IN_DOXYGEN_)
+#if !defined(EVENT__DISABLE_MM_REPLACEMENT) || defined(EVENT_IN_DOXYGEN_)
/**
Override the functions that Libevent uses for memory management.
@@ -1528,14 +1528,14 @@ const struct timeval *event_base_init_common_timeout(struct event_base *base,
Note also that if you are going to call this function, you should do so
before any call to any Libevent function that does allocation.
- Otherwise, those functions will allocate their memory using malloc(), but
+ Otherwise, those functions will allocate their memory using malloc(), but
then later free it using your provided free_fn.
@param malloc_fn A replacement for malloc.
@param realloc_fn A replacement for realloc
@param free_fn A replacement for free.
**/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_set_mem_functions(
void *(*malloc_fn)(size_t sz),
void *(*realloc_fn)(void *ptr, size_t sz),
@@ -1545,128 +1545,128 @@ void event_set_mem_functions(
#define EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED
#endif
-/**
- Writes a human-readable description of all inserted and/or active
- events to a provided stdio stream.
-
- This is intended for debugging; its format is not guaranteed to be the same
- between libevent versions.
-
- @param base An event_base on which to scan the events.
- @param output A stdio file to write on.
- */
-EVENT2_EXPORT_SYMBOL
+/**
+ Writes a human-readable description of all inserted and/or active
+ events to a provided stdio stream.
+
+ This is intended for debugging; its format is not guaranteed to be the same
+ between libevent versions.
+
+ @param base An event_base on which to scan the events.
+ @param output A stdio file to write on.
+ */
+EVENT2_EXPORT_SYMBOL
void event_base_dump_events(struct event_base *, FILE *);
-
-/**
- Activates all pending events for the given fd and event mask.
-
- This function activates pending events only. Events which have not been
- added will not become active.
-
- @param base the event_base on which to activate the events.
- @param fd An fd to active events on.
- @param events One or more of EV_{READ,WRITE,TIMEOUT}.
- */
-EVENT2_EXPORT_SYMBOL
-void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);
-
-/**
- Activates all pending signals with a given signal number
-
- This function activates pending events only. Events which have not been
- added will not become active.
-
- @param base the event_base on which to activate the events.
- @param fd The signal to active events on.
- */
-EVENT2_EXPORT_SYMBOL
-void event_base_active_by_signal(struct event_base *base, int sig);
-
-/**
- * Callback for iterating events in an event base via event_base_foreach_event
- */
-typedef int (*event_base_foreach_event_cb)(const struct event_base *, const struct event *, void *);
-
-/**
- Iterate over all added or active events events in an event loop, and invoke
- a given callback on each one.
-
- The callback must not call any function that modifies the event base, that
- modifies any event in the event base, or that adds or removes any event to
- the event base. Doing so is unsupported and will lead to undefined
- behavior -- likely, to crashes.
-
- event_base_foreach_event() holds a lock on the event_base() for the whole
- time it's running: slow callbacks are not advisable.
-
- Note that Libevent adds some events of its own to make pieces of its
- functionality work. You must not assume that the only events you'll
- encounter will be the ones you added yourself.
-
- The callback function must return 0 to continue iteration, or some other
- integer to stop iterating.
-
- @param base An event_base on which to scan the events.
- @param fn A callback function to receive the events.
- @param arg An argument passed to the callback function.
- @return 0 if we iterated over every event, or the value returned by the
- callback function if the loop exited early.
-*/
-EVENT2_EXPORT_SYMBOL
-int event_base_foreach_event(struct event_base *base, event_base_foreach_event_cb fn, void *arg);
-
-
+
+/**
+ Activates all pending events for the given fd and event mask.
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd An fd to active events on.
+ @param events One or more of EV_{READ,WRITE,TIMEOUT}.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_fd(struct event_base *base, evutil_socket_t fd, short events);
+
+/**
+ Activates all pending signals with a given signal number
+
+ This function activates pending events only. Events which have not been
+ added will not become active.
+
+ @param base the event_base on which to activate the events.
+ @param fd The signal to active events on.
+ */
+EVENT2_EXPORT_SYMBOL
+void event_base_active_by_signal(struct event_base *base, int sig);
+
+/**
+ * Callback for iterating events in an event base via event_base_foreach_event
+ */
+typedef int (*event_base_foreach_event_cb)(const struct event_base *, const struct event *, void *);
+
+/**
+ Iterate over all added or active events events in an event loop, and invoke
+ a given callback on each one.
+
+ The callback must not call any function that modifies the event base, that
+ modifies any event in the event base, or that adds or removes any event to
+ the event base. Doing so is unsupported and will lead to undefined
+ behavior -- likely, to crashes.
+
+ event_base_foreach_event() holds a lock on the event_base() for the whole
+ time it's running: slow callbacks are not advisable.
+
+ Note that Libevent adds some events of its own to make pieces of its
+ functionality work. You must not assume that the only events you'll
+ encounter will be the ones you added yourself.
+
+ The callback function must return 0 to continue iteration, or some other
+ integer to stop iterating.
+
+ @param base An event_base on which to scan the events.
+ @param fn A callback function to receive the events.
+ @param arg An argument passed to the callback function.
+ @return 0 if we iterated over every event, or the value returned by the
+ callback function if the loop exited early.
+*/
+EVENT2_EXPORT_SYMBOL
+int event_base_foreach_event(struct event_base *base, event_base_foreach_event_cb fn, void *arg);
+
+
/** Sets 'tv' to the current time (as returned by gettimeofday()),
looking at the cached value in 'base' if possible, and calling
gettimeofday() or clock_gettime() as appropriate if there is no
cached time.
Generally, this value will only be cached while actually
- processing event callbacks, and may be very inaccurate if your
+ processing event callbacks, and may be very inaccurate if your
callbacks take a long time to execute.
Returns 0 on success, negative on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_base_gettimeofday_cached(struct event_base *base,
struct timeval *tv);
-/** Update cached_tv in the 'base' to the current time
- *
- * You can use this function is useful for selectively increasing
- * the accuracy of the cached time value in 'base' during callbacks
- * that take a long time to execute.
- *
- * This function has no effect if the base is currently not in its
- * event loop, or if timeval caching is disabled via
- * EVENT_BASE_FLAG_NO_CACHE_TIME.
- *
- * @return 0 on success, -1 on failure
- */
-EVENT2_EXPORT_SYMBOL
-int event_base_update_cache_time(struct event_base *base);
-
-/** Release up all globally-allocated resources allocated by Libevent.
-
- This function does not free developer-controlled resources like
- event_bases, events, bufferevents, listeners, and so on. It only releases
- resources like global locks that there is no other way to free.
-
- It is not actually necessary to call this function before exit: every
- resource that it frees would be released anyway on exit. It mainly exists
- so that resource-leak debugging tools don't see Libevent as holding
- resources at exit.
-
- You should only call this function when no other Libevent functions will
- be invoked -- e.g., when cleanly exiting a program.
- */
-EVENT2_EXPORT_SYMBOL
-void libevent_global_shutdown(void);
-
+/** Update cached_tv in the 'base' to the current time
+ *
+ * You can use this function is useful for selectively increasing
+ * the accuracy of the cached time value in 'base' during callbacks
+ * that take a long time to execute.
+ *
+ * This function has no effect if the base is currently not in its
+ * event loop, or if timeval caching is disabled via
+ * EVENT_BASE_FLAG_NO_CACHE_TIME.
+ *
+ * @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int event_base_update_cache_time(struct event_base *base);
+
+/** Release up all globally-allocated resources allocated by Libevent.
+
+ This function does not free developer-controlled resources like
+ event_bases, events, bufferevents, listeners, and so on. It only releases
+ resources like global locks that there is no other way to free.
+
+ It is not actually necessary to call this function before exit: every
+ resource that it frees would be released anyway on exit. It mainly exists
+ so that resource-leak debugging tools don't see Libevent as holding
+ resources at exit.
+
+ You should only call this function when no other Libevent functions will
+ be invoked -- e.g., when cleanly exiting a program.
+ */
+EVENT2_EXPORT_SYMBOL
+void libevent_global_shutdown(void);
+
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_EVENT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/event_compat.h b/contrib/libs/libevent/include/event2/event_compat.h
index 67612da65b..5110175a1b 100644
--- a/contrib/libs/libevent/include/event2/event_compat.h
+++ b/contrib/libs/libevent/include/event2/event_compat.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_EVENT_COMPAT_H_INCLUDED_
-#define EVENT2_EVENT_COMPAT_H_INCLUDED_
+#ifndef EVENT2_EVENT_COMPAT_H_INCLUDED_
+#define EVENT2_EVENT_COMPAT_H_INCLUDED_
/** @file event2/event_compat.h
@@ -41,17 +41,17 @@
@deprecated All functions in this file are by definition deprecated.
*/
-#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
@@ -71,7 +71,7 @@ extern "C" {
@see event_base_set(), event_base_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *event_init(void);
/**
@@ -85,7 +85,7 @@ struct event_base *event_init(void);
@see event_base_dispatch(), event_init()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_dispatch(void);
/**
@@ -99,7 +99,7 @@ int event_dispatch(void);
@see event_base_loop(), event_init()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_loop(int);
@@ -115,7 +115,7 @@ int event_loop(int);
@see event_init, event_base_loopexit()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_loopexit(const struct timeval *);
@@ -131,7 +131,7 @@ int event_loopexit(const struct timeval *);
@see event_base_loopbreak(), event_init()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_loopbreak(void);
/**
@@ -143,7 +143,7 @@ int event_loopbreak(void);
@see event_base_once()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_once(evutil_socket_t , short,
void (*)(evutil_socket_t, short, void *), void *, const struct timeval *);
@@ -157,7 +157,7 @@ int event_once(evutil_socket_t , short,
@see event_base_get_method()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *event_get_method(void);
@@ -170,7 +170,7 @@ const char *event_get_method(void);
@see event_base_priority_init()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int event_priority_init(int);
/**
@@ -180,7 +180,7 @@ int event_priority_init(int);
a subsequent call to event_base_set() to be safe under most circumstances.
Use event_assign() or event_new() instead.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void event_set(struct event *, evutil_socket_t, short, void (*)(evutil_socket_t, short, void *), void *);
#define evtimer_set(ev, cb, arg) event_set((ev), -1, 0, (cb), (arg))
@@ -227,4 +227,4 @@ void event_set(struct event *, evutil_socket_t, short, void (*)(evutil_socket_t,
}
#endif
-#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/event_struct.h b/contrib/libs/libevent/include/event2/event_struct.h
index d6b5a5b56a..1c8b71b6b0 100644
--- a/contrib/libs/libevent/include/event2/event_struct.h
+++ b/contrib/libs/libevent/include/event2/event_struct.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_EVENT_STRUCT_H_INCLUDED_
-#define EVENT2_EVENT_STRUCT_H_INCLUDED_
+#ifndef EVENT2_EVENT_STRUCT_H_INCLUDED_
+#define EVENT2_EVENT_STRUCT_H_INCLUDED_
/** @file event2/event_struct.h
@@ -41,10 +41,10 @@ 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
@@ -54,20 +54,20 @@ extern "C" {
/* For evkeyvalq */
#include <event2/keyvalq_struct.h>
-#define EVLIST_TIMEOUT 0x01
-#define EVLIST_INSERTED 0x02
-#define EVLIST_SIGNAL 0x04
-#define EVLIST_ACTIVE 0x08
-#define EVLIST_INTERNAL 0x10
-#define EVLIST_ACTIVE_LATER 0x20
-#define EVLIST_FINALIZING 0x40
-#define EVLIST_INIT 0x80
+#define EVLIST_TIMEOUT 0x01
+#define EVLIST_INSERTED 0x02
+#define EVLIST_SIGNAL 0x04
+#define EVLIST_ACTIVE 0x08
+#define EVLIST_INTERNAL 0x10
+#define EVLIST_ACTIVE_LATER 0x20
+#define EVLIST_FINALIZING 0x40
+#define EVLIST_INIT 0x80
-#define EVLIST_ALL 0xff
+#define EVLIST_ALL 0xff
/* Fix so that people don't have to run with <sys/queue.h> */
#ifndef TAILQ_ENTRY
-#define EVENT_DEFINED_TQENTRY_
+#define EVENT_DEFINED_TQENTRY_
#define TAILQ_ENTRY(type) \
struct { \
struct type *tqe_next; /* next element */ \
@@ -76,7 +76,7 @@ struct { \
#endif /* !TAILQ_ENTRY */
#ifndef TAILQ_HEAD
-#define EVENT_DEFINED_TQHEAD_
+#define EVENT_DEFINED_TQHEAD_
#define TAILQ_HEAD(name, type) \
struct name { \
struct type *tqh_first; \
@@ -84,45 +84,45 @@ struct name { \
}
#endif
-/* Fix so that people don't have to run with <sys/queue.h> */
-#ifndef LIST_ENTRY
-#define EVENT_DEFINED_LISTENTRY_
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-#endif /* !LIST_ENTRY */
-
-#ifndef LIST_HEAD
-#define EVENT_DEFINED_LISTHEAD_
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
- }
-#endif /* !LIST_HEAD */
-
-struct event;
-
-struct event_callback {
- TAILQ_ENTRY(event_callback) evcb_active_next;
- short evcb_flags;
- ev_uint8_t evcb_pri; /* smaller numbers are higher priority */
- ev_uint8_t evcb_closure;
- /* allows us to adopt for different types of events */
- union {
- void (*evcb_callback)(evutil_socket_t, short, void *);
- void (*evcb_selfcb)(struct event_callback *, void *);
- void (*evcb_evfinalize)(struct event *, void *);
- void (*evcb_cbfinalize)(struct event_callback *, void *);
- } evcb_cb_union;
- void *evcb_arg;
-};
-
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef LIST_ENTRY
+#define EVENT_DEFINED_LISTENTRY_
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+#endif /* !LIST_ENTRY */
+
+#ifndef LIST_HEAD
+#define EVENT_DEFINED_LISTHEAD_
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+ }
+#endif /* !LIST_HEAD */
+
+struct event;
+
+struct event_callback {
+ TAILQ_ENTRY(event_callback) evcb_active_next;
+ short evcb_flags;
+ ev_uint8_t evcb_pri; /* smaller numbers are higher priority */
+ ev_uint8_t evcb_closure;
+ /* allows us to adopt for different types of events */
+ union {
+ void (*evcb_callback)(evutil_socket_t, short, void *);
+ void (*evcb_selfcb)(struct event_callback *, void *);
+ void (*evcb_evfinalize)(struct event *, void *);
+ void (*evcb_cbfinalize)(struct event_callback *, void *);
+ } evcb_cb_union;
+ void *evcb_arg;
+};
+
struct event_base;
struct event {
- struct event_callback ev_evcallback;
-
+ struct event_callback ev_evcallback;
+
/* for managing timeouts */
union {
TAILQ_ENTRY(event) ev_next_with_common_timeout;
@@ -135,18 +135,18 @@ struct event {
union {
/* used for io events */
struct {
- LIST_ENTRY (event) ev_io_next;
+ LIST_ENTRY (event) ev_io_next;
struct timeval ev_timeout;
} ev_io;
/* used by signal events */
struct {
- LIST_ENTRY (event) ev_signal_next;
+ LIST_ENTRY (event) ev_signal_next;
short ev_ncalls;
/* Allows deletes in callback */
short *ev_pncalls;
} ev_signal;
- } ev_;
+ } ev_;
short ev_events;
short ev_res; /* result passed to event callback */
@@ -155,26 +155,26 @@ struct event {
TAILQ_HEAD (event_list, event);
-#ifdef EVENT_DEFINED_TQENTRY_
+#ifdef EVENT_DEFINED_TQENTRY_
#undef TAILQ_ENTRY
#endif
-#ifdef EVENT_DEFINED_TQHEAD_
+#ifdef EVENT_DEFINED_TQHEAD_
#undef TAILQ_HEAD
#endif
-LIST_HEAD (event_dlist, event);
-
-#ifdef EVENT_DEFINED_LISTENTRY_
-#undef LIST_ENTRY
-#endif
-
-#ifdef EVENT_DEFINED_LISTHEAD_
-#undef LIST_HEAD
-#endif
-
+LIST_HEAD (event_dlist, event);
+
+#ifdef EVENT_DEFINED_LISTENTRY_
+#undef LIST_ENTRY
+#endif
+
+#ifdef EVENT_DEFINED_LISTHEAD_
+#undef LIST_HEAD
+#endif
+
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_EVENT_STRUCT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_STRUCT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/http.h b/contrib/libs/libevent/include/event2/http.h
index cfb0c2c404..40d411ddd2 100644
--- a/contrib/libs/libevent/include/event2/http.h
+++ b/contrib/libs/libevent/include/event2/http.h
@@ -24,12 +24,12 @@
* (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_HTTP_H_INCLUDED_
-#define EVENT2_HTTP_H_INCLUDED_
+#ifndef EVENT2_HTTP_H_INCLUDED_
+#define EVENT2_HTTP_H_INCLUDED_
/* For int types. */
#include <event2/util.h>
-#include <event2/visibility.h>
+#include <event2/visibility.h>
#ifdef __cplusplus
extern "C" {
@@ -39,7 +39,7 @@ extern "C" {
struct evbuffer;
struct event_base;
struct bufferevent;
-struct evhttp_connection;
+struct evhttp_connection;
/** @file event2/http.h
*
@@ -78,11 +78,11 @@ struct evdns_base;
* Create a new HTTP server.
*
* @param base (optional) the event base to receive the HTTP events
- * @return a pointer to a newly initialized evhttp server structure or NULL
- * on error
+ * @return a pointer to a newly initialized evhttp server structure or NULL
+ * on error
* @see evhttp_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp *evhttp_new(struct event_base *base);
/**
@@ -97,7 +97,7 @@ struct evhttp *evhttp_new(struct event_base *base);
* @return 0 on success, -1 on failure.
* @see evhttp_accept_socket()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t port);
/**
@@ -111,7 +111,7 @@ int evhttp_bind_socket(struct evhttp *http, const char *address, ev_uint16_t por
* @return Handle for the socket on success, NULL on failure.
* @see evhttp_bind_socket(), evhttp_del_accept_socket()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_bound_socket *evhttp_bind_socket_with_handle(struct evhttp *http, const char *address, ev_uint16_t port);
/**
@@ -130,7 +130,7 @@ struct evhttp_bound_socket *evhttp_bind_socket_with_handle(struct evhttp *http,
* @return 0 on success, -1 on failure.
* @see evhttp_bind_socket()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
/**
@@ -143,7 +143,7 @@ int evhttp_accept_socket(struct evhttp *http, evutil_socket_t fd);
* @return Handle for the socket on success, NULL on failure.
* @see evhttp_accept_socket(), evhttp_del_accept_socket()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_bound_socket *evhttp_accept_socket_with_handle(struct evhttp *http, evutil_socket_t fd);
/**
@@ -151,30 +151,30 @@ struct evhttp_bound_socket *evhttp_accept_socket_with_handle(struct evhttp *http
* returns an evhttp_bound_socket. The listener will be freed when the bound
* socket is freed.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_bound_socket *evhttp_bind_listener(struct evhttp *http, struct evconnlistener *listener);
/**
* Return the listener used to implement a bound socket.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evconnlistener *evhttp_bound_socket_get_listener(struct evhttp_bound_socket *bound);
-typedef void evhttp_bound_socket_foreach_fn(struct evhttp_bound_socket *, void *);
-/**
- * Applies the function specified in the first argument to all
- * evhttp_bound_sockets associated with "http". The user must not
- * attempt to free or remove any connections, sockets or listeners
- * in the callback "function".
- *
- * @param http pointer to an evhttp object
- * @param function function to apply to every bound socket
- * @param argument pointer value passed to function for every socket iterated
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_foreach_bound_socket(struct evhttp *http, evhttp_bound_socket_foreach_fn *function, void *argument);
-
-/**
+typedef void evhttp_bound_socket_foreach_fn(struct evhttp_bound_socket *, void *);
+/**
+ * Applies the function specified in the first argument to all
+ * evhttp_bound_sockets associated with "http". The user must not
+ * attempt to free or remove any connections, sockets or listeners
+ * in the callback "function".
+ *
+ * @param http pointer to an evhttp object
+ * @param function function to apply to every bound socket
+ * @param argument pointer value passed to function for every socket iterated
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_foreach_bound_socket(struct evhttp *http, evhttp_bound_socket_foreach_fn *function, void *argument);
+
+/**
* Makes an HTTP server stop accepting connections on the specified socket
*
* This may be useful when a socket has been sent via file descriptor passing
@@ -191,7 +191,7 @@ void evhttp_foreach_bound_socket(struct evhttp *http, evhttp_bound_socket_foreac
* @param bound_socket a handle returned by evhttp_{bind,accept}_socket_with_handle
* @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *bound_socket);
/**
@@ -201,7 +201,7 @@ void evhttp_del_accept_socket(struct evhttp *http, struct evhttp_bound_socket *b
* @return the file descriptor used by the bound socket
* @see evhttp_bind_socket_with_handle(), evhttp_accept_socket_with_handle()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound_socket);
/**
@@ -212,32 +212,32 @@ evutil_socket_t evhttp_bound_socket_get_fd(struct evhttp_bound_socket *bound_soc
* @param http the evhttp server object to be freed
* @see evhttp_start()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_free(struct evhttp* http);
/** XXX Document. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_set_max_headers_size(struct evhttp* http, ev_ssize_t max_headers_size);
/** XXX Document. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_set_max_body_size(struct evhttp* http, ev_ssize_t max_body_size);
/**
- Set the value to use for the Content-Type header when none was provided. If
- the content type string is NULL, the Content-Type header will not be
- automatically added.
-
- @param http the http server on which to set the default content type
- @param content_type the value for the Content-Type header
-*/
-EVENT2_EXPORT_SYMBOL
-void evhttp_set_default_content_type(struct evhttp *http,
- const char *content_type);
-
-void evhttp_set_bevcb(struct evhttp *http,
- struct bufferevent* (*cb)(struct event_base *, void *), void *arg);
-
-/**
+ Set the value to use for the Content-Type header when none was provided. If
+ the content type string is NULL, the Content-Type header will not be
+ automatically added.
+
+ @param http the http server on which to set the default content type
+ @param content_type the value for the Content-Type header
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_default_content_type(struct evhttp *http,
+ const char *content_type);
+
+void evhttp_set_bevcb(struct evhttp *http,
+ struct bufferevent* (*cb)(struct event_base *, void *), void *arg);
+
+/**
Sets the what HTTP methods are supported in requests accepted by this
server, and passed to user callbacks.
@@ -248,7 +248,7 @@ void evhttp_set_bevcb(struct evhttp *http,
@param http the http server on which to set the methods
@param methods bit mask constructed from evhttp_cmd_type values
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods);
/**
@@ -260,16 +260,16 @@ void evhttp_set_allowed_methods(struct evhttp* http, ev_uint16_t methods);
@param cb_arg an additional context argument for the callback
@return 0 on success, -1 if the callback existed already, -2 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_set_cb(struct evhttp *http, const char *path,
void (*cb)(struct evhttp_request *, void *), void *cb_arg);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_set_chunk_cb(struct evhttp *http, const char *path,
void (*chunk_cb)(struct evhttp_request *, void *), void *cb_arg);
/** Removes the callback for a specified URI */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_del_cb(struct evhttp *, const char *);
/**
@@ -283,27 +283,27 @@ int evhttp_del_cb(struct evhttp *, const char *);
@param cb the callback to invoke for any unmatched requests
@param arg an context argument for the callback
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_set_gencb(struct evhttp *http,
void (*cb)(struct evhttp_request *, void *), void *arg);
-/**
- Set a callback used to create new bufferevents for connections
- to a given evhttp object.
-
- You can use this to override the default bufferevent type -- for example,
- to make this evhttp object use SSL bufferevents rather than unencrypted
- ones.
-
- New bufferevents must be allocated with no fd set on them.
-
- @param http the evhttp server object for which to set the callback
- @param cb the callback to invoke for incoming connections
- @param arg an context argument for the callback
- */
-EVENT2_EXPORT_SYMBOL
+/**
+ Set a callback used to create new bufferevents for connections
+ to a given evhttp object.
+
+ You can use this to override the default bufferevent type -- for example,
+ to make this evhttp object use SSL bufferevents rather than unencrypted
+ ones.
+
+ New bufferevents must be allocated with no fd set on them.
+
+ @param http the evhttp server object for which to set the callback
+ @param cb the callback to invoke for incoming connections
+ @param arg an context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
void evhttp_set_bevcb(struct evhttp *http,
- struct bufferevent *(*cb)(struct event_base *, void *), void *arg);
+ struct bufferevent *(*cb)(struct event_base *, void *), void *arg);
/**
Adds a virtual host to the http server.
@@ -327,7 +327,7 @@ void evhttp_set_bevcb(struct evhttp *http,
@return 0 on success, -1 on failure
@see evhttp_remove_virtual_host()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
struct evhttp* vhost);
@@ -339,7 +339,7 @@ int evhttp_add_virtual_host(struct evhttp* http, const char *pattern,
@return 0 on success, -1 on failure
@see evhttp_add_virtual_host()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost);
/**
@@ -350,7 +350,7 @@ int evhttp_remove_virtual_host(struct evhttp* http, struct evhttp* vhost);
@param alias the alias to add
@see evhttp_add_remove_alias()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_add_server_alias(struct evhttp *http, const char *alias);
/**
@@ -360,7 +360,7 @@ int evhttp_add_server_alias(struct evhttp *http, const char *alias);
@param alias the alias to remove
@see evhttp_add_server_alias()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_remove_server_alias(struct evhttp *http, const char *alias);
/**
@@ -369,38 +369,38 @@ int evhttp_remove_server_alias(struct evhttp *http, const char *alias);
* @param http an evhttp object
* @param timeout_in_secs the timeout, in seconds
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_set_timeout(struct evhttp *http, int timeout_in_secs);
-/**
- * Set the timeout for an HTTP request.
- *
- * @param http an evhttp object
- * @param tv the timeout, or NULL
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_set_timeout_tv(struct evhttp *http, const struct timeval* tv);
-
-/* Read all the clients body, and only after this respond with an error if the
- * clients body exceed max_body_size */
-#define EVHTTP_SERVER_LINGERING_CLOSE 0x0001
-/**
- * Set connection flags for HTTP server.
- *
- * @see EVHTTP_SERVER_*
- * @return 0 on success, otherwise non zero (for example if flag doesn't
- * supported).
- */
-EVENT2_EXPORT_SYMBOL
-int evhttp_set_flags(struct evhttp *http, int flags);
-
+/**
+ * Set the timeout for an HTTP request.
+ *
+ * @param http an evhttp object
+ * @param tv the timeout, or NULL
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_set_timeout_tv(struct evhttp *http, const struct timeval* tv);
+
+/* Read all the clients body, and only after this respond with an error if the
+ * clients body exceed max_body_size */
+#define EVHTTP_SERVER_LINGERING_CLOSE 0x0001
+/**
+ * Set connection flags for HTTP server.
+ *
+ * @see EVHTTP_SERVER_*
+ * @return 0 on success, otherwise non zero (for example if flag doesn't
+ * supported).
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_set_flags(struct evhttp *http, int flags);
+
/* Request/Response functionality */
-struct evhttp_connection *evhttp_connection_base_bufferevent_new(
- struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, unsigned short port);
-
-struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
-
+struct evhttp_connection *evhttp_connection_base_bufferevent_new(
+ struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, unsigned short port);
+
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
+
/**
* Send an HTML error message to the client.
*
@@ -409,7 +409,7 @@ struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *
* @param reason a brief explanation of the error. If this is NULL, we'll
* just use the standard meaning of the error code.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_send_error(struct evhttp_request *req, int error,
const char *reason);
@@ -426,7 +426,7 @@ void evhttp_send_error(struct evhttp_request *req, int error,
* @param reason a brief message to send with the response code
* @param databuf the body of the response
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_send_reply(struct evhttp_request *req, int code,
const char *reason, struct evbuffer *databuf);
@@ -446,7 +446,7 @@ void evhttp_send_reply(struct evhttp_request *req, int code,
@param code the HTTP response code to send
@param reason a brief message to send with the response code
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_send_reply_start(struct evhttp_request *req, int code,
const char *reason);
@@ -461,33 +461,33 @@ void evhttp_send_reply_start(struct evhttp_request *req, int code,
@param req a request object
@param databuf the data chunk to send as part of the reply.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_send_reply_chunk(struct evhttp_request *req,
struct evbuffer *databuf);
-
-/**
- Send another data chunk as part of an ongoing chunked reply.
-
- The reply chunk consists of the data in databuf. After calling
- evhttp_send_reply_chunk() databuf will be empty, but the buffer is
- still owned by the caller and needs to be deallocated by the caller
- if necessary.
-
- @param req a request object
- @param databuf the data chunk to send as part of the reply.
- @param cb callback funcion
- @param call back's argument.
-*/
-EVENT2_EXPORT_SYMBOL
-void evhttp_send_reply_chunk_with_cb(struct evhttp_request *, struct evbuffer *,
- void (*cb)(struct evhttp_connection *, void *), void *arg);
-
-/**
+
+/**
+ Send another data chunk as part of an ongoing chunked reply.
+
+ The reply chunk consists of the data in databuf. After calling
+ evhttp_send_reply_chunk() databuf will be empty, but the buffer is
+ still owned by the caller and needs to be deallocated by the caller
+ if necessary.
+
+ @param req a request object
+ @param databuf the data chunk to send as part of the reply.
+ @param cb callback funcion
+ @param call back's argument.
+*/
+EVENT2_EXPORT_SYMBOL
+void evhttp_send_reply_chunk_with_cb(struct evhttp_request *, struct evbuffer *,
+ void (*cb)(struct evhttp_connection *, void *), void *arg);
+
+/**
Complete a chunked reply, freeing the request as appropriate.
@param req a request object
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_send_reply_end(struct evhttp_request *req);
/*
@@ -517,24 +517,24 @@ enum evhttp_cmd_type {
enum evhttp_request_kind { EVHTTP_REQUEST, EVHTTP_RESPONSE };
/**
- * Create and return a connection object that can be used to for making HTTP
- * requests. The connection object tries to resolve address and establish the
- * connection when it is given an http request object.
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
*
* @param base the event_base to use for handling the connection
* @param dnsbase the dns_base to use for resolving host names; if not
* specified host name resolution will block.
- * @param bev a bufferevent to use for connecting to the server; if NULL, a
- * socket-based bufferevent will be created. This buffrevent will be freed
- * when the connection closes. It must have no fd set on it.
+ * @param bev a bufferevent to use for connecting to the server; if NULL, a
+ * socket-based bufferevent will be created. This buffrevent will be freed
+ * when the connection closes. It must have no fd set on it.
* @param address the address to which to connect
* @param port the port to connect to
- * @return an evhttp_connection object that can be used for making requests or
- * NULL on error
+ * @return an evhttp_connection object that can be used for making requests or
+ * NULL on error
*/
-EVENT2_EXPORT_SYMBOL
-struct evhttp_connection *evhttp_connection_base_bufferevent_new(
- struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, ev_uint16_t port);
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_bufferevent_new(
+ struct event_base *base, struct evdns_base *dnsbase, struct bufferevent* bev, const char *address, ev_uint16_t port);
/**
* Creates and returns a new bufferevent object.
@@ -571,163 +571,163 @@ struct evhttp_connection *evhttp_connection_base_bufferevent_factory_new(
/**
* Return the bufferevent that an evhttp_connection is using.
*/
-EVENT2_EXPORT_SYMBOL
-struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
-
-/**
- * Return the HTTP server associated with this connection, or NULL.
- */
-EVENT2_EXPORT_SYMBOL
-struct evhttp *evhttp_connection_get_server(struct evhttp_connection *evcon);
-
-/**
- * Creates a new request object that needs to be filled in with the request
- * parameters. The callback is executed when the request completed or an
- * error occurred.
- */
-EVENT2_EXPORT_SYMBOL
-struct evhttp_request *evhttp_request_new(
- void (*cb)(struct evhttp_request *, void *), void *arg);
-
-/**
- * Enable delivery of chunks to requestor.
- * @param cb will be called after every read of data with the same argument
- * as the completion callback. Will never be called on an empty
- * response. May drain the input buffer; it will be drained
- * automatically on return.
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_request_set_chunked_cb(struct evhttp_request *,
- void (*cb)(struct evhttp_request *, void *), void *arg);
-
-/**
- * Register callback for additional parsing of request headers.
- * @param cb will be called after receiving and parsing the full header.
- * It allows analyzing the header and possibly closing the connection
- * by returning a value < 0.
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_request_set_header_cb(struct evhttp_request *,
- int (*cb)(struct evhttp_request *, void *));
-
-/**
- * The different error types supported by evhttp
- *
- * @see evhttp_request_set_error_cb()
- */
-enum evhttp_request_error {
- /**
- * Timeout reached, also @see evhttp_connection_set_timeout()
- */
- EVREQ_HTTP_TIMEOUT,
- /**
- * EOF reached
- */
- EVREQ_HTTP_EOF,
- /**
- * Error while reading header, or invalid header
- */
- EVREQ_HTTP_INVALID_HEADER,
- /**
- * Error encountered while reading or writing
- */
- EVREQ_HTTP_BUFFER_ERROR,
- /**
- * The evhttp_cancel_request() called on this request.
- */
- EVREQ_HTTP_REQUEST_CANCEL,
- /**
- * Body is greater then evhttp_connection_set_max_body_size()
- */
- EVREQ_HTTP_DATA_TOO_LONG
-};
-/**
- * Set a callback for errors
- * @see evhttp_request_error for error types.
- *
- * On error, both the error callback and the regular callback will be called,
- * error callback is called before the regular callback.
- **/
-EVENT2_EXPORT_SYMBOL
-void evhttp_request_set_error_cb(struct evhttp_request *,
- void (*)(enum evhttp_request_error, void *));
-
-/**
- * Set a callback to be called on request completion of evhttp_send_* function.
- *
- * The callback function will be called on the completion of the request after
- * the output data has been written and before the evhttp_request object
- * is destroyed. This can be useful for tracking resources associated with a
- * request (ex: timing metrics).
- *
- * @param req a request object
- * @param cb callback function that will be called on request completion
- * @param cb_arg an additional context argument for the callback
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_request_set_on_complete_cb(struct evhttp_request *req,
- void (*cb)(struct evhttp_request *, void *), void *cb_arg);
-
-/** Frees the request object and removes associated events. */
-EVENT2_EXPORT_SYMBOL
-void evhttp_request_free(struct evhttp_request *req);
-
-/**
- * Create and return a connection object that can be used to for making HTTP
- * requests. The connection object tries to resolve address and establish the
- * connection when it is given an http request object.
- *
- * @param base the event_base to use for handling the connection
- * @param dnsbase the dns_base to use for resolving host names; if not
- * specified host name resolution will block.
- * @param address the address to which to connect
- * @param port the port to connect to
- * @return an evhttp_connection object that can be used for making requests or
- * NULL on error
- */
-EVENT2_EXPORT_SYMBOL
-struct evhttp_connection *evhttp_connection_base_new(
- struct event_base *base, struct evdns_base *dnsbase,
- const char *address, ev_uint16_t port);
-
-/**
- * Set family hint for DNS requests.
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_connection_set_family(struct evhttp_connection *evcon,
- int family);
-
-/* reuse connection address on retry */
-#define EVHTTP_CON_REUSE_CONNECTED_ADDR 0x0008
-/* Try to read error, since server may already send and close
- * connection, but if at that time we have some data to send then we
- * can send get EPIPE and fail, while we can read that HTTP error. */
-#define EVHTTP_CON_READ_ON_WRITE_ERROR 0x0010
-/* @see EVHTTP_SERVER_LINGERING_CLOSE */
-#define EVHTTP_CON_LINGERING_CLOSE 0x0020
-/* Padding for public flags, @see EVHTTP_CON_* in http-internal.h */
-#define EVHTTP_CON_PUBLIC_FLAGS_END 0x100000
-/**
- * Set connection flags.
- *
- * @see EVHTTP_CON_*
- * @return 0 on success, otherwise non zero (for example if flag doesn't
- * supported).
- */
-EVENT2_EXPORT_SYMBOL
-int evhttp_connection_set_flags(struct evhttp_connection *evcon,
- int flags);
-
+EVENT2_EXPORT_SYMBOL
+struct bufferevent* evhttp_connection_get_bufferevent(struct evhttp_connection *evcon);
+
+/**
+ * Return the HTTP server associated with this connection, or NULL.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_connection_get_server(struct evhttp_connection *evcon);
+
+/**
+ * Creates a new request object that needs to be filled in with the request
+ * parameters. The callback is executed when the request completed or an
+ * error occurred.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_request *evhttp_request_new(
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ * Enable delivery of chunks to requestor.
+ * @param cb will be called after every read of data with the same argument
+ * as the completion callback. Will never be called on an empty
+ * response. May drain the input buffer; it will be drained
+ * automatically on return.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_chunked_cb(struct evhttp_request *,
+ void (*cb)(struct evhttp_request *, void *), void *arg);
+
+/**
+ * Register callback for additional parsing of request headers.
+ * @param cb will be called after receiving and parsing the full header.
+ * It allows analyzing the header and possibly closing the connection
+ * by returning a value < 0.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_header_cb(struct evhttp_request *,
+ int (*cb)(struct evhttp_request *, void *));
+
+/**
+ * The different error types supported by evhttp
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+enum evhttp_request_error {
+ /**
+ * Timeout reached, also @see evhttp_connection_set_timeout()
+ */
+ EVREQ_HTTP_TIMEOUT,
+ /**
+ * EOF reached
+ */
+ EVREQ_HTTP_EOF,
+ /**
+ * Error while reading header, or invalid header
+ */
+ EVREQ_HTTP_INVALID_HEADER,
+ /**
+ * Error encountered while reading or writing
+ */
+ EVREQ_HTTP_BUFFER_ERROR,
+ /**
+ * The evhttp_cancel_request() called on this request.
+ */
+ EVREQ_HTTP_REQUEST_CANCEL,
+ /**
+ * Body is greater then evhttp_connection_set_max_body_size()
+ */
+ EVREQ_HTTP_DATA_TOO_LONG
+};
+/**
+ * Set a callback for errors
+ * @see evhttp_request_error for error types.
+ *
+ * On error, both the error callback and the regular callback will be called,
+ * error callback is called before the regular callback.
+ **/
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_error_cb(struct evhttp_request *,
+ void (*)(enum evhttp_request_error, void *));
+
+/**
+ * Set a callback to be called on request completion of evhttp_send_* function.
+ *
+ * The callback function will be called on the completion of the request after
+ * the output data has been written and before the evhttp_request object
+ * is destroyed. This can be useful for tracking resources associated with a
+ * request (ex: timing metrics).
+ *
+ * @param req a request object
+ * @param cb callback function that will be called on request completion
+ * @param cb_arg an additional context argument for the callback
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_set_on_complete_cb(struct evhttp_request *req,
+ void (*cb)(struct evhttp_request *, void *), void *cb_arg);
+
+/** Frees the request object and removes associated events. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_request_free(struct evhttp_request *req);
+
+/**
+ * Create and return a connection object that can be used to for making HTTP
+ * requests. The connection object tries to resolve address and establish the
+ * connection when it is given an http request object.
+ *
+ * @param base the event_base to use for handling the connection
+ * @param dnsbase the dns_base to use for resolving host names; if not
+ * specified host name resolution will block.
+ * @param address the address to which to connect
+ * @param port the port to connect to
+ * @return an evhttp_connection object that can be used for making requests or
+ * NULL on error
+ */
+EVENT2_EXPORT_SYMBOL
+struct evhttp_connection *evhttp_connection_base_new(
+ struct event_base *base, struct evdns_base *dnsbase,
+ const char *address, ev_uint16_t port);
+
+/**
+ * Set family hint for DNS requests.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_family(struct evhttp_connection *evcon,
+ int family);
+
+/* reuse connection address on retry */
+#define EVHTTP_CON_REUSE_CONNECTED_ADDR 0x0008
+/* Try to read error, since server may already send and close
+ * connection, but if at that time we have some data to send then we
+ * can send get EPIPE and fail, while we can read that HTTP error. */
+#define EVHTTP_CON_READ_ON_WRITE_ERROR 0x0010
+/* @see EVHTTP_SERVER_LINGERING_CLOSE */
+#define EVHTTP_CON_LINGERING_CLOSE 0x0020
+/* Padding for public flags, @see EVHTTP_CON_* in http-internal.h */
+#define EVHTTP_CON_PUBLIC_FLAGS_END 0x100000
+/**
+ * Set connection flags.
+ *
+ * @see EVHTTP_CON_*
+ * @return 0 on success, otherwise non zero (for example if flag doesn't
+ * supported).
+ */
+EVENT2_EXPORT_SYMBOL
+int evhttp_connection_set_flags(struct evhttp_connection *evcon,
+ int flags);
+
/** Takes ownership of the request object
*
* Can be used in a request callback to keep onto the request until
* evhttp_request_free() is explicitly called by the user.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_request_own(struct evhttp_request *req);
/** Returns 1 if the request is owned by the user */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_request_is_owned(struct evhttp_request *req);
/**
@@ -736,89 +736,89 @@ int evhttp_request_is_owned(struct evhttp_request *req);
* The user needs to either free the request explicitly or call
* evhttp_send_reply_end().
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_connection *evhttp_request_get_connection(struct evhttp_request *req);
/**
* Returns the underlying event_base for this connection
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *evhttp_connection_get_base(struct evhttp_connection *req);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_max_headers_size(struct evhttp_connection *evcon,
ev_ssize_t new_max_headers_size);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_max_body_size(struct evhttp_connection* evcon,
ev_ssize_t new_max_body_size);
/** Frees an http connection */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_free(struct evhttp_connection *evcon);
-/** Disowns a given connection object
- *
- * Can be used to tell libevent to free the connection object after
- * the last request has completed or failed.
- */
-EVENT2_EXPORT_SYMBOL
-void evhttp_connection_free_on_completion(struct evhttp_connection *evcon);
-
+/** Disowns a given connection object
+ *
+ * Can be used to tell libevent to free the connection object after
+ * the last request has completed or failed.
+ */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_free_on_completion(struct evhttp_connection *evcon);
+
/** sets the ip address from which http connections are made */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_local_address(struct evhttp_connection *evcon,
const char *address);
/** sets the local port from which http connections are made */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_local_port(struct evhttp_connection *evcon,
ev_uint16_t port);
-/** Sets the timeout in seconds for events related to this connection */
-EVENT2_EXPORT_SYMBOL
+/** Sets the timeout in seconds for events related to this connection */
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_timeout(struct evhttp_connection *evcon,
int timeout_in_secs);
-/** Sets the timeout for events related to this connection. Takes a struct
- * timeval. */
-EVENT2_EXPORT_SYMBOL
-void evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
- const struct timeval *tv);
-
-/** Sets the delay before retrying requests on this connection. This is only
- * used if evhttp_connection_set_retries is used to make the number of retries
- * at least one. Each retry after the first is twice as long as the one before
- * it. */
-EVENT2_EXPORT_SYMBOL
-void evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
- const struct timeval *tv);
-
+/** Sets the timeout for events related to this connection. Takes a struct
+ * timeval. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_timeout_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
+/** Sets the delay before retrying requests on this connection. This is only
+ * used if evhttp_connection_set_retries is used to make the number of retries
+ * at least one. Each retry after the first is twice as long as the one before
+ * it. */
+EVENT2_EXPORT_SYMBOL
+void evhttp_connection_set_initial_retry_tv(struct evhttp_connection *evcon,
+ const struct timeval *tv);
+
/** Sets the retry limit for this connection - -1 repeats indefinitely */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_retries(struct evhttp_connection *evcon,
int retry_max);
/** Set a callback for connection close. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_closecb(struct evhttp_connection *evcon,
void (*)(struct evhttp_connection *, void *), void *);
/** Get the remote address and port associated with this connection. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_get_peer(struct evhttp_connection *evcon,
char **address, ev_uint16_t *port);
-/** Get the remote address associated with this connection.
- * extracted from getpeername() OR from nameserver.
- *
- * @return NULL if getpeername() return non success,
- * or connection is not connected,
- * otherwise it return pointer to struct sockaddr_storage */
-EVENT2_EXPORT_SYMBOL
-const struct sockaddr*
-evhttp_connection_get_addr(struct evhttp_connection *evcon);
-
+/** Get the remote address associated with this connection.
+ * extracted from getpeername() OR from nameserver.
+ *
+ * @return NULL if getpeername() return non success,
+ * or connection is not connected,
+ * otherwise it return pointer to struct sockaddr_storage */
+EVENT2_EXPORT_SYMBOL
+const struct sockaddr*
+evhttp_connection_get_addr(struct evhttp_connection *evcon);
+
/**
Make an HTTP request over the specified connection.
@@ -832,7 +832,7 @@ evhttp_connection_get_addr(struct evhttp_connection *evcon);
@return 0 on success, -1 on failure
@see evhttp_cancel_request()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_make_request(struct evhttp_connection *evcon,
struct evhttp_request *req,
enum evhttp_cmd_type type, const char *uri);
@@ -850,7 +850,7 @@ int evhttp_make_request(struct evhttp_connection *evcon,
@param req the evhttp_request to cancel; req becomes invalid after this call.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_cancel_request(struct evhttp_request *req);
/**
@@ -859,37 +859,37 @@ void evhttp_cancel_request(struct evhttp_request *req);
struct evhttp_uri;
/** Returns the request URI */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_request_get_uri(const struct evhttp_request *req);
/** Returns the request URI (parsed) */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const struct evhttp_uri *evhttp_request_get_evhttp_uri(const struct evhttp_request *req);
/** Returns the request command */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
enum evhttp_cmd_type evhttp_request_get_command(const struct evhttp_request *req);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_request_get_response_code(const struct evhttp_request *req);
-EVENT2_EXPORT_SYMBOL
-const char * evhttp_request_get_response_code_line(const struct evhttp_request *req);
+EVENT2_EXPORT_SYMBOL
+const char * evhttp_request_get_response_code_line(const struct evhttp_request *req);
/** Returns the input headers */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evkeyvalq *evhttp_request_get_input_headers(struct evhttp_request *req);
/** Returns the output headers */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evkeyvalq *evhttp_request_get_output_headers(struct evhttp_request *req);
/** Returns the input buffer */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer *evhttp_request_get_input_buffer(struct evhttp_request *req);
/** Returns the output buffer */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evbuffer *evhttp_request_get_output_buffer(struct evhttp_request *req);
/** Returns the host associated with the request. If a client sends an absolute
URI, the host part of that is preferred. Otherwise, the input headers are
searched for a Host: header. NULL is returned if no absolute URI or Host:
header is provided. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_request_get_host(struct evhttp_request *req);
/* Interfaces for dealing with HTTP headers */
@@ -900,10 +900,10 @@ const char *evhttp_request_get_host(struct evhttp_request *req);
@param headers the evkeyvalq object in which to find the header
@param key the name of the header to find
@returns a pointer to the value for the header or NULL if the header
- could not be found.
+ could not be found.
@see evhttp_add_header(), evhttp_remove_header()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_find_header(const struct evkeyvalq *headers,
const char *key);
@@ -915,7 +915,7 @@ const char *evhttp_find_header(const struct evkeyvalq *headers,
@returns 0 if the header was removed, -1 otherwise.
@see evhttp_find_header(), evhttp_add_header()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_remove_header(struct evkeyvalq *headers, const char *key);
/**
@@ -927,7 +927,7 @@ int evhttp_remove_header(struct evkeyvalq *headers, const char *key);
@returns 0 on success, -1 otherwise.
@see evhttp_find_header(), evhttp_clear_headers()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_add_header(struct evkeyvalq *headers, const char *key, const char *value);
/**
@@ -935,7 +935,7 @@ int evhttp_add_header(struct evkeyvalq *headers, const char *key, const char *va
@param headers the evkeyvalq object from which to remove all headers
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_clear_headers(struct evkeyvalq *headers);
/* Miscellaneous utility functions */
@@ -952,7 +952,7 @@ void evhttp_clear_headers(struct evkeyvalq *headers);
@param str an unencoded string
@return a newly allocated URI-encoded string or NULL on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_encode_uri(const char *str);
/**
@@ -969,24 +969,24 @@ char *evhttp_encode_uri(const char *str);
as +, not %20.
@return a newly allocate URI-encoded string, or NULL on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_uriencode(const char *str, ev_ssize_t size, int space_to_plus);
/**
Helper function to sort of decode a URI-encoded string. Unlike
- evhttp_uridecode, it decodes all plus characters that appear
+ evhttp_uridecode, it decodes all plus characters that appear
_after_ the first question mark character, but no plusses that occur
before. This is not a good way to decode URIs in whole or in part.
The returned string must be freed by the caller
@deprecated This function is deprecated; you probably want to use
- evhttp_uridecode instead.
+ evhttp_uridecode instead.
@param uri an encoded URI
@return a newly allocated unencoded URI or NULL on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_decode_uri(const char *uri);
/**
@@ -999,12 +999,12 @@ char *evhttp_decode_uri(const char *uri);
The returned string must be freed by the caller.
@param uri a URI-encode encoded URI
- @param decode_plus determines whether we convert '+' to space.
+ @param decode_plus determines whether we convert '+' to space.
@param size_out if size_out is not NULL, *size_out is set to the size of the
returned string
@return a newly allocated unencoded URI or NULL on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_uridecode(const char *uri, int decode_plus,
size_t *size_out);
@@ -1027,7 +1027,7 @@ char *evhttp_uridecode(const char *uri, int decode_plus,
@param headers the head of the evkeyval queue
@return 0 on success, -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_parse_query(const char *uri, struct evkeyvalq *headers);
/**
@@ -1047,7 +1047,7 @@ int evhttp_parse_query(const char *uri, struct evkeyvalq *headers);
@param headers the head of the evkeyval queue
@return 0 on success, -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers);
/**
@@ -1061,31 +1061,31 @@ int evhttp_parse_query_str(const char *uri, struct evkeyvalq *headers);
* @param html an unescaped HTML string
* @return an escaped HTML string or NULL on error
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_htmlescape(const char *html);
/**
* Return a new empty evhttp_uri with no fields set.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_uri *evhttp_uri_new(void);
/**
* Changes the flags set on a given URI. See EVHTTP_URI_* for
* a list of flags.
**/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_uri_set_flags(struct evhttp_uri *uri, unsigned flags);
/** Return the scheme of an evhttp_uri, or NULL if there is no scheme has
* been set and the evhttp_uri contains a Relative-Ref. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_scheme(const struct evhttp_uri *uri);
/**
* Return the userinfo part of an evhttp_uri, or NULL if it has no userinfo
* set.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_userinfo(const struct evhttp_uri *uri);
/**
* Return the host part of an evhttp_uri, or NULL if it has no host set.
@@ -1099,52 +1099,52 @@ const char *evhttp_uri_get_userinfo(const struct evhttp_uri *uri);
* "mailto:user@example.com" has a host of NULL, but "file:///etc/motd"
* has a host of "".
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_host(const struct evhttp_uri *uri);
/** Return the port part of an evhttp_uri, or -1 if there is no port set. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_get_port(const struct evhttp_uri *uri);
/** Return the path part of an evhttp_uri, or NULL if it has no path set */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_path(const struct evhttp_uri *uri);
/** Return the query part of an evhttp_uri (excluding the leading "?"), or
* NULL if it has no query set */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_query(const struct evhttp_uri *uri);
/** Return the fragment part of an evhttp_uri (excluding the leading "#"),
* or NULL if it has no fragment set */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evhttp_uri_get_fragment(const struct evhttp_uri *uri);
/** Set the scheme of an evhttp_uri, or clear the scheme if scheme==NULL.
* Returns 0 on success, -1 if scheme is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_scheme(struct evhttp_uri *uri, const char *scheme);
/** Set the userinfo of an evhttp_uri, or clear the userinfo if userinfo==NULL.
* Returns 0 on success, -1 if userinfo is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_userinfo(struct evhttp_uri *uri, const char *userinfo);
/** Set the host of an evhttp_uri, or clear the host if host==NULL.
* Returns 0 on success, -1 if host is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_host(struct evhttp_uri *uri, const char *host);
/** Set the port of an evhttp_uri, or clear the port if port==-1.
* Returns 0 on success, -1 if port is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_port(struct evhttp_uri *uri, int port);
/** Set the path of an evhttp_uri, or clear the path if path==NULL.
* Returns 0 on success, -1 if path is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_path(struct evhttp_uri *uri, const char *path);
/** Set the query of an evhttp_uri, or clear the query if query==NULL.
* The query should not include a leading "?".
* Returns 0 on success, -1 if query is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_query(struct evhttp_uri *uri, const char *query);
/** Set the fragment of an evhttp_uri, or clear the fragment if fragment==NULL.
* The fragment should not include a leading "#".
* Returns 0 on success, -1 if fragment is not well-formed. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment);
/**
@@ -1181,7 +1181,7 @@ int evhttp_uri_set_fragment(struct evhttp_uri *uri, const char *fragment);
* @return uri container to hold parsed data, or NULL if there is error
* @see evhttp_uri_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_uri *evhttp_uri_parse_with_flags(const char *source_uri,
unsigned flags);
@@ -1200,7 +1200,7 @@ struct evhttp_uri *evhttp_uri_parse_with_flags(const char *source_uri,
#define EVHTTP_URI_NONCONFORMANT 0x01
/** Alias for evhttp_uri_parse_with_flags(source_uri, 0) */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_uri *evhttp_uri_parse(const char *source_uri);
/**
@@ -1210,7 +1210,7 @@ struct evhttp_uri *evhttp_uri_parse(const char *source_uri);
* @param uri container with parsed data
* @see evhttp_uri_parse()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_uri_free(struct evhttp_uri *uri);
/**
@@ -1226,11 +1226,11 @@ void evhttp_uri_free(struct evhttp_uri *uri);
* @return an joined uri as string or NULL on error
* @see evhttp_uri_parse()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
char *evhttp_uri_join(struct evhttp_uri *uri, char *buf, size_t limit);
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_HTTP_H_INCLUDED_ */
+#endif /* EVENT2_HTTP_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/http_compat.h b/contrib/libs/libevent/include/event2/http_compat.h
index 7bad9bf22f..794a581083 100644
--- a/contrib/libs/libevent/include/event2/http_compat.h
+++ b/contrib/libs/libevent/include/event2/http_compat.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_HTTP_COMPAT_H_INCLUDED_
-#define EVENT2_HTTP_COMPAT_H_INCLUDED_
+#ifndef EVENT2_HTTP_COMPAT_H_INCLUDED_
+#define EVENT2_HTTP_COMPAT_H_INCLUDED_
/** @file event2/http_compat.h
@@ -39,10 +39,10 @@ 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
@@ -56,11 +56,11 @@ extern "C" {
*
* @param address the address to which the HTTP server should be bound
* @param port the port number on which the HTTP server should listen
- * @return a pointer to a newly initialized evhttp server structure
- * or NULL on error
+ * @return a pointer to a newly initialized evhttp server structure
+ * or NULL on error
*/
-EVENT2_EXPORT_SYMBOL
-struct evhttp *evhttp_start(const char *address, ev_uint16_t port);
+EVENT2_EXPORT_SYMBOL
+struct evhttp *evhttp_start(const char *address, ev_uint16_t port);
/**
* A connection object that can be used to for making HTTP requests. The
@@ -69,9 +69,9 @@ struct evhttp *evhttp_start(const char *address, ev_uint16_t port);
*
* @deprecated It does not allow an event base to be specified
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_connection *evhttp_connection_new(
- const char *address, ev_uint16_t port);
+ const char *address, ev_uint16_t port);
/**
* Associates an event base with the connection - can only be called
@@ -79,7 +79,7 @@ struct evhttp_connection *evhttp_connection_new(
*
* @deprecated XXXX Why?
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evhttp_connection_set_base(struct evhttp_connection *evcon,
struct event_base *base);
@@ -91,4 +91,4 @@ void evhttp_connection_set_base(struct evhttp_connection *evcon,
}
#endif
-#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/http_struct.h b/contrib/libs/libevent/include/event2/http_struct.h
index 55d2335dd2..2691c8c037 100644
--- a/contrib/libs/libevent/include/event2/http_struct.h
+++ b/contrib/libs/libevent/include/event2/http_struct.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_HTTP_STRUCT_H_INCLUDED_
-#define EVENT2_HTTP_STRUCT_H_INCLUDED_
+#ifndef EVENT2_HTTP_STRUCT_H_INCLUDED_
+#define EVENT2_HTTP_STRUCT_H_INCLUDED_
/** @file event2/http_struct.h
@@ -39,10 +39,10 @@ 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
@@ -123,33 +123,33 @@ struct {
*/
void (*chunk_cb)(struct evhttp_request *, void *);
void *chunk_cb_arg;
-
- /*
- * Callback added for forked-daapd so they can collect ICY
- * (shoutcast) metadata from the http header. If return
- * int is negative the connection will be closed.
- */
- int (*header_cb)(struct evhttp_request *, void *);
-
- /*
- * Error callback - called when error is occured.
- * @see evhttp_request_error for error types.
- *
- * @see evhttp_request_set_error_cb()
- */
- void (*error_cb)(enum evhttp_request_error, void *);
-
- /*
- * Send complete callback - called when the request is actually
- * sent and completed.
- */
- void (*on_complete_cb)(struct evhttp_request *, void *);
- void *on_complete_cb_arg;
+
+ /*
+ * Callback added for forked-daapd so they can collect ICY
+ * (shoutcast) metadata from the http header. If return
+ * int is negative the connection will be closed.
+ */
+ int (*header_cb)(struct evhttp_request *, void *);
+
+ /*
+ * Error callback - called when error is occured.
+ * @see evhttp_request_error for error types.
+ *
+ * @see evhttp_request_set_error_cb()
+ */
+ void (*error_cb)(enum evhttp_request_error, void *);
+
+ /*
+ * Send complete callback - called when the request is actually
+ * sent and completed.
+ */
+ void (*on_complete_cb)(struct evhttp_request *, void *);
+ void *on_complete_cb_arg;
};
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_HTTP_STRUCT_H_INCLUDED_ */
+#endif /* EVENT2_HTTP_STRUCT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/keyvalq_struct.h b/contrib/libs/libevent/include/event2/keyvalq_struct.h
index def0a525fb..bffa54b3a7 100644
--- a/contrib/libs/libevent/include/event2/keyvalq_struct.h
+++ b/contrib/libs/libevent/include/event2/keyvalq_struct.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_KEYVALQ_STRUCT_H_INCLUDED_
-#define EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+#ifndef EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
+#define EVENT2_KEYVALQ_STRUCT_H_INCLUDED_
#ifdef __cplusplus
extern "C" {
@@ -34,7 +34,7 @@ extern "C" {
/* Fix so that people don't have to run with <sys/queue.h> */
/* XXXX This code is duplicated with event_struct.h */
#ifndef TAILQ_ENTRY
-#define EVENT_DEFINED_TQENTRY_
+#define EVENT_DEFINED_TQENTRY_
#define TAILQ_ENTRY(type) \
struct { \
struct type *tqe_next; /* next element */ \
@@ -43,7 +43,7 @@ struct { \
#endif /* !TAILQ_ENTRY */
#ifndef TAILQ_HEAD
-#define EVENT_DEFINED_TQHEAD_
+#define EVENT_DEFINED_TQHEAD_
#define TAILQ_HEAD(name, type) \
struct name { \
struct type *tqh_first; \
@@ -65,11 +65,11 @@ struct evkeyval {
TAILQ_HEAD (evkeyvalq, evkeyval);
/* XXXX This code is duplicated with event_struct.h */
-#ifdef EVENT_DEFINED_TQENTRY_
+#ifdef EVENT_DEFINED_TQENTRY_
#undef TAILQ_ENTRY
#endif
-#ifdef EVENT_DEFINED_TQHEAD_
+#ifdef EVENT_DEFINED_TQHEAD_
#undef TAILQ_HEAD
#endif
diff --git a/contrib/libs/libevent/include/event2/listener.h b/contrib/libs/libevent/include/event2/listener.h
index b82d6d2c29..789a27c2aa 100644
--- a/contrib/libs/libevent/include/event2/listener.h
+++ b/contrib/libs/libevent/include/event2/listener.h
@@ -24,11 +24,11 @@
* (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_LISTENER_H_INCLUDED_
-#define EVENT2_LISTENER_H_INCLUDED_
+#ifndef EVENT2_LISTENER_H_INCLUDED_
+#define EVENT2_LISTENER_H_INCLUDED_
+
+#include <event2/visibility.h>
-#include <event2/visibility.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -71,44 +71,44 @@ typedef void (*evconnlistener_errorcb)(struct evconnlistener *, void *);
/** Flag: Indicates that the listener should be locked so it's safe to use
* from multiple threadcs at once. */
#define LEV_OPT_THREADSAFE (1u<<4)
-/** Flag: Indicates that the listener should be created in disabled
- * state. Use evconnlistener_enable() to enable it later. */
-#define LEV_OPT_DISABLED (1u<<5)
-/** Flag: Indicates that the listener should defer accept() until data is
- * available, if possible. Ignored on platforms that do not support this.
- *
- * This option can help performance for protocols where the client transmits
- * immediately after connecting. Do not use this option if your protocol
- * _doesn't_ start out with the client transmitting data, since in that case
- * this option will sometimes cause the kernel to never tell you about the
- * connection.
- *
- * This option is only supported by evconnlistener_new_bind(): it can't
- * work with evconnlistener_new_fd(), since the listener needs to be told
- * to use the option before it is actually bound.
- */
-#define LEV_OPT_DEFERRED_ACCEPT (1u<<6)
-/** Flag: Indicates that we ask to allow multiple servers (processes or
- * threads) to bind to the same port if they each set the option.
- *
- * SO_REUSEPORT is what most people would expect SO_REUSEADDR to be, however
- * SO_REUSEPORT does not imply SO_REUSEADDR.
- *
- * This is only available on Linux and kernel 3.9+
- */
-#define LEV_OPT_REUSEABLE_PORT (1u<<7)
-/** Flag: Indicates that the listener wants to work only in IPv6 socket.
- *
- * According to RFC3493 and most Linux distributions, default value is to
- * work in IPv4-mapped mode. If there is a requirement to bind same port
- * on same ip addresses but different handlers for both IPv4 and IPv6,
- * it is required to set IPV6_V6ONLY socket option to be sure that the
- * code works as expected without affected by bindv6only sysctl setting in
- * system.
+/** Flag: Indicates that the listener should be created in disabled
+ * state. Use evconnlistener_enable() to enable it later. */
+#define LEV_OPT_DISABLED (1u<<5)
+/** Flag: Indicates that the listener should defer accept() until data is
+ * available, if possible. Ignored on platforms that do not support this.
+ *
+ * This option can help performance for protocols where the client transmits
+ * immediately after connecting. Do not use this option if your protocol
+ * _doesn't_ start out with the client transmitting data, since in that case
+ * this option will sometimes cause the kernel to never tell you about the
+ * connection.
+ *
+ * This option is only supported by evconnlistener_new_bind(): it can't
+ * work with evconnlistener_new_fd(), since the listener needs to be told
+ * to use the option before it is actually bound.
+ */
+#define LEV_OPT_DEFERRED_ACCEPT (1u<<6)
+/** Flag: Indicates that we ask to allow multiple servers (processes or
+ * threads) to bind to the same port if they each set the option.
*
- * This socket option also supported by Windows.
- */
-#define LEV_OPT_BIND_IPV6ONLY (1u<<8)
+ * SO_REUSEPORT is what most people would expect SO_REUSEADDR to be, however
+ * SO_REUSEPORT does not imply SO_REUSEADDR.
+ *
+ * This is only available on Linux and kernel 3.9+
+ */
+#define LEV_OPT_REUSEABLE_PORT (1u<<7)
+/** Flag: Indicates that the listener wants to work only in IPv6 socket.
+ *
+ * According to RFC3493 and most Linux distributions, default value is to
+ * work in IPv4-mapped mode. If there is a requirement to bind same port
+ * on same ip addresses but different handlers for both IPv4 and IPv6,
+ * it is required to set IPV6_V6ONLY socket option to be sure that the
+ * code works as expected without affected by bindv6only sysctl setting in
+ * system.
+ *
+ * This socket option also supported by Windows.
+ */
+#define LEV_OPT_BIND_IPV6ONLY (1u<<8)
/**
Allocate a new evconnlistener object to listen for incoming TCP connections
@@ -127,7 +127,7 @@ typedef void (*evconnlistener_errorcb)(struct evconnlistener *, void *);
file descriptor, and it should already be bound to an appropriate
port and address.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evconnlistener *evconnlistener_new(struct event_base *base,
evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
evutil_socket_t fd);
@@ -146,42 +146,42 @@ struct evconnlistener *evconnlistener_new(struct event_base *base,
@param addr The address to listen for connections on.
@param socklen The length of the address.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evconnlistener *evconnlistener_new_bind(struct event_base *base,
evconnlistener_cb cb, void *ptr, unsigned flags, int backlog,
const struct sockaddr *sa, int socklen);
/**
Disable and deallocate an evconnlistener.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evconnlistener_free(struct evconnlistener *lev);
/**
Re-enable an evconnlistener that has been disabled.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evconnlistener_enable(struct evconnlistener *lev);
/**
Stop listening for connections on an evconnlistener.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evconnlistener_disable(struct evconnlistener *lev);
/** Return an evconnlistener's associated event_base. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct event_base *evconnlistener_get_base(struct evconnlistener *lev);
/** Return the socket that an evconnlistner is listening on. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
evutil_socket_t evconnlistener_get_fd(struct evconnlistener *lev);
/** Change the callback on the listener to cb and its user_data to arg.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evconnlistener_set_cb(struct evconnlistener *lev,
evconnlistener_cb cb, void *arg);
/** Set an evconnlistener's error callback. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evconnlistener_set_error_cb(struct evconnlistener *lev,
evconnlistener_errorcb errorcb);
diff --git a/contrib/libs/libevent/include/event2/rpc.h b/contrib/libs/libevent/include/event2/rpc.h
index d59ca3dfe6..1bc31d5711 100644
--- a/contrib/libs/libevent/include/event2/rpc.h
+++ b/contrib/libs/libevent/include/event2/rpc.h
@@ -24,13 +24,13 @@
* (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_RPC_H_INCLUDED_
-#define EVENT2_RPC_H_INCLUDED_
+#ifndef EVENT2_RPC_H_INCLUDED_
+#define EVENT2_RPC_H_INCLUDED_
+
+/* For int types. */
+#include <event2/util.h>
+#include <event2/visibility.h>
-/* For int types. */
-#include <event2/util.h>
-#include <event2/visibility.h>
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -80,7 +80,7 @@ extern "C" {
#define EVTAG_HAS(msg, member) \
((msg)->member##_set == 1)
-#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
/**
Assigns a value to the member in the message.
@@ -123,7 +123,7 @@ extern "C" {
#define EVTAG_GET_WITH_LEN(msg, member, pvalue, plen) \
(*(msg)->base->member##_get)((msg), (pvalue), (plen))
-#endif /* EVENT2_RPC_COMPAT_H_INCLUDED_ */
+#endif /* EVENT2_RPC_COMPAT_H_INCLUDED_ */
/**
Adds a value to an array.
@@ -182,7 +182,7 @@ EVRPC_STRUCT(rpcname) { \
struct evhttp_request* http_req; \
struct evbuffer* rpc_data; \
}; \
-EVENT2_EXPORT_SYMBOL \
+EVENT2_EXPORT_SYMBOL \
int evrpc_send_request_##rpcname(struct evrpc_pool *, \
struct reqstruct *, struct rplystruct *, \
void (*)(struct evrpc_status *, \
@@ -192,7 +192,7 @@ int evrpc_send_request_##rpcname(struct evrpc_pool *, \
struct evrpc_pool;
/** use EVRPC_GENERATE instead */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evrpc_request_wrapper *evrpc_make_request_ctx(
struct evrpc_pool *pool, void *request, void *reply,
const char *rpcname,
@@ -263,13 +263,13 @@ struct evrpc_request_wrapper *evrpc_make_request_ctx(
#define EVRPC_REQUEST_HTTP(rpc_req) (rpc_req)->http_req
/** completes the server response to an rpc request */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_request_done(struct evrpc_req_generic *req);
/** accessors for request and reply */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void *evrpc_get_request(struct evrpc_req_generic *req);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void *evrpc_get_reply(struct evrpc_req_generic *req);
/** Creates the reply to an RPC request
@@ -281,8 +281,8 @@ void *evrpc_get_reply(struct evrpc_req_generic *req);
* @param rpc_req the rpc request structure provided to the server callback
*/
#define EVRPC_REQUEST_DONE(rpc_req) do { \
- struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
- evrpc_request_done(req_); \
+ struct evrpc_req_generic *req_ = (struct evrpc_req_generic *)(rpc_req); \
+ evrpc_request_done(req_); \
} while (0)
@@ -294,10 +294,10 @@ struct evhttp;
/** Creates a new rpc base from which RPC requests can be received
*
* @param server a pointer to an existing HTTP server
- * @return a newly allocated evrpc_base struct or NULL if an error occurred
+ * @return a newly allocated evrpc_base struct or NULL if an error occurred
* @see evrpc_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evrpc_base *evrpc_init(struct evhttp *server);
/**
@@ -308,7 +308,7 @@ struct evrpc_base *evrpc_init(struct evhttp *server);
* @param base the evrpc_base object to be freed
* @see evrpc_init
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_free(struct evrpc_base *base);
/** register RPCs with the HTTP Server
@@ -330,10 +330,10 @@ void evrpc_free(struct evrpc_base *base);
#define EVRPC_REGISTER(base, name, request, reply, callback, cbarg) \
evrpc_register_generic(base, #name, \
(void (*)(struct evrpc_req_generic *, void *))callback, cbarg, \
- (void *(*)(void *))request##_new_with_arg, NULL, \
+ (void *(*)(void *))request##_new_with_arg, NULL, \
(void (*)(void *))request##_free, \
(int (*)(void *, struct evbuffer *))request##_unmarshal, \
- (void *(*)(void *))reply##_new_with_arg, NULL, \
+ (void *(*)(void *))reply##_new_with_arg, NULL, \
(void (*)(void *))reply##_free, \
(int (*)(void *))reply##_complete, \
(void (*)(struct evbuffer *, void *))reply##_marshal)
@@ -345,7 +345,7 @@ void evrpc_free(struct evrpc_base *base);
@see EVRPC_REGISTER()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_register_rpc(struct evrpc_base *, struct evrpc *,
void (*)(struct evrpc_req_generic*, void *), void *);
@@ -359,7 +359,7 @@ int evrpc_register_rpc(struct evrpc_base *, struct evrpc *,
*/
#define EVRPC_UNREGISTER(base, name) evrpc_unregister_rpc((base), #name)
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_unregister_rpc(struct evrpc_base *base, const char *name);
/*
@@ -398,7 +398,7 @@ struct evrpc_status;
@returns 0 on success, -1 otherwise.
@see EVRPC_MAKE_REQUEST(), EVRPC_MAKE_CTX()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_make_request(struct evrpc_request_wrapper *ctx);
/** creates an rpc connection pool
@@ -408,18 +408,18 @@ int evrpc_make_request(struct evrpc_request_wrapper *ctx);
*
* @param base a pointer to an struct event_based object; can be left NULL
* in singled-threaded applications
- * @return a newly allocated struct evrpc_pool object or NULL if an error
- * occurred
+ * @return a newly allocated struct evrpc_pool object or NULL if an error
+ * occurred
* @see evrpc_pool_free()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evrpc_pool *evrpc_pool_new(struct event_base *base);
/** frees an rpc connection pool
*
* @param pool a pointer to an evrpc_pool allocated via evrpc_pool_new()
* @see evrpc_pool_new()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_pool_free(struct evrpc_pool *pool);
/**
@@ -430,7 +430,7 @@ void evrpc_pool_free(struct evrpc_pool *pool);
* @param pool the pool to which to add the connection
* @param evcon the connection to add to the pool.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_pool_add_connection(struct evrpc_pool *pool,
struct evhttp_connection *evcon);
@@ -442,7 +442,7 @@ void evrpc_pool_add_connection(struct evrpc_pool *pool,
* @param pool the pool from which to remove the connection
* @param evcon the connection to remove from the pool.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_pool_remove_connection(struct evrpc_pool *pool,
struct evhttp_connection *evcon);
@@ -461,7 +461,7 @@ void evrpc_pool_remove_connection(struct evrpc_pool *pool,
* @param timeout_in_secs the number of seconds after which a request should
* timeout and a failure be returned to the callback.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_pool_set_timeout(struct evrpc_pool *pool, int timeout_in_secs);
/**
@@ -474,7 +474,7 @@ enum EVRPC_HOOK_TYPE {
EVRPC_OUTPUT /**< apply the function to an output hook */
};
-#ifndef _WIN32
+#ifndef _WIN32
/** Deprecated alias for EVRPC_INPUT. Not available on windows, where it
* conflicts with platform headers. */
#define INPUT EVRPC_INPUT
@@ -509,7 +509,7 @@ enum EVRPC_HOOK_RESULT {
* @return a handle to the hook so it can be removed later
* @see evrpc_remove_hook()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void *evrpc_add_hook(void *vbase,
enum EVRPC_HOOK_TYPE hook_type,
int (*cb)(void *, struct evhttp_request *, struct evbuffer *, void *),
@@ -523,7 +523,7 @@ void *evrpc_add_hook(void *vbase,
* @return 1 on success or 0 on failure
* @see evrpc_add_hook()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_remove_hook(void *vbase,
enum EVRPC_HOOK_TYPE hook_type,
void *handle);
@@ -533,8 +533,8 @@ int evrpc_remove_hook(void *vbase,
* @param vbase a pointer to either struct evrpc_base or struct evrpc_pool
* @param ctx the context pointer provided to the original hook call
*/
-EVENT2_EXPORT_SYMBOL
-int evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res);
+EVENT2_EXPORT_SYMBOL
+int evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res);
/** adds meta data to request
*
@@ -547,7 +547,7 @@ int evrpc_resume_request(void *vbase, void *ctx, enum EVRPC_HOOK_RESULT res);
* @param data the data to be associated with the key
* @param data_size the size of the data
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_hook_add_meta(void *ctx, const char *key,
const void *data, size_t data_size);
@@ -561,7 +561,7 @@ void evrpc_hook_add_meta(void *ctx, const char *key,
* @param data_size pointer to the size of the data
* @return 0 on success or -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_hook_find_meta(void *ctx, const char *key,
void **data, size_t *data_size);
@@ -569,10 +569,10 @@ int evrpc_hook_find_meta(void *ctx, const char *key,
* returns the connection object associated with the request
*
* @param ctx the context provided to the hook call
- * @return a pointer to the evhttp_connection object or NULL if an error
- * occurred
+ * @return a pointer to the evhttp_connection object or NULL if an error
+ * occurred
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evhttp_connection *evrpc_hook_get_connection(void *ctx);
/**
@@ -582,7 +582,7 @@ struct evhttp_connection *evrpc_hook_get_connection(void *ctx);
@see EVRPC_MAKE_REQUEST()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evrpc_send_request_generic(struct evrpc_pool *pool,
void *request, void *reply,
void (*cb)(struct evrpc_status *, void *, void *, void *),
@@ -599,8 +599,8 @@ int evrpc_send_request_generic(struct evrpc_pool *pool,
@see EVRPC_REGISTER()
*/
-EVENT2_EXPORT_SYMBOL
-int evrpc_register_generic(struct evrpc_base *base, const char *name,
+EVENT2_EXPORT_SYMBOL
+int evrpc_register_generic(struct evrpc_base *base, const char *name,
void (*callback)(struct evrpc_req_generic *, void *), void *cbarg,
void *(*req_new)(void *), void *req_new_arg, void (*req_free)(void *),
int (*req_unmarshal)(void *, struct evbuffer *),
@@ -609,12 +609,12 @@ int evrpc_register_generic(struct evrpc_base *base, const char *name,
void (*rpl_marshal)(struct evbuffer *, void *));
/** accessors for obscure and undocumented functionality */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
struct evrpc_pool* evrpc_request_get_pool(struct evrpc_request_wrapper *ctx);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_request_set_pool(struct evrpc_request_wrapper *ctx,
struct evrpc_pool *pool);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
void (*cb)(struct evrpc_status*, void *request, void *reply, void *arg),
void *cb_arg);
@@ -623,4 +623,4 @@ void evrpc_request_set_cb(struct evrpc_request_wrapper *ctx,
}
#endif
-#endif /* EVENT2_RPC_H_INCLUDED_ */
+#endif /* EVENT2_RPC_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/rpc_compat.h b/contrib/libs/libevent/include/event2/rpc_compat.h
index 74634a0d7f..8d8334d25f 100644
--- a/contrib/libs/libevent/include/event2/rpc_compat.h
+++ b/contrib/libs/libevent/include/event2/rpc_compat.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_RPC_COMPAT_H_INCLUDED_
-#define EVENT2_RPC_COMPAT_H_INCLUDED_
+#ifndef EVENT2_RPC_COMPAT_H_INCLUDED_
+#define EVENT2_RPC_COMPAT_H_INCLUDED_
/** @file event2/rpc_compat.h
@@ -58,4 +58,4 @@ extern "C" {
}
#endif
-#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
+#endif /* EVENT2_EVENT_COMPAT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/rpc_struct.h b/contrib/libs/libevent/include/event2/rpc_struct.h
index b60eff2425..f3cb460aed 100644
--- a/contrib/libs/libevent/include/event2/rpc_struct.h
+++ b/contrib/libs/libevent/include/event2/rpc_struct.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_RPC_STRUCT_H_INCLUDED_
-#define EVENT2_RPC_STRUCT_H_INCLUDED_
+#ifndef EVENT2_RPC_STRUCT_H_INCLUDED_
+#define EVENT2_RPC_STRUCT_H_INCLUDED_
#ifdef __cplusplus
extern "C" {
@@ -38,16 +38,16 @@ extern "C" {
*/
-/* Fix so that people don't have to run with <sys/queue.h> */
-#ifndef TAILQ_ENTRY
-#define EVENT_DEFINED_TQENTRY_
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-#endif /* !TAILQ_ENTRY */
-
+/* Fix so that people don't have to run with <sys/queue.h> */
+#ifndef TAILQ_ENTRY
+#define EVENT_DEFINED_TQENTRY_
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+#endif /* !TAILQ_ENTRY */
+
/**
* provides information about the completed RPC request.
*/
@@ -103,12 +103,12 @@ struct evrpc {
struct evrpc_base *base;
};
-#ifdef EVENT_DEFINED_TQENTRY_
-#undef TAILQ_ENTRY
-#endif
-
+#ifdef EVENT_DEFINED_TQENTRY_
+#undef TAILQ_ENTRY
+#endif
+
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_RPC_STRUCT_H_INCLUDED_ */
+#endif /* EVENT2_RPC_STRUCT_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/tag.h b/contrib/libs/libevent/include/event2/tag.h
index 19fc6d56a1..2f73bfc00e 100644
--- a/contrib/libs/libevent/include/event2/tag.h
+++ b/contrib/libs/libevent/include/event2/tag.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_TAG_H_INCLUDED_
-#define EVENT2_TAG_H_INCLUDED_
+#ifndef EVENT2_TAG_H_INCLUDED_
+#define EVENT2_TAG_H_INCLUDED_
/** @file event2/tag.h
@@ -33,17 +33,17 @@
*/
-#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
@@ -58,7 +58,7 @@ struct evbuffer;
* known ones - and we can just ignore the end of an event buffer.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_init(void);
/**
@@ -68,13 +68,13 @@ void evtag_init(void);
@param ptag a pointer in which the tag id is being stored
@returns -1 on failure or the number of bytes in the remaining payload.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_header(struct evbuffer *evbuf, ev_uint32_t *ptag);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal(struct evbuffer *evbuf, ev_uint32_t tag, const void *data,
ev_uint32_t len);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
struct evbuffer *data);
@@ -88,54 +88,54 @@ void evtag_marshal_buffer(struct evbuffer *evbuf, ev_uint32_t tag,
@param evbuf evbuffer to store the encoded number
@param number a 32-bit integer
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_encode_int(struct evbuffer *evbuf, ev_uint32_t number);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_encode_int64(struct evbuffer *evbuf, ev_uint64_t number);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal_int(struct evbuffer *evbuf, ev_uint32_t tag,
ev_uint32_t integer);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal_int64(struct evbuffer *evbuf, ev_uint32_t tag,
ev_uint64_t integer);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal_string(struct evbuffer *buf, ev_uint32_t tag,
const char *string);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evtag_marshal_timeval(struct evbuffer *evbuf, ev_uint32_t tag,
struct timeval *tv);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal(struct evbuffer *src, ev_uint32_t *ptag,
struct evbuffer *dst);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_peek(struct evbuffer *evbuf, ev_uint32_t *ptag);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_peek_length(struct evbuffer *evbuf, ev_uint32_t *plength);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_payload_length(struct evbuffer *evbuf, ev_uint32_t *plength);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_consume(struct evbuffer *evbuf);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_int(struct evbuffer *evbuf, ev_uint32_t need_tag,
ev_uint32_t *pinteger);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_int64(struct evbuffer *evbuf, ev_uint32_t need_tag,
ev_uint64_t *pinteger);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_fixed(struct evbuffer *src, ev_uint32_t need_tag,
void *data, size_t len);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_string(struct evbuffer *evbuf, ev_uint32_t need_tag,
char **pstring);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
struct timeval *ptv);
@@ -143,4 +143,4 @@ int evtag_unmarshal_timeval(struct evbuffer *evbuf, ev_uint32_t need_tag,
}
#endif
-#endif /* EVENT2_TAG_H_INCLUDED_ */
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/tag_compat.h b/contrib/libs/libevent/include/event2/tag_compat.h
index 8087a2ac45..a276c0d35b 100644
--- a/contrib/libs/libevent/include/event2/tag_compat.h
+++ b/contrib/libs/libevent/include/event2/tag_compat.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_TAG_COMPAT_H_INCLUDED_
-#define EVENT2_TAG_COMPAT_H_INCLUDED_
+#ifndef EVENT2_TAG_COMPAT_H_INCLUDED_
+#define EVENT2_TAG_COMPAT_H_INCLUDED_
/** @file event2/tag_compat.h
@@ -46,4 +46,4 @@
#define encode_int64(evbuf, number) evtag_encode_int64((evbuf), (number))
/**@}*/
-#endif /* EVENT2_TAG_H_INCLUDED_ */
+#endif /* EVENT2_TAG_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/thread.h b/contrib/libs/libevent/include/event2/thread.h
index 2a1f4c7b95..b51998631b 100644
--- a/contrib/libs/libevent/include/event2/thread.h
+++ b/contrib/libs/libevent/include/event2/thread.h
@@ -23,8 +23,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_THREAD_H_INCLUDED_
-#define EVENT2_THREAD_H_INCLUDED_
+#ifndef EVENT2_THREAD_H_INCLUDED_
+#define EVENT2_THREAD_H_INCLUDED_
/** @file event2/thread.h
@@ -46,8 +46,8 @@
*/
-#include <event2/visibility.h>
-
+#include <event2/visibility.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -71,7 +71,7 @@ extern "C" {
#define EVTHREAD_TRY 0x10
/**@}*/
-#if !defined(EVENT__DISABLE_THREAD_SUPPORT) || defined(EVENT_IN_DOXYGEN_)
+#if !defined(EVENT__DISABLE_THREAD_SUPPORT) || defined(EVENT_IN_DOXYGEN_)
#define EVTHREAD_LOCK_API_VERSION 1
@@ -126,7 +126,7 @@ struct evthread_lock_callbacks {
* probably shouldn't call this function; instead, use
* evthread_use_windows_threads() or evthread_use_posix_threads() if you can.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evthread_set_lock_callbacks(const struct evthread_lock_callbacks *);
#define EVTHREAD_CONDITION_API_VERSION 1
@@ -177,7 +177,7 @@ struct evthread_condition_callbacks {
* probably shouldn't call this function; instead, use
* evthread_use_windows_threads() or evthread_use_pthreads() if you can.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evthread_set_condition_callbacks(
const struct evthread_condition_callbacks *);
@@ -188,16 +188,16 @@ int evthread_set_condition_callbacks(
@param id_fn the identify function Libevent should invoke to
determine the identity of a thread.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evthread_set_id_callback(
unsigned long (*id_fn)(void));
-#if (defined(_WIN32) && !defined(EVENT__DISABLE_THREAD_SUPPORT)) || defined(EVENT_IN_DOXYGEN_)
+#if (defined(_WIN32) && !defined(EVENT__DISABLE_THREAD_SUPPORT)) || defined(EVENT_IN_DOXYGEN_)
/** Sets up Libevent for use with Windows builtin locking and thread ID
functions. Unavailable if Libevent is not built for Windows.
@return 0 on success, -1 on failure. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evthread_use_windows_threads(void);
/**
Defined if Libevent was built with support for evthread_use_windows_threads()
@@ -205,13 +205,13 @@ int evthread_use_windows_threads(void);
#define EVTHREAD_USE_WINDOWS_THREADS_IMPLEMENTED 1
#endif
-#if defined(EVENT__HAVE_PTHREADS) || defined(EVENT_IN_DOXYGEN_)
+#if defined(EVENT__HAVE_PTHREADS) || defined(EVENT_IN_DOXYGEN_)
/** Sets up Libevent for use with Pthreads locking and thread ID functions.
Unavailable if Libevent is not build for use with pthreads. Requires
libraries to link against Libevent_pthreads as well as Libevent.
@return 0 on success, -1 on failure. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evthread_use_pthreads(void);
/** Defined if Libevent was built with support for evthread_use_pthreads() */
#define EVTHREAD_USE_PTHREADS_IMPLEMENTED 1
@@ -224,30 +224,30 @@ int evthread_use_pthreads(void);
* If you're going to call this function, you must do so before any locks are
* allocated.
**/
-EVENT2_EXPORT_SYMBOL
-void evthread_enable_lock_debugging(void);
-
-/* Old (misspelled) version: This is deprecated; use
- * evthread_enable_log_debugging instead. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
+void evthread_enable_lock_debugging(void);
+
+/* Old (misspelled) version: This is deprecated; use
+ * evthread_enable_log_debugging instead. */
+EVENT2_EXPORT_SYMBOL
void evthread_enable_lock_debuging(void);
-#endif /* EVENT__DISABLE_THREAD_SUPPORT */
+#endif /* EVENT__DISABLE_THREAD_SUPPORT */
struct event_base;
/** Make sure it's safe to tell an event base to wake up from another thread
or a signal handler.
- You shouldn't need to call this by hand; configuring the base with thread
- support should be necessary and sufficient.
-
+ You shouldn't need to call this by hand; configuring the base with thread
+ support should be necessary and sufficient.
+
@return 0 on success, -1 on failure.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evthread_make_base_notifiable(struct event_base *base);
#ifdef __cplusplus
}
#endif
-#endif /* EVENT2_THREAD_H_INCLUDED_ */
+#endif /* EVENT2_THREAD_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/util.h b/contrib/libs/libevent/include/event2/util.h
index f54f93ef4f..02aa7ba9da 100644
--- a/contrib/libs/libevent/include/event2/util.h
+++ b/contrib/libs/libevent/include/event2/util.h
@@ -23,8 +23,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_UTIL_H_INCLUDED_
-#define EVENT2_UTIL_H_INCLUDED_
+#ifndef EVENT2_UTIL_H_INCLUDED_
+#define EVENT2_UTIL_H_INCLUDED_
/** @file event2/util.h
@@ -32,53 +32,53 @@
related socket manipulations.
*/
-#include <event2/visibility.h>
+#include <event2/visibility.h>
#ifdef __cplusplus
extern "C" {
#endif
#include <event2/event-config.h>
-#ifdef EVENT__HAVE_SYS_TIME_H
+#ifdef EVENT__HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef EVENT__HAVE_STDINT_H
+#ifdef EVENT__HAVE_STDINT_H
#include <stdint.h>
-#elif defined(EVENT__HAVE_INTTYPES_H)
+#elif defined(EVENT__HAVE_INTTYPES_H)
#include <inttypes.h>
#endif
-#ifdef EVENT__HAVE_SYS_TYPES_H
+#ifdef EVENT__HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef EVENT__HAVE_STDDEF_H
+#ifdef EVENT__HAVE_STDDEF_H
#include <stddef.h>
#endif
#ifdef _MSC_VER
#include <BaseTsd.h>
#endif
#include <stdarg.h>
-#ifdef EVENT__HAVE_NETDB_H
+#ifdef EVENT__HAVE_NETDB_H
#include <netdb.h>
#endif
-#ifdef _WIN32
+#ifdef _WIN32
#include <winsock2.h>
-#ifdef EVENT__HAVE_GETADDRINFO
-/* for EAI_* definitions. */
-#include <ws2tcpip.h>
-#endif
-#else
-#ifdef EVENT__HAVE_ERRNO_H
-#include <errno.h>
-#endif
+#ifdef EVENT__HAVE_GETADDRINFO
+/* for EAI_* definitions. */
+#include <ws2tcpip.h>
+#endif
+#else
+#ifdef EVENT__HAVE_ERRNO_H
+#include <errno.h>
+#endif
#include <sys/socket.h>
#endif
-#include <time.h>
-
+#include <time.h>
+
/* Some openbsd autoconf versions get the name of this macro wrong. */
-#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
-#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
+#if defined(EVENT__SIZEOF_VOID__) && !defined(EVENT__SIZEOF_VOID_P)
+#define EVENT__SIZEOF_VOID_P EVENT__SIZEOF_VOID__
#endif
/**
@@ -110,67 +110,67 @@ extern "C" {
*
* @{
*/
-#ifdef EVENT__HAVE_UINT64_T
+#ifdef EVENT__HAVE_UINT64_T
#define ev_uint64_t uint64_t
#define ev_int64_t int64_t
-#elif defined(_WIN32)
+#elif defined(_WIN32)
#define ev_uint64_t unsigned __int64
#define ev_int64_t signed __int64
-#elif EVENT__SIZEOF_LONG_LONG == 8
+#elif EVENT__SIZEOF_LONG_LONG == 8
#define ev_uint64_t unsigned long long
#define ev_int64_t long long
-#elif EVENT__SIZEOF_LONG == 8
+#elif EVENT__SIZEOF_LONG == 8
#define ev_uint64_t unsigned long
#define ev_int64_t long
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define ev_uint64_t ...
#define ev_int64_t ...
#else
#error "No way to define ev_uint64_t"
#endif
-#ifdef EVENT__HAVE_UINT32_T
+#ifdef EVENT__HAVE_UINT32_T
#define ev_uint32_t uint32_t
#define ev_int32_t int32_t
-#elif defined(_WIN32)
+#elif defined(_WIN32)
#define ev_uint32_t unsigned int
#define ev_int32_t signed int
-#elif EVENT__SIZEOF_LONG == 4
+#elif EVENT__SIZEOF_LONG == 4
#define ev_uint32_t unsigned long
#define ev_int32_t signed long
-#elif EVENT__SIZEOF_INT == 4
+#elif EVENT__SIZEOF_INT == 4
#define ev_uint32_t unsigned int
#define ev_int32_t signed int
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define ev_uint32_t ...
#define ev_int32_t ...
#else
#error "No way to define ev_uint32_t"
#endif
-#ifdef EVENT__HAVE_UINT16_T
+#ifdef EVENT__HAVE_UINT16_T
#define ev_uint16_t uint16_t
#define ev_int16_t int16_t
-#elif defined(_WIN32)
+#elif defined(_WIN32)
#define ev_uint16_t unsigned short
#define ev_int16_t signed short
-#elif EVENT__SIZEOF_INT == 2
+#elif EVENT__SIZEOF_INT == 2
#define ev_uint16_t unsigned int
#define ev_int16_t signed int
-#elif EVENT__SIZEOF_SHORT == 2
+#elif EVENT__SIZEOF_SHORT == 2
#define ev_uint16_t unsigned short
#define ev_int16_t signed short
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define ev_uint16_t ...
#define ev_int16_t ...
#else
#error "No way to define ev_uint16_t"
#endif
-#ifdef EVENT__HAVE_UINT8_T
+#ifdef EVENT__HAVE_UINT8_T
#define ev_uint8_t uint8_t
#define ev_int8_t int8_t
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define ev_uint8_t ...
#define ev_int8_t ...
#else
@@ -178,43 +178,43 @@ extern "C" {
#define ev_int8_t signed char
#endif
-#ifdef EVENT__HAVE_UINTPTR_T
+#ifdef EVENT__HAVE_UINTPTR_T
#define ev_uintptr_t uintptr_t
#define ev_intptr_t intptr_t
-#elif EVENT__SIZEOF_VOID_P <= 4
+#elif EVENT__SIZEOF_VOID_P <= 4
#define ev_uintptr_t ev_uint32_t
#define ev_intptr_t ev_int32_t
-#elif EVENT__SIZEOF_VOID_P <= 8
+#elif EVENT__SIZEOF_VOID_P <= 8
#define ev_uintptr_t ev_uint64_t
#define ev_intptr_t ev_int64_t
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define ev_uintptr_t ...
#define ev_intptr_t ...
#else
#error "No way to define ev_uintptr_t"
#endif
-#ifdef EVENT__ssize_t
-#define ev_ssize_t EVENT__ssize_t
+#ifdef EVENT__ssize_t
+#define ev_ssize_t EVENT__ssize_t
#else
#define ev_ssize_t ssize_t
#endif
-/* Note that we define ev_off_t based on the compile-time size of off_t that
- * we used to build Libevent, and not based on the current size of off_t.
- * (For example, we don't define ev_off_t to off_t.). We do this because
- * some systems let you build your software with different off_t sizes
- * at runtime, and so putting in any dependency on off_t would risk API
- * mismatch.
- */
-#ifdef _WIN32
+/* Note that we define ev_off_t based on the compile-time size of off_t that
+ * we used to build Libevent, and not based on the current size of off_t.
+ * (For example, we don't define ev_off_t to off_t.). We do this because
+ * some systems let you build your software with different off_t sizes
+ * at runtime, and so putting in any dependency on off_t would risk API
+ * mismatch.
+ */
+#ifdef _WIN32
#define ev_off_t ev_int64_t
-#elif EVENT__SIZEOF_OFF_T == 8
-#define ev_off_t ev_int64_t
-#elif EVENT__SIZEOF_OFF_T == 4
-#define ev_off_t ev_int32_t
-#elif defined(EVENT_IN_DOXYGEN_)
-#define ev_off_t ...
+#elif EVENT__SIZEOF_OFF_T == 8
+#define ev_off_t ev_int64_t
+#elif EVENT__SIZEOF_OFF_T == 4
+#define ev_off_t ev_int32_t
+#elif defined(EVENT_IN_DOXYGEN_)
+#define ev_off_t ...
#else
#define ev_off_t off_t
#endif
@@ -235,7 +235,7 @@ extern "C" {
@{
*/
-#ifndef EVENT__HAVE_STDINT_H
+#ifndef EVENT__HAVE_STDINT_H
#define EV_UINT64_MAX ((((ev_uint64_t)0xffffffffUL) << 32) | 0xffffffffUL)
#define EV_INT64_MAX ((((ev_int64_t) 0x7fffffffL) << 32) | 0xffffffffL)
#define EV_INT64_MIN ((-EV_INT64_MAX) - 1)
@@ -248,35 +248,35 @@ extern "C" {
#define EV_UINT8_MAX 255
#define EV_INT8_MAX 127
#define EV_INT8_MIN ((-EV_INT8_MAX) - 1)
-#else
-#define EV_UINT64_MAX UINT64_MAX
-#define EV_INT64_MAX INT64_MAX
-#define EV_INT64_MIN INT64_MIN
-#define EV_UINT32_MAX UINT32_MAX
-#define EV_INT32_MAX INT32_MAX
-#define EV_INT32_MIN INT32_MIN
-#define EV_UINT16_MAX UINT16_MAX
-#define EV_INT16_MIN INT16_MIN
-#define EV_INT16_MAX INT16_MAX
-#define EV_UINT8_MAX UINT8_MAX
-#define EV_INT8_MAX INT8_MAX
-#define EV_INT8_MIN INT8_MIN
+#else
+#define EV_UINT64_MAX UINT64_MAX
+#define EV_INT64_MAX INT64_MAX
+#define EV_INT64_MIN INT64_MIN
+#define EV_UINT32_MAX UINT32_MAX
+#define EV_INT32_MAX INT32_MAX
+#define EV_INT32_MIN INT32_MIN
+#define EV_UINT16_MAX UINT16_MAX
+#define EV_INT16_MIN INT16_MIN
+#define EV_INT16_MAX INT16_MAX
+#define EV_UINT8_MAX UINT8_MAX
+#define EV_INT8_MAX INT8_MAX
+#define EV_INT8_MIN INT8_MIN
/** @} */
-#endif
+#endif
+
-
/**
@name Limits for SIZE_T and SSIZE_T
@{
*/
-#if EVENT__SIZEOF_SIZE_T == 8
+#if EVENT__SIZEOF_SIZE_T == 8
#define EV_SIZE_MAX EV_UINT64_MAX
#define EV_SSIZE_MAX EV_INT64_MAX
-#elif EVENT__SIZEOF_SIZE_T == 4
+#elif EVENT__SIZEOF_SIZE_T == 4
#define EV_SIZE_MAX EV_UINT32_MAX
#define EV_SSIZE_MAX EV_INT32_MAX
-#elif defined(EVENT_IN_DOXYGEN_)
+#elif defined(EVENT_IN_DOXYGEN_)
#define EV_SIZE_MAX ...
#define EV_SSIZE_MAX ...
#else
@@ -286,16 +286,16 @@ extern "C" {
#define EV_SSIZE_MIN ((-EV_SSIZE_MAX) - 1)
/**@}*/
-#ifdef _WIN32
+#ifdef _WIN32
#define ev_socklen_t int
-#elif defined(EVENT__socklen_t)
-#define ev_socklen_t EVENT__socklen_t
+#elif defined(EVENT__socklen_t)
+#define ev_socklen_t EVENT__socklen_t
#else
#define ev_socklen_t socklen_t
#endif
-#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
-#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \
+#ifdef EVENT__HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
+#if !defined(EVENT__HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY) \
&& !defined(ss_family)
#define ss_family __ss_family
#endif
@@ -304,77 +304,77 @@ extern "C" {
/**
* A type wide enough to hold the output of "socket()" or "accept()". On
* Windows, this is an intptr_t; elsewhere, it is an int. */
-#ifdef _WIN32
+#ifdef _WIN32
#define evutil_socket_t intptr_t
#else
#define evutil_socket_t int
#endif
-/**
- * Structure to hold information about a monotonic timer
- *
- * Use this with evutil_configure_monotonic_time() and
- * evutil_gettime_monotonic().
- *
- * This is an opaque structure; you can allocate one using
- * evutil_monotonic_timer_new().
- *
- * @see evutil_monotonic_timer_new(), evutil_monotonic_timer_free(),
- * evutil_configure_monotonic_time(), evutil_gettime_monotonic()
- */
-struct evutil_monotonic_timer
-#ifdef EVENT_IN_DOXYGEN_
-{/*Empty body so that doxygen will generate documentation here.*/}
-#endif
-;
-
-#define EV_MONOT_PRECISE 1
-#define EV_MONOT_FALLBACK 2
-
-/** Format a date string using RFC 1123 format (used in HTTP).
- * If `tm` is NULL, current system's time will be used.
- * The number of characters written will be returned.
- * One should check if the return value is smaller than `datelen` to check if
- * the result is truncated or not.
- */
-EVENT2_EXPORT_SYMBOL int
-evutil_date_rfc1123(char *date, const size_t datelen, const struct tm *tm);
-
-/** Allocate a new struct evutil_monotonic_timer for use with the
- * evutil_configure_monotonic_time() and evutil_gettime_monotonic()
- * functions. You must configure the timer with
- * evutil_configure_monotonic_time() before using it.
- */
-EVENT2_EXPORT_SYMBOL
-struct evutil_monotonic_timer * evutil_monotonic_timer_new(void);
-
-/** Free a struct evutil_monotonic_timer that was allocated using
- * evutil_monotonic_timer_new().
- */
-EVENT2_EXPORT_SYMBOL
-void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer);
-
-/** Set up a struct evutil_monotonic_timer; flags can include
- * EV_MONOT_PRECISE and EV_MONOT_FALLBACK.
- */
-EVENT2_EXPORT_SYMBOL
-int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
- int flags);
-
-/** Query the current monotonic time from a struct evutil_monotonic_timer
- * previously configured with evutil_configure_monotonic_time(). Monotonic
- * time is guaranteed never to run in reverse, but is not necessarily epoch-
- * based, or relative to any other definite point. Use it to make reliable
- * measurements of elapsed time between events even when the system time
- * may be changed.
- *
- * It is not safe to use this funtion on the same timer from multiple
- * threads.
- */
-EVENT2_EXPORT_SYMBOL
-int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
- struct timeval *tp);
-
+/**
+ * Structure to hold information about a monotonic timer
+ *
+ * Use this with evutil_configure_monotonic_time() and
+ * evutil_gettime_monotonic().
+ *
+ * This is an opaque structure; you can allocate one using
+ * evutil_monotonic_timer_new().
+ *
+ * @see evutil_monotonic_timer_new(), evutil_monotonic_timer_free(),
+ * evutil_configure_monotonic_time(), evutil_gettime_monotonic()
+ */
+struct evutil_monotonic_timer
+#ifdef EVENT_IN_DOXYGEN_
+{/*Empty body so that doxygen will generate documentation here.*/}
+#endif
+;
+
+#define EV_MONOT_PRECISE 1
+#define EV_MONOT_FALLBACK 2
+
+/** Format a date string using RFC 1123 format (used in HTTP).
+ * If `tm` is NULL, current system's time will be used.
+ * The number of characters written will be returned.
+ * One should check if the return value is smaller than `datelen` to check if
+ * the result is truncated or not.
+ */
+EVENT2_EXPORT_SYMBOL int
+evutil_date_rfc1123(char *date, const size_t datelen, const struct tm *tm);
+
+/** Allocate a new struct evutil_monotonic_timer for use with the
+ * evutil_configure_monotonic_time() and evutil_gettime_monotonic()
+ * functions. You must configure the timer with
+ * evutil_configure_monotonic_time() before using it.
+ */
+EVENT2_EXPORT_SYMBOL
+struct evutil_monotonic_timer * evutil_monotonic_timer_new(void);
+
+/** Free a struct evutil_monotonic_timer that was allocated using
+ * evutil_monotonic_timer_new().
+ */
+EVENT2_EXPORT_SYMBOL
+void evutil_monotonic_timer_free(struct evutil_monotonic_timer *timer);
+
+/** Set up a struct evutil_monotonic_timer; flags can include
+ * EV_MONOT_PRECISE and EV_MONOT_FALLBACK.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_configure_monotonic_time(struct evutil_monotonic_timer *timer,
+ int flags);
+
+/** Query the current monotonic time from a struct evutil_monotonic_timer
+ * previously configured with evutil_configure_monotonic_time(). Monotonic
+ * time is guaranteed never to run in reverse, but is not necessarily epoch-
+ * based, or relative to any other definite point. Use it to make reliable
+ * measurements of elapsed time between events even when the system time
+ * may be changed.
+ *
+ * It is not safe to use this funtion on the same timer from multiple
+ * threads.
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
+ struct timeval *tp);
+
/** Create two new sockets that are connected to each other.
On Unix, this simply calls socketpair(). On Windows, it uses the
@@ -386,14 +386,14 @@ int evutil_gettime_monotonic(struct evutil_monotonic_timer *timer,
Parameters and return values are as for socketpair()
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_socketpair(int d, int type, int protocol, evutil_socket_t sv[2]);
/** Do platform-specific operations as needed to make a socket nonblocking.
@param sock The socket to make nonblocking
@return 0 on success, -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_make_socket_nonblocking(evutil_socket_t sock);
/** Do platform-specific operations to make a listener socket reusable.
@@ -407,82 +407,82 @@ int evutil_make_socket_nonblocking(evutil_socket_t sock);
@param sock The socket to make reusable
@return 0 on success, -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_make_listen_socket_reuseable(evutil_socket_t sock);
-/** Do platform-specific operations to make a listener port reusable.
-
- Specifically, we want to make sure that multiple programs which also
- set the same socket option will be able to bind, listen at the same time.
-
- This is a feature available only to Linux 3.9+
-
- @param sock The socket to make reusable
- @return 0 on success, -1 on failure
- */
-EVENT2_EXPORT_SYMBOL
-int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock);
-
-/** Set ipv6 only bind socket option to make listener work only in ipv6 sockets.
-
- According to RFC3493 and most Linux distributions, default value for the
- sockets is to work in IPv4-mapped mode. In IPv4-mapped mode, it is not possible
- to bind same port from different IPv4 and IPv6 handlers.
-
- @param sock The socket to make in ipv6only working mode
- @return 0 on success, -1 on failure
- */
-EVENT2_EXPORT_SYMBOL
-int evutil_make_listen_socket_ipv6only(evutil_socket_t sock);
-
+/** Do platform-specific operations to make a listener port reusable.
+
+ Specifically, we want to make sure that multiple programs which also
+ set the same socket option will be able to bind, listen at the same time.
+
+ This is a feature available only to Linux 3.9+
+
+ @param sock The socket to make reusable
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_reuseable_port(evutil_socket_t sock);
+
+/** Set ipv6 only bind socket option to make listener work only in ipv6 sockets.
+
+ According to RFC3493 and most Linux distributions, default value for the
+ sockets is to work in IPv4-mapped mode. In IPv4-mapped mode, it is not possible
+ to bind same port from different IPv4 and IPv6 handlers.
+
+ @param sock The socket to make in ipv6only working mode
+ @return 0 on success, -1 on failure
+ */
+EVENT2_EXPORT_SYMBOL
+int evutil_make_listen_socket_ipv6only(evutil_socket_t sock);
+
/** Do platform-specific operations as needed to close a socket upon a
successful execution of one of the exec*() functions.
@param sock The socket to be closed
@return 0 on success, -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_make_socket_closeonexec(evutil_socket_t sock);
/** Do the platform-specific call needed to close a socket returned from
socket() or accept().
@param sock The socket to be closed
- @return 0 on success (whether the operation is supported or not),
- -1 on failure
+ @return 0 on success (whether the operation is supported or not),
+ -1 on failure
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_closesocket(evutil_socket_t sock);
#define EVUTIL_CLOSESOCKET(s) evutil_closesocket(s)
-/** Do platform-specific operations, if possible, to make a tcp listener
- * socket defer accept()s until there is data to read.
- *
- * Not all platforms support this. You don't want to do this for every
- * listener socket: only the ones that implement a protocol where the
- * client transmits before the server needs to respond.
- *
- * @param sock The listening socket to to make deferred
- * @return 0 on success (whether the operation is supported or not),
- * -1 on failure
-*/
-EVENT2_EXPORT_SYMBOL
-int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock);
-
-#ifdef _WIN32
+/** Do platform-specific operations, if possible, to make a tcp listener
+ * socket defer accept()s until there is data to read.
+ *
+ * Not all platforms support this. You don't want to do this for every
+ * listener socket: only the ones that implement a protocol where the
+ * client transmits before the server needs to respond.
+ *
+ * @param sock The listening socket to to make deferred
+ * @return 0 on success (whether the operation is supported or not),
+ * -1 on failure
+*/
+EVENT2_EXPORT_SYMBOL
+int evutil_make_tcp_listen_socket_deferred(evutil_socket_t sock);
+
+#ifdef _WIN32
/** Return the most recent socket error. Not idempotent on all platforms. */
#define EVUTIL_SOCKET_ERROR() WSAGetLastError()
/** Replace the most recent socket error with errcode */
#define EVUTIL_SET_SOCKET_ERROR(errcode) \
do { WSASetLastError(errcode); } while (0)
/** Return the most recent socket error to occur on sock. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_socket_geterror(evutil_socket_t sock);
/** Convert a socket error to a string. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evutil_socket_error_to_string(int errcode);
-#define EVUTIL_INVALID_SOCKET INVALID_SOCKET
-#elif defined(EVENT_IN_DOXYGEN_)
+#define EVUTIL_INVALID_SOCKET INVALID_SOCKET
+#elif defined(EVENT_IN_DOXYGEN_)
/**
@name Socket error functions
@@ -505,16 +505,16 @@ const char *evutil_socket_error_to_string(int errcode);
#define evutil_socket_geterror(sock) ...
/** Convert a socket error to a string. */
#define evutil_socket_error_to_string(errcode) ...
-#define EVUTIL_INVALID_SOCKET -1
+#define EVUTIL_INVALID_SOCKET -1
/**@}*/
-#else /** !EVENT_IN_DOXYGEN_ && !_WIN32 */
+#else /** !EVENT_IN_DOXYGEN_ && !_WIN32 */
#define EVUTIL_SOCKET_ERROR() (errno)
#define EVUTIL_SET_SOCKET_ERROR(errcode) \
do { errno = (errcode); } while (0)
#define evutil_socket_geterror(sock) (errno)
#define evutil_socket_error_to_string(errcode) (strerror(errcode))
-#define EVUTIL_INVALID_SOCKET -1
-#endif /** !_WIN32 */
+#define EVUTIL_INVALID_SOCKET -1
+#endif /** !_WIN32 */
/**
@@ -525,7 +525,7 @@ const char *evutil_socket_error_to_string(int errcode);
*
* @{
*/
-#ifdef EVENT__HAVE_TIMERADD
+#ifdef EVENT__HAVE_TIMERADD
#define evutil_timeradd(tvp, uvp, vvp) timeradd((tvp), (uvp), (vvp))
#define evutil_timersub(tvp, uvp, vvp) timersub((tvp), (uvp), (vvp))
#else
@@ -547,9 +547,9 @@ const char *evutil_socket_error_to_string(int errcode);
(vvp)->tv_usec += 1000000; \
} \
} while (0)
-#endif /* !EVENT__HAVE_TIMERADD */
+#endif /* !EVENT__HAVE_TIMERADD */
-#ifdef EVENT__HAVE_TIMERCLEAR
+#ifdef EVENT__HAVE_TIMERCLEAR
#define evutil_timerclear(tvp) timerclear(tvp)
#else
#define evutil_timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
@@ -563,7 +563,7 @@ const char *evutil_socket_error_to_string(int errcode);
((tvp)->tv_usec cmp (uvp)->tv_usec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
-#ifdef EVENT__HAVE_TIMERISSET
+#ifdef EVENT__HAVE_TIMERISSET
#define evutil_timerisset(tvp) timerisset(tvp)
#else
#define evutil_timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
@@ -578,22 +578,22 @@ const char *evutil_socket_error_to_string(int errcode);
/* big-int related functions */
/** Parse a 64-bit value from a string. Arguments are as for strtol. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
ev_int64_t evutil_strtoll(const char *s, char **endptr, int base);
/** Replacement for gettimeofday on platforms that lack it. */
-#ifdef EVENT__HAVE_GETTIMEOFDAY
+#ifdef EVENT__HAVE_GETTIMEOFDAY
#define evutil_gettimeofday(tv, tz) gettimeofday((tv), (tz))
#else
struct timezone;
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_gettimeofday(struct timeval *tv, struct timezone *tz);
#endif
/** Replacement for snprintf to get consistent behavior on platforms for
which the return value of snprintf does not conform to C99.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
#ifdef __GNUC__
__attribute__((format(printf, 3, 4)))
@@ -602,7 +602,7 @@ int evutil_snprintf(char *buf, size_t buflen, const char *format, ...)
/** Replacement for vsnprintf to get consistent behavior on platforms for
which the return value of snprintf does not conform to C99.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
#ifdef __GNUC__
__attribute__((format(printf, 3, 0)))
@@ -610,7 +610,7 @@ int evutil_vsnprintf(char *buf, size_t buflen, const char *format, va_list ap)
;
/** Replacement for inet_ntop for platforms which lack it. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evutil_inet_ntop(int af, const void *src, char *dst, size_t len);
/** Variation of inet_pton that also parses IPv6 scopes. Public for
unit tests. No reason to call this directly.
@@ -619,7 +619,7 @@ EVENT2_EXPORT_SYMBOL
int evutil_inet_pton_scope(int af, const char *src, void *dst,
unsigned *indexp);
/** Replacement for inet_pton for platforms which lack it. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_inet_pton(int af, const char *src, void *dst);
struct sockaddr;
@@ -643,7 +643,7 @@ struct sockaddr;
or if out is not large enough to hold the result. Otherwise returns
0 on success.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_parse_sockaddr_port(const char *str, struct sockaddr *out, int *outlen);
/** Compare two sockaddrs; return 0 if they are equal, or less than 0 if sa1
@@ -651,24 +651,24 @@ int evutil_parse_sockaddr_port(const char *str, struct sockaddr *out, int *outle
* true, consider the port as well as the address. Only implemented for
* AF_INET and AF_INET6 addresses. The ordering is not guaranteed to remain
* the same between Libevent versions. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_sockaddr_cmp(const struct sockaddr *sa1, const struct sockaddr *sa2,
int include_port);
/** As strcasecmp, but always compares the characters in locale-independent
ASCII. That's useful if you're handling data in ASCII-based protocols.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_ascii_strcasecmp(const char *str1, const char *str2);
/** As strncasecmp, but always compares the characters in locale-independent
ASCII. That's useful if you're handling data in ASCII-based protocols.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_ascii_strncasecmp(const char *str1, const char *str2, size_t n);
/* Here we define evutil_addrinfo to the native addrinfo type, or redefine it
* if this system has no getaddrinfo(). */
-#ifdef EVENT__HAVE_STRUCT_ADDRINFO
+#ifdef EVENT__HAVE_STRUCT_ADDRINFO
#define evutil_addrinfo addrinfo
#else
/** A definition of struct addrinfo for systems that lack it.
@@ -694,32 +694,32 @@ struct evutil_addrinfo {
@{
*/
-#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_ADDRFAMILY) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_ADDRFAMILY EAI_ADDRFAMILY
#else
#define EVUTIL_EAI_ADDRFAMILY -901
#endif
-#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_AGAIN) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_AGAIN EAI_AGAIN
#else
#define EVUTIL_EAI_AGAIN -902
#endif
-#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_BADFLAGS) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_BADFLAGS EAI_BADFLAGS
#else
#define EVUTIL_EAI_BADFLAGS -903
#endif
-#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_FAIL) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_FAIL EAI_FAIL
#else
#define EVUTIL_EAI_FAIL -904
#endif
-#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_FAMILY) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_FAMILY EAI_FAMILY
#else
#define EVUTIL_EAI_FAMILY -905
#endif
-#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_MEMORY) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_MEMORY EAI_MEMORY
#else
#define EVUTIL_EAI_MEMORY -906
@@ -727,27 +727,27 @@ struct evutil_addrinfo {
/* This test is a bit complicated, since some MS SDKs decide to
* remove NODATA or redefine it to be the same as NONAME, in a
* fun interpretation of RFC 2553 and RFC 3493. */
-#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME)
+#if defined(EAI_NODATA) && defined(EVENT__HAVE_GETADDRINFO) && (!defined(EAI_NONAME) || EAI_NODATA != EAI_NONAME)
#define EVUTIL_EAI_NODATA EAI_NODATA
#else
#define EVUTIL_EAI_NODATA -907
#endif
-#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_NONAME) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_NONAME EAI_NONAME
#else
#define EVUTIL_EAI_NONAME -908
#endif
-#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_SERVICE) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_SERVICE EAI_SERVICE
#else
#define EVUTIL_EAI_SERVICE -909
#endif
-#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_SOCKTYPE) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_SOCKTYPE EAI_SOCKTYPE
#else
#define EVUTIL_EAI_SOCKTYPE -910
#endif
-#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(EAI_SYSTEM) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_EAI_SYSTEM EAI_SYSTEM
#else
#define EVUTIL_EAI_SYSTEM -911
@@ -755,37 +755,37 @@ struct evutil_addrinfo {
#define EVUTIL_EAI_CANCEL -90001
-#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_PASSIVE) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_PASSIVE AI_PASSIVE
#else
#define EVUTIL_AI_PASSIVE 0x1000
#endif
-#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_CANONNAME) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_CANONNAME AI_CANONNAME
#else
#define EVUTIL_AI_CANONNAME 0x2000
#endif
-#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_NUMERICHOST) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_NUMERICHOST AI_NUMERICHOST
#else
#define EVUTIL_AI_NUMERICHOST 0x4000
#endif
-#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_NUMERICSERV) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_NUMERICSERV AI_NUMERICSERV
#else
#define EVUTIL_AI_NUMERICSERV 0x8000
#endif
-#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_V4MAPPED) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_V4MAPPED AI_V4MAPPED
#else
#define EVUTIL_AI_V4MAPPED 0x10000
#endif
-#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_ALL) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_ALL AI_ALL
#else
#define EVUTIL_AI_ALL 0x20000
#endif
-#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO)
+#if defined(AI_ADDRCONFIG) && defined(EVENT__HAVE_GETADDRINFO)
#define EVUTIL_AI_ADDRCONFIG AI_ADDRCONFIG
#else
#define EVUTIL_AI_ADDRCONFIG 0x40000
@@ -804,15 +804,15 @@ struct evutil_addrinfo;
*
* For a nonblocking variant, see evdns_getaddrinfo.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_getaddrinfo(const char *nodename, const char *servname,
const struct evutil_addrinfo *hints_in, struct evutil_addrinfo **res);
/** Release storage allocated by evutil_getaddrinfo or evdns_getaddrinfo. */
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evutil_freeaddrinfo(struct evutil_addrinfo *ai);
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
const char *evutil_gai_strerror(int err);
/** Generate n bytes of secure pseudorandom data, and store them in buf.
@@ -824,7 +824,7 @@ const char *evutil_gai_strerror(int err);
* provides only rudimentary prediction- and backtracking-resistance. Don't
* use this for serious cryptographic applications.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evutil_secure_rng_get_bytes(void *buf, size_t n);
/**
@@ -843,7 +843,7 @@ void evutil_secure_rng_get_bytes(void *buf, size_t n);
* whatever), and you want to make sure that seeding happens before your
* program loses the ability to do it.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_secure_rng_init(void);
/**
@@ -859,10 +859,10 @@ int evutil_secure_rng_init(void);
*
* This API is unstable, and might change in a future libevent version.
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
int evutil_secure_rng_set_urandom_device_file(char *fname);
-#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
+#if !defined(EVENT__HAVE_ARC4RANDOM) || defined(EVENT__HAVE_ARC4RANDOM_ADDRANDOM)
/** Seed the random number generator with extra random bytes.
You should almost never need to call this function; it should be
@@ -877,12 +877,12 @@ int evutil_secure_rng_set_urandom_device_file(char *fname);
@param dat a buffer full of a strong source of random numbers
@param datlen the number of bytes to read from datlen
*/
-EVENT2_EXPORT_SYMBOL
+EVENT2_EXPORT_SYMBOL
void evutil_secure_rng_add_bytes(const char *dat, size_t datlen);
-#endif
+#endif
#ifdef __cplusplus
}
#endif
-#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
+#endif /* EVENT1_EVUTIL_H_INCLUDED_ */
diff --git a/contrib/libs/libevent/include/event2/visibility.h b/contrib/libs/libevent/include/event2/visibility.h
index 221cb1f7b8..006bbf06d8 100644
--- a/contrib/libs/libevent/include/event2/visibility.h
+++ b/contrib/libs/libevent/include/event2/visibility.h
@@ -1,67 +1,67 @@
-/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
-/*
- * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- * derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (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_VISIBILITY_H_INCLUDED_
-#define EVENT2_VISIBILITY_H_INCLUDED_
-
-#include <event2/event-config.h>
-
-#if defined(event_shared_EXPORTS) || \
- defined(event_extra_shared_EXPORTS) || \
- defined(event_core_shared_EXPORTS) || \
- defined(event_pthreads_shared_EXPORTS) || \
- defined(event_openssl_shared_EXPORTS)
-
-# if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
-# define EVENT2_EXPORT_SYMBOL __global
-# elif defined __GNUC__
-# define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default")))
-# elif defined(_MSC_VER)
-# define EVENT2_EXPORT_SYMBOL __declspec(dllexport)
-# else
-# define EVENT2_EXPORT_SYMBOL /* unknown compiler */
-# endif
-
-#else /* event_*_EXPORTS */
-
-# define EVENT2_EXPORT_SYMBOL
-
-#endif /* event_*_EXPORTS */
-
-/** We need to dllimport event_debug_logging_mask_ into event_extra */
-#if defined(_MSC_VER)
-# if defined(event_core_shared_EXPORTS) /** from core export */
-# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllexport)
-# elif defined(event_extra_shared_EXPORTS) || /** from extra import */ \
- defined(EVENT_VISIBILITY_WANT_DLLIMPORT)
-# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllimport)
-# endif
-#endif /* _MSC_VER */
-#if !defined(EVENT2_CORE_EXPORT_SYMBOL)
-# define EVENT2_CORE_EXPORT_SYMBOL EVENT2_EXPORT_SYMBOL
-#endif
-
-#endif /* EVENT2_VISIBILITY_H_INCLUDED_ */
+/* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
+/*
+ * Copyright (c) 2007-2012 Niels Provos and Nick Mathewson
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ * derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (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_VISIBILITY_H_INCLUDED_
+#define EVENT2_VISIBILITY_H_INCLUDED_
+
+#include <event2/event-config.h>
+
+#if defined(event_shared_EXPORTS) || \
+ defined(event_extra_shared_EXPORTS) || \
+ defined(event_core_shared_EXPORTS) || \
+ defined(event_pthreads_shared_EXPORTS) || \
+ defined(event_openssl_shared_EXPORTS)
+
+# if defined (__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+# define EVENT2_EXPORT_SYMBOL __global
+# elif defined __GNUC__
+# define EVENT2_EXPORT_SYMBOL __attribute__ ((visibility("default")))
+# elif defined(_MSC_VER)
+# define EVENT2_EXPORT_SYMBOL __declspec(dllexport)
+# else
+# define EVENT2_EXPORT_SYMBOL /* unknown compiler */
+# endif
+
+#else /* event_*_EXPORTS */
+
+# define EVENT2_EXPORT_SYMBOL
+
+#endif /* event_*_EXPORTS */
+
+/** We need to dllimport event_debug_logging_mask_ into event_extra */
+#if defined(_MSC_VER)
+# if defined(event_core_shared_EXPORTS) /** from core export */
+# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllexport)
+# elif defined(event_extra_shared_EXPORTS) || /** from extra import */ \
+ defined(EVENT_VISIBILITY_WANT_DLLIMPORT)
+# define EVENT2_CORE_EXPORT_SYMBOL __declspec(dllimport)
+# endif
+#endif /* _MSC_VER */
+#if !defined(EVENT2_CORE_EXPORT_SYMBOL)
+# define EVENT2_CORE_EXPORT_SYMBOL EVENT2_EXPORT_SYMBOL
+#endif
+
+#endif /* EVENT2_VISIBILITY_H_INCLUDED_ */