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