Coda Distributed File System
coda_assert.h
Go to the documentation of this file.
1/* BLURB lgpl
2
3 Coda File System
4 Release 6
5
6 Copyright (c) 1987-2003 Carnegie Mellon University
7 Additional copyrights listed below
8
9This code is distributed "AS IS" without warranty of any kind under
10the terms of the GNU Library General Public Licence Version 2, as
11shown in the file LICENSE. The technical and financial contributors to
12Coda are listed in the file CREDITS.
13
14 Additional copyrights
15 none currently
16
17#*/
18
19#ifndef _CODA_ASSERT_H_
20#define _CODA_ASSERT_H_ 1
21
22#define CODA_ASSERT(pred) \
23 do { \
24 if (!(pred)) \
25 coda_assert(#pred, __FILE__, __LINE__); \
26 } while (0)
27#define CODA_NOTE(pred) \
28 do { \
29 if (!(pred)) \
30 coda_note(#pred, __FILE__, __LINE__); \
31 } while (0)
32
33#define CODA_ASSERT_SLEEP 1
34#define CODA_ASSERT_EXIT 2
35#define CODA_ASSERT_ABORT 3
36#define CODA_ASSERT_CORE 3
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
42extern void (*coda_assert_cleanup)(void);
43extern int coda_assert_action;
44
45void coda_assert(const char *pred, const char *file, int line);
46void coda_note(const char *pred, const char *file, int line);
47
48#ifdef __cplusplus
49}
50#endif
51
52#endif /* _CODA_ASSERT_H_ */
int coda_assert_action
Definition: coda_assert.c:33
void coda_note(const char *pred, const char *file, int line)
Definition: coda_assert.c:87
void(* coda_assert_cleanup)(void)
Definition: coda_assert.c:32
void coda_assert(const char *pred, const char *file, int line)
Definition: coda_assert.c:35
FILE * file
Definition: dirtest.c:723
int line
Definition: advice_parser.c:54