require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_nnpfs_h)) {
    eval 'sub _nnpfs_h () {1;}' unless defined(&_nnpfs_h);
    require 'sys/types.ph';
    require 'nnpfs/nnpfs_common.ph';
    require 'nnpfs/nnpfs_node.ph';
    require 'nnpfs/nnpfs_attr.ph';
    eval 'sub NNNPFS () {2;}' unless defined(&NNNPFS);
    eval 'sub NNPFS_MOUNTED () {0x1;}' unless defined(&NNPFS_MOUNTED);
    if(defined(&__osf__)) {
	if(defined(&HAVE_STRUCT_MOUNT_M_INFO)) {
	    eval 'sub VFS_TO_NNPFS {
	        my($v) = @_;
    		eval q(( (($v)-> &m_info)));
	    }' unless defined(&VFS_TO_NNPFS);
	    eval 'sub VFS_ASSIGN {
	        my($v, $val) = @_;
    		eval q( &do { ($v)-> &m_info = ( &void *) ($val); }  &while (0));
	    }' unless defined(&VFS_ASSIGN);
	} else {
	    eval 'sub VFS_TO_NNPFS {
	        my($v) = @_;
    		eval q(( (($v)-> &m_data)));
	    }' unless defined(&VFS_TO_NNPFS);
	    eval 'sub VFS_ASSIGN {
	        my($v, $val) = @_;
    		eval q( &do { ($v)-> &m_data = ( &void *) ($val); }  &while (0));
	    }' unless defined(&VFS_ASSIGN);
	}
    } else {
	eval 'sub VFS_TO_NNPFS {
	    my($v) = @_;
    	    eval q(( (($v)-> &mnt_data)));
	}' unless defined(&VFS_TO_NNPFS);
	eval 'sub VFS_ASSIGN {
	    my($v, $val) = @_;
    	    eval q( &do { ($v)-> &mnt_data = ( &void *) ($val); }  &while (0));
	}' unless defined(&VFS_ASSIGN);
    }
    eval 'sub NNPFS_TO_VFS {
        my($x) = @_;
	    eval q((($x)-> &mp));
    }' unless defined(&NNPFS_TO_VFS);
    eval 'sub NNPFS_FROM_VNODE {
        my($vp) = @_;
	    eval q( &VFS_TO_NNPFS(($vp)-> &v_mount));
    }' unless defined(&NNPFS_FROM_VNODE);
    eval 'sub NNPFS_FROM_XNODE {
        my($xp) = @_;
	    eval q( &NNPFS_FROM_VNODE( &XNODE_TO_VNODE($xp)));
    }' unless defined(&NNPFS_FROM_XNODE);
}
1;
