move deprecated function to deprecated.c

This commit is contained in:
Love Hornquist Astrand
2011-09-25 19:03:11 +02:00
parent 0793246e99
commit d3f85af92c
2 changed files with 38 additions and 36 deletions

View File

@@ -606,4 +606,40 @@ krb5_auth_getremoteseqnumber(krb5_context context,
return 0;
}
/**
* Return the error message in context. On error or no error string,
* the function returns NULL.
*
* @param context Kerberos 5 context
*
* @return an error string, needs to be freed with
* krb5_free_error_message(). The functions return NULL on error.
*
* @ingroup krb5_error
*/
KRB5_LIB_FUNCTION char * KRB5_LIB_CALL
krb5_get_error_string(krb5_context context)
KRB5_DEPRECATED_FUNCTION("Use krb5_get_error_message instead")
{
char *ret = NULL;
HEIMDAL_MUTEX_lock(context->mutex);
if (context->error_string)
ret = strdup(context->error_string);
HEIMDAL_MUTEX_unlock(context->mutex);
return ret;
}
KRB5_LIB_FUNCTION krb5_boolean KRB5_LIB_CALL
krb5_have_error_string(krb5_context context)
KRB5_DEPRECATED_FUNCTION("Use krb5_get_error_message instead")
{
char *str;
HEIMDAL_MUTEX_lock(context->mutex);
str = context->error_string;
HEIMDAL_MUTEX_unlock(context->mutex);
return str != NULL;
}
#endif /* HEIMDAL_SMALLER */