summaryrefslogtreecommitdiff
path: root/pith/debug.h
diff options
context:
space:
mode:
authorEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
committerEduardo Chappa <echappa@gmx.com>2013-02-03 00:59:38 -0700
commit094ca96844842928810f14844413109fc6cdd890 (patch)
treee60efbb980f38ba9308ccb4fb2b77b87bbc115f3 /pith/debug.h
downloadalpine-094ca96844842928810f14844413109fc6cdd890.tar.xz
Initial Alpine Version
Diffstat (limited to 'pith/debug.h')
-rw-r--r--pith/debug.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/pith/debug.h b/pith/debug.h
new file mode 100644
index 00000000..912791d8
--- /dev/null
+++ b/pith/debug.h
@@ -0,0 +1,58 @@
+/*
+ * $Id: debug.h 761 2007-10-23 22:35:18Z hubert@u.washington.edu $
+ *
+ * ========================================================================
+ * Copyright 2006 University of Washington
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * ========================================================================
+ */
+
+#ifndef PITH_DEBUG_INCLUDED
+#define PITH_DEBUG_INCLUDED
+
+
+/*======================================================================
+ Macros for debug printfs
+ n is debugging level:
+ 1 logs only highest level events and errors
+ 2 logs events like file writes
+ 3
+ 4 logs each command
+ 5
+ 6
+ 7 logs details of command execution (7 is highest to run any production)
+ allows core dumps without cleaning up terminal modes
+ 8
+ 9 logs gross details of command execution
+
+ ====*/
+
+
+#ifdef DEBUG
+
+#define dprint(x) { output_debug_msg x ; }
+
+/* global debugging level */
+extern int debug;
+
+/* mandatory to implement stubs */
+void output_debug_msg(int, char *fmt, ...);
+void dump_configuration(int);
+void dump_contexts();
+
+
+
+#else /* !DEBUG */
+
+#define dprint(x)
+
+#endif /* !DEBUG */
+
+
+#endif /* PITH_DEBUG_INCLUDED */