summaryrefslogtreecommitdiffstats
path: root/src/diag.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/diag.h')
-rw-r--r--src/diag.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/diag.h b/src/diag.h
index fea8847..838a794 100644
--- a/src/diag.h
+++ b/src/diag.h
@@ -9,7 +9,6 @@
#define BFS_DIAG_H
#include "config.h"
-#include "ctx.h"
#include <stdarg.h>
/**
@@ -84,9 +83,37 @@ noreturn void bfs_abortf(const struct bfs_loc *loc, const char *format, ...);
# define bfs_assert bfs_verify
#endif
+struct bfs_ctx;
struct bfs_expr;
/**
+ * Various debugging flags.
+ */
+enum debug_flags {
+ /** Print cost estimates. */
+ DEBUG_COST = 1 << 0,
+ /** Print executed command details. */
+ DEBUG_EXEC = 1 << 1,
+ /** Print optimization details. */
+ DEBUG_OPT = 1 << 2,
+ /** Print rate information. */
+ DEBUG_RATES = 1 << 3,
+ /** Trace the filesystem traversal. */
+ DEBUG_SEARCH = 1 << 4,
+ /** Trace all stat() calls. */
+ DEBUG_STAT = 1 << 5,
+ /** Print the parse tree. */
+ DEBUG_TREE = 1 << 6,
+ /** All debug flags. */
+ DEBUG_ALL = (1 << 7) - 1,
+};
+
+/**
+ * Convert a debug flag to a string.
+ */
+const char *debug_flag_name(enum debug_flags flag);
+
+/**
* Like perror(), but decorated like bfs_error().
*/
void bfs_perror(const struct bfs_ctx *ctx, const char *str);