summaryrefslogtreecommitdiffstats
path: root/mdoc.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-17 20:10:36 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-17 20:10:36 +0000
commitdd2076332ac7deafb5fe4ca97b255ce8964654fd (patch)
treece3c7d038801a16c4ae3993ee3dedb51b65e8255 /mdoc.c
parent0b5cea59a912aaf566e5d1258761bd53beaf6a35 (diff)
downloadmandoc-dd2076332ac7deafb5fe4ca97b255ce8964654fd.tar.gz
Lint checks.
Diffstat (limited to 'mdoc.c')
-rw-r--r--mdoc.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/mdoc.c b/mdoc.c
index b4e6114f..b56f62c2 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -724,3 +724,25 @@ argdup(size_t argsz, const struct mdoc_arg *args)
return(pp);
}
+
+char *
+mdoc_node2a(struct mdoc_node *node)
+{
+ static char buf[64];
+
+ assert(node);
+
+ buf[0] = 0;
+ (void)xstrlcat(buf, mdoc_type2a(node->type), 64);
+ if (MDOC_ROOT == node->type)
+ return(buf);
+ (void)xstrlcat(buf, " `", 64);
+ if (MDOC_TEXT == node->type)
+ (void)xstrlcat(buf, node->data.text.string, 64);
+ else
+ (void)xstrlcat(buf, mdoc_macronames[node->tok], 64);
+
+ return(buf);
+}
+
+