1 /* 2 * Copyright (c) 1994-2008 Carnegie Mellon University. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in 13 * the documentation and/or other materials provided with the 14 * distribution. 15 * 16 * 3. The name "Carnegie Mellon University" must not be used to 17 * endorse or promote products derived from this software without 18 * prior written permission. For permission or any legal 19 * details, please contact 20 * Carnegie Mellon University 21 * Center for Technology Transfer and Enterprise Creation 22 * 4615 Forbes Avenue 23 * Suite 302 24 * Pittsburgh, PA 15213 25 * (412) 268-7393, fax: (412) 268-7395 26 * innovation@andrew.cmu.edu 27 * 28 * 4. Redistributions of any form whatsoever must retain the following 29 * acknowledgment: 30 * "This product includes software developed by Computing Services 31 * at Carnegie Mellon University (http://www.cmu.edu/computing/)." 32 * 33 * CARNEGIE MELLON UNIVERSITY DISCLAIMS ALL WARRANTIES WITH REGARD TO 34 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 35 * AND FITNESS, IN NO EVENT SHALL CARNEGIE MELLON UNIVERSITY BE LIABLE 36 * FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 37 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN 38 * AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING 39 * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 40 */ 41 42 /* 43 * Header file for common error description library. 44 * 45 * Copyright 1988, Student Information Processing Board of the 46 * Massachusetts Institute of Technology. 47 * 48 * Copyright 1995 by Cygnus Support. 49 * 50 * For copyright and distribution info, see the documentation supplied 51 * with this package. 52 */ 53 54 #ifndef __COM_ERR_H 55 56 #ifndef HAVE_STDARG_H 57 /* End-user programs may need this -- oh well */ 58 #if defined(__STDC__) || defined(_WINDOWS) 59 #define HAVE_STDARG_H 1 60 #endif 61 #endif 62 63 #ifdef HAVE_STDARG_H 64 #include <stdarg.h> 65 #else 66 #include <varargs.h> 67 #endif 68 69 #include "error_table.h" 70 71 /* This should be part of k5-config.h but many application 72 * programs are not including that file. We probably want to 73 * come up with a better way of handling this problem. 74 */ 75 #ifndef INTERFACE 76 #ifdef _WINDOWS 77 #define INTERFACE __far __export __pascal 78 #define INTERFACE_C __far __export __cdecl 79 #else 80 #define INTERFACE 81 #define INTERFACE_C 82 #endif 83 #endif 84 #ifndef FAR 85 #define FAR 86 #endif 87 88 #if defined(__STDC__) || defined(_WINDOWS) 89 /* ANSI C -- use prototypes etc */ 90 extern void INTERFACE_C com_err (const char FAR *, long, const char FAR *, ...) 91 __attribute__((format(printf, 3, 4))); 92 extern char const FAR * INTERFACE error_message (long); 93 extern void (*com_err_hook) (const char *, long, const char *, va_list); 94 extern void (*set_com_err_hook (void (*) (const char *, long, const char *, va_list))) 95 (const char *, long, const char *, va_list); 96 extern void (*reset_com_err_hook ()) (const char *, long, const char *, va_list); 97 #else 98 /* no prototypes */ 99 extern void INTERFACE_C com_err (); 100 extern char * INTERFACE error_message (); 101 extern void (*com_err_hook) (); 102 extern void (*set_com_err_hook ()) (); 103 extern void (*reset_com_err_hook ()) (); 104 #endif 105 106 #define __COM_ERR_H 107 #endif /* ! defined(__COM_ERR_H) */ 108