require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&__KRB5_V4COMPAT_H__)) {
    eval 'sub __KRB5_V4COMPAT_H__ () {1;}' unless defined(&__KRB5_V4COMPAT_H__);
    require 'krb5/krb_err.ph';
    eval 'sub KRB_PROT_VERSION () {4;}' unless defined(&KRB_PROT_VERSION);
    eval 'sub AUTH_MSG_KDC_REQUEST () {(1<<1);}' unless defined(&AUTH_MSG_KDC_REQUEST);
    eval 'sub AUTH_MSG_KDC_REPLY () {(2<<1);}' unless defined(&AUTH_MSG_KDC_REPLY);
    eval 'sub AUTH_MSG_APPL_REQUEST () {(3<<1);}' unless defined(&AUTH_MSG_APPL_REQUEST);
    eval 'sub AUTH_MSG_APPL_REQUEST_MUTUAL () {(4<<1);}' unless defined(&AUTH_MSG_APPL_REQUEST_MUTUAL);
    eval 'sub AUTH_MSG_ERR_REPLY () {(5<<1);}' unless defined(&AUTH_MSG_ERR_REPLY);
    eval 'sub AUTH_MSG_PRIVATE () {(6<<1);}' unless defined(&AUTH_MSG_PRIVATE);
    eval 'sub AUTH_MSG_SAFE () {(7<<1);}' unless defined(&AUTH_MSG_SAFE);
    eval 'sub AUTH_MSG_APPL_ERR () {(8<<1);}' unless defined(&AUTH_MSG_APPL_ERR);
    eval 'sub AUTH_MSG_KDC_FORWARD () {(9<<1);}' unless defined(&AUTH_MSG_KDC_FORWARD);
    eval 'sub AUTH_MSG_KDC_RENEW () {(10<<1);}' unless defined(&AUTH_MSG_KDC_RENEW);
    eval 'sub AUTH_MSG_DIE () {(63<<1);}' unless defined(&AUTH_MSG_DIE);
    eval 'sub KSUCCESS () {0;}' unless defined(&KSUCCESS);
    eval 'sub KFAILURE () {255;}' unless defined(&KFAILURE);
    eval 'sub MAX_KTXT_LEN () {1250;}' unless defined(&MAX_KTXT_LEN);
    eval 'sub ANAME_SZ () {40;}' unless defined(&ANAME_SZ);
    eval 'sub REALM_SZ () {40;}' unless defined(&REALM_SZ);
    eval 'sub SNAME_SZ () {40;}' unless defined(&SNAME_SZ);
    eval 'sub INST_SZ () {40;}' unless defined(&INST_SZ);
    eval 'sub TKTLIFENUMFIXED () {64;}' unless defined(&TKTLIFENUMFIXED);
    eval 'sub TKTLIFEMINFIXED () {0x80;}' unless defined(&TKTLIFEMINFIXED);
    eval 'sub TKTLIFEMAXFIXED () {0xbf;}' unless defined(&TKTLIFEMAXFIXED);
    eval 'sub TKTLIFENOEXPIRE () {0xff;}' unless defined(&TKTLIFENOEXPIRE);
    eval 'sub MAXTKTLIFETIME () {(30*24*3600);}' unless defined(&MAXTKTLIFETIME);
    unless(defined(&NEVERDATE)) {
	eval 'sub NEVERDATE () {(( &time_t)0x7fffffff);}' unless defined(&NEVERDATE);
    }
    eval 'sub KERB_ERR_NULL_KEY () {10;}' unless defined(&KERB_ERR_NULL_KEY);
    eval 'sub CLOCK_SKEW () {5*60;}' unless defined(&CLOCK_SKEW);
    unless(defined(&TKT_ROOT)) {
	if(defined(&KRB5_USE_PATH_TOKENS)) {
	    eval 'sub TKT_ROOT () {"%{TEMP}/tkt";}' unless defined(&TKT_ROOT);
	} else {
	    eval 'sub TKT_ROOT () {"/tmp/tkt";}' unless defined(&TKT_ROOT);
	}
    }
    eval 'sub krb_time_to_life () { &_krb5_krb_time_to_life;}' unless defined(&krb_time_to_life);
    eval 'sub krb_life_to_time () { &_krb5_krb_life_to_time;}' unless defined(&krb_life_to_time);
}
1;
