From 647d10f2b8efd96a47ce5864f685b17cc7705f9f Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 8 Feb 1997 03:16:25 +0000 Subject: [PATCH] compile_et.c: Change the emitted name of the struct error_table to be et_XXX_error_table, instead of it being a static variable named "et". (This change has already been made in the awk versions of compile_et.) com_err.h, com_err.c: Remove the void *priv argument from com_err_va() and et_com_err() experimental API's. (That was a braino; the private data pointer should come from the hook_func_data field.) git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@9821 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/et/ChangeLog | 12 ++++++++++++ src/util/et/com_err.c | 16 +++++++--------- src/util/et/com_err.h | 9 ++++++--- src/util/et/compile_et.c | 6 +++--- 4 files changed, 28 insertions(+), 15 deletions(-) diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index 24a62e105..46fc71e5a 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,15 @@ +Fri Feb 7 22:10:23 1997 Theodore Y. Ts'o + + * compile_et.c: Change the emitted name of the struct error_table + to be et_XXX_error_table, instead of it being a static + variable named "et". (This change has already been made + in the awk versions of compile_et.) + + * com_err.h, com_err.c: Remove the void *priv argument from + com_err_va() and et_com_err() experimental API's. (That + was a braino; the private data pointer should come from + the hook_func_data field.) + Fri Feb 7 19:03:07 1997 Richard Basch * com_err.c com_err.h: Added old interface function com_err_va diff --git a/src/util/et/com_err.c b/src/util/et/com_err.c index 5c9e59fe0..49aa29658 100644 --- a/src/util/et/com_err.c +++ b/src/util/et/com_err.c @@ -103,9 +103,8 @@ void KRB5_CALLCONV default_com_err_proc(ectx, priv, whoami, code, fmt, ap) et_old_error_hook_func com_err_hook = 0; -void et_com_err_va(ectx, priv, whoami, code, fmt, ap) +void et_com_err_va(ectx, whoami, code, fmt, ap) et_ctx ectx; - void FAR *priv; const char FAR *whoami; errcode_t code; const char FAR *fmt; @@ -114,7 +113,8 @@ void et_com_err_va(ectx, priv, whoami, code, fmt, ap) if (ectx) { if (ectx->hook_func == 0) ectx->hook_func = default_com_err_proc; - (*ectx->hook_func)(ectx, priv, whoami, code, fmt, ap); + (*ectx->hook_func)(ectx, ectx->hook_func_data, whoami, + code, fmt, ap); } else { if (!com_err_hook) default_com_err_proc(0, 0, whoami, @@ -126,15 +126,13 @@ void et_com_err_va(ectx, priv, whoami, code, fmt, ap) #ifndef ET_VARARGS KRB5_DLLIMP void KRB5_CALLCONV_C et_com_err(et_ctx ectx, - void FAR *priv, const char FAR *whoami, errcode_t code, const char FAR *fmt, ...) #else -KRB5_DLLIMP void KRB5_CALLCONV_C et_com_err(ectx, priv, whoami, +KRB5_DLLIMP void KRB5_CALLCONV_C et_com_err(ectx, whoami, code, fmt, va_alist) et_ctx ectx; - void FAR *priv; const char FAR *whoami; errcode_t code; const char FAR *fmt; @@ -148,7 +146,7 @@ KRB5_DLLIMP void KRB5_CALLCONV_C et_com_err(ectx, priv, whoami, #else va_start(ap, fmt); #endif - et_com_err_va(ectx, priv, whoami, code, fmt, ap); + et_com_err_va(ectx, whoami, code, fmt, ap); va_end(ap); } @@ -162,7 +160,7 @@ KRB5_DLLIMP void KRB5_CALLCONV_C com_err_va(whoami, code, fmt, args) const char FAR * fmt; va_list args; { - et_com_err_va(0, 0, whoami, code, fmt, args); + et_com_err_va(0, whoami, code, fmt, args); } #ifndef ET_VARARGS @@ -170,7 +168,7 @@ KRB5_DLLIMP void KRB5_CALLCONV_C com_err(const char FAR *whoami, errcode_t code, const char FAR *fmt, ...) #else -KRB5_DLLIMP void KRB5_CALLCONV_C et_com_err(whoami, code, fmt, va_alist) +KRB5_DLLIMP void KRB5_CALLCONV_C com_err(whoami, code, fmt, va_alist) const char FAR *whoami; errcode_t code; const char FAR *fmt; diff --git a/src/util/et/com_err.h b/src/util/et/com_err.h index f050f33b5..435dd4d10 100644 --- a/src/util/et/com_err.h +++ b/src/util/et/com_err.h @@ -72,9 +72,12 @@ KRB5_DLLIMP extern et_old_error_hook_func KRB5_CALLCONV set_com_err_hook ET_P((et_old_error_hook_func)); KRB5_DLLIMP extern et_old_error_hook_func KRB5_CALLCONV reset_com_err_hook ET_P((void)); +KRB5_DLLIMP extern void KRB5_CALLCONV com_err_va + ET_P((const char FAR *whoami, errcode_t code, const char FAR *fmt, + va_list ap)); /* - * The the new com_err API... + * The experimental com_err API... */ typedef struct et_context FAR *et_ctx; typedef void (KRB5_CALLCONV *et_error_hook_func) @@ -102,11 +105,11 @@ KRB5_DLLIMP extern const char FAR * KRB5_CALLCONV et_error_message ET_P((et_ctx, errcode_t)); KRB5_DLLIMP extern void KRB5_CALLCONV_C et_com_err - ET_STDARG_P((et_ctx, void FAR *, const char FAR *, errcode_t, + ET_STDARG_P((et_ctx, const char FAR *, errcode_t, const char FAR *, ...)); KRB5_DLLIMP extern void KRB5_CALLCONV_C et_com_err_va - ET_STDARG_P((et_ctx, void FAR *, const char FAR *, errcode_t, + ET_STDARG_P((et_ctx, const char FAR *, errcode_t, const char FAR *, va_list ap)); KRB5_DLLIMP errcode_t KRB5_CALLCONV et_set_hook diff --git a/src/util/et/compile_et.c b/src/util/et/compile_et.c index d42c27433..20239312e 100644 --- a/src/util/et/compile_et.c +++ b/src/util/et/compile_et.c @@ -247,15 +247,15 @@ int main (argc, argv) int argc; char **argv; { for (cpp = struct_def; *cpp; cpp++) fputs (*cpp, cfile); fprintf(cfile, - "static const struct error_table et = { text, %ldL, %d };\n\n", - table_number, current); + "const struct error_table et_%s_error_table = { text, %ldL, %d };\n\n", + table_name, table_number, current); fputs("static struct et_list link = { 0, 0 };\n\n", cfile); fprintf(cfile, "void initialize_%s_error_table (%s) {\n", table_name, (language == lang_C) ? "void" : "NOARGS"); fputs(" if (!link.table) {\n", cfile); fputs(" link.next = _et_list;\n", cfile); - fputs(" link.table = &et;\n", cfile); + fprintf(cfile, " link.table = &et_%s_error_table;\n", table_name); fputs(" _et_list = &link;\n", cfile); fputs(" }\n", cfile); fputs("}\n", cfile); -- 2.26.2