require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_SYS_DISK_H_)) {
    eval 'sub _SYS_DISK_H_ () {1;}' unless defined(&_SYS_DISK_H_);
    require 'sys/dkio.ph';
    require 'sys/time.ph';
    require 'sys/queue.ph';
    require 'sys/iostat.ph';
    eval 'sub DKW_PTYPE_UNKNOWN () {"";}' unless defined(&DKW_PTYPE_UNKNOWN);
    eval 'sub DKW_PTYPE_UNUSED () {"unused";}' unless defined(&DKW_PTYPE_UNUSED);
    eval 'sub DKW_PTYPE_SWAP () {"swap";}' unless defined(&DKW_PTYPE_SWAP);
    eval 'sub DKW_PTYPE_V6 () {"v6";}' unless defined(&DKW_PTYPE_V6);
    eval 'sub DKW_PTYPE_V7 () {"v7";}' unless defined(&DKW_PTYPE_V7);
    eval 'sub DKW_PTYPE_SYSV () {"sysv";}' unless defined(&DKW_PTYPE_SYSV);
    eval 'sub DKW_PTYPE_V71K () {"v71k";}' unless defined(&DKW_PTYPE_V71K);
    eval 'sub DKW_PTYPE_V8 () {"v8";}' unless defined(&DKW_PTYPE_V8);
    eval 'sub DKW_PTYPE_FFS () {"ffs";}' unless defined(&DKW_PTYPE_FFS);
    eval 'sub DKW_PTYPE_FAT () {"msdos";}' unless defined(&DKW_PTYPE_FAT);
    eval 'sub DKW_PTYPE_LFS () {"lfs";}' unless defined(&DKW_PTYPE_LFS);
    eval 'sub DKW_PTYPE_OTHER () {"other";}' unless defined(&DKW_PTYPE_OTHER);
    eval 'sub DKW_PTYPE_HPFS () {"hpfs";}' unless defined(&DKW_PTYPE_HPFS);
    eval 'sub DKW_PTYPE_ISO9660 () {"cd9660";}' unless defined(&DKW_PTYPE_ISO9660);
    eval 'sub DKW_PTYPE_BOOT () {"boot";}' unless defined(&DKW_PTYPE_BOOT);
    eval 'sub DKW_PTYPE_AMIGADOS () {"ados";}' unless defined(&DKW_PTYPE_AMIGADOS);
    eval 'sub DKW_PTYPE_HFS () {"hfs";}' unless defined(&DKW_PTYPE_HFS);
    eval 'sub DKW_PTYPE_FILECORE () {"filecore";}' unless defined(&DKW_PTYPE_FILECORE);
    eval 'sub DKW_PTYPE_EXT2FS () {"ext2fs";}' unless defined(&DKW_PTYPE_EXT2FS);
    eval 'sub DKW_PTYPE_NTFS () {"ntfs";}' unless defined(&DKW_PTYPE_NTFS);
    eval 'sub DKW_PTYPE_RAIDFRAME () {"raidframe";}' unless defined(&DKW_PTYPE_RAIDFRAME);
    eval 'sub DKW_PTYPE_CCD () {"ccd";}' unless defined(&DKW_PTYPE_CCD);
    eval 'sub DKW_PTYPE_JFS2 () {"jfs2";}' unless defined(&DKW_PTYPE_JFS2);
    eval 'sub DKW_PTYPE_APPLEUFS () {"appleufs";}' unless defined(&DKW_PTYPE_APPLEUFS);
    eval 'sub DKW_PTYPE_VINUM () {"vinum";}' unless defined(&DKW_PTYPE_VINUM);
    eval 'sub DKW_PTYPE_UDF () {"udf";}' unless defined(&DKW_PTYPE_UDF);
    eval 'sub DKW_PTYPE_APPLEHFS () {"hfs";}' unless defined(&DKW_PTYPE_APPLEHFS);
    eval 'sub DKW_PTYPE_SYSVBFS () {"sysvbfs";}' unless defined(&DKW_PTYPE_SYSVBFS);
    eval 'sub DKW_PTYPE_EFS () {"efs";}' unless defined(&DKW_PTYPE_EFS);
    eval 'sub DKW_PTYPE_NILFS () {"nilfs";}' unless defined(&DKW_PTYPE_NILFS);
    eval 'sub DKW_PTYPE_CGD () {"cgd";}' unless defined(&DKW_PTYPE_CGD);
    eval 'sub DKW_PTYPE_MINIXFS3 () {"minixfs3";}' unless defined(&DKW_PTYPE_MINIXFS3);
    eval 'sub DKW_PTYPE_VMKCORE () {"vmkcore";}' unless defined(&DKW_PTYPE_VMKCORE);
    eval 'sub DKW_PTYPE_VMFS () {"vmfs";}' unless defined(&DKW_PTYPE_VMFS);
    eval 'sub DKW_PTYPE_VMWRESV () {"vmwresv";}' unless defined(&DKW_PTYPE_VMWRESV);
    eval 'sub DKW_PTYPE_ZFS () {"zfs";}' unless defined(&DKW_PTYPE_ZFS);
    eval 'sub DKW_PTYPE_MSDOS () { &DKW_PTYPE_FAT;}' unless defined(&DKW_PTYPE_MSDOS);
    eval 'sub DKW_PTYPE_BSDFFS () { &DKW_PTYPE_FFS;}' unless defined(&DKW_PTYPE_BSDFFS);
    eval 'sub DKW_PTYPE_BSDLFS () { &DKW_PTYPE_LFS;}' unless defined(&DKW_PTYPE_BSDLFS);
    eval 'sub DKW_PTYPE_ADOS () { &DKW_PTYPE_AMIGADOS;}' unless defined(&DKW_PTYPE_ADOS);
    eval 'sub DKW_PTYPE_EX2FS () { &DKW_PTYPE_EXT2FS;}' unless defined(&DKW_PTYPE_EX2FS);
    eval 'sub DKW_PTYPE_RAID () { &DKW_PTYPE_RAIDFRAME;}' unless defined(&DKW_PTYPE_RAID);
    eval 'sub DK_STRATEGYNAMELEN () {32;}' unless defined(&DK_STRATEGYNAMELEN);
    if(defined(&_KERNEL)) {
	require 'sys/device.ph';
	require 'sys/mutex.ph';
	require 'prop/proplib.ph';
	eval 'sub DKWEDGE_DISCOVERY_METHOD_DECL {
	    my($name, $prio, $discover) = @_;
    	    eval q( &static \'struct dkwedge_discovery_method\' $name   &_ddm = { {  &NULL,  &NULL }, $name, $prio, $discover };  &__link_set_add_data( &dkwedge_methods, $name   &_ddm));
	}' unless defined(&DKWEDGE_DISCOVERY_METHOD_DECL);
	eval 'sub DK_CLOSED () {0;}' unless defined(&DK_CLOSED);
	eval 'sub DK_WANTOPEN () {1;}' unless defined(&DK_WANTOPEN);
	eval 'sub DK_WANTOPENRAW () {2;}' unless defined(&DK_WANTOPENRAW);
	eval 'sub DK_RDLABEL () {3;}' unless defined(&DK_RDLABEL);
	eval 'sub DK_OPEN () {4;}' unless defined(&DK_OPEN);
	eval 'sub DK_OPENRAW () {5;}' unless defined(&DK_OPENRAW);
	eval 'sub DK_BSIZE2BLKSHIFT {
	    my($b) = @_;
    	    eval q((( &ffs(($b) /  &DEV_BSIZE)) - 1));
	}' unless defined(&DK_BSIZE2BLKSHIFT);
	eval 'sub DK_BSIZE2BYTESHIFT {
	    my($b) = @_;
    	    eval q(( &ffs(($b)) - 1));
	}' unless defined(&DK_BSIZE2BYTESHIFT);
	eval 'sub DK_DEV_BSIZE_OK {
	    my($b) = @_;
    	    eval q((($b) >=  &DEV_BSIZE  && (($b) & (($b) - 1)) == 0 && ($b) <=  &MAXPHYS));
	}' unless defined(&DK_DEV_BSIZE_OK);
    }
}
1;
