2 * debug.h - Debugging output functions. Part of the Linux-NTFS project.
4 * Copyright (c) 2002 Anton Altaparmakov
6 * This program/include file is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as published
8 * by the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program/include file is distributed in the hope that it will be
12 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
13 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program (in the main directory of the Linux-NTFS
18 * distribution in the file COPYING); if not, write to the Free Software
19 * Foundation,Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
40 /* Debug output to stderr. To get it run ./configure --enable-debug. */
42 static __inline__ void Dprintf(const char *fmt, ...)
48 vfprintf(stderr, fmt, ap);
53 static __inline__ void Dputs(const char *s)
56 fprintf(stderr, "%s\n", s);
60 static __inline__ void Dperror(const char *s)
67 extern void ntfs_debug_runlist_dump(const runlist_element *rl);
71 static __inline__ void Dprintf(const char *fmt, ...) {}
72 static __inline__ void Dputs(const char *s) {}
73 static __inline__ void Dperror(const char *s) {}
74 static __inline__ void ntfs_debug_runlist_dump(const runlist_element *rl) {}
78 #define NTFS_BUG(msg) \
81 fprintf(stderr, "libntfs: Bug in %s(): %s\n", __FUNCTION__, msg); \
82 Dputs("Forcing segmentation fault!"); \
83 ___i = ((int*)NULL)[1]; \
86 #endif /* defined _NTFS_DEBUG_H */