From c2853bd601064ef028cf4c6c35c197fd0c547c56 Mon Sep 17 00:00:00 2001 From: Tom Yu Date: Thu, 29 Jun 2006 00:39:29 +0000 Subject: [PATCH] pull up r18254,18255 from trunk r18254@cathode-dark-space: raeburn | 2006-06-28 20:03:36 -0400 ticket: new subject: fix calling convention for krb5 error-message routines, document usage of krb5_get_error_message target_version: 1.5 tags: pullup * lib/krb5/krb/kerrs.c (krb5_*_error_message): Annotate with correct calling conventions for Windows. * include/krb5/krb5.hin: Update declarations. Add comment on krb5_get_error_message usage. r18255@cathode-dark-space: raeburn | 2006-06-28 20:12:21 -0400 ticket: 3952 Fix comment style in public header. ticket: 3952 version_fixed: 1.5 git-svn-id: svn://anonsvn.mit.edu/krb5/branches/krb5-1-5@18257 dc483132-0cff-0310-8789-dd5450dbe970 --- src/include/krb5/krb5.hin | 20 +++++++++++++++----- src/lib/krb5/krb/kerrs.c | 10 +++++----- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/include/krb5/krb5.hin b/src/include/krb5/krb5.hin index 9c8399847..603ed8028 100644 --- a/src/include/krb5/krb5.hin +++ b/src/include/krb5/krb5.hin @@ -2539,17 +2539,27 @@ krb5_prompt_type* KRB5_CALLCONV krb5_get_prompt_types (krb5_context context); /* Error reporting */ -void +void KRB5_CALLCONV_C krb5_set_error_message (krb5_context, krb5_error_code, const char *, ...); #ifdef va_start -void +void KRB5_CALLCONV krb5_vset_error_message (krb5_context, krb5_error_code, const char *, va_list); #endif -char * +/* + * The behavior of krb5_get_error_message is only defined the first + * time it is called after a failed call to a krb5 function using the + * same context, and only when the error code passed in is the same as + * that returned by the krb5 function. Future versions may return the + * same string for the second and following calls. + * + * The string returned by this function must be freed using + * krb5_free_error_message. + */ +char * KRB5_CALLCONV krb5_get_error_message (krb5_context, krb5_error_code); -void +void KRB5_CALLCONV krb5_free_error_message (krb5_context, char *); -void +void KRB5_CALLCONV krb5_clear_error_message (krb5_context); diff --git a/src/lib/krb5/krb/kerrs.c b/src/lib/krb5/krb/kerrs.c index 6de62b780..448b38910 100644 --- a/src/lib/krb5/krb/kerrs.c +++ b/src/lib/krb5/krb/kerrs.c @@ -28,7 +28,7 @@ #include #include "k5-int.h" -void +void KRB5_CALLCONV_C krb5_set_error_message (krb5_context ctx, krb5_error_code code, const char *fmt, ...) { @@ -40,7 +40,7 @@ krb5_set_error_message (krb5_context ctx, krb5_error_code code, va_end (args); } -void +void KRB5_CALLCONV krb5_vset_error_message (krb5_context ctx, krb5_error_code code, const char *fmt, va_list args) { @@ -49,7 +49,7 @@ krb5_vset_error_message (krb5_context ctx, krb5_error_code code, krb5int_vset_error (&ctx->err, code, fmt, args); } -char * +char * KRB5_CALLCONV krb5_get_error_message (krb5_context ctx, krb5_error_code code) { if (ctx == NULL) @@ -57,7 +57,7 @@ krb5_get_error_message (krb5_context ctx, krb5_error_code code) return krb5int_get_error (&ctx->err, code); } -void +void KRB5_CALLCONV krb5_free_error_message (krb5_context ctx, char *msg) { if (ctx == NULL) @@ -65,7 +65,7 @@ krb5_free_error_message (krb5_context ctx, char *msg) krb5int_free_error (&ctx->err, msg); } -void +void KRB5_CALLCONV krb5_clear_error_message (krb5_context ctx) { if (ctx == NULL) -- 2.26.2