diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2014-12-02 09:01:21 +0000 |
---|---|---|
committer | <> | 2014-12-04 16:11:25 +0000 |
commit | bdab5265fcbf3f472545073a23f8999749a9f2b9 (patch) | |
tree | c6018dd03dea906f8f1fb5f105f05b71a7dc250a /lib/isc/include/isc/error.h | |
download | ntp-d4b7cd9723cce9561fa15f74b90b85a3a61b5ef8.tar.gz |
Imported from /home/lorry/working-area/delta_ntp/ntp-dev-4.2.7p482.tar.gz.ntp-dev-4.2.7p482
Diffstat (limited to 'lib/isc/include/isc/error.h')
-rw-r--r-- | lib/isc/include/isc/error.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/lib/isc/include/isc/error.h b/lib/isc/include/isc/error.h new file mode 100644 index 0000000..e0cdfa8 --- /dev/null +++ b/lib/isc/include/isc/error.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 1998-2001 Internet Software Consortium. + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM + * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE + * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + */ + +/* $Id: error.h,v 1.22 2009/09/29 23:48:04 tbox Exp $ */ + +#ifndef ISC_ERROR_H +#define ISC_ERROR_H 1 + +/*! \file isc/error.h */ + +#include <stdarg.h> + +#include <isc/formatcheck.h> +#include <isc/lang.h> +#include <isc/platform.h> + +ISC_LANG_BEGINDECLS + +typedef void (*isc_errorcallback_t)(const char *, int, const char *, va_list); + +/*% set unexpected error */ +void +isc_error_setunexpected(isc_errorcallback_t); + +/*% set fatal error */ +void +isc_error_setfatal(isc_errorcallback_t); + +/*% unexpected error */ +void +isc_error_unexpected(const char *, int, const char *, ...) + ISC_FORMAT_PRINTF(3, 4); + +/*% fatal error */ +ISC_PLATFORM_NORETURN_PRE void +isc_error_fatal(const char *, int, const char *, ...) +ISC_FORMAT_PRINTF(3, 4) ISC_PLATFORM_NORETURN_POST; + +/*% runtimecheck error */ +void +isc_error_runtimecheck(const char *, int, const char *); + +#define ISC_ERROR_RUNTIMECHECK(cond) \ + ((void) ((cond) || \ + ((isc_error_runtimecheck)(__FILE__, __LINE__, #cond), 0))) + +ISC_LANG_ENDDECLS + +#endif /* ISC_ERROR_H */ |