import cyrus-sasl-2.1.23
[cyrus-sasl.git] / mac / CommonKClient / mac_kclient3 / Headers / KerberosComErr / com_err.h
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 #if defined(_MSDOS) || defined(_WIN32) || defined(macintosh)
16 #include <Kerberos5/win-mac.h>
17 #if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
18 #pragma import on
19 #endif
20 #endif
21
22 #ifndef KRB5_CALLCONV
23 #define KRB5_CALLCONV
24 #define KRB5_CALLCONV_C
25 #define KRB5_DLLIMP
26 #define GSS_DLLIMP
27 #define KRB5_EXPORTVAR
28 #endif
29
30 #ifndef FAR
31 #define FAR
32 #define NEAR
33 #endif
34
35 #if defined(__STDC__) || defined(__cplusplus) || defined(_MSDOS) || defined(_WIN32) || defined(macintosh)
36
37 /* End-user programs may need this -- oh well */
38 #ifndef HAVE_STDARG_H
39 #define HAVE_STDARG_H 1
40 #endif
41
42 #define ET_P(x) x
43
44 #else
45 #define ET_P(x) ()
46 #endif /* __STDC__ */
47
48 #ifdef HAVE_STDARG_H
49 #include <stdarg.h>
50 #define ET_STDARG_P(x) x
51 #else
52 #include <varargs.h>
53 #define ET_STDARG_P(x) ()
54 #define ET_VARARGS
55 #endif
56
57 typedef long errcode_t;
58 typedef void (*et_old_error_hook_func) ET_P((const char FAR *, errcode_t,
59                                              const char FAR *, va_list ap));
60         
61 struct error_table {
62         char const FAR * const FAR * msgs;
63         unsigned long base;
64         unsigned int n_msgs;
65 };
66
67 #ifdef __cplusplus
68 extern "C" {
69 #endif
70
71 KRB5_DLLIMP extern void KRB5_CALLCONV_C com_err
72         ET_STDARG_P((const char FAR *, errcode_t, const char FAR *, ...));
73 KRB5_DLLIMP extern void KRB5_CALLCONV com_err_va
74         ET_P((const char FAR *whoami, errcode_t code, const char FAR *fmt,
75               va_list ap));
76 KRB5_DLLIMP extern const char FAR * KRB5_CALLCONV error_message
77         ET_P((errcode_t));
78 KRB5_DLLIMP extern errcode_t KRB5_CALLCONV add_error_table
79         ET_P((const struct error_table FAR *));
80 KRB5_DLLIMP extern errcode_t KRB5_CALLCONV remove_error_table
81         ET_P((const struct error_table FAR *));
82
83 #if !defined(_MSDOS) && !defined(_WIN32) && !defined(macintosh) && !defined(__MACH__)
84 /*
85  * The display routine should be application specific.  A global hook,
86  * may cause inappropriate display procedures to be called between
87  * applications under non-Unix environments.
88  */
89
90 extern et_old_error_hook_func set_com_err_hook
91         ET_P((et_old_error_hook_func));
92 extern et_old_error_hook_func reset_com_err_hook
93         ET_P((void));
94 #endif
95
96 #ifdef __cplusplus
97 }
98 #endif
99
100 #if defined(macintosh) && defined(__CFM68K__) && !defined(__USING_STATIC_LIBS__)
101 #pragma import reset
102 #endif
103
104 #define __COM_ERR_H
105 #endif /* ! defined(__COM_ERR_H) */