jpayne@69: /* jpayne@69: * Copyright 1988, Student Information Processing Board of the jpayne@69: * Massachusetts Institute of Technology. jpayne@69: * jpayne@69: * Copyright 1995 by Cygnus Support. jpayne@69: * jpayne@69: * For copyright and distribution info, see the documentation supplied jpayne@69: * with this package. jpayne@69: */ jpayne@69: jpayne@69: /* Header file for common error description library. */ jpayne@69: jpayne@69: #ifndef __COM_ERR_H jpayne@69: jpayne@69: #if defined(_WIN32) jpayne@69: #include jpayne@69: #endif jpayne@69: jpayne@69: #ifndef KRB5_CALLCONV jpayne@69: #define KRB5_CALLCONV jpayne@69: #define KRB5_CALLCONV_C jpayne@69: #endif jpayne@69: jpayne@69: #include jpayne@69: jpayne@69: typedef long errcode_t; jpayne@69: typedef void (*et_old_error_hook_func) (const char *, errcode_t, jpayne@69: const char *, va_list ap); jpayne@69: jpayne@69: struct error_table { jpayne@69: /*@shared@*/ char const * const * msgs; jpayne@69: long base; jpayne@69: unsigned int n_msgs; jpayne@69: }; jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: extern "C" { jpayne@69: #endif jpayne@69: jpayne@69: /* Public interfaces */ jpayne@69: extern void KRB5_CALLCONV_C com_err jpayne@69: (const char *, errcode_t, const char *, ...) jpayne@69: #if !defined(__cplusplus) && (__GNUC__ > 2) jpayne@69: __attribute__((__format__(__printf__, 3, 4))) jpayne@69: #endif jpayne@69: ; jpayne@69: extern void KRB5_CALLCONV com_err_va jpayne@69: (const char *whoami, errcode_t code, const char *fmt, jpayne@69: va_list ap) jpayne@69: #if !defined(__cplusplus) && (__GNUC__ > 2) jpayne@69: __attribute__((__format__(__printf__, 3, 0))) jpayne@69: #endif jpayne@69: ; jpayne@69: extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message jpayne@69: (errcode_t) jpayne@69: /*@modifies internalState@*/; jpayne@69: extern errcode_t KRB5_CALLCONV add_error_table jpayne@69: (/*@dependent@*/ const struct error_table *) jpayne@69: /*@modifies internalState@*/; jpayne@69: extern errcode_t KRB5_CALLCONV remove_error_table jpayne@69: (const struct error_table *) jpayne@69: /*@modifies internalState@*/; jpayne@69: jpayne@69: #if !defined(_WIN32) jpayne@69: /* jpayne@69: * The display routine should be application specific. A global hook, jpayne@69: * may cause inappropriate display procedures to be called between jpayne@69: * applications under non-Unix environments. jpayne@69: */ jpayne@69: jpayne@69: extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func); jpayne@69: extern et_old_error_hook_func reset_com_err_hook (void); jpayne@69: #endif jpayne@69: jpayne@69: #ifdef __cplusplus jpayne@69: } jpayne@69: #endif jpayne@69: jpayne@69: #define __COM_ERR_H jpayne@69: #endif /* ! defined(__COM_ERR_H) */