+
+
+enum mdoc_att
+mdoc_atoatt(const char *p)
+{
+
+ assert(p);
+ if (0 == strcmp(p, "v1"))
+ return(ATT_v1);
+ else if (0 == strcmp(p, "v2"))
+ return(ATT_v2);
+ else if (0 == strcmp(p, "v3"))
+ return(ATT_v3);
+ else if (0 == strcmp(p, "v4"))
+ return(ATT_v4);
+ else if (0 == strcmp(p, "v5"))
+ return(ATT_v5);
+ else if (0 == strcmp(p, "v6"))
+ return(ATT_v6);
+ else if (0 == strcmp(p, "v7"))
+ return(ATT_v7);
+ else if (0 == strcmp(p, "32v"))
+ return(ATT_32v);
+ else if (0 == strcmp(p, "V.1"))
+ return(ATT_V1);
+ else if (0 == strcmp(p, "V.2"))
+ return(ATT_V2);
+ else if (0 == strcmp(p, "V.3"))
+ return(ATT_V3);
+ else if (0 == strcmp(p, "V.4"))
+ return(ATT_V4);
+
+ return(ATT_DEFAULT);
+}
+
+
+char *
+mdoc_type2a(enum mdoc_type type)
+{
+ switch (type) {
+ case (MDOC_ROOT):
+ return("root");
+ case (MDOC_BLOCK):
+ return("block");
+ case (MDOC_HEAD):
+ return("block-head");
+ case (MDOC_BODY):
+ return("block-body");
+ case (MDOC_TAIL):
+ return("block-tail");
+ case (MDOC_ELEM):
+ return("elem");
+ case (MDOC_TEXT):
+ return("text");
+ default:
+ break;
+ }
+
+ abort();
+ /* NOTREACHED */
+}