require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&MSDOSFSROOT_OFS)) {
    sub MSDOSFSROOT_OFS () {	0x1fffffff;}
}
unless(defined(&FC_SIZE)) {
    sub FC_SIZE () {	2;}
}
unless(defined(&FC_LASTMAP)) {
    sub FC_LASTMAP () {	0;}
}
unless(defined(&FC_LASTFC)) {
    sub FC_LASTFC () {	1;}
}
unless(defined(&FCE_EMPTY)) {
    sub FCE_EMPTY () {	0xffffffff;}
}
unless(defined(&fc_setcache)) {
    sub fc_setcache {
	my($dep, $slot, $frcn, $fsrcn) = @_;
	eval q(($dep)-> ($de_fc[$slot]->{fc_frcn}) = $frcn; ($dep)-> ($de_fc[$slot]->{fc_fsrcn}) = $fsrcn;);
    }
}
unless(defined(&DE_UPDATE)) {
    sub DE_UPDATE () {	0x4;}
}
unless(defined(&DE_CREATE)) {
    sub DE_CREATE () {	0x8;}
}
unless(defined(&DE_ACCESS)) {
    sub DE_ACCESS () {	0x10;}
}
unless(defined(&DE_MODIFIED)) {
    sub DE_MODIFIED () {	0x20;}
}
unless(defined(&DE_RENAME)) {
    sub DE_RENAME () {	0x40;}
}
unless(defined(&WIN_MAXLEN)) {
    sub WIN_MAXLEN () {	255;}
}
unless(defined(&MSDOSFS_FILESIZE_MAX)) {
    sub MSDOSFS_FILESIZE_MAX () {	0xffffffff;}
}
unless(defined(&DE_INTERNALIZE32)) {
    sub DE_INTERNALIZE32 {
	my($dep, $dp) = @_;
	eval q((($dep)-> &de_StartCluster |=  &getushort(($dp)-> &deHighClust) << 16));
    }
}
unless(defined(&DE_INTERNALIZE)) {
    sub DE_INTERNALIZE {
	my($dep, $dp) = @_;
	eval q(( &bcopy(($dp)-> &deName, ($dep)-> &de_Name, 11), ($dep)-> &de_Attributes = ($dp)-> &deAttributes, ($dep)-> &de_CTimeHundredth = ($dp)-> &deCTimeHundredth, ($dep)-> &de_CTime =  &getushort(($dp)-> &deCTime), ($dep)-> &de_CDate =  &getushort(($dp)-> &deCDate), ($dep)-> &de_ADate =  &getushort(($dp)-> &deADate), ($dep)-> &de_MTime =  &getushort(($dp)-> &deMTime), ($dep)-> &de_MDate =  &getushort(($dp)-> &deMDate), ($dep)-> &de_StartCluster =  &getushort(($dp)-> &deStartCluster), ($dep)-> &de_FileSize =  &getulong(($dp)-> &deFileSize), ( &FAT32(($dep)-> &de_pmp) ?  &DE_INTERNALIZE32(($dep), ($dp)) : 0)));
    }
}
unless(defined(&DE_EXTERNALIZE)) {
    sub DE_EXTERNALIZE {
	my($dp, $dep) = @_;
	eval q(( &bcopy(($dep)-> &de_Name, ($dp)-> &deName, 11), ($dp)-> &deAttributes = ($dep)-> &de_Attributes, ($dp)-> &deLowerCase =  &CASE_LOWER_BASE |  &CASE_LOWER_EXT, ($dp)-> &deCTimeHundredth = ($dep)-> &de_CTimeHundredth,  &putushort(($dp)-> &deCTime, ($dep)-> &de_CTime),  &putushort(($dp)-> &deCDate, ($dep)-> &de_CDate),  &putushort(($dp)-> &deADate, ($dep)-> &de_ADate),  &putushort(($dp)-> &deMTime, ($dep)-> &de_MTime),  &putushort(($dp)-> &deMDate, ($dep)-> &de_MDate),  &putushort(($dp)-> &deStartCluster, ($dep)-> &de_StartCluster),  &putulong(($dp)-> &deFileSize, (($dep)-> &de_Attributes &  &ATTR_DIRECTORY) ? 0: ($dep)-> &de_FileSize),  &putushort(($dp)-> &deHighClust,  &FAT32(($dep)-> &de_pmp) ? ($dep)-> &de_StartCluster >> 16: 0)));
    }
}
unless(defined(&de_forw)) {
    sub de_forw () {	 $de_chain[0];}
}
unless(defined(&de_back)) {
    sub de_back () {	 $de_chain[1];}
}
if(defined(&_KERNEL)) {
    eval 'sub VTODE {
        my($vp) = @_;
	    eval q((($vp)-> &v_data));
    }' unless defined(&VTODE);
    eval 'sub DETOV {
        my($de) = @_;
	    eval q((($de)-> &de_vnode));
    }' unless defined(&DETOV);
    eval 'sub DETIMES {
        my($dep, $acc, $mod, $cre) = @_;
	    eval q( &if (($dep)-> &de_flag & ( &DE_UPDATE |  &DE_CREATE |  &DE_ACCESS)) { ($dep)-> &de_flag |=  &DE_MODIFIED;  &if (($dep)-> &de_flag &  &DE_UPDATE) {  &unix2dostime(($mod), ($dep)-> &de_MDate, ($dep)-> &de_MTime,  &NULL); ($dep)-> &de_Attributes |=  &ATTR_ARCHIVE; }  &if (!(($dep)-> ($de_pmp->{pm_flags}) &  &MSDOSFSMNT_NOWIN95)) {  &if (($dep)-> &de_flag &  &DE_ACCESS)  &unix2dostime(($acc), ($dep)-> &de_ADate,  &NULL,  &NULL);  &if (($dep)-> &de_flag &  &DE_CREATE)  &unix2dostime(($cre), ($dep)-> &de_CDate, ($dep)-> &de_CTime, ($dep)-> &de_CTimeHundredth); } ($dep)-> &de_flag &= ~( &DE_UPDATE |  &DE_CREATE |  &DE_ACCESS); });
    }' unless defined(&DETIMES);
    if(0) {
    }
}
1;
