com_err.h 1.9 KB

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