xref: /titanic_51/usr/src/lib/gss_mechs/mech_krb5/include/com_err.h (revision 10db1377dafab8ba3feedef26db9c5d8539a5cd1)
1 /*
2  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
3  * Use is subject to license terms.
4  */
5 
6 /*
7  * Header file for common error description library.
8  *
9  * Copyright 1988, Student Information Processing Board of the
10  * Massachusetts Institute of Technology.
11  *
12  * Copyright 1995 by Cygnus Support.
13  *
14  * For copyright and distribution info, see the documentation supplied
15  * with this package.
16  */
17 
18 #ifndef __COM_ERR_H
19 
20 #pragma ident	"%Z%%M%	%I%	%E% SMI"
21 
22 #if defined(_WIN32)
23 #include <win-mac.h>
24 #endif
25 
26 #ifndef KRB5_CALLCONV
27 #define KRB5_CALLCONV
28 #define KRB5_CALLCONV_C
29 #endif
30 
31 #include <stdarg.h>
32 
33 typedef long errcode_t;
34 typedef void (*et_old_error_hook_func) (const char *, errcode_t,
35 					const char *, va_list ap);
36 
37 struct error_table {
38 	/*@shared@*/ char const * const * msgs;
39         long base;
40 	unsigned int n_msgs;
41 };
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /* Public interfaces */
48 extern void KRB5_CALLCONV_C com_err
49 	(const char *, errcode_t, const char *, ...);
50 extern void KRB5_CALLCONV com_err_va
51 	(const char *whoami, errcode_t code, const char *fmt,
52 	 va_list ap);
53 extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message
54 	(errcode_t)
55        /*@modifies internalState@*/;
56 
57 /*
58  * Solaris Kerberos
59  * {add_,remove_}error_table have been removed here as they don't exist
60  * in the Solaris mech.
61  *
62  * initialize_krb5_error_table is not be needed anymore but Samba still
63  * calls it so we make it a no-op.
64  */
65 #define initialize_krb5_error_table()
66 
67 #if !defined(_WIN32)
68 /*
69  * The display routine should be application specific.  A global hook,
70  * may cause inappropriate display procedures to be called between
71  * applications under non-Unix environments.
72  */
73 
74 extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func);
75 extern et_old_error_hook_func reset_com_err_hook (void);
76 #endif
77 
78 #ifdef __cplusplus
79 }
80 #endif
81 
82 #define __COM_ERR_H
83 #endif /* ! defined(__COM_ERR_H) */
84