xref: /onnv-gate/usr/src/lib/gss_mechs/mech_krb5/include/krb5/k5-err.h (revision 4960:a4746a82a247)
1*4960Swillf /*
2*4960Swillf  * include/k5-err.h
3*4960Swillf  *
4*4960Swillf  * Copyright 2006 Massachusetts Institute of Technology.
5*4960Swillf  * All Rights Reserved.
6*4960Swillf  *
7*4960Swillf  * Export of this software from the United States of America may
8*4960Swillf  *   require a specific license from the United States Government.
9*4960Swillf  *   It is the responsibility of any person or organization contemplating
10*4960Swillf  *   export to obtain such a license before exporting.
11*4960Swillf  *
12*4960Swillf  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
13*4960Swillf  * distribute this software and its documentation for any purpose and
14*4960Swillf  * without fee is hereby granted, provided that the above copyright
15*4960Swillf  * notice appear in all copies and that both that copyright notice and
16*4960Swillf  * this permission notice appear in supporting documentation, and that
17*4960Swillf  * the name of M.I.T. not be used in advertising or publicity pertaining
18*4960Swillf  * to distribution of the software without specific, written prior
19*4960Swillf  * permission.	Furthermore if you modify this software you must label
20*4960Swillf  * your software as modified software and not distribute it in such a
21*4960Swillf  * fashion that it might be confused with the original M.I.T. software.
22*4960Swillf  * M.I.T. makes no representations about the suitability of
23*4960Swillf  * this software for any purpose.  It is provided "as is" without express
24*4960Swillf  * or implied warranty.
25*4960Swillf  *
26*4960Swillf  *
27*4960Swillf  * Error-message handling
28*4960Swillf  */
29*4960Swillf 
30*4960Swillf #ifndef K5_ERR_H
31*4960Swillf #define K5_ERR_H
32*4960Swillf 
33*4960Swillf #pragma ident	"%Z%%M%	%I%	%E% SMI"
34*4960Swillf 
35*4960Swillf #ifndef _
36*4960Swillf #define _(X) (X)
37*4960Swillf #endif
38*4960Swillf 
39*4960Swillf #if defined(_MSDOS) || defined(_WIN32)
40*4960Swillf #include <win-mac.h>
41*4960Swillf #endif
42*4960Swillf #ifndef KRB5_CALLCONV
43*4960Swillf #define KRB5_CALLCONV
44*4960Swillf #define KRB5_CALLCONV_C
45*4960Swillf #endif
46*4960Swillf 
47*4960Swillf #include <stdarg.h>
48*4960Swillf 
49*4960Swillf struct errinfo {
50*4960Swillf     long code;
51*4960Swillf     const char *msg;
52*4960Swillf     char scratch_buf[1024];
53*4960Swillf };
54*4960Swillf 
55*4960Swillf void
56*4960Swillf krb5int_set_error (struct errinfo *ep,
57*4960Swillf 		   long code,
58*4960Swillf 		   const char *fmt, ...);
59*4960Swillf void
60*4960Swillf krb5int_vset_error (struct errinfo *ep, long code,
61*4960Swillf 		    const char *fmt, va_list args);
62*4960Swillf const char *
63*4960Swillf krb5int_get_error (struct errinfo *ep, long code);
64*4960Swillf void
65*4960Swillf krb5int_free_error (struct errinfo *ep, const char *msg);
66*4960Swillf void
67*4960Swillf krb5int_clear_error (struct errinfo *ep);
68*4960Swillf void
69*4960Swillf krb5int_set_error_info_callout_fn (const char *(KRB5_CALLCONV *f)(long));
70*4960Swillf 
71*4960Swillf #endif /* K5_ERR_H */
72