diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2020-12-02 10:06:53 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2020-12-02 10:06:53 -0500 |
commit | bdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5 (patch) | |
tree | 1d84e62abf5bfa01a04bca8b7305b78bb96880b2 /ctx.c | |
parent | bec07dfca5caefea28f20c7ce6c4a80c70cc6944 (diff) | |
download | bfs-bdef1cd0bb00251bf92e6a545bb6e0f2dc2814a5.tar.xz |
parse: Clean up debug flag parsing/printing
Diffstat (limited to 'ctx.c')
-rw-r--r-- | ctx.c | 26 |
1 files changed, 26 insertions, 0 deletions
@@ -23,11 +23,37 @@ #include "pwcache.h" #include "stat.h" #include "trie.h" +#include <assert.h> #include <errno.h> #include <limits.h> #include <stdio.h> #include <stdlib.h> +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) { |