156a424ccSmp /*
254925bf6Swillf  * include/k5-err.h
356a424ccSmp  *
454925bf6Swillf  * Copyright 2006 Massachusetts Institute of Technology.
556a424ccSmp  * All Rights Reserved.
656a424ccSmp  *
756a424ccSmp  * Export of this software from the United States of America may
856a424ccSmp  *   require a specific license from the United States Government.
956a424ccSmp  *   It is the responsibility of any person or organization contemplating
1056a424ccSmp  *   export to obtain such a license before exporting.
11*1da57d55SToomas Soome  *
1256a424ccSmp  * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
1356a424ccSmp  * distribute this software and its documentation for any purpose and
1456a424ccSmp  * without fee is hereby granted, provided that the above copyright
1556a424ccSmp  * notice appear in all copies and that both that copyright notice and
1656a424ccSmp  * this permission notice appear in supporting documentation, and that
1756a424ccSmp  * the name of M.I.T. not be used in advertising or publicity pertaining
1856a424ccSmp  * to distribution of the software without specific, written prior
1954925bf6Swillf  * permission.	Furthermore if you modify this software you must label
2056a424ccSmp  * your software as modified software and not distribute it in such a
2156a424ccSmp  * fashion that it might be confused with the original M.I.T. software.
2256a424ccSmp  * M.I.T. makes no representations about the suitability of
2356a424ccSmp  * this software for any purpose.  It is provided "as is" without express
2456a424ccSmp  * or implied warranty.
25*1da57d55SToomas Soome  *
2656a424ccSmp  *
2754925bf6Swillf  * Error-message handling
2856a424ccSmp  */
2956a424ccSmp 
3054925bf6Swillf #ifndef K5_ERR_H
3154925bf6Swillf #define K5_ERR_H
3254925bf6Swillf 
3354925bf6Swillf #ifndef _
3454925bf6Swillf #define _(X) (X)
3554925bf6Swillf #endif
3656a424ccSmp 
3754925bf6Swillf #if defined(_MSDOS) || defined(_WIN32)
3854925bf6Swillf #include <win-mac.h>
3954925bf6Swillf #endif
4054925bf6Swillf #ifndef KRB5_CALLCONV
4154925bf6Swillf #define KRB5_CALLCONV
4254925bf6Swillf #define KRB5_CALLCONV_C
4354925bf6Swillf #endif
4456a424ccSmp 
4554925bf6Swillf #include <stdarg.h>
4656a424ccSmp 
4754925bf6Swillf struct errinfo {
4854925bf6Swillf     long code;
4954925bf6Swillf     const char *msg;
5054925bf6Swillf     char scratch_buf[1024];
5154925bf6Swillf };
5256a424ccSmp 
5354925bf6Swillf void
5454925bf6Swillf krb5int_set_error (struct errinfo *ep,
5554925bf6Swillf 		   long code,
5654925bf6Swillf 		   const char *fmt, ...);
5754925bf6Swillf void
5854925bf6Swillf krb5int_vset_error (struct errinfo *ep, long code,
5954925bf6Swillf 		    const char *fmt, va_list args);
6054925bf6Swillf const char *
6154925bf6Swillf krb5int_get_error (struct errinfo *ep, long code);
6254925bf6Swillf void
6354925bf6Swillf krb5int_free_error (struct errinfo *ep, const char *msg);
6454925bf6Swillf void
6554925bf6Swillf krb5int_clear_error (struct errinfo *ep);
6654925bf6Swillf void
6754925bf6Swillf krb5int_set_error_info_callout_fn (const char *(KRB5_CALLCONV *f)(long));
6856a424ccSmp 
6954925bf6Swillf #endif /* K5_ERR_H */
70