1/* $Copyright: 2 * 3 * Copyright 1998-2000 by the Massachusetts Institute of Technology. 4 * 5 * All rights reserved. 6 * 7 * Permission to use, copy, modify, and distribute this software and its 8 * documentation for any purpose and without fee is hereby granted, 9 * provided that the above copyright notice appear in all copies and that 10 * both that copyright notice and this permission notice appear in 11 * supporting documentation, and that the name of M.I.T. not be used in 12 * advertising or publicity pertaining to distribution of the software 13 * without specific, written prior permission. Furthermore if you modify 14 * this software you must label your software as modified software and not 15 * distribute it in such a fashion that it might be confused with the 16 * original MIT software. M.I.T. makes no representations about the 17 * suitability of this software for any purpose. It is provided "as is" 18 * without express or implied warranty. 19 * 20 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED 21 * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF 22 * MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. 23 * 24 * Individual source code files are copyright MIT, Cygnus Support, 25 * OpenVision, Oracle, Sun Soft, FundsXpress, and others. 26 * 27 * Project Athena, Athena, Athena MUSE, Discuss, Hesiod, Kerberos, Moira, 28 * and Zephyr are trademarks of the Massachusetts Institute of Technology 29 * (MIT). No commercial use of these trademarks may be made without prior 30 * written permission of MIT. 31 * 32 * "Commercial use" means use of a name in a product or other for-profit 33 * manner. It does NOT prevent a commercial firm from referring to the MIT 34 * trademarks in order to convey information (although in doing so, 35 * recognition of their trademark status should be given). 36 * $ 37 */ 38 39/* $Header$ */ 40 41/* 42 * 43 * KerberosComErr.h -- Functions to handle Kerberos errors. 44 * 45 */ 46 47 48#ifndef __KERBEROSCOMERR__ 49#define __KERBEROSCOMERR__ 50 51#if defined(macintosh) || (defined(__MACH__) && defined(__APPLE__)) 52# include <TargetConditionals.h> 53# if TARGET_RT_MAC_CFM 54# error "Use KfM 4.0 SDK headers for CFM compilation." 55# endif 56#endif 57 58#include <sys/types.h> 59#include <stdarg.h> 60 61#ifdef __cplusplus 62extern "C" { 63#endif 64 65typedef long errcode_t; 66typedef void (*com_err_handler_t) 67 (const char *whoami, errcode_t code, const char *format, va_list args); 68 69struct error_table { 70 const char * const * const messages; 71 int32_t base; 72 int32_t count; 73}; 74 75/* ******************* */ 76/* Function prototypes */ 77/* ******************* */ 78 79void com_err (const char *progname, errcode_t code, const char *format, ...); 80void com_err_va (const char *progname, errcode_t code, const char *format, va_list args); 81 82const char *error_message (errcode_t code); 83const char *error_manager (errcode_t code); 84 85com_err_handler_t set_com_err_hook(com_err_handler_t handler); 86com_err_handler_t reset_com_err_hook(void); 87 88errcode_t add_error_table (const struct error_table *et); 89errcode_t remove_error_table (const struct error_table *et); 90 91#ifdef __cplusplus 92} 93#endif 94 95#endif /* __KERBEROSCOMERR__ */ 96