diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-17 20:10:36 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-01-17 20:10:36 +0000 |
commit | dd2076332ac7deafb5fe4ca97b255ce8964654fd (patch) | |
tree | ce3c7d038801a16c4ae3993ee3dedb51b65e8255 /mdoc.c | |
parent | 0b5cea59a912aaf566e5d1258761bd53beaf6a35 (diff) | |
download | mandoc-dd2076332ac7deafb5fe4ca97b255ce8964654fd.tar.gz |
Lint checks.
Diffstat (limited to 'mdoc.c')
-rw-r--r-- | mdoc.c | 22 |
1 files changed, 22 insertions, 0 deletions
@@ -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); +} + + |