require '_h2ph_pre.ph';

unless(defined(&_LINUX_MSDOS_FS_H)) {
    eval 'sub _LINUX_MSDOS_FS_H () {1;}' unless defined(&_LINUX_MSDOS_FS_H);
    require 'linux/fs.ph';
    require 'linux/stat.ph';
    require 'linux/fd.ph';
    require 'asm/byteorder.ph';
    eval 'sub MSDOS_ROOT_INO () {1;}' unless defined(&MSDOS_ROOT_INO);
    eval 'sub SECTOR_SIZE () {512;}' unless defined(&SECTOR_SIZE);
    eval 'sub SECTOR_BITS () {9;}' unless defined(&SECTOR_BITS);
    eval 'sub MSDOS_DPB () {( &MSDOS_DPS);}' unless defined(&MSDOS_DPB);
    eval 'sub MSDOS_DPB_BITS () {4;}' unless defined(&MSDOS_DPB_BITS);
    eval 'sub MSDOS_DPS () {( &SECTOR_SIZE/$sizeof{\'struct msdos_dir_entry\'});}' unless defined(&MSDOS_DPS);
    eval 'sub MSDOS_DPS_BITS () {4;}' unless defined(&MSDOS_DPS_BITS);
    eval 'sub MSDOS_DIR_BITS () {5;}' unless defined(&MSDOS_DIR_BITS);
    eval 'sub MSDOS_SUPER_MAGIC () {0x4d44;}' unless defined(&MSDOS_SUPER_MAGIC);
    eval 'sub FAT_CACHE () {8;}' unless defined(&FAT_CACHE);
    eval 'sub MSDOS_MAX_EXTRA () {3;}' unless defined(&MSDOS_MAX_EXTRA);
    eval 'sub ATTR_RO () {1;}' unless defined(&ATTR_RO);
    eval 'sub ATTR_HIDDEN () {2;}' unless defined(&ATTR_HIDDEN);
    eval 'sub ATTR_SYS () {4;}' unless defined(&ATTR_SYS);
    eval 'sub ATTR_VOLUME () {8;}' unless defined(&ATTR_VOLUME);
    eval 'sub ATTR_DIR () {16;}' unless defined(&ATTR_DIR);
    eval 'sub ATTR_ARCH () {32;}' unless defined(&ATTR_ARCH);
    eval 'sub ATTR_NONE () {0;}' unless defined(&ATTR_NONE);
    eval 'sub ATTR_UNUSED () {( &ATTR_VOLUME |  &ATTR_ARCH |  &ATTR_SYS |  &ATTR_HIDDEN);}' unless defined(&ATTR_UNUSED);
    eval 'sub ATTR_EXT () {( &ATTR_RO |  &ATTR_HIDDEN |  &ATTR_SYS |  &ATTR_VOLUME);}' unless defined(&ATTR_EXT);
    eval 'sub ATTR_DIR_READ_BOTH () {512;}' unless defined(&ATTR_DIR_READ_BOTH);
    eval 'sub ATTR_DIR_READ_SHORT () {1024;}' unless defined(&ATTR_DIR_READ_SHORT);
    eval 'sub CASE_LOWER_BASE () {8;}' unless defined(&CASE_LOWER_BASE);
    eval 'sub CASE_LOWER_EXT () {16;}' unless defined(&CASE_LOWER_EXT);
    eval 'sub SCAN_ANY () {0;}' unless defined(&SCAN_ANY);
    eval 'sub SCAN_HID () {1;}' unless defined(&SCAN_HID);
    eval 'sub SCAN_NOTHID () {2;}' unless defined(&SCAN_NOTHID);
    eval 'sub SCAN_NOTANY () {3;}' unless defined(&SCAN_NOTANY);
    eval 'sub DELETED_FLAG () {0xe5;}' unless defined(&DELETED_FLAG);
    eval 'sub IS_FREE {
        local($n) = @_;
	    eval q((!* || * ($n) ==  &DELETED_FLAG));
    }' unless defined(&IS_FREE);
    eval 'sub MSDOS_VALID_MODE () {( &S_IFREG |  &S_IFDIR |  &S_IRWXU |  &S_IRWXG |  &S_IRWXO);}' unless defined(&MSDOS_VALID_MODE);
    eval 'sub MSDOS_SB {
        local($s) = @_;
	    eval q(((($s)-> ($u->{m$sdos_sb}))));
    }' unless defined(&MSDOS_SB);
    eval 'sub MSDOS_I {
        local($i) = @_;
	    eval q(((($i)-> ($u->{msdos_i}))));
    }' unless defined(&MSDOS_I);
    eval 'sub MSDOS_NAME () {11;}' unless defined(&MSDOS_NAME);
    eval 'sub MSDOS_LONGNAME () {256;}' unless defined(&MSDOS_LONGNAME);
    eval 'sub MSDOS_SLOTS () {21;}' unless defined(&MSDOS_SLOTS);
    eval 'sub MSDOS_DOT () {".	  ";}' unless defined(&MSDOS_DOT);
    eval 'sub MSDOS_DOTDOT () {"..	 ";}' unless defined(&MSDOS_DOTDOT);
    eval 'sub MSDOS_FAT12 () {4084;}' unless defined(&MSDOS_FAT12);
    eval 'sub EOF_FAT12 () {0xff8;}' unless defined(&EOF_FAT12);
    eval 'sub EOF_FAT16 () {0xfff8;}' unless defined(&EOF_FAT16);
    eval 'sub EOF_FAT32 () {0xffffff8;}' unless defined(&EOF_FAT32);
    eval 'sub EOF_FAT {
        local($s) = @_;
	    eval q(( &MSDOS_SB($s)-> &fat_bits == 32?  &EOF_FAT32 :  &MSDOS_SB($s)-> &fat_bits == 16?  &EOF_FAT16 :  &EOF_FAT12));
    }' unless defined(&EOF_FAT);
    eval 'sub FAT_FSINFO_SIG1 () {0x41615252;}' unless defined(&FAT_FSINFO_SIG1);
    eval 'sub FAT_FSINFO_SIG2 () {0x61417272;}' unless defined(&FAT_FSINFO_SIG2);
    eval 'sub IS_FSINFO {
        local($x) = @_;
	    eval q(( &CF_LE_L(($x)-> &signature1) ==  &FAT_FSINFO_SIG1  &&  &CF_LE_L(($x)-> &signature2) ==  &FAT_FSINFO_SIG2));
    }' unless defined(&IS_FSINFO);
    eval 'sub FAT_BINARY_FL () {0x1;}' unless defined(&FAT_BINARY_FL);
    eval 'sub VFAT_IOCTL_READDIR_BOTH () { &_IOR(ord(\'r\'), 1, \'struct dirent\' [2]);}' unless defined(&VFAT_IOCTL_READDIR_BOTH);
    eval 'sub VFAT_IOCTL_READDIR_SHORT () { &_IOR(ord(\'r\'), 2, \'struct dirent\' [2]);}' unless defined(&VFAT_IOCTL_READDIR_SHORT);
    eval 'sub VFAT_SFN_DISPLAY_LOWER () {0x1;}' unless defined(&VFAT_SFN_DISPLAY_LOWER);
    eval 'sub VFAT_SFN_DISPLAY_WIN95 () {0x2;}' unless defined(&VFAT_SFN_DISPLAY_WIN95);
    eval 'sub VFAT_SFN_DISPLAY_WINNT () {0x4;}' unless defined(&VFAT_SFN_DISPLAY_WINNT);
    eval 'sub VFAT_SFN_CREATE_WIN95 () {0x100;}' unless defined(&VFAT_SFN_CREATE_WIN95);
    eval 'sub VFAT_SFN_CREATE_WINNT () {0x200;}' unless defined(&VFAT_SFN_CREATE_WINNT);
    eval 'sub CF_LE_W {
        local($v) = @_;
	    eval q( &le16_to_cpu($v));
    }' unless defined(&CF_LE_W);
    eval 'sub CF_LE_L {
        local($v) = @_;
	    eval q( &le32_to_cpu($v));
    }' unless defined(&CF_LE_L);
    eval 'sub CT_LE_W {
        local($v) = @_;
	    eval q( &cpu_to_le16($v));
    }' unless defined(&CT_LE_W);
    eval 'sub CT_LE_L {
        local($v) = @_;
	    eval q( &cpu_to_le32($v));
    }' unless defined(&CT_LE_L);
    eval 'sub MSDOS_CAN_BMAP {
        local($mib) = @_;
	    eval q((!((($mib)-> &cluster_size & 1) || (($mib)-> &data_start & 1))));
    }' unless defined(&MSDOS_CAN_BMAP);
    eval 'sub MSDOS_MKMODE {
        local($a,$m) = @_;
	    eval q(($m & ($a &  &ATTR_RO ?  &S_IRUGO| &S_IXUGO :  &S_IRWXUGO)));
    }' unless defined(&MSDOS_MKMODE);
    eval 'sub MSDOS_MKATTR {
        local($m) = @_;
	    eval q((($m &  &S_IWUGO) ?  &ATTR_NONE :  &ATTR_RO));
    }' unless defined(&MSDOS_MKATTR);
}
1;
