mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +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
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@ -34,34 +34,34 @@
|
||||
#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
|
||||
|
||||
@ -70,17 +70,17 @@
|
||||
#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"
|
||||
@ -92,10 +92,10 @@
|
||||
#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
|
||||
@ -103,7 +103,7 @@
|
||||
#ifdef USE_SENDFILE
|
||||
static int use_sendfile = 1;
|
||||
#endif
|
||||
#ifdef HAVE_MMAP
|
||||
#ifdef _EVENT_HAVE_MMAP
|
||||
static int use_mmap = 1;
|
||||
#endif
|
||||
|
||||
@ -154,7 +154,7 @@ evbuffer_chain_free(struct evbuffer_chain *chain)
|
||||
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,
|
||||
@ -1034,13 +1034,13 @@ _evbuffer_expand_fast(struct evbuffer *buf, size_t datlen)
|
||||
* 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
|
||||
@ -1428,7 +1428,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd,
|
||||
{
|
||||
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
|
||||
@ -1453,7 +1453,7 @@ evbuffer_add_file(struct evbuffer *outbuf, int fd,
|
||||
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
|
||||
|
@ -31,7 +31,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#include "evutil.h"
|
||||
|
||||
struct bufferevent_filter {
|
||||
|
@ -28,10 +28,10 @@
|
||||
#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>
|
||||
@ -40,7 +40,7 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#ifdef HAVE_STDARG_H
|
||||
#ifdef _EVENT_HAVE_STDARG_H
|
||||
#include <stdarg.h>
|
||||
#endif
|
||||
|
||||
|
@ -25,12 +25,12 @@
|
||||
* 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>
|
||||
|
8
epoll.c
8
epoll.c
@ -25,13 +25,13 @@
|
||||
* 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>
|
||||
@ -44,7 +44,7 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#ifdef _EVENT_HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
||||
@ -77,7 +77,7 @@ const struct eventop epollops = {
|
||||
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); \
|
||||
|
@ -31,7 +31,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#include "evutil.h"
|
||||
|
||||
#include <sys/queue.h>
|
||||
|
26
evdns.c
26
evdns.c
@ -36,15 +36,15 @@
|
||||
|
||||
#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.
|
||||
@ -59,18 +59,18 @@
|
||||
/* 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>
|
||||
@ -80,17 +80,17 @@
|
||||
|
||||
#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>
|
||||
@ -118,7 +118,7 @@
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_NETINET_IN6_H
|
||||
#ifdef _EVENT_HAVE_NETINET_IN6_H
|
||||
#include <netinet/in6.h>
|
||||
#endif
|
||||
|
||||
@ -1079,7 +1079,7 @@ static u16
|
||||
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) {
|
||||
@ -1100,7 +1100,7 @@ default_transaction_id_fn(void)
|
||||
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;
|
||||
@ -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");
|
||||
}
|
||||
|
||||
#ifndef HAVE_STRTOK_R
|
||||
#ifndef _EVENT_HAVE_STRTOK_R
|
||||
static char *
|
||||
strtok_r(char *s, const char *delim, char **state) {
|
||||
char *cp, *start;
|
||||
|
@ -31,7 +31,7 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#include "minheap-internal.h"
|
||||
#include "evsignal-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> */
|
||||
#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)
|
||||
|
52
event.c
52
event.c
@ -25,7 +25,7 @@
|
||||
* 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
|
||||
@ -36,22 +36,22 @@
|
||||
#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>
|
||||
@ -71,22 +71,22 @@
|
||||
#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
|
||||
@ -95,22 +95,22 @@ extern const struct eventop win32ops;
|
||||
|
||||
/* 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
|
||||
@ -152,7 +152,7 @@ static int evthread_notify_base(struct event_base *base);
|
||||
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)
|
||||
@ -168,7 +168,7 @@ gettime(struct event_base *base, struct timeval *tp)
|
||||
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;
|
||||
|
||||
@ -1061,7 +1061,7 @@ evthread_notify_base_default(struct event_base *base)
|
||||
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)
|
||||
{
|
||||
@ -1445,7 +1445,7 @@ event_queue_insert(struct event_base *base, struct event *ev, int queue)
|
||||
const char *
|
||||
event_get_version(void)
|
||||
{
|
||||
return (VERSION);
|
||||
return (_EVENT_VERSION);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -1535,13 +1535,13 @@ void
|
||||
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)
|
||||
{
|
||||
@ -1568,7 +1568,7 @@ void
|
||||
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
|
||||
@ -1598,7 +1598,7 @@ evthread_make_base_notifiable(struct event_base *base)
|
||||
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;
|
||||
@ -1648,7 +1648,7 @@ void
|
||||
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;
|
||||
|
@ -26,13 +26,13 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
#include <sys/queue.h>
|
||||
#ifdef HAVE_SYS_TIME_H
|
||||
#ifdef _EVENT_HAVE_SYS_TIME_H
|
||||
#include <sys/time.h>
|
||||
#endif
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
#ifndef WIN32
|
||||
#include <syslog.h>
|
||||
#endif
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#ifdef _EVENT_HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
4
evmap.c
4
evmap.c
@ -25,7 +25,7 @@
|
||||
* 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
|
||||
@ -34,7 +34,7 @@
|
||||
#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>
|
||||
|
2
evport.c
2
evport.c
@ -51,7 +51,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#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.
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@ -39,7 +39,7 @@
|
||||
#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>
|
||||
|
@ -39,7 +39,7 @@ struct evsig_info {
|
||||
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;
|
||||
|
@ -31,10 +31,10 @@
|
||||
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)
|
||||
|
||||
@ -56,7 +56,7 @@ struct event_base;
|
||||
(*(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)
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <pthread.h>
|
||||
|
@ -1,5 +1,5 @@
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
|
24
evutil.c
24
evutil.c
@ -25,7 +25,7 @@
|
||||
* 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
|
||||
@ -37,29 +37,29 @@
|
||||
#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
|
||||
|
||||
@ -192,9 +192,9 @@ evutil_make_socket_nonblocking(evutil_socket_t fd)
|
||||
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
|
||||
@ -639,7 +639,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o
|
||||
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;
|
||||
@ -654,7 +654,7 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int o
|
||||
} 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;
|
||||
|
28
http.c
28
http.c
@ -26,18 +26,18 @@
|
||||
*/
|
||||
|
||||
#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
|
||||
@ -73,10 +73,10 @@
|
||||
#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
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
#define strncasecmp _strnicmp
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GETNAMEINFO
|
||||
#ifndef _EVENT_HAVE_GETNAMEINFO
|
||||
#define NI_MAXSERV 32
|
||||
#define NI_MAXHOST 1025
|
||||
|
||||
@ -147,7 +147,7 @@ fake_getnameinfo(const struct sockaddr *sa, size_t salen, char *host,
|
||||
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
#ifndef _EVENT_HAVE_GETADDRINFO
|
||||
struct addrinfo {
|
||||
int ai_family;
|
||||
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,
|
||||
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 *
|
||||
@ -2803,7 +2803,7 @@ evhttp_get_request(struct evhttp *http, evutil_socket_t fd,
|
||||
static struct addrinfo *
|
||||
addr_from_name(char *address)
|
||||
{
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||
struct addrinfo ai, *aitop;
|
||||
int ai_result;
|
||||
|
||||
@ -2834,7 +2834,7 @@ name_from_addr(struct sockaddr *sa, socklen_t salen,
|
||||
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);
|
||||
@ -2911,7 +2911,7 @@ make_addrinfo(const char *address, ev_uint16_t port)
|
||||
{
|
||||
struct addrinfo *aitop = NULL;
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||
struct addrinfo ai;
|
||||
char strport[NI_MAXSERV];
|
||||
int ai_result;
|
||||
@ -2961,7 +2961,7 @@ bind_socket(const char *address, ev_uint16_t port, int reuse)
|
||||
|
||||
fd = bind_socket_ai(aitop, reuse);
|
||||
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||
freeaddrinfo(aitop);
|
||||
#else
|
||||
fake_freeaddrinfo(aitop);
|
||||
@ -2992,7 +2992,7 @@ socket_connect(evutil_socket_t fd, const char *address, unsigned short port)
|
||||
res = 0;
|
||||
|
||||
out:
|
||||
#ifdef HAVE_GETADDRINFO
|
||||
#ifdef _EVENT_HAVE_GETADDRINFO
|
||||
freeaddrinfo(ai);
|
||||
#else
|
||||
fake_freeaddrinfo(ai);
|
||||
|
8
kqueue.c
8
kqueue.c
@ -27,11 +27,11 @@
|
||||
* 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>
|
||||
@ -45,14 +45,14 @@
|
||||
#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)
|
||||
|
4
log.c
4
log.c
@ -38,7 +38,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
@ -47,7 +47,7 @@
|
||||
#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>
|
||||
|
4
poll.c
4
poll.c
@ -27,11 +27,11 @@
|
||||
* 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>
|
||||
|
@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -7,7 +7,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/stat.h>
|
||||
@ -15,7 +15,7 @@
|
||||
#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>
|
||||
|
6
select.c
6
select.c
@ -27,16 +27,16 @@
|
||||
* 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>
|
||||
|
22
signal.c
22
signal.c
@ -27,7 +27,7 @@
|
||||
* 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
|
||||
@ -37,22 +37,22 @@
|
||||
#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>
|
||||
@ -99,7 +99,7 @@ evsig_cb(evutil_socket_t fd, short what, void *arg)
|
||||
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); \
|
||||
@ -144,7 +144,7 @@ int
|
||||
_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;
|
||||
@ -181,7 +181,7 @@ _evsig_set_handler(struct event_base *base,
|
||||
}
|
||||
|
||||
/* 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;
|
||||
@ -233,7 +233,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal)
|
||||
{
|
||||
int ret = 0;
|
||||
struct evsig_info *sig = &base->sig;
|
||||
#ifdef HAVE_SIGACTION
|
||||
#ifdef _EVENT_HAVE_SIGACTION
|
||||
struct sigaction *sh;
|
||||
#else
|
||||
ev_sighandler_t *sh;
|
||||
@ -242,7 +242,7 @@ _evsig_restore_handler(struct event_base *base, int evsignal)
|
||||
/* 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;
|
||||
@ -287,7 +287,7 @@ evsig_handler(int sig)
|
||||
evsig_base->sig.evsigcaught[sig]++;
|
||||
evsig_base->sig.evsig_caught = 1;
|
||||
|
||||
#ifndef HAVE_SIGACTION
|
||||
#ifndef _EVENT_HAVE_SIGACTION
|
||||
signal(sig, evsig_handler);
|
||||
#endif
|
||||
|
||||
|
@ -6,10 +6,10 @@ extern "C" {
|
||||
#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
|
||||
|
@ -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>
|
||||
|
||||
#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"
|
||||
|
||||
/*
|
||||
|
@ -34,7 +34,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -31,12 +31,12 @@
|
||||
#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>
|
||||
@ -811,13 +811,13 @@ test_signal_restore(void)
|
||||
{
|
||||
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);
|
||||
@ -2375,11 +2375,11 @@ main (int argc, char **argv)
|
||||
|
||||
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
|
||||
|
||||
|
@ -31,12 +31,12 @@
|
||||
#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>
|
||||
@ -47,7 +47,7 @@
|
||||
#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
|
||||
@ -90,7 +90,7 @@ dns_gethostbyname_cb(int result, char type, int count, int ttl,
|
||||
|
||||
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;
|
||||
@ -297,7 +297,7 @@ dns_server_gethostbyname_cb(int result, char type, int count, int ttl,
|
||||
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)
|
||||
|
@ -31,12 +31,12 @@
|
||||
#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>
|
||||
|
@ -26,7 +26,7 @@
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -31,12 +31,12 @@
|
||||
#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>
|
||||
|
@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
#ifndef WIN32
|
||||
#include <sys/socket.h>
|
||||
@ -40,7 +40,7 @@
|
||||
#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>
|
||||
@ -261,7 +261,7 @@ regress_sockaddr_port_parse(void)
|
||||
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;
|
||||
@ -277,7 +277,7 @@ regress_sockaddr_port_parse(void)
|
||||
} 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;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#include "event-config.h"
|
||||
#endif
|
||||
|
||||
#include <sys/types.h>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* 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
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#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>
|
||||
|
@ -3,14 +3,14 @@
|
||||
* 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>
|
||||
|
@ -3,7 +3,7 @@
|
||||
* 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
|
||||
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* 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
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@
|
||||
#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>
|
||||
|
Loading…
x
Reference in New Issue
Block a user