require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_MSDOSFS_MSDOSFSMOUNT_H_)) {
    eval 'sub _MSDOSFS_MSDOSFSMOUNT_H_ () {1;}' unless defined(&_MSDOSFS_MSDOSFSMOUNT_H_);
    unless(defined(&MAKEFS)) {
	eval 'sub MSDOSFSMNT_VERSION () {3;}' unless defined(&MSDOSFSMNT_VERSION);
    }
    eval 'sub MSDOSFSMNT_SHORTNAME () {1;}' unless defined(&MSDOSFSMNT_SHORTNAME);
    eval 'sub MSDOSFSMNT_LONGNAME () {2;}' unless defined(&MSDOSFSMNT_LONGNAME);
    eval 'sub MSDOSFSMNT_NOWIN95 () {4;}' unless defined(&MSDOSFSMNT_NOWIN95);
    eval 'sub MSDOSFSMNT_GEMDOSFS () {8;}' unless defined(&MSDOSFSMNT_GEMDOSFS);
    eval 'sub MSDOSFSMNT_VERSIONED () {16;}' unless defined(&MSDOSFSMNT_VERSIONED);
    eval 'sub MSDOSFSMNT_UTF8 () {32;}' unless defined(&MSDOSFSMNT_UTF8);
    eval 'sub MSDOSFSMNT_MNTOPT () {( &MSDOSFSMNT_SHORTNAME| &MSDOSFSMNT_LONGNAME| &MSDOSFSMNT_NOWIN95 | &MSDOSFSMNT_GEMDOSFS| &MSDOSFSMNT_VERSIONED| &MSDOSFSMNT_UTF8);}' unless defined(&MSDOSFSMNT_MNTOPT);
    eval 'sub MSDOSFSMNT_RONLY () {0x80000000;}' unless defined(&MSDOSFSMNT_RONLY);
    eval 'sub MSDOSFSMNT_WAITONFAT () {0x40000000;}' unless defined(&MSDOSFSMNT_WAITONFAT);
    eval 'sub MSDOSFS_FATMIRROR () {0x20000000;}' unless defined(&MSDOSFS_FATMIRROR);
    eval 'sub MSDOSFSMNT_BITS () {"\\177\\20" "b\\00shortname\\0b\\01longname\\0b\\02nowin95\\0b\\03gemdosfs\\0b\\04mntversioned\\0" "b\\05utf8\\0b\\037ronly\\0b\\036waitonfat\\0b\\035fatmirror\\0";}' unless defined(&MSDOSFSMNT_BITS);
    if(defined(&_KERNEL)) {
	require 'sys/mallocvar.ph';
	if(defined(&MALLOC_DECLARE)) {
	}
    }
    if(defined(&_KERNEL) || defined(&MAKEFS)) {
	eval 'sub FATOFS {
	    my($pmp, $cn) = @_;
    	    eval q((($cn) * ($pmp)-> &pm_fatmult / ($pmp)-> &pm_fatdiv));
	}' unless defined(&FATOFS);
	eval 'sub VFSTOMSDOSFS {
	    my($mp) = @_;
    	    eval q(( ($mp->{mnt_data})));
	}' unless defined(&VFSTOMSDOSFS);
	eval 'sub N_INUSEBITS () {(8* $sizeof{\'u_int\'});}' unless defined(&N_INUSEBITS);
	eval 'sub pm_BytesPerSec () { ($pm_bpb->{bpbBytesPerSec});}' unless defined(&pm_BytesPerSec);
	eval 'sub pm_ResSectors () { ($pm_bpb->{bpbResSectors});}' unless defined(&pm_ResSectors);
	eval 'sub pm_FATs () { ($pm_bpb->{bpbFATs});}' unless defined(&pm_FATs);
	eval 'sub pm_RootDirEnts () { ($pm_bpb->{bpbRootDirEnts});}' unless defined(&pm_RootDirEnts);
	eval 'sub pm_Sectors () { ($pm_bpb->{bpbSectors});}' unless defined(&pm_Sectors);
	eval 'sub pm_Media () { ($pm_bpb->{bpbMedia});}' unless defined(&pm_Media);
	eval 'sub pm_SecPerTrack () { ($pm_bpb->{bpbSecPerTrack});}' unless defined(&pm_SecPerTrack);
	eval 'sub pm_Heads () { ($pm_bpb->{bpbHeads});}' unless defined(&pm_Heads);
	eval 'sub pm_HiddenSects () { ($pm_bpb->{bpbHiddenSecs});}' unless defined(&pm_HiddenSects);
	eval 'sub pm_HugeSectors () { ($pm_bpb->{bpbHugeSectors});}' unless defined(&pm_HugeSectors);
	eval 'sub bptoep {
	    my($pmp, $bp, $dirofs) = @_;
    	    eval q((((($bp)-> &b_data) + (($dirofs) & ($pmp)-> &pm_crbomask))));
	}' unless defined(&bptoep);
	eval 'sub de_bn2cn {
	    my($pmp, $bn) = @_;
    	    eval q((($bn) >> (($pmp)-> &pm_cnshift - ($pmp)-> &pm_bnshift)));
	}' unless defined(&de_bn2cn);
	eval 'sub de_cn2bn {
	    my($pmp, $cn) = @_;
    	    eval q((($cn) << (($pmp)-> &pm_cnshift - ($pmp)-> &pm_bnshift)));
	}' unless defined(&de_cn2bn);
	eval 'sub de_bn2kb {
	    my($pmp, $bn) = @_;
    	    eval q((($bn) << (($pmp)-> &pm_bnshift -  &DEV_BSHIFT)));
	}' unless defined(&de_bn2kb);
	eval 'sub de_kb2bn {
	    my($pmp, $kb) = @_;
    	    eval q((($kb) >> (($pmp)-> &pm_bnshift -  &DEV_BSHIFT)));
	}' unless defined(&de_kb2bn);
	eval 'sub de_cluster {
	    my($pmp, $off) = @_;
    	    eval q((($off) >> ($pmp)-> &pm_cnshift));
	}' unless defined(&de_cluster);
	eval 'sub de_clcount {
	    my($pmp, $size) = @_;
    	    eval q(((($size) + ($pmp)-> &pm_bpcluster - 1) >> ($pmp)-> &pm_cnshift));
	}' unless defined(&de_clcount);
	eval 'sub de_blk {
	    my($pmp, $off) = @_;
    	    eval q(( &de_cn2bn($pmp,  &de_cluster(($pmp), ($off)))));
	}' unless defined(&de_blk);
	eval 'sub de_cn2off {
	    my($pmp, $cn) = @_;
    	    eval q((($cn) << ($pmp)-> &pm_cnshift));
	}' unless defined(&de_cn2off);
	eval 'sub de_bn2off {
	    my($pmp, $bn) = @_;
    	    eval q((($bn) << ($pmp)-> &pm_bnshift));
	}' unless defined(&de_bn2off);
	eval 'sub cntobn {
	    my($pmp, $cn) = @_;
    	    eval q(( &de_cn2bn(($pmp), ($cn)- &CLUST_FIRST) + ($pmp)-> &pm_firstcluster));
	}' unless defined(&cntobn);
	eval 'sub roottobn {
	    my($pmp, $dirofs) = @_;
    	    eval q(( &de_blk(($pmp), ($dirofs)) + ($pmp)-> &pm_rootdirblk));
	}' unless defined(&roottobn);
	eval 'sub detobn {
	    my($pmp, $dirclu, $dirofs) = @_;
    	    eval q((($dirclu) ==  &MSDOSFSROOT ?  &roottobn(($pmp), ($dirofs)) :  &cntobn(($pmp), ($dirclu))));
	}' unless defined(&detobn);
	unless(defined(&MAKEFS)) {
	}
    }
}
1;
