-static int dbg_lvl = 0;
-
-
-static void
-dbg_enter(const struct md_args *args, int tokid)
-{
- int i;
- static char buf[72];
-
- assert(args);
- if ( ! (args->dbg & MD_DBG_TREE))
- return;
- assert(tokid >= 0 && tokid <= ROFF_MAX);
-
- buf[0] = buf[71] = 0;
-
- switch (tokens[tokid].type) {
- case (ROFF_LAYOUT):
- (void)strncat(buf, "[body-layout] ", sizeof(buf) - 1);
- break;
- case (ROFF_TEXT):
- (void)strncat(buf, "[ body-text] ", sizeof(buf) - 1);
- break;
- case (ROFF_TITLE):
- (void)strncat(buf, "[ prelude] ", sizeof(buf) - 1);
- break;
- default:
- abort();
- }
-
- /* LINTED */
- for (i = 0; i < dbg_lvl; i++)
- (void)strncat(buf, " ", sizeof(buf) - 1);
-
- (void)strncat(buf, tokens[tokid].name, sizeof(buf) - 1);
-
- (void)printf("%s\n", buf);
-
- dbg_lvl++;
-}
-
-
-/* FIXME: accept only struct rofftree *. */
-static void
-dbg_leave(const struct md_args *args, int tokid)
-{
- assert(args);
- if ( ! (args->dbg & MD_DBG_TREE))
- return;
-
- assert(tokid >= 0 && tokid <= ROFF_MAX);
- assert(dbg_lvl > 0);
- dbg_lvl--;
-}
-
-