xref: /onnv-gate/usr/src/lib/gss_mechs/mech_krb5/include/com_err.h (revision 1770:5ee0954c363b)
1*1770Sgtb /*
2*1770Sgtb  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
3*1770Sgtb  * Use is subject to license terms.
4*1770Sgtb  */
5*1770Sgtb 
60Sstevel@tonic-gate /*
70Sstevel@tonic-gate  * Header file for common error description library.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * Copyright 1988, Student Information Processing Board of the
100Sstevel@tonic-gate  * Massachusetts Institute of Technology.
110Sstevel@tonic-gate  *
120Sstevel@tonic-gate  * Copyright 1995 by Cygnus Support.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * For copyright and distribution info, see the documentation supplied
150Sstevel@tonic-gate  * with this package.
160Sstevel@tonic-gate  */
170Sstevel@tonic-gate 
180Sstevel@tonic-gate #ifndef __COM_ERR_H
190Sstevel@tonic-gate 
200Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
210Sstevel@tonic-gate 
22781Sgtb #if defined(_WIN32)
230Sstevel@tonic-gate #include <win-mac.h>
240Sstevel@tonic-gate #endif
250Sstevel@tonic-gate 
260Sstevel@tonic-gate #ifndef KRB5_CALLCONV
270Sstevel@tonic-gate #define KRB5_CALLCONV
280Sstevel@tonic-gate #define KRB5_CALLCONV_C
290Sstevel@tonic-gate #endif
300Sstevel@tonic-gate 
310Sstevel@tonic-gate #include <stdarg.h>
320Sstevel@tonic-gate 
330Sstevel@tonic-gate typedef long errcode_t;
34781Sgtb typedef void (*et_old_error_hook_func) (const char *, errcode_t,
35781Sgtb 					const char *, va_list ap);
360Sstevel@tonic-gate 
370Sstevel@tonic-gate struct error_table {
38781Sgtb 	/*@shared@*/ char const * const * msgs;
39781Sgtb         long base;
400Sstevel@tonic-gate 	unsigned int n_msgs;
410Sstevel@tonic-gate };
420Sstevel@tonic-gate 
430Sstevel@tonic-gate #ifdef __cplusplus
440Sstevel@tonic-gate extern "C" {
450Sstevel@tonic-gate #endif
460Sstevel@tonic-gate 
47781Sgtb /* Public interfaces */
48781Sgtb extern void KRB5_CALLCONV_C com_err
49781Sgtb 	(const char *, errcode_t, const char *, ...);
50781Sgtb extern void KRB5_CALLCONV com_err_va
51781Sgtb 	(const char *whoami, errcode_t code, const char *fmt,
52781Sgtb 	 va_list ap);
53781Sgtb extern /*@observer@*//*@dependent@*/ const char * KRB5_CALLCONV error_message
54781Sgtb 	(errcode_t)
55781Sgtb        /*@modifies internalState@*/;
56*1770Sgtb 
57*1770Sgtb /*
58*1770Sgtb  * Solaris Kerberos
59*1770Sgtb  * {add_,remove_}error_table have been removed here as they don't exist
60*1770Sgtb  * in the Solaris mech.
61*1770Sgtb  *
62*1770Sgtb  * initialize_krb5_error_table is not be needed anymore but Samba still
63*1770Sgtb  * calls it so we make it a no-op.
64*1770Sgtb  */
65*1770Sgtb #define initialize_krb5_error_table()
660Sstevel@tonic-gate 
67781Sgtb #if !defined(_WIN32)
680Sstevel@tonic-gate /*
690Sstevel@tonic-gate  * The display routine should be application specific.  A global hook,
700Sstevel@tonic-gate  * may cause inappropriate display procedures to be called between
710Sstevel@tonic-gate  * applications under non-Unix environments.
720Sstevel@tonic-gate  */
730Sstevel@tonic-gate 
74781Sgtb extern et_old_error_hook_func set_com_err_hook (et_old_error_hook_func);
75781Sgtb extern et_old_error_hook_func reset_com_err_hook (void);
760Sstevel@tonic-gate #endif
770Sstevel@tonic-gate 
780Sstevel@tonic-gate #ifdef __cplusplus
790Sstevel@tonic-gate }
800Sstevel@tonic-gate #endif
810Sstevel@tonic-gate 
820Sstevel@tonic-gate #define __COM_ERR_H
830Sstevel@tonic-gate #endif /* ! defined(__COM_ERR_H) */
84