*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#include <windows.h>
#endif
-#ifdef HAVE_VASPRINTF
+#ifdef _EVENT_HAVE_VASPRINTF
/* If we have vasprintf, we need to define this before we include stdio.h. */
#define _GNU_SOURCE
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef HAVE_SYS_UIO_H
+#ifdef _EVENT_HAVE_SYS_UIO_H
#include <sys/uio.h>
#endif
-#ifdef HAVE_SYS_IOCTL_H
+#ifdef _EVENT_HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
#endif
-#ifdef HAVE_SYS_MMAN_H
+#ifdef _EVENT_HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
-#ifdef HAVE_SYS_SENDFILE_H
+#ifdef _EVENT_HAVE_SYS_SENDFILE_H
#include <sys/sendfile.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_STDARG_H
+#ifdef _EVENT_HAVE_STDARG_H
#include <stdarg.h>
#endif
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
#include "event2/event.h"
#include "event2/buffer.h"
#include "event2/buffer_compat.h"
-#include "config.h"
+#include "event-config.h"
#include "log-internal.h"
#include "mm-internal.h"
#include "util-internal.h"
#endif
/* 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 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 SENDFILE_IS_FREEBSD 1
#endif
#ifdef USE_SENDFILE
static int use_sendfile = 1;
#endif
-#ifdef HAVE_MMAP
+#ifdef _EVENT_HAVE_MMAP
static int use_mmap = 1;
#endif
if (info->cleanupfn)
(*info->cleanupfn)(info->extra);
}
-#ifdef HAVE_MMAP
+#ifdef _EVENT_HAVE_MMAP
if (chain->flags & EVBUFFER_MMAP) {
struct evbuffer_chain_fd *info =
EVBUFFER_CHAIN_EXTRA(struct evbuffer_chain_fd,
* 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
#endif
#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
* how much we end up writing */
#define NUM_IOVEC 128
{
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_fd *info;
#endif
evbuffer_chain_insert(outbuf, chain);
} else
#endif
-#if defined(HAVE_MMAP)
+#if defined(_EVENT_HAVE_MMAP)
if (use_mmap) {
void *mapped = mmap(NULL, length + offset, PROT_READ,
#ifdef MAP_NOCACHE
extern "C" {
#endif
-#include "config.h"
+#include "event-config.h"
#include "evutil.h"
struct bufferevent_filter {
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_STDARG_H
+#ifdef _EVENT_HAVE_STDARG_H
#include <stdarg.h>
#endif
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/resource.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <stdint.h>
#include <sys/types.h>
#include <sys/resource.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#ifdef HAVE_FCNTL_H
+#ifdef _EVENT_HAVE_FCNTL_H
#include <fcntl.h>
#endif
0
};
-#ifdef HAVE_SETFD
+#ifdef _EVENT_HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
event_warn("fcntl(%d, F_SETFD)", x); \
extern "C" {
#endif
-#include "config.h"
+#include "event-config.h"
#include "evutil.h"
#include <sys/queue.h>
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef DNS_USE_FTIME_FOR_ID
#include <sys/timeb.h>
#endif
-#ifndef DNS_USE_CPU_CLOCK_FOR_ID
-#ifndef DNS_USE_GETTIMEOFDAY_FOR_ID
+#ifndef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
+#ifndef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
#ifndef DNS_USE_OPENSSL_FOR_ID
#ifndef DNS_USE_FTIME_FOR_ID
#error Must configure at least one id generation method.
/* for strtok_r */
#define _REENTRANT
-#ifdef DNS_USE_CPU_CLOCK_FOR_ID
+#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
#ifdef DNS_USE_OPENSSL_FOR_ID
#error Multiple id options selected
#endif
-#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
+#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
#error Multiple id options selected
#endif
#include <time.h>
#endif
#ifdef DNS_USE_OPENSSL_FOR_ID
-#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
+#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
#error Multiple id options selected
#endif
#include <openssl/rand.h>
#include <string.h>
#include <fcntl.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
-#ifdef HAVE_STDINT_H
+#ifdef _EVENT_HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <limits.h>
#include <arpa/inet.h>
#endif
-#ifdef HAVE_NETINET_IN6_H
+#ifdef _EVENT_HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
default_transaction_id_fn(void)
{
u16 trans_id;
-#ifdef DNS_USE_CPU_CLOCK_FOR_ID
+#ifdef _EVENT_DNS_USE_CPU_CLOCK_FOR_ID
struct timespec ts;
static int clkid = -1;
if (clkid == -1) {
trans_id = tb.millitm & 0xffff;
#endif
-#ifdef DNS_USE_GETTIMEOFDAY_FOR_ID
+#ifdef _EVENT_DNS_USE_GETTIMEOFDAY_FOR_ID
struct timeval tv;
evutil_gettimeofday(&tv, NULL);
trans_id = tv.tv_usec & 0xffff;
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 *
strtok_r(char *s, const char *delim, char **state) {
char *cp, *start;
extern "C" {
#endif
-#include "config.h"
+#include "event-config.h"
#include "minheap-internal.h"
#include "evsignal-internal.h"
#include "mm-internal.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_END(head) NULL
#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#endif
#include <sys/types.h>
#ifndef WIN32
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
#endif
#endif
#include <sys/queue.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <stdio.h>
#include <stdlib.h>
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_SYS_EVENTFD_H
+#ifdef _EVENT_HAVE_SYS_EVENTFD_H
#include <sys/eventfd.h>
#endif
#include <ctype.h>
#include "log-internal.h"
#include "evmap-internal.h"
-#ifdef HAVE_EVENT_PORTS
+#ifdef _EVENT_HAVE_EVENT_PORTS
extern const struct eventop evportops;
#endif
-#ifdef HAVE_SELECT
+#ifdef _EVENT_HAVE_SELECT
extern const struct eventop selectops;
#endif
-#ifdef HAVE_POLL
+#ifdef _EVENT_HAVE_POLL
extern const struct eventop pollops;
#endif
-#ifdef HAVE_EPOLL
+#ifdef _EVENT_HAVE_EPOLL
extern const struct eventop epollops;
#endif
-#ifdef HAVE_WORKING_KQUEUE
+#ifdef _EVENT_HAVE_WORKING_KQUEUE
extern const struct eventop kqops;
#endif
-#ifdef HAVE_DEVPOLL
+#ifdef _EVENT_HAVE_DEVPOLL
extern const struct eventop devpollops;
#endif
#ifdef WIN32
/* In order of preference */
static const struct eventop *eventops[] = {
-#ifdef HAVE_EVENT_PORTS
+#ifdef _EVENT_HAVE_EVENT_PORTS
&evportops,
#endif
-#ifdef HAVE_WORKING_KQUEUE
+#ifdef _EVENT_HAVE_WORKING_KQUEUE
&kqops,
#endif
-#ifdef HAVE_EPOLL
+#ifdef _EVENT_HAVE_EPOLL
&epollops,
#endif
-#ifdef HAVE_DEVPOLL
+#ifdef _EVENT_HAVE_DEVPOLL
&devpollops,
#endif
-#ifdef HAVE_POLL
+#ifdef _EVENT_HAVE_POLL
&pollops,
#endif
-#ifdef HAVE_SELECT
+#ifdef _EVENT_HAVE_SELECT
&selectops,
#endif
#ifdef WIN32
static void
detect_monotonic(void)
{
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
struct timespec ts;
if (clock_gettime(CLOCK_MONOTONIC, &ts) == 0)
return (0);
}
-#if defined(HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
+#if defined(_EVENT_HAVE_CLOCK_GETTIME) && defined(CLOCK_MONOTONIC)
if (use_monotonic) {
struct timespec ts;
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
evthread_notify_base_eventfd(struct event_base *base)
{
const char *
event_get_version(void)
{
- return (VERSION);
+ return (_EVENT_VERSION);
}
/*
evthread_set_locking_callback(struct event_base *base,
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__);
#endif
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
evthread_notify_drain_eventfd(int fd, short what, void *arg)
{
evthread_set_id_callback(struct event_base *base,
unsigned long (*id_fn)(void))
{
-#ifdef DISABLE_THREAD_SUPPORT
+#ifdef _EVENT_DISABLE_THREAD_SUPPORT
event_errx(1, "%s: not compiled with thread support", __func__);
#endif
#ifdef WIN32
if (base->th_notify_fd[0] >= 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);
if (base->th_notify_fd[0] >= 0) {
notify = evthread_notify_base_eventfd;
evthread_set_lock_create_callbacks(struct event_base *base,
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__);
#endif
base->th_alloc = alloc_fn;
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
-#ifdef HAVE_SYS_TYPES_H
+#ifdef _EVENT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_PARAM_H
+#ifdef _EVENT_HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
#endif
#include <sys/queue.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifndef WIN32
#include <syslog.h>
#endif
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#undef WIN32_LEAN_AND_MEAN
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/time.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#ifndef WIN32
#include <sys/socket.h>
#endif
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
int ev_signal_added;
volatile sig_atomic_t evsig_caught;
sig_atomic_t evsigcaught[NSIG];
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
struct sigaction **sh_old;
#else
ev_sighandler_t **sh_old;
extern "C" {
#endif
-#include "config.h"
+#include "event-config.h"
struct event_base;
-#ifndef DISABLE_THREAD_SUPPORT
+#ifndef _EVENT_DISABLE_THREAD_SUPPORT
#define EVTHREAD_USE_LOCKS(base) \
(base != NULL && (base)->th_lock != NULL)
(*(base)->th_lock)(EVTHREAD_UNLOCK | mode, \
(base)->lock); \
} while (0)
-#else /* DISABLE_THREAD_SUPPORT */
+#else /* _EVENT_DISABLE_THREAD_SUPPORT */
#define EVTHREAD_USE_LOCKS(base)
#define EVTHREAD_IN_THREAD(base) 1
#define EVTHREAD_GET_ID(base)
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <pthread.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_FCNTL_H
+#ifdef _EVENT_HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#ifdef HAVE_STDLIB_H
+#ifdef _EVENT_HAVE_STDLIB_H
#include <stdlib.h>
#endif
#include <errno.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
-#ifdef HAVE_ARPA_INET_H
+#ifdef _EVENT_HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
-#ifdef HAVE_NETINET_IN_H
+#ifdef _EVENT_HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
-#ifdef HAVE_NETINET_IN6_H
+#ifdef _EVENT_HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
ev_int64_t
evutil_strtoll(const char *s, char **endptr, int base)
{
-#ifdef HAVE_STRTOLL
+#ifdef _EVENT_HAVE_STRTOLL
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);
#elif defined(WIN32) && defined(_MSC_VER) && _MSC_VER < 1300
/* XXXX on old versions of MS APIs, we only support base
if (is_ipv6) {
struct sockaddr_in6 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);
#endif
sin6.sin6_family = AF_INET6;
} else {
struct sockaddr_in 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);
#endif
sin.sin_family = AF_INET;
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#define _REENTRANT
-#ifdef HAVE_SYS_PARAM_H
+#ifdef _EVENT_HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#ifdef HAVE_SYS_TYPES_H
+#ifdef _EVENT_HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#ifdef HAVE_SYS_IOCCOM_H
#endif
#include <signal.h>
#include <time.h>
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_FCNTL_H
+#ifdef _EVENT_HAVE_FCNTL_H
#include <fcntl.h>
#endif
#define strncasecmp _strnicmp
#endif
-#ifndef HAVE_GETNAMEINFO
+#ifndef _EVENT_HAVE_GETNAMEINFO
#define NI_MAXSERV 32
#define NI_MAXHOST 1025
#endif
-#ifndef HAVE_GETADDRINFO
+#ifndef _EVENT_HAVE_GETADDRINFO
struct addrinfo {
int ai_family;
int ai_socktype;
static int evhttp_decode_uri_internal(const char *uri, size_t length,
char *ret);
-#ifndef HAVE_STRSEP
+#ifndef _EVENT_HAVE_STRSEP
/* strsep replacement for platforms that lack it. Only works if
* del is one character long. */
static char *
static struct addrinfo *
addr_from_name(char *address)
{
-#ifdef HAVE_GETADDRINFO
+#ifdef _EVENT_HAVE_GETADDRINFO
struct addrinfo ai, *aitop;
int ai_result;
char strport[NI_MAXSERV];
int ni_result;
-#ifdef HAVE_GETNAMEINFO
+#ifdef _EVENT_HAVE_GETNAMEINFO
ni_result = getnameinfo(sa, salen,
ntop, sizeof(ntop), strport, sizeof(strport),
NI_NUMERICHOST|NI_NUMERICSERV);
{
struct addrinfo *aitop = NULL;
-#ifdef HAVE_GETADDRINFO
+#ifdef _EVENT_HAVE_GETADDRINFO
struct addrinfo ai;
char strport[NI_MAXSERV];
int ai_result;
fd = bind_socket_ai(aitop, reuse);
-#ifdef HAVE_GETADDRINFO
+#ifdef _EVENT_HAVE_GETADDRINFO
freeaddrinfo(aitop);
#else
fake_freeaddrinfo(aitop);
res = 0;
out:
-#ifdef HAVE_GETADDRINFO
+#ifdef _EVENT_HAVE_GETADDRINFO
freeaddrinfo(ai);
#else
fake_freeaddrinfo(ai);
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
#include <unistd.h>
#include <errno.h>
#include <assert.h>
-#ifdef HAVE_INTTYPES_H
+#ifdef _EVENT_HAVE_INTTYPES_H
#include <inttypes.h>
#endif
/* 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
* 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))
#else
#define PTR_TO_UDATA(x) (x)
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#undef WIN32_LEAN_AND_MEAN
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/stat.h>
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/stat.h>
#include <unistd.h>
#endif
#include <time.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <fcntl.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#else
#include <sys/_time.h>
#endif
-#ifdef HAVE_SYS_SELECT_H
+#ifdef _EVENT_HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#include <sys/queue.h>
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifdef WIN32
#undef WIN32_LEAN_AND_MEAN
#endif
#include <sys/types.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
+#ifdef _EVENT_HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <errno.h>
-#ifdef HAVE_FCNTL_H
+#ifdef _EVENT_HAVE_FCNTL_H
#include <fcntl.h>
#endif
#include <assert.h>
event_sock_err(1, fd, "%s: read", __func__);
}
-#ifdef HAVE_SETFD
+#ifdef _EVENT_HAVE_SETFD
#define FD_CLOSEONEXEC(x) do { \
if (fcntl(x, F_SETFD, 1) == -1) \
event_warn("fcntl(%d, F_SETFD)", x); \
_evsig_set_handler(struct event_base *base,
int evsignal, void (*handler)(int))
{
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
struct sigaction sa;
#else
ev_sighandler_t sh;
}
/* save previous handler and setup new handler */
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
memset(&sa, 0, sizeof(sa));
sa.sa_handler = handler;
sa.sa_flags |= SA_RESTART;
{
int ret = 0;
struct evsig_info *sig = &base->sig;
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
struct sigaction *sh;
#else
ev_sighandler_t *sh;
/* restore previous handler */
sh = sig->sh_old[evsignal];
sig->sh_old[evsignal] = NULL;
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
if (sigaction(evsignal, sh, NULL) == -1) {
event_warn("sigaction");
ret = -1;
evsig_base->sig.evsigcaught[sig]++;
evsig_base->sig.evsig_caught = 1;
-#ifndef HAVE_SIGACTION
+#ifndef _EVENT_HAVE_SIGACTION
signal(sig, evsig_handler);
#endif
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif /* HAVE_CONFIG_H */
-#ifndef HAVE_STRLCPY
+#ifndef _EVENT_HAVE_STRLCPY
#include <string.h>
size_t _event_strlcpy(char *dst, const char *src, size_t siz);
#define strlcpy _event_strlcpy
#include <sys/types.h>
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif /* HAVE_CONFIG_H */
-#ifndef HAVE_STRLCPY
+#ifndef _EVENT_HAVE_STRLCPY
#include "strlcpy-internal.h"
/*
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
{
struct event ev;
struct event_base *base = event_init();
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
struct sigaction sa;
#endif
test_ok = 0;
printf("Signal handler restore: ");
-#ifdef HAVE_SIGACTION
+#ifdef _EVENT_HAVE_SIGACTION
sa.sa_handler = signal_cb_sa;
sa.sa_flags = 0x0;
sigemptyset(&sa.sa_mask);
test_event_base_new();
-#if defined(HAVE_PTHREADS) && !defined(DISABLE_THREAD_SUPPORT)
+#if defined(_EVENT_HAVE_PTHREADS) && !defined(_EVENT_DISABLE_THREAD_SUPPORT)
regress_pthread();
#endif
-#if defined(HAVE_LIBZ)
+#if defined(_EVENT_HAVE_LIBZ)
regress_zlib();
#endif
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
-#ifdef HAVE_NETINET_IN6_H
+#ifdef _EVENT_HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
#ifdef HAVE_NETDB_H
switch (type) {
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;
char buf[INET6_ADDRSTRLEN+1];
int i;
break;
}
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;
char buf[INET6_ADDRSTRLEN+1];
if (memcmp(&in6_addrs[0].s6_addr, "abcdefghijklmnop", 16)
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
-#ifdef HAVE_SYS_TIME_H
+#ifdef _EVENT_HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#include <sys/queue.h>
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#ifndef WIN32
#include <sys/socket.h>
#include <arpa/inet.h>
#include <unistd.h>
#endif
-#ifdef HAVE_NETINET_IN6_H
+#ifdef _EVENT_HAVE_NETINET_IN6_H
#include <netinet/in6.h>
#endif
#include <stdio.h>
if (ent->sa_family == AF_INET) {
struct sockaddr_in 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);
#endif
sin.sin_family = AF_INET;
} else {
struct sockaddr_in6 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);
#endif
sin6.sin6_family = AF_INET6;
#endif
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <fcntl.h>
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <fcntl.h>
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
* cc -I/usr/local/include -o time-test time-test.c -L/usr/local/lib -levent
*/
#ifdef HAVE_CONFIG_H
-#include "config.h"
+#include "event-config.h"
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
-#ifdef HAVE_SYS_SOCKET_H
+#ifdef _EVENT_HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#include <fcntl.h>