]> git.proxmox.com Git - ceph.git/blob - ceph/src/include/error.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / include / error.h
1 // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
2 // vim: ts=8 sw=2 smarttab
3 /*
4 * Ceph - scalable distributed file system
5 *
6 * Copyright (C) 2004-2006 Sage Weil <sage@newdream.net>
7 *
8 * This is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License version 2.1, as published by the Free Software
11 * Foundation. See file COPYING.
12 *
13 */
14
15
16 #include <stdarg.h>
17
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21
22 #define SYSERROR() syserror("At %s:%d", __FILE__, __LINE__)
23
24 #define ASSERT(c) \
25 ((c) || (exiterror("Assertion failed at %s:%d", __FILE__, __LINE__), 1))
26
27 /* print usage error message and exit */
28 extern void userror(const char *use, const char *fmt, ...);
29
30 /* print system error message and exit */
31 extern void syserror(const char *fmt, ...);
32
33 /* print error message and exit */
34 extern void exiterror(const char *fmt, ...);
35
36 /* print error message */
37 extern void error(const char *fmt, ...);
38
39 #ifdef __cplusplus
40 } // extern "C"
41 #endif