require '_h2ph_pre.ph';

unless(defined(&__PRESTO_PSDEV_H)) {
    eval 'sub __PRESTO_PSDEV_H () {1;}' unless defined(&__PRESTO_PSDEV_H);
    if(defined(&PRESTO_DEVEL)) {
	eval 'sub PRESTO_FS_NAME () {"izofs";}' unless defined(&PRESTO_FS_NAME);
	eval 'sub PRESTO_PSDEV_NAME () {"/dev/izo";}' unless defined(&PRESTO_PSDEV_NAME);
	eval 'sub PRESTO_PSDEV_MAJOR () {186;}' unless defined(&PRESTO_PSDEV_MAJOR);
    } else {
	eval 'sub PRESTO_FS_NAME () {"InterMezzo";}' unless defined(&PRESTO_FS_NAME);
	eval 'sub PRESTO_PSDEV_NAME () {"/dev/intermezzo";}' unless defined(&PRESTO_PSDEV_NAME);
	eval 'sub PRESTO_PSDEV_MAJOR () {185;}' unless defined(&PRESTO_PSDEV_MAJOR);
    }
    eval 'sub MAX_PRESTODEV () {16;}' unless defined(&MAX_PRESTODEV);
    require 'linux/version.ph';
    if(((defined(&LINUX_VERSION_CODE) ? &LINUX_VERSION_CODE : 0) <  &KERNEL_VERSION(2,3,0))) {
	eval 'sub wait_queue_head_t () {\'struct wait_queue\' *;}' unless defined(&wait_queue_head_t);
	eval 'sub DECLARE_WAITQUEUE {
	    local($name,$task) = @_;
    	    eval q(\'struct wait_queue\' $name = { $task,  &NULL });
	}' unless defined(&DECLARE_WAITQUEUE);
	eval 'sub init_waitqueue_head {
	    local($arg) = @_;
    	    eval q();
	}' unless defined(&init_waitqueue_head);
    } else {
	unless(defined(&__initfunc)) {
	    eval 'sub __initfunc {
	        local($arg) = @_;
    		eval q($arg);
	    }' unless defined(&__initfunc);
	}
    }
    eval 'sub ISLENTO {
        local($minor) = @_;
	    eval q(( ($current->{pid}) ==  ($upc_comms[$minor]->{uc_pid})  ||  ($current->{p_pptr}->{pid}) ==  ($upc_comms[$minor]->{uc_pid})));
    }' unless defined(&ISLENTO);
    eval 'sub REQ_READ () {1;}' unless defined(&REQ_READ);
    eval 'sub REQ_WRITE () {2;}' unless defined(&REQ_WRITE);
    eval 'sub REQ_ASYNC () {4;}' unless defined(&REQ_ASYNC);
    eval 'sub REQ_DEAD () {8;}' unless defined(&REQ_DEAD);
}
1;
