require '_h2ph_pre.ph';

unless(defined(&_TCFS_KEYTAB_H_)) {
    eval 'sub _TCFS_KEYTAB_H_ () {1;}' unless defined(&_TCFS_KEYTAB_H_);
    require 'sys/types.ph';
    eval 'sub KEYTABSIZE () {20;}' unless defined(&KEYTABSIZE);
    eval 'sub KEYSIZE () {32;}' unless defined(&KEYSIZE);
    eval 'sub KEYPARTSIZE () {( &KEYSIZE+ &KEYSIZE/8);}' unless defined(&KEYPARTSIZE);
    eval 'sub CLEAN () {0x00;}' unless defined(&CLEAN);
    eval 'sub PID_BIT () {0x01;}' unless defined(&PID_BIT);
    eval 'sub UID_KEY () {0x02;}' unless defined(&UID_KEY);
    eval 'sub GID_KEY () {0x04;}' unless defined(&GID_KEY);
    eval 'sub PID_KEY () {( &PID_BIT| &UID_KEY);}' unless defined(&PID_KEY);
    eval 'sub IS_GID_NODE {
        local($np) = @_;
	    eval q(((($np)-> &kn_type) &GID_KEY));
    }' unless defined(&IS_GID_NODE);
    eval 'sub IS_UID_NODE {
        local($np) = @_;
	    eval q(((($np)-> &kn_type) &UID_KEY));
    }' unless defined(&IS_UID_NODE);
    eval 'sub IS_PID_NODE {
        local($np) = @_;
	    eval q((((($np)-> &kn_type) &PID_BIT) &&( &IS_UID_NODE(($np)))));
    }' unless defined(&IS_PID_NODE);
    unless(defined(&TCFS_OK)) {
	eval 'sub TCFS_OK () {0;}' unless defined(&TCFS_OK);
    }
    eval 'sub MAXUSRPERGRP () {10;}' unless defined(&MAXUSRPERGRP);
    eval 'sub GUI_CLEAN () {0;}' unless defined(&GUI_CLEAN);
    eval 'sub GUI_SET () {1;}' unless defined(&GUI_SET);
    eval 'sub IS_SET_GUI {
        local($gui) = @_;
	    eval q((($gui). &gui_flag== &GUI_SET));
    }' unless defined(&IS_SET_GUI);
    eval 'sub IS_CLEAN_GD {
        local($gd) = @_;
	    eval q((($gd)-> &gd_n==0));
    }' unless defined(&IS_CLEAN_GD);
    eval 'sub IS_FULL_GD {
        local($gd) = @_;
	    eval q((($gd)-> &gd_n== &MAXUSRPERGRP));
    }' unless defined(&IS_FULL_GD);
    eval 'sub IS_READY_GD {
        local($gd) = @_;
	    eval q(((($gd)-> &gd_n)>=(($gd)-> &gd_k)));
    }' unless defined(&IS_READY_GD);
    undef(&kn_data) if defined(&kn_data);
    eval 'sub NIL () {(0);}' unless defined(&NIL);
    if(defined(&_HAVE_HASH_)) {
	eval 'sub tcfs_keytab_hash {
	    local($x) = @_;
    	    eval q( &_tcfs_keytab_hash(($x)));
	}' unless defined(&tcfs_keytab_hash);
    } else {
	eval 'sub tcfs_keytab_hash {
	    local($u) = @_;
    	    eval q((($u)% &KEYTABSIZE));
	}' unless defined(&tcfs_keytab_hash);
    }
}
1;
