require '_h2ph_pre.ph';

unless(defined(&_SYS_QUOTA_H)) {
    eval 'sub _SYS_QUOTA_H () {1;}' unless defined(&_SYS_QUOTA_H);
    require 'features.ph';
    require 'sys/types.ph';
    eval 'sub dbtob {
        local($num) = @_;
	    eval q((($num) << 10));
    }' unless defined(&dbtob);
    eval 'sub btodb {
        local($num) = @_;
	    eval q((($num) >> 10));
    }' unless defined(&btodb);
    eval 'sub fs_to_dq_blocks {
        local($num, $blksize) = @_;
	    eval q(((($num) * ($blksize)) /  &BLOCK_SIZE));
    }' unless defined(&fs_to_dq_blocks);
    eval 'sub MAX_IQ_TIME () {604800;}' unless defined(&MAX_IQ_TIME);
    eval 'sub MAX_DQ_TIME () {604800;}' 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 () {"staff";}' unless defined(&QUOTAGROUP);
    eval 'sub NR_DQHASH () {43;}' unless defined(&NR_DQHASH);
    eval 'sub NR_DQUOTS () {256;}' unless defined(&NR_DQUOTS);
    eval 'sub SUBCMDMASK () {0xff;}' 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 () {0x100;}' unless defined(&Q_QUOTAON);
    eval 'sub Q_QUOTAOFF () {0x200;}' unless defined(&Q_QUOTAOFF);
    eval 'sub Q_GETQUOTA () {0x300;}' unless defined(&Q_GETQUOTA);
    eval 'sub Q_SETQUOTA () {0x400;}' unless defined(&Q_SETQUOTA);
    eval 'sub Q_SETUSE () {0x500;}' unless defined(&Q_SETUSE);
    eval 'sub Q_SYNC () {0x600;}' unless defined(&Q_SYNC);
    eval 'sub Q_SETQLIM () {0x700;}' unless defined(&Q_SETQLIM);
    eval 'sub Q_GETSTATS () {0x800;}' unless defined(&Q_GETSTATS);
    eval 'sub Q_RSQUASH () {0x1000;}' unless defined(&Q_RSQUASH);
    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 dqoff {
        local($UID) = @_;
	    eval q(((($UID) * $sizeof{\'struct dqblk\'})));
    }' unless defined(&dqoff);
}
1;
