require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&EVENT2_EVENT_COMPAT_H_INCLUDED_)) {
    eval 'sub EVENT2_EVENT_COMPAT_H_INCLUDED_ () {1;}' unless defined(&EVENT2_EVENT_COMPAT_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 'event2/util.ph';
    eval 'sub evtimer_set {
        my($ev, $cb, $arg) = @_;
	    eval q( &event_set(($ev), -1, 0, ($cb), ($arg)));
    }' unless defined(&evtimer_set);
    eval 'sub evsignal_set {
        my($ev, $x, $cb, $arg) = @_;
	    eval q( &event_set(($ev), ($x),  &EV_SIGNAL| &EV_PERSIST, ($cb), ($arg)));
    }' unless defined(&evsignal_set);
    eval 'sub timeout_add {
        my($ev, $tv) = @_;
	    eval q( &event_add(($ev), ($tv)));
    }' unless defined(&timeout_add);
    eval 'sub timeout_set {
        my($ev, $cb, $arg) = @_;
	    eval q( &event_set(($ev), -1, 0, ($cb), ($arg)));
    }' unless defined(&timeout_set);
    eval 'sub timeout_del {
        my($ev) = @_;
	    eval q( &event_del($ev));
    }' unless defined(&timeout_del);
    eval 'sub timeout_pending {
        my($ev, $tv) = @_;
	    eval q( &event_pending(($ev),  &EV_TIMEOUT, ($tv)));
    }' unless defined(&timeout_pending);
    eval 'sub timeout_initialized {
        my($ev) = @_;
	    eval q( &event_initialized($ev));
    }' unless defined(&timeout_initialized);
    eval 'sub signal_add {
        my($ev, $tv) = @_;
	    eval q( &event_add(($ev), ($tv)));
    }' unless defined(&signal_add);
    eval 'sub signal_set {
        my($ev, $x, $cb, $arg) = @_;
	    eval q( &event_set(($ev), ($x),  &EV_SIGNAL| &EV_PERSIST, ($cb), ($arg)));
    }' unless defined(&signal_set);
    eval 'sub signal_del {
        my($ev) = @_;
	    eval q( &event_del($ev));
    }' unless defined(&signal_del);
    eval 'sub signal_pending {
        my($ev, $tv) = @_;
	    eval q( &event_pending(($ev),  &EV_SIGNAL, ($tv)));
    }' unless defined(&signal_pending);
    eval 'sub signal_initialized {
        my($ev) = @_;
	    eval q( &event_initialized($ev));
    }' unless defined(&signal_initialized);
    unless(defined(&EVENT_FD)) {
	eval 'sub EVENT_FD {
	    my($ev) = @_;
    	    eval q(( &event_get_fd($ev)));
	}' unless defined(&EVENT_FD);
	eval 'sub EVENT_SIGNAL {
	    my($ev) = @_;
    	    eval q( &event_get_signal($ev));
	}' unless defined(&EVENT_SIGNAL);
    }
    if(defined(&__cplusplus)) {
    }
}
1;
