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 #if defined(_WIN32)
21 #include <win-mac.h>
22 #endif
23 
24 #ifndef KRB5_CALLCONV
25 #define KRB5_CALLCONV
26 #define KRB5_CALLCONV_C
27 #endif
28 
29 #include <stdarg.h>
30 
31 typedef long errcode_t;
32 typedef void (*et_old_error_hook_func) (const char *, errcode_t,
33 					const char *, va_list ap);
34 
35 struct error_table {
36 	/*@shared@*/ char const * const * msgs;
37         long base;
38 	unsigned int n_msgs;
39 };
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 /* Public interfaces */
46 extern void KRB5_CALLCONV_C com_err
47 	(const char *, errcode_t, const char *, ...);
48 extern void KRB5_CALLCONV com_err_va
49 	(const char *whoami, errcode_t code, const char *fmt,
50 	 va_list ap);
51 extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message
52 	(errcode_t)
53        /*@modifies internalState@*/;
54 
55 /*
56  * Solaris Kerberos
57  * {add_,remove_}error_table have been removed here as they don't exist
58  * in the Solaris mech.
59  *
60  * initialize_krb5_error_table is not be needed anymore but Samba still
61  * calls it so we make it a no-op.
62  */
63 #define initialize_krb5_error_table()
64 
65 #if !defined(_WIN32)
66 /*
67  * The display routine should be application specific.  A global hook,
68  * may cause inappropriate display procedures to be called between
69  * applications under non-Unix environments.
70  */
71 
72 extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func);
73 extern et_old_error_hook_func reset_com_err_hook (void);
74 #endif
75 
76 #ifdef __cplusplus
77 }
78 #endif
79 
80 #define __COM_ERR_H
81 #endif /* ! defined(__COM_ERR_H) */
82