require '_h2ph_pre.ph';

unless(defined(&_LINUX_PIPE_FS_I_H)) {
    eval 'sub _LINUX_PIPE_FS_I_H () {1;}' unless defined(&_LINUX_PIPE_FS_I_H);
    eval 'sub PIPEFS_MAGIC () {0x50495045;}' unless defined(&PIPEFS_MAGIC);
    eval 'sub PIPE_SIZE () { &PAGE_SIZE;}' unless defined(&PIPE_SIZE);
    eval 'sub PIPE_SEM {
        local($inode) = @_;
	    eval q((($inode). &i_sem));
    }' unless defined(&PIPE_SEM);
    eval 'sub PIPE_WAIT {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{wait})));
    }' unless defined(&PIPE_WAIT);
    eval 'sub PIPE_BASE {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{base})));
    }' unless defined(&PIPE_BASE);
    eval 'sub PIPE_START {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{start})));
    }' unless defined(&PIPE_START);
    eval 'sub PIPE_LEN {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{len})));
    }' unless defined(&PIPE_LEN);
    eval 'sub PIPE_READERS {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{readers})));
    }' unless defined(&PIPE_READERS);
    eval 'sub PIPE_WRITERS {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{writers})));
    }' unless defined(&PIPE_WRITERS);
    eval 'sub PIPE_WAITING_READERS {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{waiting_readers})));
    }' unless defined(&PIPE_WAITING_READERS);
    eval 'sub PIPE_WAITING_WRITERS {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{waiting_writers})));
    }' unless defined(&PIPE_WAITING_WRITERS);
    eval 'sub PIPE_RCOUNTER {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{r_counter})));
    }' unless defined(&PIPE_RCOUNTER);
    eval 'sub PIPE_WCOUNTER {
        local($inode) = @_;
	    eval q((($inode). ($i_pipe->{w_counter})));
    }' unless defined(&PIPE_WCOUNTER);
    eval 'sub PIPE_EMPTY {
        local($inode) = @_;
	    eval q(( &PIPE_LEN($inode) == 0));
    }' unless defined(&PIPE_EMPTY);
    eval 'sub PIPE_FULL {
        local($inode) = @_;
	    eval q(( &PIPE_LEN($inode) ==  &PIPE_SIZE));
    }' unless defined(&PIPE_FULL);
    eval 'sub PIPE_FREE {
        local($inode) = @_;
	    eval q(( &PIPE_SIZE -  &PIPE_LEN($inode)));
    }' unless defined(&PIPE_FREE);
    eval 'sub PIPE_END {
        local($inode) = @_;
	    eval q((( &PIPE_START($inode) +  &PIPE_LEN($inode)) & ( &PIPE_SIZE-1)));
    }' unless defined(&PIPE_END);
    eval 'sub PIPE_MAX_RCHUNK {
        local($inode) = @_;
	    eval q(( &PIPE_SIZE -  &PIPE_START($inode)));
    }' unless defined(&PIPE_MAX_RCHUNK);
    eval 'sub PIPE_MAX_WCHUNK {
        local($inode) = @_;
	    eval q(( &PIPE_SIZE -  &PIPE_END($inode)));
    }' unless defined(&PIPE_MAX_WCHUNK);
}
1;
