require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&EVENT2_EVENT_STRUCT_H_INCLUDED_)) {
    eval 'sub EVENT2_EVENT_STRUCT_H_INCLUDED_ () {1;}' unless defined(&EVENT2_EVENT_STRUCT_H_INCLUDED_);
    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 'event2/util.ph';
    require 'event2/keyvalq_struct.ph';
    eval 'sub EVLIST_TIMEOUT () {0x1;}' unless defined(&EVLIST_TIMEOUT);
    eval 'sub EVLIST_INSERTED () {0x2;}' unless defined(&EVLIST_INSERTED);
    eval 'sub EVLIST_SIGNAL () {0x4;}' unless defined(&EVLIST_SIGNAL);
    eval 'sub EVLIST_ACTIVE () {0x8;}' unless defined(&EVLIST_ACTIVE);
    eval 'sub EVLIST_INTERNAL () {0x10;}' unless defined(&EVLIST_INTERNAL);
    eval 'sub EVLIST_ACTIVE_LATER () {0x20;}' unless defined(&EVLIST_ACTIVE_LATER);
    eval 'sub EVLIST_FINALIZING () {0x40;}' unless defined(&EVLIST_FINALIZING);
    eval 'sub EVLIST_INIT () {0x80;}' unless defined(&EVLIST_INIT);
    eval 'sub EVLIST_ALL () {0xff;}' unless defined(&EVLIST_ALL);
    unless(defined(&TAILQ_ENTRY)) {
	eval 'sub EVENT_DEFINED_TQENTRY_ () {1;}' unless defined(&EVENT_DEFINED_TQENTRY_);
	eval 'sub TAILQ_ENTRY {
	    my($type) = @_;
    	    eval q(\'struct struct\' { \'struct type\' * &tqe_next; \'struct type\' ** &tqe_prev; });
	}' unless defined(&TAILQ_ENTRY);
    }
    unless(defined(&TAILQ_HEAD)) {
	eval 'sub EVENT_DEFINED_TQHEAD_ () {1;}' unless defined(&EVENT_DEFINED_TQHEAD_);
	eval 'sub TAILQ_HEAD {
	    my($name, $type) = @_;
    	    eval q(\'struct name\' { \'struct type\' * &tqh_first; \'struct type\' ** &tqh_last; });
	}' unless defined(&TAILQ_HEAD);
    }
    unless(defined(&LIST_ENTRY)) {
	eval 'sub EVENT_DEFINED_LISTENTRY_ () {1;}' unless defined(&EVENT_DEFINED_LISTENTRY_);
	eval 'sub LIST_ENTRY {
	    my($type) = @_;
    	    eval q(\'struct struct\' { \'struct type\' * &le_next; \'struct type\' ** &le_prev; });
	}' unless defined(&LIST_ENTRY);
    }
    unless(defined(&LIST_HEAD)) {
	eval 'sub EVENT_DEFINED_LISTHEAD_ () {1;}' unless defined(&EVENT_DEFINED_LISTHEAD_);
	eval 'sub LIST_HEAD {
	    my($name, $type) = @_;
    	    eval q(\'struct name\' { \'struct type\' * &lh_first; });
	}' unless defined(&LIST_HEAD);
    }
    if(defined(&EVENT_DEFINED_TQENTRY_)) {
	undef(&TAILQ_ENTRY) if defined(&TAILQ_ENTRY);
    }
    if(defined(&EVENT_DEFINED_TQHEAD_)) {
	undef(&TAILQ_HEAD) if defined(&TAILQ_HEAD);
    }
    if(defined(&EVENT_DEFINED_LISTENTRY_)) {
	undef(&LIST_ENTRY) if defined(&LIST_ENTRY);
    }
    if(defined(&EVENT_DEFINED_LISTHEAD_)) {
	undef(&LIST_HEAD) if defined(&LIST_HEAD);
    }
    if(defined(&__cplusplus)) {
    }
}
1;
