require '_h2ph_pre.ph';

unless(defined(&_QUOTA_)) {
    eval 'sub _QUOTA_ () {1;}' unless defined(&_QUOTA_);
    eval 'sub MAX_IQ_TIME () {(7*24*60*60);}' unless defined(&MAX_IQ_TIME);
    eval 'sub MAX_DQ_TIME () {(7*24*60*60);}' unless defined(&MAX_DQ_TIME);
    eval 'sub MAXQUOTAS () {2;}' unless defined(&MAXQUOTAS);
    eval 'sub USRQUOTA () {0;}' unless defined(&USRQUOTA);
    eval 'sub GRPQUOTA () {1;}' unless defined(&GRPQUOTA);
    eval 'sub INITQFNAMES () {{ "user", "group", "undefined", };;}' unless defined(&INITQFNAMES);
    eval 'sub QUOTAFILENAME () {"quota";}' unless defined(&QUOTAFILENAME);
    eval 'sub QUOTAGROUP () {"operator";}' unless defined(&QUOTAGROUP);
    eval 'sub SUBCMDMASK () {0x00ff;}' unless defined(&SUBCMDMASK);
    eval 'sub SUBCMDSHIFT () {8;}' unless defined(&SUBCMDSHIFT);
    eval 'sub QCMD {
        local($cmd, $type) = @_;
	    eval q(((($cmd) <<  &SUBCMDSHIFT) | (($type) &  &SUBCMDMASK)));
    }' unless defined(&QCMD);
    eval 'sub Q_QUOTAON () {0x0100;}' unless defined(&Q_QUOTAON);
    eval 'sub Q_QUOTAOFF () {0x0200;}' unless defined(&Q_QUOTAOFF);
    eval 'sub Q_GETQUOTA () {0x0300;}' unless defined(&Q_GETQUOTA);
    eval 'sub Q_SETQUOTA () {0x0400;}' unless defined(&Q_SETQUOTA);
    eval 'sub Q_SETUSE () {0x0500;}' unless defined(&Q_SETUSE);
    eval 'sub Q_SYNC () {0x0600;}' unless defined(&Q_SYNC);
    if(defined(&_KERNEL)) {
	require 'sys/queue.ph';
	eval 'sub DQ_LOCK () {0x01;}' unless defined(&DQ_LOCK);
	eval 'sub DQ_WANT () {0x02;}' unless defined(&DQ_WANT);
	eval 'sub DQ_MOD () {0x04;}' unless defined(&DQ_MOD);
	eval 'sub DQ_FAKE () {0x08;}' unless defined(&DQ_FAKE);
	eval 'sub DQ_BLKS () {0x10;}' unless defined(&DQ_BLKS);
	eval 'sub DQ_INODS () {0x20;}' unless defined(&DQ_INODS);
	eval 'sub dq_bhardlimit () { ($dq_dqb->{dqb_bhardlimit});}' unless defined(&dq_bhardlimit);
	eval 'sub dq_bsoftlimit () { ($dq_dqb->{dqb_bsoftlimit});}' unless defined(&dq_bsoftlimit);
	eval 'sub dq_curblocks () { ($dq_dqb->{dqb_curblocks});}' unless defined(&dq_curblocks);
	eval 'sub dq_ihardlimit () { ($dq_dqb->{dqb_ihardlimit});}' unless defined(&dq_ihardlimit);
	eval 'sub dq_isoftlimit () { ($dq_dqb->{dqb_isoftlimit});}' unless defined(&dq_isoftlimit);
	eval 'sub dq_curinodes () { ($dq_dqb->{dqb_curinodes});}' unless defined(&dq_curinodes);
	eval 'sub dq_btime () { ($dq_dqb->{dqb_btime});}' unless defined(&dq_btime);
	eval 'sub dq_itime () { ($dq_dqb->{dqb_itime});}' unless defined(&dq_itime);
	eval 'sub NODQUOT () { &NULL;}' unless defined(&NODQUOT);
	eval 'sub FORCE () {0x01;}' unless defined(&FORCE);
	eval 'sub CHOWN () {0x02;}' unless defined(&CHOWN);
	if(defined(&DIAGNOSTIC)) {
	    eval 'sub DQREF {
	        local($dq) = @_;
    		eval q( &dqref($dq));
	    }' unless defined(&DQREF);
	} else {
	    eval 'sub DQREF {
	        local($dq) = @_;
    		eval q(($dq)-> &dq_cnt++);
	    }' unless defined(&DQREF);
	}
	require 'sys/cdefs.ph';
	if(defined(&DIAGNOSTIC)) {
	}
    }
}
1;
