compile_et.c: Change the emitted name of the struct error_table
authorTheodore Tso <tytso@mit.edu>
Sat, 8 Feb 1997 03:16:25 +0000 (03:16 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 8 Feb 1997 03:16:25 +0000 (03:16 +0000)
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
src/util/et/com_err.c
src/util/et/com_err.h
src/util/et/compile_et.c

index 24a62e1054420ee1f58ed030c4f9b61e5ab9fa8f..46fc71e5a75977fbcf5360aaaa25964d716c93c0 100644 (file)
@@ -1,3 +1,15 @@
+Fri Feb  7 22:10:23 1997  Theodore Y. Ts'o  <tytso@mit.edu>
+
+       * 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  <basch@lehman.com>
 
        * com_err.c com_err.h: Added old interface function com_err_va
index 5c9e59fe0f2d32702283de64e99a95129328c86f..49aa2965873ef9fd56cab43648953d9dbc081caf 100644 (file)
@@ -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;
index f050f33b51fd584703879a1670e3ee1f02f42dd0..435dd4d1099fbb6be65a48eeda1a3b5c4c4d6541 100644 (file)
@@ -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
index d42c274337438552536c32f7dbbe5e1bbc8dda4d..20239312eaf4d7837f56728d1e4d2212a6e74561 100644 (file)
@@ -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);