mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Replace all use of config.h with event-config.h.
svn:r1064
This commit is contained in:
parent
9993137cbb
commit
8889a77039
38
buffer.c
38
buffer.c
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -34,34 +34,34 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_VASPRINTF
|
#ifdef _EVENT_HAVE_VASPRINTF
|
||||||
/* If we have vasprintf, we need to define this before we include stdio.h. */
|
/* If we have vasprintf, we need to define this before we include stdio.h. */
|
||||||
#define _GNU_SOURCE
|
#define _GNU_SOURCE
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_UIO_H
|
#ifdef _EVENT_HAVE_SYS_UIO_H
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_IOCTL_H
|
#ifdef _EVENT_HAVE_SYS_IOCTL_H
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_MMAN_H
|
#ifdef _EVENT_HAVE_SYS_MMAN_H
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_SENDFILE_H
|
#ifdef _EVENT_HAVE_SYS_SENDFILE_H
|
||||||
#include <sys/sendfile.h>
|
#include <sys/sendfile.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -70,17 +70,17 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_STDARG_H
|
#ifdef _EVENT_HAVE_STDARG_H
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "event2/event.h"
|
#include "event2/event.h"
|
||||||
#include "event2/buffer.h"
|
#include "event2/buffer.h"
|
||||||
#include "event2/buffer_compat.h"
|
#include "event2/buffer_compat.h"
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#include "log-internal.h"
|
#include "log-internal.h"
|
||||||
#include "mm-internal.h"
|
#include "mm-internal.h"
|
||||||
#include "util-internal.h"
|
#include "util-internal.h"
|
||||||
@ -92,10 +92,10 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* send file support */
|
/* send file support */
|
||||||
#if defined(HAVE_SYS_SENDFILE_H) && defined(HAVE_SENDFILE) && defined(__linux__)
|
#if defined(_EVENT_HAVE_SYS_SENDFILE_H) && defined(_EVENT_HAVE_SENDFILE) && defined(__linux__)
|
||||||
#define USE_SENDFILE 1
|
#define USE_SENDFILE 1
|
||||||
#define SENDFILE_IS_LINUX 1
|
#define SENDFILE_IS_LINUX 1
|
||||||
#elif defined(HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__APPLE__))
|
#elif defined(_EVENT_HAVE_SENDFILE) && (defined(__FreeBSD__) || defined(__APPLE__))
|
||||||
#define USE_SENDFILE 1
|
#define USE_SENDFILE 1
|
||||||
#define SENDFILE_IS_FREEBSD 1
|
#define SENDFILE_IS_FREEBSD 1
|
||||||
#endif
|
#endif
|
||||||
@ -103,7 +103,7 @@
|
|||||||
#ifdef USE_SENDFILE
|
#ifdef USE_SENDFILE
|
||||||
static int use_sendfile = 1;
|
static int use_sendfile = 1;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MMAP
|
#ifdef _EVENT_HAVE_MMAP
|
||||||
static int use_mmap = 1;
|
static int use_mmap = 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ evbuffer_chain_free(struct evbuffer_chain *chain)
|
|||||||
if (info->cleanupfn)
|
if (info->cleanupfn)
|
||||||
(*info->cleanupfn)(info->extra);
|
(*info->cleanupfn)(info->extra);
|
||||||
}
|
}
|
||||||
#ifdef HAVE_MMAP
|
#ifdef _EVENT_HAVE_MMAP
|
||||||
if (chain->flags & EVBUFFER_MMAP) {
|
if (chain->flags & EVBUFFER_MMAP) {
|
||||||
struct evbuffer_chain_fd *info =
|
struct evbuffer_chain_fd *info =
|
||||||
EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_fd,
|
EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_fd,
|
||||||
@ -1034,13 +1034,13 @@ _evbuffer_expand_fast(struct evbuffer *buf, size_t datlen)
|
|||||||
* Reads data from a file descriptor into a buffer.
|
* Reads data from a file descriptor into a buffer.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(HAVE_SYS_UIO_H)
|
#if defined(_EVENT_HAVE_SYS_UIO_H)
|
||||||
#define USE_IOVEC_IMPL
|
#define USE_IOVEC_IMPL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef USE_IOVEC_IMPL
|
#ifdef USE_IOVEC_IMPL
|
||||||
|
|
||||||
#ifdef HAVE_SYS_UIO_H
|
#ifdef _EVENT_HAVE_SYS_UIO_H
|
||||||
/* number of iovec we use for writev, fragmentation is going to determine
|
/* number of iovec we use for writev, fragmentation is going to determine
|
||||||
* how much we end up writing */
|
* how much we end up writing */
|
||||||
#define NUM_IOVEC 128
|
#define NUM_IOVEC 128
|
||||||
@ -1428,7 +1428,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd,
|
|||||||
{
|
{
|
||||||
size_t old_len = outbuf->total_len;
|
size_t old_len = outbuf->total_len;
|
||||||
|
|
||||||
#if defined(USE_SENDFILE) || defined(HAVE_MMAP)
|
#if defined(USE_SENDFILE) || defined(_EVENT_HAVE_MMAP)
|
||||||
struct evbuffer_chain *chain;
|
struct evbuffer_chain *chain;
|
||||||
struct evbuffer_chain_fd *info;
|
struct evbuffer_chain_fd *info;
|
||||||
#endif
|
#endif
|
||||||
@ -1453,7 +1453,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd,
|
|||||||
evbuffer_chain_insert(outbuf, chain);
|
evbuffer_chain_insert(outbuf, chain);
|
||||||
} else
|
} else
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_MMAP)
|
#if defined(_EVENT_HAVE_MMAP)
|
||||||
if (use_mmap) {
|
if (use_mmap) {
|
||||||
void *mapped = mmap(NULL, length + offset, PROT_READ,
|
void *mapped = mmap(NULL, length + offset, PROT_READ,
|
||||||
#ifdef MAP_NOCACHE
|
#ifdef MAP_NOCACHE
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#include "evutil.h"
|
#include "evutil.h"
|
||||||
|
|
||||||
struct bufferevent_filter {
|
struct bufferevent_filter {
|
||||||
|
@ -28,10 +28,10 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_STDARG_H
|
#ifdef _EVENT_HAVE_STDARG_H
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -25,12 +25,12 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
|
8
epoll.c
8
epoll.c
@ -25,13 +25,13 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
@ -44,7 +44,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef _EVENT_HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ const struct eventop epollops = {
|
|||||||
0
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef HAVE_SETFD
|
#ifdef _EVENT_HAVE_SETFD
|
||||||
#define FD_CLOSEONEXEC(x) do { \
|
#define FD_CLOSEONEXEC(x) do { \
|
||||||
if (fcntl(x, F_SETFD, 1) == -1) \
|
if (fcntl(x, F_SETFD, 1) == -1) \
|
||||||
event_warn("fcntl(%d, F_SETFD)", x); \
|
event_warn("fcntl(%d, F_SETFD)", x); \
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#include "evutil.h"
|
#include "evutil.h"
|
||||||
|
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
26
evdns.c
26
evdns.c
@ -36,15 +36,15 @@
|
|||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DNS_USE_FTIME_FOR_ID
|
#ifdef DNS_USE_FTIME_FOR_ID
|
||||||
#include <sys/timeb.h>
|
#include <sys/timeb.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef DNS_USE_CPU_CLOCK_FOR_ID
|
#ifndef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
|
||||||
#ifndef DNS_USE_GETTIMEOFDAY_FOR_ID
|
#ifndef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
|
||||||
#ifndef DNS_USE_OPENSSL_FOR_ID
|
#ifndef DNS_USE_OPENSSL_FOR_ID
|
||||||
#ifndef DNS_USE_FTIME_FOR_ID
|
#ifndef DNS_USE_FTIME_FOR_ID
|
||||||
#error Must configure at least one id generation method.
|
#error Must configure at least one id generation method.
|
||||||
@ -59,18 +59,18 @@
|
|||||||
/* for strtok_r */
|
/* for strtok_r */
|
||||||
#define _REENTRANT
|
#define _REENTRANT
|
||||||
|
|
||||||
#ifdef DNS_USE_CPU_CLOCK_FOR_ID
|
#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
|
||||||
#ifdef DNS_USE_OPENSSL_FOR_ID
|
#ifdef DNS_USE_OPENSSL_FOR_ID
|
||||||
#error Multiple id options selected
|
#error Multiple id options selected
|
||||||
#endif
|
#endif
|
||||||
#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
|
#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
|
||||||
#error Multiple id options selected
|
#error Multiple id options selected
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DNS_USE_OPENSSL_FOR_ID
|
#ifdef DNS_USE_OPENSSL_FOR_ID
|
||||||
#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
|
#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
|
||||||
#error Multiple id options selected
|
#error Multiple id options selected
|
||||||
#endif
|
#endif
|
||||||
#include <openssl/rand.h>
|
#include <openssl/rand.h>
|
||||||
@ -80,17 +80,17 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STDINT_H
|
#ifdef _EVENT_HAVE_STDINT_H
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
@ -118,7 +118,7 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_NETINET_IN6_H
|
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||||
#include <netinet/in6.h>
|
#include <netinet/in6.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1079,7 +1079,7 @@ static u16
|
|||||||
default_transaction_id_fn(void)
|
default_transaction_id_fn(void)
|
||||||
{
|
{
|
||||||
u16 trans_id;
|
u16 trans_id;
|
||||||
#ifdef DNS_USE_CPU_CLOCK_FOR_ID
|
#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
static int clkid = -1;
|
static int clkid = -1;
|
||||||
if (clkid == -1) {
|
if (clkid == -1) {
|
||||||
@ -1100,7 +1100,7 @@ default_transaction_id_fn(void)
|
|||||||
trans_id = tb.millitm & 0xffff;
|
trans_id = tb.millitm & 0xffff;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
|
#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
evutil_gettimeofday(&tv, NULL);
|
evutil_gettimeofday(&tv, NULL);
|
||||||
trans_id = tv.tv_usec & 0xffff;
|
trans_id = tv.tv_usec & 0xffff;
|
||||||
@ -2824,7 +2824,7 @@ evdns_resolv_set_defaults(struct evdns_base *base, int flags) {
|
|||||||
if (flags & DNS_OPTION_NAMESERVERS) evdns_base_nameserver_ip_add(base,"127.0.0.1");
|
if (flags & DNS_OPTION_NAMESERVERS) evdns_base_nameserver_ip_add(base,"127.0.0.1");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef HAVE_STRTOK_R
|
#ifndef _EVENT_HAVE_STRTOK_R
|
||||||
static char *
|
static char *
|
||||||
strtok_r(char *s, const char *delim, char **state) {
|
strtok_r(char *s, const char *delim, char **state) {
|
||||||
char *cp, *start;
|
char *cp, *start;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#include "minheap-internal.h"
|
#include "minheap-internal.h"
|
||||||
#include "evsignal-internal.h"
|
#include "evsignal-internal.h"
|
||||||
#include "mm-internal.h"
|
#include "mm-internal.h"
|
||||||
@ -145,7 +145,7 @@ struct event_config {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* Internal use only: Functions that might be missing from <sys/queue.h> */
|
/* Internal use only: Functions that might be missing from <sys/queue.h> */
|
||||||
#ifndef HAVE_TAILQFOREACH
|
#ifndef _EVENT_HAVE_TAILQFOREACH
|
||||||
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
#define TAILQ_FIRST(head) ((head)->tqh_first)
|
||||||
#define TAILQ_END(head) NULL
|
#define TAILQ_END(head) NULL
|
||||||
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
|
||||||
|
52
event.c
52
event.c
@ -25,7 +25,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -36,22 +36,22 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_EVENTFD_H
|
#ifdef _EVENT_HAVE_SYS_EVENTFD_H
|
||||||
#include <sys/eventfd.h>
|
#include <sys/eventfd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@ -71,22 +71,22 @@
|
|||||||
#include "log-internal.h"
|
#include "log-internal.h"
|
||||||
#include "evmap-internal.h"
|
#include "evmap-internal.h"
|
||||||
|
|
||||||
#ifdef HAVE_EVENT_PORTS
|
#ifdef _EVENT_HAVE_EVENT_PORTS
|
||||||
extern const struct eventop evportops;
|
extern const struct eventop evportops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SELECT
|
#ifdef _EVENT_HAVE_SELECT
|
||||||
extern const struct eventop selectops;
|
extern const struct eventop selectops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_POLL
|
#ifdef _EVENT_HAVE_POLL
|
||||||
extern const struct eventop pollops;
|
extern const struct eventop pollops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_EPOLL
|
#ifdef _EVENT_HAVE_EPOLL
|
||||||
extern const struct eventop epollops;
|
extern const struct eventop epollops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WORKING_KQUEUE
|
#ifdef _EVENT_HAVE_WORKING_KQUEUE
|
||||||
extern const struct eventop kqops;
|
extern const struct eventop kqops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DEVPOLL
|
#ifdef _EVENT_HAVE_DEVPOLL
|
||||||
extern const struct eventop devpollops;
|
extern const struct eventop devpollops;
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -95,22 +95,22 @@ extern const struct eventop win32ops;
|
|||||||
|
|
||||||
/* In order of preference */
|
/* In order of preference */
|
||||||
static const struct eventop *eventops[] = {
|
static const struct eventop *eventops[] = {
|
||||||
#ifdef HAVE_EVENT_PORTS
|
#ifdef _EVENT_HAVE_EVENT_PORTS
|
||||||
&evportops,
|
&evportops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_WORKING_KQUEUE
|
#ifdef _EVENT_HAVE_WORKING_KQUEUE
|
||||||
&kqops,
|
&kqops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_EPOLL
|
#ifdef _EVENT_HAVE_EPOLL
|
||||||
&epollops,
|
&epollops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_DEVPOLL
|
#ifdef _EVENT_HAVE_DEVPOLL
|
||||||
&devpollops,
|
&devpollops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_POLL
|
#ifdef _EVENT_HAVE_POLL
|
||||||
&pollops,
|
&pollops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SELECT
|
#ifdef _EVENT_HAVE_SELECT
|
||||||
&selectops,
|
&selectops,
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -152,7 +152,7 @@ static int evthread_notify_base(struct event_base *base);
|
|||||||
static void
|
static void
|
||||||
detect_monotonic(void)
|
detect_monotonic(void)
|
||||||
{
|
{
|
||||||
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
|
#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
|
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
|
||||||
@ -168,7 +168,7 @@ gettime(struct event_base *base, struct timeval *tp)
|
|||||||
return (0);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
|
#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
|
||||||
if (use_monotonic) {
|
if (use_monotonic) {
|
||||||
struct timespec ts;
|
struct timespec ts;
|
||||||
|
|
||||||
@ -1061,7 +1061,7 @@ evthread_notify_base_default(struct event_base *base)
|
|||||||
return (r < 0) ? -1 : 0;
|
return (r < 0) ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H)
|
#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H)
|
||||||
static int
|
static int
|
||||||
evthread_notify_base_eventfd(struct event_base *base)
|
evthread_notify_base_eventfd(struct event_base *base)
|
||||||
{
|
{
|
||||||
@ -1445,7 +1445,7 @@ event_queue_insert(struct event_base *base, struct event *ev, int queue)
|
|||||||
const char *
|
const char *
|
||||||
event_get_version(void)
|
event_get_version(void)
|
||||||
{
|
{
|
||||||
return (VERSION);
|
return (_EVENT_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1535,13 +1535,13 @@ void
|
|||||||
evthread_set_locking_callback(struct event_base *base,
|
evthread_set_locking_callback(struct event_base *base,
|
||||||
void (*locking_fn)(int mode, void *lock))
|
void (*locking_fn)(int mode, void *lock))
|
||||||
{
|
{
|
||||||
#ifdef DISABLE_THREAD_SUPPORT
|
#ifdef _EVENT_DISABLE_THREAD_SUPPORT
|
||||||
event_errx(1, "%s: not compiled with thread support", __func__);
|
event_errx(1, "%s: not compiled with thread support", __func__);
|
||||||
#endif
|
#endif
|
||||||
base->th_lock = locking_fn;
|
base->th_lock = locking_fn;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H)
|
#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H)
|
||||||
static void
|
static void
|
||||||
evthread_notify_drain_eventfd(int fd, short what, void *arg)
|
evthread_notify_drain_eventfd(int fd, short what, void *arg)
|
||||||
{
|
{
|
||||||
@ -1568,7 +1568,7 @@ void
|
|||||||
evthread_set_id_callback(struct event_base *base,
|
evthread_set_id_callback(struct event_base *base,
|
||||||
unsigned long (*id_fn)(void))
|
unsigned long (*id_fn)(void))
|
||||||
{
|
{
|
||||||
#ifdef DISABLE_THREAD_SUPPORT
|
#ifdef _EVENT_DISABLE_THREAD_SUPPORT
|
||||||
event_errx(1, "%s: not compiled with thread support", __func__);
|
event_errx(1, "%s: not compiled with thread support", __func__);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -1598,7 +1598,7 @@ evthread_make_base_notifiable(struct event_base *base)
|
|||||||
if (base->th_notify_fd[0] >= 0)
|
if (base->th_notify_fd[0] >= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
#if defined(HAVE_EVENTFD) && defined(HAVE_SYS_EVENTFD_H)
|
#if defined(_EVENT_HAVE_EVENTFD) && defined(_EVENT_HAVE_SYS_EVENTFD_H)
|
||||||
base->th_notify_fd[0] = eventfd(0, 0);
|
base->th_notify_fd[0] = eventfd(0, 0);
|
||||||
if (base->th_notify_fd[0] >= 0) {
|
if (base->th_notify_fd[0] >= 0) {
|
||||||
notify = evthread_notify_base_eventfd;
|
notify = evthread_notify_base_eventfd;
|
||||||
@ -1648,7 +1648,7 @@ void
|
|||||||
evthread_set_lock_create_callbacks(struct event_base *base,
|
evthread_set_lock_create_callbacks(struct event_base *base,
|
||||||
void *(*alloc_fn)(void), void (*free_fn)(void *))
|
void *(*alloc_fn)(void), void (*free_fn)(void *))
|
||||||
{
|
{
|
||||||
#ifdef DISABLE_THREAD_SUPPORT
|
#ifdef _EVENT_DISABLE_THREAD_SUPPORT
|
||||||
event_errx(1, "%s: not compiled with thread support", __func__);
|
event_errx(1, "%s: not compiled with thread support", __func__);
|
||||||
#endif
|
#endif
|
||||||
base->th_alloc = alloc_fn;
|
base->th_alloc = alloc_fn;
|
||||||
|
@ -26,13 +26,13 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef _EVENT_HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef _EVENT_HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -46,7 +46,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -57,7 +57,7 @@
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
4
evmap.c
4
evmap.c
@ -25,7 +25,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -34,7 +34,7 @@
|
|||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
|
2
evport.c
2
evport.c
@ -51,7 +51,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
4
evrpc.c
4
evrpc.c
@ -25,7 +25,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -39,7 +39,7 @@
|
|||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
@ -39,7 +39,7 @@ struct evsig_info {
|
|||||||
int ev_signal_added;
|
int ev_signal_added;
|
||||||
volatile sig_atomic_t evsig_caught;
|
volatile sig_atomic_t evsig_caught;
|
||||||
sig_atomic_t evsigcaught[NSIG];
|
sig_atomic_t evsigcaught[NSIG];
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
struct sigaction **sh_old;
|
struct sigaction **sh_old;
|
||||||
#else
|
#else
|
||||||
ev_sighandler_t **sh_old;
|
ev_sighandler_t **sh_old;
|
||||||
|
@ -31,10 +31,10 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
|
|
||||||
struct event_base;
|
struct event_base;
|
||||||
#ifndef DISABLE_THREAD_SUPPORT
|
#ifndef _EVENT_DISABLE_THREAD_SUPPORT
|
||||||
#define EVTHREAD_USE_LOCKS(base) \
|
#define EVTHREAD_USE_LOCKS(base) \
|
||||||
(base != NULL && (base)->th_lock != NULL)
|
(base != NULL && (base)->th_lock != NULL)
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ struct event_base;
|
|||||||
(*(base)->th_lock)(EVTHREAD_UNLOCK | mode, \
|
(*(base)->th_lock)(EVTHREAD_UNLOCK | mode, \
|
||||||
(base)->lock); \
|
(base)->lock); \
|
||||||
} while (0)
|
} while (0)
|
||||||
#else /* DISABLE_THREAD_SUPPORT */
|
#else /* _EVENT_DISABLE_THREAD_SUPPORT */
|
||||||
#define EVTHREAD_USE_LOCKS(base)
|
#define EVTHREAD_USE_LOCKS(base)
|
||||||
#define EVTHREAD_IN_THREAD(base) 1
|
#define EVTHREAD_IN_THREAD(base) 1
|
||||||
#define EVTHREAD_GET_ID(base)
|
#define EVTHREAD_GET_ID(base)
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
24
evutil.c
24
evutil.c
@ -25,7 +25,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -37,29 +37,29 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef _EVENT_HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_STDLIB_H
|
#ifdef _EVENT_HAVE_STDLIB_H
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_ARPA_INET_H
|
#ifdef _EVENT_HAVE_ARPA_INET_H
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN_H
|
#ifdef _EVENT_HAVE_NETINET_IN_H
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN6_H
|
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||||
#include <netinet/in6.h>
|
#include <netinet/in6.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -192,9 +192,9 @@ evutil_make_socket_nonblocking(evutil_socket_t fd)
|
|||||||
ev_int64_t
|
ev_int64_t
|
||||||
evutil_strtoll(const char *s, char **endptr, int base)
|
evutil_strtoll(const char *s, char **endptr, int base)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_STRTOLL
|
#ifdef _EVENT_HAVE_STRTOLL
|
||||||
return (ev_int64_t)strtoll(s, endptr, base);
|
return (ev_int64_t)strtoll(s, endptr, base);
|
||||||
#elif SIZEOF_LONG == 8
|
#elif _EVENT_SIZEOF_LONG == 8
|
||||||
return (ev_int64_t)strtol(s, endptr, base);
|
return (ev_int64_t)strtol(s, endptr, base);
|
||||||
#elif defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
|
#elif defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
|
||||||
/* XXXX on old versions of MS APIs, we only support base
|
/* XXXX on old versions of MS APIs, we only support base
|
||||||
@ -639,7 +639,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o
|
|||||||
if (is_ipv6) {
|
if (is_ipv6) {
|
||||||
struct sockaddr_in6 sin6;
|
struct sockaddr_in6 sin6;
|
||||||
memset(&sin6, 0, sizeof(sin6));
|
memset(&sin6, 0, sizeof(sin6));
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
|
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
|
||||||
sin6.sin6_len = sizeof(sin6);
|
sin6.sin6_len = sizeof(sin6);
|
||||||
#endif
|
#endif
|
||||||
sin6.sin6_family = AF_INET6;
|
sin6.sin6_family = AF_INET6;
|
||||||
@ -654,7 +654,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o
|
|||||||
} else {
|
} else {
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
||||||
sin.sin_len = sizeof(sin);
|
sin.sin_len = sizeof(sin);
|
||||||
#endif
|
#endif
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
|
28
http.c
28
http.c
@ -26,18 +26,18 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
#define _REENTRANT
|
#define _REENTRANT
|
||||||
|
|
||||||
#ifdef HAVE_SYS_PARAM_H
|
#ifdef _EVENT_HAVE_SYS_PARAM_H
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_TYPES_H
|
#ifdef _EVENT_HAVE_SYS_TYPES_H
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_IOCCOM_H
|
#ifdef HAVE_SYS_IOCCOM_H
|
||||||
@ -73,10 +73,10 @@
|
|||||||
#endif
|
#endif
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef _EVENT_HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -101,7 +101,7 @@
|
|||||||
#define strncasecmp _strnicmp
|
#define strncasecmp _strnicmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETNAMEINFO
|
#ifndef _EVENT_HAVE_GETNAMEINFO
|
||||||
#define NI_MAXSERV 32
|
#define NI_MAXSERV 32
|
||||||
#define NI_MAXHOST 1025
|
#define NI_MAXHOST 1025
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_GETADDRINFO
|
#ifndef _EVENT_HAVE_GETADDRINFO
|
||||||
struct addrinfo {
|
struct addrinfo {
|
||||||
int ai_family;
|
int ai_family;
|
||||||
int ai_socktype;
|
int ai_socktype;
|
||||||
@ -220,7 +220,7 @@ static void evhttp_error_cb(struct bufferevent *bufev, short what, void *arg);
|
|||||||
static int evhttp_decode_uri_internal(const char *uri, size_t length,
|
static int evhttp_decode_uri_internal(const char *uri, size_t length,
|
||||||
char *ret);
|
char *ret);
|
||||||
|
|
||||||
#ifndef HAVE_STRSEP
|
#ifndef _EVENT_HAVE_STRSEP
|
||||||
/* strsep replacement for platforms that lack it. Only works if
|
/* strsep replacement for platforms that lack it. Only works if
|
||||||
* del is one character long. */
|
* del is one character long. */
|
||||||
static char *
|
static char *
|
||||||
@ -2803,7 +2803,7 @@ evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
|
|||||||
static struct addrinfo *
|
static struct addrinfo *
|
||||||
addr_from_name(char *address)
|
addr_from_name(char *address)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||||
struct addrinfo ai, *aitop;
|
struct addrinfo ai, *aitop;
|
||||||
int ai_result;
|
int ai_result;
|
||||||
|
|
||||||
@ -2834,7 +2834,7 @@ name_from_addr(struct sockaddr *sa, socklen_t salen,
|
|||||||
char strport[NI_MAXSERV];
|
char strport[NI_MAXSERV];
|
||||||
int ni_result;
|
int ni_result;
|
||||||
|
|
||||||
#ifdef HAVE_GETNAMEINFO
|
#ifdef _EVENT_HAVE_GETNAMEINFO
|
||||||
ni_result = getnameinfo(sa, salen,
|
ni_result = getnameinfo(sa, salen,
|
||||||
ntop, sizeof(ntop), strport, sizeof(strport),
|
ntop, sizeof(ntop), strport, sizeof(strport),
|
||||||
NI_NUMERICHOST|NI_NUMERICSERV);
|
NI_NUMERICHOST|NI_NUMERICSERV);
|
||||||
@ -2911,7 +2911,7 @@ make_addrinfo(const char *address, ev_uint16_t port)
|
|||||||
{
|
{
|
||||||
struct addrinfo *aitop = NULL;
|
struct addrinfo *aitop = NULL;
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||||
struct addrinfo ai;
|
struct addrinfo ai;
|
||||||
char strport[NI_MAXSERV];
|
char strport[NI_MAXSERV];
|
||||||
int ai_result;
|
int ai_result;
|
||||||
@ -2961,7 +2961,7 @@ bind_socket(const char *address, ev_uint16_t port, int reuse)
|
|||||||
|
|
||||||
fd = bind_socket_ai(aitop, reuse);
|
fd = bind_socket_ai(aitop, reuse);
|
||||||
|
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||||
freeaddrinfo(aitop);
|
freeaddrinfo(aitop);
|
||||||
#else
|
#else
|
||||||
fake_freeaddrinfo(aitop);
|
fake_freeaddrinfo(aitop);
|
||||||
@ -2992,7 +2992,7 @@ socket_connect(evutil_socket_t fd, const char *address, unsigned short port)
|
|||||||
res = 0;
|
res = 0;
|
||||||
|
|
||||||
out:
|
out:
|
||||||
#ifdef HAVE_GETADDRINFO
|
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||||
freeaddrinfo(ai);
|
freeaddrinfo(ai);
|
||||||
#else
|
#else
|
||||||
fake_freeaddrinfo(ai);
|
fake_freeaddrinfo(ai);
|
||||||
|
8
kqueue.c
8
kqueue.c
@ -27,11 +27,11 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
@ -45,14 +45,14 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#ifdef HAVE_INTTYPES_H
|
#ifdef _EVENT_HAVE_INTTYPES_H
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some platforms apparently define the udata field of struct kevent as
|
/* Some platforms apparently define the udata field of struct kevent as
|
||||||
* intptr_t, whereas others define it as void*. There doesn't seem to be an
|
* intptr_t, whereas others define it as void*. There doesn't seem to be an
|
||||||
* easy way to tell them apart via autoconf, so we need to use OS macros. */
|
* easy way to tell them apart via autoconf, so we need to use OS macros. */
|
||||||
#if defined(HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__)
|
#if defined(_EVENT_HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__)
|
||||||
#define PTR_TO_UDATA(x) ((intptr_t)(x))
|
#define PTR_TO_UDATA(x) ((intptr_t)(x))
|
||||||
#else
|
#else
|
||||||
#define PTR_TO_UDATA(x) (x)
|
#define PTR_TO_UDATA(x) (x)
|
||||||
|
4
log.c
4
log.c
@ -38,7 +38,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -47,7 +47,7 @@
|
|||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
|
4
poll.c
4
poll.c
@ -27,11 +27,11 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
6
select.c
6
select.c
@ -27,16 +27,16 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/_time.h>
|
#include <sys/_time.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYS_SELECT_H
|
#ifdef _EVENT_HAVE_SYS_SELECT_H
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
22
signal.c
22
signal.c
@ -27,7 +27,7 @@
|
|||||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
@ -37,22 +37,22 @@
|
|||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
#endif
|
#endif
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef _EVENT_HAVE_UNISTD_H
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#ifdef HAVE_FCNTL_H
|
#ifdef _EVENT_HAVE_FCNTL_H
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#endif
|
#endif
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
@ -99,7 +99,7 @@ evsig_cb(evutil_socket_t fd, short what, void *arg)
|
|||||||
event_sock_err(1, fd, "%s: read", __func__);
|
event_sock_err(1, fd, "%s: read", __func__);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_SETFD
|
#ifdef _EVENT_HAVE_SETFD
|
||||||
#define FD_CLOSEONEXEC(x) do { \
|
#define FD_CLOSEONEXEC(x) do { \
|
||||||
if (fcntl(x, F_SETFD, 1) == -1) \
|
if (fcntl(x, F_SETFD, 1) == -1) \
|
||||||
event_warn("fcntl(%d, F_SETFD)", x); \
|
event_warn("fcntl(%d, F_SETFD)", x); \
|
||||||
@ -144,7 +144,7 @@ int
|
|||||||
_evsig_set_handler(struct event_base *base,
|
_evsig_set_handler(struct event_base *base,
|
||||||
int evsignal, void (*handler)(int))
|
int evsignal, void (*handler)(int))
|
||||||
{
|
{
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
#else
|
#else
|
||||||
ev_sighandler_t sh;
|
ev_sighandler_t sh;
|
||||||
@ -181,7 +181,7 @@ _evsig_set_handler(struct event_base *base,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* save previous handler and setup new handler */
|
/* save previous handler and setup new handler */
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
memset(&sa, 0, sizeof(sa));
|
memset(&sa, 0, sizeof(sa));
|
||||||
sa.sa_handler = handler;
|
sa.sa_handler = handler;
|
||||||
sa.sa_flags |= SA_RESTART;
|
sa.sa_flags |= SA_RESTART;
|
||||||
@ -233,7 +233,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal)
|
|||||||
{
|
{
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
struct evsig_info *sig = &base->sig;
|
struct evsig_info *sig = &base->sig;
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
struct sigaction *sh;
|
struct sigaction *sh;
|
||||||
#else
|
#else
|
||||||
ev_sighandler_t *sh;
|
ev_sighandler_t *sh;
|
||||||
@ -242,7 +242,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal)
|
|||||||
/* restore previous handler */
|
/* restore previous handler */
|
||||||
sh = sig->sh_old[evsignal];
|
sh = sig->sh_old[evsignal];
|
||||||
sig->sh_old[evsignal] = NULL;
|
sig->sh_old[evsignal] = NULL;
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
if (sigaction(evsignal, sh, NULL) == -1) {
|
if (sigaction(evsignal, sh, NULL) == -1) {
|
||||||
event_warn("sigaction");
|
event_warn("sigaction");
|
||||||
ret = -1;
|
ret = -1;
|
||||||
@ -287,7 +287,7 @@ evsig_handler(int sig)
|
|||||||
evsig_base->sig.evsigcaught[sig]++;
|
evsig_base->sig.evsigcaught[sig]++;
|
||||||
evsig_base->sig.evsig_caught = 1;
|
evsig_base->sig.evsig_caught = 1;
|
||||||
|
|
||||||
#ifndef HAVE_SIGACTION
|
#ifndef _EVENT_HAVE_SIGACTION
|
||||||
signal(sig, evsig_handler);
|
signal(sig, evsig_handler);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -6,10 +6,10 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif /* HAVE_CONFIG_H */
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef _EVENT_HAVE_STRLCPY
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
size_t _event_strlcpy(char *dst, const char *src, size_t siz);
|
size_t _event_strlcpy(char *dst, const char *src, size_t siz);
|
||||||
#define strlcpy _event_strlcpy
|
#define strlcpy _event_strlcpy
|
||||||
|
@ -34,10 +34,10 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif /* HAVE_CONFIG_H */
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
||||||
#ifndef HAVE_STRLCPY
|
#ifndef _EVENT_HAVE_STRLCPY
|
||||||
#include "strlcpy-internal.h"
|
#include "strlcpy-internal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@ -811,13 +811,13 @@ test_signal_restore(void)
|
|||||||
{
|
{
|
||||||
struct event ev;
|
struct event ev;
|
||||||
struct event_base *base = event_init();
|
struct event_base *base = event_init();
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
struct sigaction sa;
|
struct sigaction sa;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
test_ok = 0;
|
test_ok = 0;
|
||||||
printf("Signal handler restore: ");
|
printf("Signal handler restore: ");
|
||||||
#ifdef HAVE_SIGACTION
|
#ifdef _EVENT_HAVE_SIGACTION
|
||||||
sa.sa_handler = signal_cb_sa;
|
sa.sa_handler = signal_cb_sa;
|
||||||
sa.sa_flags = 0x0;
|
sa.sa_flags = 0x0;
|
||||||
sigemptyset(&sa.sa_mask);
|
sigemptyset(&sa.sa_mask);
|
||||||
@ -2375,11 +2375,11 @@ main (int argc, char **argv)
|
|||||||
|
|
||||||
test_event_base_new();
|
test_event_base_new();
|
||||||
|
|
||||||
#if defined(HAVE_PTHREADS) && !defined(DISABLE_THREAD_SUPPORT)
|
#if defined(_EVENT_HAVE_PTHREADS) && !defined(_EVENT_DISABLE_THREAD_SUPPORT)
|
||||||
regress_pthread();
|
regress_pthread();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_LIBZ)
|
#if defined(_EVENT_HAVE_LIBZ)
|
||||||
regress_zlib();
|
regress_zlib();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
@ -47,7 +47,7 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN6_H
|
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||||
#include <netinet/in6.h>
|
#include <netinet/in6.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETDB_H
|
#ifdef HAVE_NETDB_H
|
||||||
@ -90,7 +90,7 @@ dns_gethostbyname_cb(int result, char type, int count, int ttl,
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DNS_IPv6_AAAA: {
|
case DNS_IPv6_AAAA: {
|
||||||
#if defined(HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
#if defined(_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
||||||
struct in6_addr *in6_addrs = addresses;
|
struct in6_addr *in6_addrs = addresses;
|
||||||
char buf[INET6_ADDRSTRLEN+1];
|
char buf[INET6_ADDRSTRLEN+1];
|
||||||
int i;
|
int i;
|
||||||
@ -297,7 +297,7 @@ dns_server_gethostbyname_cb(int result, char type, int count, int ttl,
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case DNS_IPv6_AAAA: {
|
case DNS_IPv6_AAAA: {
|
||||||
#if defined (HAVE_STRUCT_IN6_ADDR) && defined(HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
#if defined (_EVENT_HAVE_STRUCT_IN6_ADDR) && defined(_EVENT_HAVE_INET_NTOP) && defined(INET6_ADDRSTRLEN)
|
||||||
struct in6_addr *in6_addrs = addresses;
|
struct in6_addr *in6_addrs = addresses;
|
||||||
char buf[INET6_ADDRSTRLEN+1];
|
char buf[INET6_ADDRSTRLEN+1];
|
||||||
if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
|
if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -31,12 +31,12 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#ifdef HAVE_SYS_TIME_H
|
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#endif
|
#endif
|
||||||
#include <sys/queue.h>
|
#include <sys/queue.h>
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
#ifndef WIN32
|
#ifndef WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
@ -40,7 +40,7 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_NETINET_IN6_H
|
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||||
#include <netinet/in6.h>
|
#include <netinet/in6.h>
|
||||||
#endif
|
#endif
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -261,7 +261,7 @@ regress_sockaddr_port_parse(void)
|
|||||||
if (ent->sa_family == AF_INET) {
|
if (ent->sa_family == AF_INET) {
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin;
|
||||||
memset(&sin, 0, sizeof(sin));
|
memset(&sin, 0, sizeof(sin));
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN_SIN_LEN
|
||||||
sin.sin_len = sizeof(sin);
|
sin.sin_len = sizeof(sin);
|
||||||
#endif
|
#endif
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
@ -277,7 +277,7 @@ regress_sockaddr_port_parse(void)
|
|||||||
} else {
|
} else {
|
||||||
struct sockaddr_in6 sin6;
|
struct sockaddr_in6 sin6;
|
||||||
memset(&sin6, 0, sizeof(sin6));
|
memset(&sin6, 0, sizeof(sin6));
|
||||||
#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
|
#ifdef _EVENT_HAVE_STRUCT_SOCKADDR_IN6_SIN6_LEN
|
||||||
sin6.sin6_len = sizeof(sin6);
|
sin6.sin6_len = sizeof(sin6);
|
||||||
#endif
|
#endif
|
||||||
sin6.sin6_family = AF_INET6;
|
sin6.sin6_family = AF_INET6;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -3,14 +3,14 @@
|
|||||||
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "event-config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -13,7 +13,7 @@
|
|||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#ifdef HAVE_SYS_SOCKET_H
|
#ifdef _EVENT_HAVE_SYS_SOCKET_H
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user