require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&EVENT2_EVENT_H_INCLUDED_)) {
    eval 'sub EVENT2_EVENT_H_INCLUDED_ () {1;}' unless defined(&EVENT2_EVENT_H_INCLUDED_);
    require 'event2/visibility.ph';
    if(defined(&__cplusplus)) {
    }
    require 'event2/event-config.ph';
    if(defined(&EVENT__HAVE_SYS_TYPES_H)) {
	require 'sys/types.ph';
    }
    if(defined(&EVENT__HAVE_SYS_TIME_H)) {
	require 'sys/time.ph';
    }
    require 'stdio.ph';
    require 'event2/util.ph';
    if(defined(&EVENT_IN_DOXYGEN_)) {
    }
    if(defined(&EVENT_IN_DOXYGEN_)) {
    }
    if(defined(&EVENT_IN_DOXYGEN_)) {
    }
    eval 'sub EVENT_BASE_COUNT_ACTIVE () {1;}' unless defined(&EVENT_BASE_COUNT_ACTIVE);
    eval 'sub EVENT_BASE_COUNT_VIRTUAL () {2;}' unless defined(&EVENT_BASE_COUNT_VIRTUAL);
    eval 'sub EVENT_BASE_COUNT_ADDED () {4;}' unless defined(&EVENT_BASE_COUNT_ADDED);
    eval("sub EV_FEATURE_ET () { 0x01; }") unless defined(&EV_FEATURE_ET);
    eval("sub EV_FEATURE_O1 () { 0x02; }") unless defined(&EV_FEATURE_O1);
    eval("sub EV_FEATURE_FDS () { 0x04; }") unless defined(&EV_FEATURE_FDS);
    eval("sub EV_FEATURE_EARLY_CLOSE () { 0x08; }") unless defined(&EV_FEATURE_EARLY_CLOSE);
    eval("sub EVENT_BASE_FLAG_NOLOCK () { 0x01; }") unless defined(&EVENT_BASE_FLAG_NOLOCK);
    eval("sub EVENT_BASE_FLAG_IGNORE_ENV () { 0x02; }") unless defined(&EVENT_BASE_FLAG_IGNORE_ENV);
    eval("sub EVENT_BASE_FLAG_STARTUP_IOCP () { 0x04; }") unless defined(&EVENT_BASE_FLAG_STARTUP_IOCP);
    eval("sub EVENT_BASE_FLAG_NO_CACHE_TIME () { 0x08; }") unless defined(&EVENT_BASE_FLAG_NO_CACHE_TIME);
    eval("sub EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST () { 0x10; }") unless defined(&EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST);
    eval("sub EVENT_BASE_FLAG_PRECISE_TIMER () { 0x20; }") unless defined(&EVENT_BASE_FLAG_PRECISE_TIMER);
    eval 'sub EVENT_LOG_DEBUG () {0;}' unless defined(&EVENT_LOG_DEBUG);
    eval 'sub EVENT_LOG_MSG () {1;}' unless defined(&EVENT_LOG_MSG);
    eval 'sub EVENT_LOG_WARN () {2;}' unless defined(&EVENT_LOG_WARN);
    eval 'sub EVENT_LOG_ERR () {3;}' unless defined(&EVENT_LOG_ERR);
    eval 'sub _EVENT_LOG_DEBUG () { &EVENT_LOG_DEBUG;}' unless defined(&_EVENT_LOG_DEBUG);
    eval 'sub _EVENT_LOG_MSG () { &EVENT_LOG_MSG;}' unless defined(&_EVENT_LOG_MSG);
    eval 'sub _EVENT_LOG_WARN () { &EVENT_LOG_WARN;}' unless defined(&_EVENT_LOG_WARN);
    eval 'sub _EVENT_LOG_ERR () { &EVENT_LOG_ERR;}' unless defined(&_EVENT_LOG_ERR);
    eval 'sub EVENT_DBG_ALL () {0xffffffff;}' unless defined(&EVENT_DBG_ALL);
    eval 'sub EVENT_DBG_NONE () {0;}' unless defined(&EVENT_DBG_NONE);
    eval 'sub EVLOOP_ONCE () {0x1;}' unless defined(&EVLOOP_ONCE);
    eval 'sub EVLOOP_NONBLOCK () {0x2;}' unless defined(&EVLOOP_NONBLOCK);
    eval 'sub EVLOOP_NO_EXIT_ON_EMPTY () {0x4;}' unless defined(&EVLOOP_NO_EXIT_ON_EMPTY);
    eval 'sub EV_TIMEOUT () {0x1;}' unless defined(&EV_TIMEOUT);
    eval 'sub EV_READ () {0x2;}' unless defined(&EV_READ);
    eval 'sub EV_WRITE () {0x4;}' unless defined(&EV_WRITE);
    eval 'sub EV_SIGNAL () {0x8;}' unless defined(&EV_SIGNAL);
    eval 'sub EV_PERSIST () {0x10;}' unless defined(&EV_PERSIST);
    eval 'sub EV_ET () {0x20;}' unless defined(&EV_ET);
    eval 'sub EV_FINALIZE () {0x40;}' unless defined(&EV_FINALIZE);
    eval 'sub EV_CLOSED () {0x80;}' unless defined(&EV_CLOSED);
    eval 'sub evtimer_assign {
        my($ev, $b, $cb, $arg) = @_;
	    eval q( &event_assign(($ev), ($b), -1, 0, ($cb), ($arg)));
    }' unless defined(&evtimer_assign);
    eval 'sub evtimer_new {
        my($b, $cb, $arg) = @_;
	    eval q( &event_new(($b), -1, 0, ($cb), ($arg)));
    }' unless defined(&evtimer_new);
    eval 'sub evtimer_add {
        my($ev, $tv) = @_;
	    eval q( &event_add(($ev), ($tv)));
    }' unless defined(&evtimer_add);
    eval 'sub evtimer_del {
        my($ev) = @_;
	    eval q( &event_del($ev));
    }' unless defined(&evtimer_del);
    eval 'sub evtimer_pending {
        my($ev, $tv) = @_;
	    eval q( &event_pending(($ev),  &EV_TIMEOUT, ($tv)));
    }' unless defined(&evtimer_pending);
    eval 'sub evtimer_initialized {
        my($ev) = @_;
	    eval q( &event_initialized($ev));
    }' unless defined(&evtimer_initialized);
    eval 'sub evsignal_add {
        my($ev, $tv) = @_;
	    eval q( &event_add(($ev), ($tv)));
    }' unless defined(&evsignal_add);
    eval 'sub evsignal_assign {
        my($ev, $b, $x, $cb, $arg) = @_;
	    eval q( &event_assign(($ev), ($b), ($x),  &EV_SIGNAL| &EV_PERSIST, $cb, ($arg)));
    }' unless defined(&evsignal_assign);
    eval 'sub evsignal_new {
        my($b, $x, $cb, $arg) = @_;
	    eval q( &event_new(($b), ($x),  &EV_SIGNAL| &EV_PERSIST, ($cb), ($arg)));
    }' unless defined(&evsignal_new);
    eval 'sub evsignal_del {
        my($ev) = @_;
	    eval q( &event_del($ev));
    }' unless defined(&evsignal_del);
    eval 'sub evsignal_pending {
        my($ev, $tv) = @_;
	    eval q( &event_pending(($ev),  &EV_SIGNAL, ($tv)));
    }' unless defined(&evsignal_pending);
    eval 'sub evsignal_initialized {
        my($ev) = @_;
	    eval q( &event_initialized($ev));
    }' unless defined(&evsignal_initialized);
    eval 'sub evuser_new {
        my($b, $cb, $arg) = @_;
	    eval q( &event_new(($b), -1, 0, ($cb), ($arg)));
    }' unless defined(&evuser_new);
    eval 'sub evuser_del {
        my($ev) = @_;
	    eval q( &event_del($ev));
    }' unless defined(&evuser_del);
    eval 'sub evuser_pending {
        my($ev, $tv) = @_;
	    eval q( &event_pending(($ev), 0, ($tv)));
    }' unless defined(&evuser_pending);
    eval 'sub evuser_initialized {
        my($ev) = @_;
	    eval q( &event_initialized($ev));
    }' unless defined(&evuser_initialized);
    eval 'sub evuser_trigger {
        my($ev) = @_;
	    eval q( &event_active(($ev), 0, 0));
    }' unless defined(&evuser_trigger);
    eval 'sub event_get_signal {
        my($ev) = @_;
	    eval q(( &event_get_fd($ev)));
    }' unless defined(&event_get_signal);
    eval 'sub LIBEVENT_VERSION () { &EVENT__VERSION;}' unless defined(&LIBEVENT_VERSION);
    eval 'sub LIBEVENT_VERSION_NUMBER () { &EVENT__NUMERIC_VERSION;}' unless defined(&LIBEVENT_VERSION_NUMBER);
    eval 'sub EVENT_MAX_PRIORITIES () {256;}' unless defined(&EVENT_MAX_PRIORITIES);
    if(!defined(&EVENT__DISABLE_MM_REPLACEMENT) || defined(&EVENT_IN_DOXYGEN_)) {
	eval 'sub EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED () {1;}' unless defined(&EVENT_SET_MEM_FUNCTIONS_IMPLEMENTED);
    }
    if(defined(&__cplusplus)) {
    }
}
1;
