15e9cd1aeSAssar Westerlund/* 2*ae771770SStanislav Sedov * Copyright (c) 1995 - 2004 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 34*ae771770SStanislav Sedov/* $Id$ */ 355e9cd1aeSAssar Westerlund 365e9cd1aeSAssar Westerlund#ifndef __ERR_H__ 375e9cd1aeSAssar Westerlund#define __ERR_H__ 385e9cd1aeSAssar Westerlund 395e9cd1aeSAssar Westerlund#include <errno.h> 405e9cd1aeSAssar Westerlund#include <stdio.h> 415e9cd1aeSAssar Westerlund#include <stdlib.h> 425e9cd1aeSAssar Westerlund#include <string.h> 435e9cd1aeSAssar Westerlund#include <stdarg.h> 445e9cd1aeSAssar Westerlund 455e9cd1aeSAssar Westerlund#if !defined(__GNUC__) && !defined(__attribute__) 465e9cd1aeSAssar Westerlund#define __attribute__(x) 475e9cd1aeSAssar Westerlund#endif 485e9cd1aeSAssar Westerlund 49c19800e8SDoug Rabson#ifndef ROKEN_LIB_FUNCTION 50c19800e8SDoug Rabson#ifdef _WIN32 51*ae771770SStanislav Sedov#define ROKEN_LIB_FUNCTION 52*ae771770SStanislav Sedov#define ROKEN_LIB_CALL __cdecl 53c19800e8SDoug Rabson#else 54c19800e8SDoug Rabson#define ROKEN_LIB_FUNCTION 55*ae771770SStanislav Sedov#define ROKEN_LIB_CALL 56c19800e8SDoug Rabson#endif 57c19800e8SDoug Rabson#endif 58c19800e8SDoug Rabson 59*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 60c19800e8SDoug Rabsonverr(int eval, const char *fmt, va_list ap) 615e9cd1aeSAssar Westerlund __attribute__ ((noreturn, format (printf, 2, 0))); 62c19800e8SDoug Rabson 63*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 64c19800e8SDoug Rabsonerr(int eval, const char *fmt, ...) 655e9cd1aeSAssar Westerlund __attribute__ ((noreturn, format (printf, 2, 3))); 66c19800e8SDoug Rabson 67*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 68c19800e8SDoug Rabsonverrx(int eval, const char *fmt, va_list ap) 695e9cd1aeSAssar Westerlund __attribute__ ((noreturn, format (printf, 2, 0))); 70c19800e8SDoug Rabson 71*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 72c19800e8SDoug Rabsonerrx(int eval, const char *fmt, ...) 735e9cd1aeSAssar Westerlund __attribute__ ((noreturn, format (printf, 2, 3))); 74*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 75c19800e8SDoug Rabsonvwarn(const char *fmt, va_list ap) 765e9cd1aeSAssar Westerlund __attribute__ ((format (printf, 1, 0))); 77c19800e8SDoug Rabson 78*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 79c19800e8SDoug Rabsonwarn(const char *fmt, ...) 805e9cd1aeSAssar Westerlund __attribute__ ((format (printf, 1, 2))); 81c19800e8SDoug Rabson 82*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 83c19800e8SDoug Rabsonvwarnx(const char *fmt, va_list ap) 845e9cd1aeSAssar Westerlund __attribute__ ((format (printf, 1, 0))); 85c19800e8SDoug Rabson 86*ae771770SStanislav SedovROKEN_LIB_FUNCTION void ROKEN_LIB_CALL 87c19800e8SDoug Rabsonwarnx(const char *fmt, ...) 885e9cd1aeSAssar Westerlund __attribute__ ((format (printf, 1, 2))); 895e9cd1aeSAssar Westerlund 905e9cd1aeSAssar Westerlund#endif /* __ERR_H__ */ 91