require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_)) {
    eval 'sub EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_ () {1;}' unless defined(&EVENT2_BUFFEREVENT_COMPAT_H_INCLUDED_);
    require 'event2/visibility.ph';
    eval 'sub evbuffercb () { &bufferevent_data_cb;}' unless defined(&evbuffercb);
    eval 'sub everrorcb () { &bufferevent_event_cb;}' unless defined(&everrorcb);
    eval 'sub EVBUFFER_READ () { &BEV_EVENT_READING;}' unless defined(&EVBUFFER_READ);
    eval 'sub EVBUFFER_WRITE () { &BEV_EVENT_WRITING;}' unless defined(&EVBUFFER_WRITE);
    eval 'sub EVBUFFER_EOF () { &BEV_EVENT_EOF;}' unless defined(&EVBUFFER_EOF);
    eval 'sub EVBUFFER_ERROR () { &BEV_EVENT_ERROR;}' unless defined(&EVBUFFER_ERROR);
    eval 'sub EVBUFFER_TIMEOUT () { &BEV_EVENT_TIMEOUT;}' unless defined(&EVBUFFER_TIMEOUT);
    eval 'sub EVBUFFER_INPUT {
        my($x) = @_;
	    eval q( &bufferevent_get_input($x));
    }' unless defined(&EVBUFFER_INPUT);
    eval 'sub EVBUFFER_OUTPUT {
        my($x) = @_;
	    eval q( &bufferevent_get_output($x));
    }' unless defined(&EVBUFFER_OUTPUT);
}
1;
