require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&FATOFS)) {
    sub FATOFS {
	my($pmp, $cn) = @_;
	eval q((($cn) * ($pmp)-> &pm_fatmult / ($pmp)-> &pm_fatdiv));
    }
}
if(0) {
    eval 'sub MSDOSFSMNT_SHORTNAME () {0x1;}' unless defined(&MSDOSFSMNT_SHORTNAME);
    eval 'sub MSDOSFSMNT_LONGNAME () {0x2;}' unless defined(&MSDOSFSMNT_LONGNAME);
    eval 'sub MSDOSFSMNT_NOWIN95 () {0x4;}' unless defined(&MSDOSFSMNT_NOWIN95);
    eval 'sub MSDOSFSMNT_ALLOWDIRX () {0x10;}' unless defined(&MSDOSFSMNT_ALLOWDIRX);
}
unless(defined(&MSDOSFSMNT_MNTOPT)) {
    sub MSDOSFSMNT_MNTOPT () {	( &MSDOSFSMNT_SHORTNAME| &MSDOSFSMNT_LONGNAME| &MSDOSFSMNT_NOWIN95 | &MSDOSFSMNT_ALLOWDIRX);}
}
unless(defined(&MSDOSFSMNT_RONLY)) {
    sub MSDOSFSMNT_RONLY () {	0x80000000;}
}
unless(defined(&MSDOSFSMNT_WAITONFAT)) {
    sub MSDOSFSMNT_WAITONFAT () {	0x40000000;}
}
unless(defined(&MSDOSFS_FATMIRROR)) {
    sub MSDOSFS_FATMIRROR () {	0x20000000;}
}
unless(defined(&VFSTOMSDOSFS)) {
    sub VFSTOMSDOSFS {
	my($mp) = @_;
	eval q(( ($mp->{mnt_data})));
    }
}
unless(defined(&N_INUSEBITS)) {
    sub N_INUSEBITS () {	(8* $sizeof{'u_int'});}
}
unless(defined(&pm_BytesPerSec)) {
    sub pm_BytesPerSec () {	 ($pm_bpb->{bpbBytesPerSec});}
}
unless(defined(&pm_ResSectors)) {
    sub pm_ResSectors () {	 ($pm_bpb->{bpbResSectors});}
}
unless(defined(&pm_FATs)) {
    sub pm_FATs () {	 ($pm_bpb->{bpbFATs});}
}
unless(defined(&pm_RootDirEnts)) {
    sub pm_RootDirEnts () {	 ($pm_bpb->{bpbRootDirEnts});}
}
unless(defined(&pm_Sectors)) {
    sub pm_Sectors () {	 ($pm_bpb->{bpbSectors});}
}
unless(defined(&pm_Media)) {
    sub pm_Media () {	 ($pm_bpb->{bpbMedia});}
}
unless(defined(&pm_SecPerTrack)) {
    sub pm_SecPerTrack () {	 ($pm_bpb->{bpbSecPerTrack});}
}
unless(defined(&pm_Heads)) {
    sub pm_Heads () {	 ($pm_bpb->{bpbHeads});}
}
unless(defined(&pm_HiddenSects)) {
    sub pm_HiddenSects () {	 ($pm_bpb->{bpbHiddenSecs});}
}
unless(defined(&pm_HugeSectors)) {
    sub pm_HugeSectors () {	 ($pm_bpb->{bpbHugeSectors});}
}
unless(defined(&bptoep)) {
    sub bptoep {
	my($pmp, $bp, $dirofs) = @_;
	eval q((((($bp)-> &b_data) + (($dirofs) & ($pmp)-> &pm_crbomask))));
    }
}
unless(defined(&de_bn2cn)) {
    sub de_bn2cn {
	my($pmp, $bn) = @_;
	eval q((($bn) >> (($pmp)-> &pm_cnshift - ($pmp)-> &pm_bnshift)));
    }
}
unless(defined(&de_cn2bn)) {
    sub de_cn2bn {
	my($pmp, $cn) = @_;
	eval q((($cn) << (($pmp)-> &pm_cnshift - ($pmp)-> &pm_bnshift)));
    }
}
unless(defined(&de_cluster)) {
    sub de_cluster {
	my($pmp, $off) = @_;
	eval q((($off) >> ($pmp)-> &pm_cnshift));
    }
}
unless(defined(&de_clcount)) {
    sub de_clcount {
	my($pmp, $size) = @_;
	eval q(((($size) + ($pmp)-> &pm_bpcluster - 1) >> ($pmp)-> &pm_cnshift));
    }
}
unless(defined(&de_blk)) {
    sub de_blk {
	my($pmp, $off) = @_;
	eval q(( &de_cn2bn($pmp,  &de_cluster(($pmp), ($off)))));
    }
}
unless(defined(&de_cn2off)) {
    sub de_cn2off {
	my($pmp, $cn) = @_;
	eval q((($cn) << ($pmp)-> &pm_cnshift));
    }
}
unless(defined(&de_bn2off)) {
    sub de_bn2off {
	my($pmp, $bn) = @_;
	eval q((($bn) << ($pmp)-> &pm_bnshift));
    }
}
unless(defined(&cntobn)) {
    sub cntobn {
	my($pmp, $cn) = @_;
	eval q(( &de_cn2bn(($pmp), ($cn)- &CLUST_FIRST) + ($pmp)-> &pm_firstcluster));
    }
}
unless(defined(&roottobn)) {
    sub roottobn {
	my($pmp, $dirofs) = @_;
	eval q(( &de_blk(($pmp), ($dirofs)) + ($pmp)-> &pm_rootdirblk));
    }
}
unless(defined(&detobn)) {
    sub detobn {
	my($pmp, $dirclu, $dirofs) = @_;
	eval q((($dirclu) ==  &MSDOSFSROOT ?  &roottobn(($pmp), ($dirofs)) :  &cntobn(($pmp), ($dirclu))));
    }
}
unless(defined(&fsi_size)) {
    sub fsi_size {
	my($pmp) = @_;
	eval q((1024<< (($pmp)-> &pm_BlkPerSec >> 2)));
    }
}
1;
