1 /* 2 * Header file for common error description library. 3 * 4 * Copyright 1988, Student Information Processing Board of the 5 * Massachusetts Institute of Technology. 6 * 7 * Copyright 1995 by Cygnus Support. 8 * 9 * For copyright and distribution info, see the documentation supplied 10 * with this package. 11 */ 12 13 #ifndef __COM_ERR_H 14 15 #pragma ident "%Z%%M% %I% %E% SMI" 16 17 #if defined(_WIN32) 18 #include <win-mac.h> 19 #endif 20 21 #ifndef KRB5_CALLCONV 22 #define KRB5_CALLCONV 23 #define KRB5_CALLCONV_C 24 #endif 25 26 #include <stdarg.h> 27 28 typedef long errcode_t; 29 typedef void (*et_old_error_hook_func) (const char *, errcode_t, 30 const char *, va_list ap); 31 32 struct error_table { 33 /*@shared@*/ char const * const * msgs; 34 long base; 35 unsigned int n_msgs; 36 }; 37 38 #ifdef __cplusplus 39 extern "C" { 40 #endif 41 42 /* Public interfaces */ 43 extern void KRB5_CALLCONV_C com_err 44 (const char *, errcode_t, const char *, ...); 45 extern void KRB5_CALLCONV com_err_va 46 (const char *whoami, errcode_t code, const char *fmt, 47 va_list ap); 48 extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message 49 (errcode_t) 50 /*@modifies internalState@*/; 51 extern errcode_t KRB5_CALLCONV add_error_table 52 (/*@dependent@*/ const struct error_table *) 53 /*@modifies internalState@*/; 54 extern errcode_t KRB5_CALLCONV remove_error_table 55 (const struct error_table *) 56 /*@modifies internalState@*/; 57 58 #if !defined(_WIN32) 59 /* 60 * The display routine should be application specific. A global hook, 61 * may cause inappropriate display procedures to be called between 62 * applications under non-Unix environments. 63 */ 64 65 extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); 66 extern et_old_error_hook_func reset_com_err_hook (void); 67 #endif 68 69 #ifdef __cplusplus 70 } 71 #endif 72 73 #define __COM_ERR_H 74 #endif /* ! defined(__COM_ERR_H) */ 75