xref: /freebsd/crypto/heimdal/lib/com_err/com_err.h (revision c19800e8cd5640693f36f2040db4ab5e8d738146)
15e9cd1aeSAssar Westerlund /*
2adb0ddaeSAssar Westerlund  * Copyright (c) 1997 - 2001 Kungliga Tekniska H�gskolan
35e9cd1aeSAssar Westerlund  * (Royal Institute of Technology, Stockholm, Sweden).
45e9cd1aeSAssar Westerlund  * All rights reserved.
55e9cd1aeSAssar Westerlund  *
65e9cd1aeSAssar Westerlund  * Redistribution and use in source and binary forms, with or without
75e9cd1aeSAssar Westerlund  * modification, are permitted provided that the following conditions
85e9cd1aeSAssar Westerlund  * are met:
95e9cd1aeSAssar Westerlund  *
105e9cd1aeSAssar Westerlund  * 1. Redistributions of source code must retain the above copyright
115e9cd1aeSAssar Westerlund  *    notice, this list of conditions and the following disclaimer.
125e9cd1aeSAssar Westerlund  *
135e9cd1aeSAssar Westerlund  * 2. Redistributions in binary form must reproduce the above copyright
145e9cd1aeSAssar Westerlund  *    notice, this list of conditions and the following disclaimer in the
155e9cd1aeSAssar Westerlund  *    documentation and/or other materials provided with the distribution.
165e9cd1aeSAssar Westerlund  *
175e9cd1aeSAssar Westerlund  * 3. Neither the name of the Institute nor the names of its contributors
185e9cd1aeSAssar Westerlund  *    may be used to endorse or promote products derived from this software
195e9cd1aeSAssar Westerlund  *    without specific prior written permission.
205e9cd1aeSAssar Westerlund  *
215e9cd1aeSAssar Westerlund  * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
225e9cd1aeSAssar Westerlund  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
235e9cd1aeSAssar Westerlund  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
245e9cd1aeSAssar Westerlund  * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
255e9cd1aeSAssar Westerlund  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
265e9cd1aeSAssar Westerlund  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
275e9cd1aeSAssar Westerlund  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
285e9cd1aeSAssar Westerlund  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
295e9cd1aeSAssar Westerlund  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
305e9cd1aeSAssar Westerlund  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
315e9cd1aeSAssar Westerlund  * SUCH DAMAGE.
325e9cd1aeSAssar Westerlund  */
335e9cd1aeSAssar Westerlund 
34c19800e8SDoug Rabson /* $Id: com_err.h 15566 2005-07-07 14:58:07Z lha $ */
355e9cd1aeSAssar Westerlund 
365e9cd1aeSAssar Westerlund /* MIT compatible com_err library */
375e9cd1aeSAssar Westerlund 
385e9cd1aeSAssar Westerlund #ifndef __COM_ERR_H__
395e9cd1aeSAssar Westerlund #define __COM_ERR_H__
405e9cd1aeSAssar Westerlund 
415e9cd1aeSAssar Westerlund #include <com_right.h>
42c19800e8SDoug Rabson #include <stdarg.h>
435e9cd1aeSAssar Westerlund 
44adb0ddaeSAssar Westerlund #if !defined(__GNUC__) && !defined(__attribute__)
45adb0ddaeSAssar Westerlund #define __attribute__(X)
46adb0ddaeSAssar Westerlund #endif
47adb0ddaeSAssar Westerlund 
48c19800e8SDoug Rabson typedef void (*errf) (const char *, long, const char *, va_list);
495e9cd1aeSAssar Westerlund 
50c19800e8SDoug Rabson const char * error_message (long);
51c19800e8SDoug Rabson int init_error_table (const char**, long, int);
525e9cd1aeSAssar Westerlund 
53c19800e8SDoug Rabson void com_err_va (const char *, long, const char *, va_list)
54adb0ddaeSAssar Westerlund     __attribute__((format(printf, 3, 0)));
55adb0ddaeSAssar Westerlund 
56c19800e8SDoug Rabson void com_err (const char *, long, const char *, ...)
57adb0ddaeSAssar Westerlund     __attribute__((format(printf, 3, 4)));
585e9cd1aeSAssar Westerlund 
59c19800e8SDoug Rabson errf set_com_err_hook (errf);
60c19800e8SDoug Rabson errf reset_com_err_hook (void);
615e9cd1aeSAssar Westerlund 
62c19800e8SDoug Rabson const char *error_table_name  (int num);
635e9cd1aeSAssar Westerlund 
64c19800e8SDoug Rabson void add_to_error_table (struct et_list *new_table);
65adb0ddaeSAssar Westerlund 
665e9cd1aeSAssar Westerlund #endif /* __COM_ERR_H__ */
67