From bdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Wed, 2 Dec 2020 10:06:53 -0500 Subject: parse: Clean up debug flag parsing/printing --- ctx.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'ctx.c') diff --git a/ctx.c b/ctx.c index 26619d7..8f623e5 100644 --- a/ctx.c +++ b/ctx.c @@ -23,11 +23,37 @@ #include "pwcache.h" #include "stat.h" #include "trie.h" +#include #include #include #include #include +const char *debug_flag_name(enum debug_flags flag) { + switch (flag) { + case DEBUG_COST: + return "cost"; + case DEBUG_EXEC: + return "exec"; + case DEBUG_OPT: + return "opt"; + case DEBUG_RATES: + return "rates"; + case DEBUG_SEARCH: + return "search"; + case DEBUG_STAT: + return "stat"; + case DEBUG_TREE: + return "tree"; + + case DEBUG_ALL: + break; + } + + assert(false); + return "???"; +} + struct bfs_ctx *bfs_ctx_new(void) { struct bfs_ctx *ctx = malloc(sizeof(*ctx)); if (!ctx) { -- cgit v1.2.3