2 * Copyright 1987, 1988 by MIT Student Information Processing Board.
4 * For copyright info, see mit-sipb-cr.h.
10 #include "error_table.h"
14 * Protect us from header version (externally visible) of com_err, so
15 * we can survive in a <varargs.h> environment. I think.
17 #define com_err com_err_external
18 /* #include "com_err.h" */
19 char *error_message();
22 extern char *error_message ();
25 default_com_err_proc (const char *whoami, afs_int32 code, const char *fmt, va_list args)
28 fputs(whoami, stderr);
32 fputs(error_message(code), stderr);
36 vfprintf (stderr, fmt, args);
39 /* should do this only on a tty in raw mode */
44 typedef void (*errf) (const char *, afs_int32, const char *, va_list);
46 static errf com_err_hook = default_com_err_proc;
48 void com_err_va (whoami, code, fmt, args)
54 (*com_err_hook) (whoami, code, fmt, args);
57 void com_err (const char *whoami,
64 com_err_hook = default_com_err_proc;
66 com_err_va (whoami, code, fmt, pvar);
70 errf set_com_err_hook (new_proc)
73 errf x = com_err_hook;
74 if (new_proc) com_err_hook = new_proc;
75 else com_err_hook = default_com_err_proc;
79 errf reset_com_err_hook () {
80 errf x = com_err_hook;
81 com_err_hook = default_com_err_proc;