aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2010-06-29 14:00:25 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2010-06-29 16:47:34 +0300
commit3f938834227d544f8b5fe05dcf3f57eecc5e9197 (patch)
tree8297b3295e1a08cde7e5e6f86372d7c64b36476e /include
parent1de4bd512440c175f4b9dfed947d58f3d420bcb3 (diff)
downloadsmap-3f938834227d544f8b5fe05dcf3f57eecc5e9197.tar.gz
smap-3f938834227d544f8b5fe05dcf3f57eecc5e9197.tar.bz2
Configuration parser debugging.
* src/smapd.c (debug_init): New category "conf". * src/smapd.h (DBG_CONF): New constant. * src/cfg.c (parse_config_loop): Add debugging output. (smapd_ws_debug): New function. * lib/wordsplit.c (wordsplit_len): Fix character case in debug output. (wordsplit_init): Consistency checking for WRDSF_SHOWDBG. (wordsplit_dump_nodes, wordsplit_len): Debugging output is triggered by WRDSF_SHOWDBG flag. * include/smap/wordsplit.h (wordsplit): New member ws_debug. (WRDSF_SHOWDBG): New flag.
Diffstat (limited to 'include')
-rw-r--r--include/smap/wordsplit.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/smap/wordsplit.h b/include/smap/wordsplit.h
index ced28f3..07afc0a 100644
--- a/include/smap/wordsplit.h
+++ b/include/smap/wordsplit.h
@@ -30,6 +30,8 @@ struct wordsplit
const char *ws_comment;
void (*ws_alloc_die)(struct wordsplit *wsp);
void (*ws_error)(const char *, ...);
+ void (*ws_debug)(const char *, ...);
+
const char **ws_env;
char *(*ws_getvar)(const char *, size_t);
@@ -86,7 +88,7 @@ struct wordsplit
/* ws_getvar field is initialized */
#define WRDSF_GETVAR 0x040000
/* enable debugging */
-#define WRDSF_DEBUG 0x080000
+#define WRDSF_SHOWDBG 0x080000
/* Don't split input into words. Useful for side effects. */
#define WRDSF_NOSPLIT 0x100000
/* Keep undefined variables in place, instead of expanding them to
@@ -94,6 +96,8 @@ struct wordsplit
#define WRDSF_KEEPUNDEF 0x200000
/* Handle C escapes */
#define WRDSF_CESCAPES 0x400000
+/* ws_debug field is initialized */
+#define WRDSF_DEBUG 0x800000
#define WRDSF_DEFFLAGS \
(WRDSF_NOVAR | WRDSF_NOCMD | \

Return to:

Send suggestions and report system problems to the System administrator.