require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_UFS_UFS_DINODE_H_)) {
    eval 'sub _UFS_UFS_DINODE_H_ () {1;}' unless defined(&_UFS_UFS_DINODE_H_);
    eval 'sub UFS_ROOTINO () {(( &ino_t)2);}' unless defined(&UFS_ROOTINO);
    eval 'sub UFS_WINO () {(( &ino_t)1);}' unless defined(&UFS_WINO);
    eval 'sub UFS_NXADDR () {2;}' unless defined(&UFS_NXADDR);
    eval 'sub UFS_NDADDR () {12;}' unless defined(&UFS_NDADDR);
    eval 'sub UFS_NIADDR () {3;}' unless defined(&UFS_NIADDR);
    eval 'sub di_ogid () { $di_oldids[1];}' unless defined(&di_ogid);
    eval 'sub di_ouid () { $di_oldids[0];}' unless defined(&di_ouid);
    eval 'sub di_rdev () { $di_db[0];}' unless defined(&di_rdev);
    eval 'sub UFS1_MAXSYMLINKLEN () {(( &UFS_NDADDR +  &UFS_NIADDR) * $sizeof{ &int32_t});}' unless defined(&UFS1_MAXSYMLINKLEN);
    eval 'sub UFS2_MAXSYMLINKLEN () {(( &UFS_NDADDR +  &UFS_NIADDR) * $sizeof{ &int64_t});}' unless defined(&UFS2_MAXSYMLINKLEN);
    eval 'sub UFS_MAXSYMLINKLEN {
        my($ip) = @_;
	    eval q((($ip)-> ($i_ump->{um_fstype}) ==  &UFS1) ?  &UFS1_MAXSYMLINKLEN :  &UFS2_MAXSYMLINKLEN);
    }' unless defined(&UFS_MAXSYMLINKLEN);
    eval 'sub APPLEUFS_MAXSYMLINKLEN () {60;}' unless defined(&APPLEUFS_MAXSYMLINKLEN);
    eval 'sub IEXEC () {0000100;}' unless defined(&IEXEC);
    eval 'sub IWRITE () {0000200;}' unless defined(&IWRITE);
    eval 'sub IREAD () {0000400;}' unless defined(&IREAD);
    eval 'sub ISVTX () {0001000;}' unless defined(&ISVTX);
    eval 'sub ISGID () {0002000;}' unless defined(&ISGID);
    eval 'sub ISUID () {0004000;}' unless defined(&ISUID);
    eval 'sub IFMT () {0170000;}' unless defined(&IFMT);
    eval 'sub IFIFO () {0010000;}' unless defined(&IFIFO);
    eval 'sub IFCHR () {0020000;}' unless defined(&IFCHR);
    eval 'sub IFDIR () {0040000;}' unless defined(&IFDIR);
    eval 'sub IFBLK () {0060000;}' unless defined(&IFBLK);
    eval 'sub IFREG () {0100000;}' unless defined(&IFREG);
    eval 'sub IFLNK () {0120000;}' unless defined(&IFLNK);
    eval 'sub IFSOCK () {0140000;}' unless defined(&IFSOCK);
    eval 'sub IFWHT () {0160000;}' unless defined(&IFWHT);
    eval 'sub DINODE1_SIZE () {($sizeof{\'struct ufs1_dinode\'});}' unless defined(&DINODE1_SIZE);
    eval 'sub DINODE2_SIZE () {($sizeof{\'struct ufs2_dinode\'});}' unless defined(&DINODE2_SIZE);
}
1;
