require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_UFS_UFS_QUOTA2_H_)) {
    eval 'sub _UFS_UFS_QUOTA2_H_ () {1;}' unless defined(&_UFS_UFS_QUOTA2_H_);
    require 'ufs/ufs/quota.ph';
    eval 'sub N_QL () {2;}' unless defined(&N_QL);
    eval 'sub QL_BLOCK () {0;}' unless defined(&QL_BLOCK);
    eval 'sub QL_FILE () {1;}' unless defined(&QL_FILE);
    eval 'sub INITQLNAMES () {{ [ &QL_BLOCK] = "block", [ &QL_FILE] = "file", };}' unless defined(&INITQLNAMES);
    eval 'sub Q2_HEAD_MAGIC () {0xb746915e;}' unless defined(&Q2_HEAD_MAGIC);
    eval 'sub FS_Q2_DO_TYPE {
        my($type) = @_;
	    eval q((0x1 << ($type)));
    }' unless defined(&FS_Q2_DO_TYPE);
    eval 'sub off2qindex {
        my($hsize, $off) = @_;
	    eval q(((($off) - ($hsize)) / $sizeof{\'struct quota2_entry\'}));
    }' unless defined(&off2qindex);
    eval 'sub qindex2off {
        my($hsize, $idx) = @_;
	    eval q((( &daddr_t)($idx) * $sizeof{\'struct quota2_entry\'} + ($hsize)));
    }' unless defined(&qindex2off);
    eval 'sub QL_S_ALLOW_OK () {0x;}' unless defined(&QL_S_ALLOW_OK);
    eval 'sub QL_S_ALLOW_SOFT () {0x1;}' unless defined(&QL_S_ALLOW_SOFT);
    eval 'sub QL_S_DENY_GRACE () {0x2;}' unless defined(&QL_S_DENY_GRACE);
    eval 'sub QL_S_DENY_HARD () {0x3;}' unless defined(&QL_S_DENY_HARD);
    eval 'sub QL_F_CROSS () {0x80;}' unless defined(&QL_F_CROSS);
    eval 'sub QL_STATUS {
        my($x) = @_;
	    eval q((($x) & 0xf));
    }' unless defined(&QL_STATUS);
    eval 'sub QL_FLAGS {
        my($x) = @_;
	    eval q((($x) & 0xf0));
    }' unless defined(&QL_FLAGS);
}
1;
