require '_h2ph_pre.ph';

unless(defined(&_TCFS_H_)) {
    eval 'sub _TCFS_H_ () {1;}' unless defined(&_TCFS_H_);
    require 'miscfs/tcfs/tcfs_mount.ph';
    if(defined(&_KERNEL)) {
	eval 'sub MOUNTTOTCFSMOUNT {
	    local($mp) = @_;
    	    eval q(((($mp)-> &mnt_data)));
	}' unless defined(&MOUNTTOTCFSMOUNT);
	eval 'sub VTOTCFS {
	    local($vp) = @_;
    	    eval q((($vp)-> &v_data));
	}' unless defined(&VTOTCFS);
	eval 'sub TCFSTOV {
	    local($xp) = @_;
    	    eval q((($xp)-> &tcfs_vnode));
	}' unless defined(&TCFSTOV);
	if(defined(&TCFS_DIAGNOSTIC)) {
	    eval 'sub TCFSVPTOLOWERVP {
	        local($vp) = @_;
    		eval q( &tcfs_checkvp(($vp),  &__FILE__,  &__LINE__));
	    }' unless defined(&TCFSVPTOLOWERVP);
	} else {
	    eval 'sub TCFSVPTOLOWERVP {
	        local($vp) = @_;
    		eval q(( &VTOTCFS($vp)-> &tcfs_lowervp));
	    }' unless defined(&TCFSVPTOLOWERVP);
	}
	eval 'sub TCFS_VP2UKT {
	    local($vp) = @_;
    	    eval q((( &MOUNTTOTCFSMOUNT((($vp)-> &v_mount)))-> &tcfs_uid_kt));
	}' unless defined(&TCFS_VP2UKT);
	eval 'sub TCFS_VP2GKT {
	    local($vp) = @_;
    	    eval q((( &MOUNTTOTCFSMOUNT((($vp)-> &v_mount)))-> &tcfs_gid_kt));
	}' unless defined(&TCFS_VP2GKT);
	eval 'sub tcfs_fhtovp () {((\'int\' (*)  &__P((\'struct mount\' *, \'struct fid\' *, \'struct vnode\' **))) &eopnotsupp);}' unless defined(&tcfs_fhtovp);
	eval 'sub tcfs_vptofh () {((\'int\' (*)  &__P((\'struct vnode\' *, \'struct fid\' *))) &eopnotsupp);}' unless defined(&tcfs_vptofh);
	eval 'sub BLOCKSIZE () {1024;}' unless defined(&BLOCKSIZE);
	eval 'sub SBLOCKSIZE () {8;}' unless defined(&SBLOCKSIZE);
	eval 'sub ABS {
	    local($a) = @_;
    	    eval q((($a)>=0?($a):(-$a)));
	}' unless defined(&ABS);
	eval 'sub TCFS_CHECK_AKEY {
	    local($c,$p,$v) = @_;
    	    eval q((  &tcfs_checkukey(($c),($p),($v)) ||  &tcfs_checkpkey(($c),($p),($v)) ||  &tcfs_checkgkey(($c),($p),($v)) ));
	}' unless defined(&TCFS_CHECK_AKEY);
    }
}
1;
