=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/mandoc/mandocdb.c,v retrieving revision 1.140 retrieving revision 1.141 diff -u -r1.140 -r1.141 --- src/usr.bin/mandoc/mandocdb.c 2015/03/27 17:36:56 1.140 +++ src/usr.bin/mandoc/mandocdb.c 2015/04/02 21:03:18 1.141 @@ -1,4 +1,4 @@ -/* $OpenBSD: mandocdb.c,v 1.140 2015/03/27 17:36:56 schwarze Exp $ */ +/* $OpenBSD: mandocdb.c,v 1.141 2015/04/02 21:03:18 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011-2015 Ingo Schwarze @@ -36,10 +36,11 @@ #include #include +#include "mandoc_aux.h" +#include "mandoc.h" +#include "roff.h" #include "mdoc.h" #include "man.h" -#include "mandoc.h" -#include "mandoc_aux.h" #include "manconf.h" #include "mansearch.h" @@ -1418,7 +1419,7 @@ for ( ; NULL != n; n = n->next) { if (NULL != n->child) putmdockey(mpage, n->child, m); - if (MDOC_TEXT == n->type) + if (n->type == ROFFT_TEXT) putkey(mpage, n->string, m); } } @@ -1442,13 +1443,13 @@ * the correct section or not. */ - if (MAN_BODY == n->type && MAN_SH == n->tok) { + if (n->type == ROFFT_BODY && n->tok == MAN_SH) { body = n; assert(body->parent); if (NULL != (head = body->parent->head) && 1 == head->nchild && NULL != (head = (head->child)) && - MAN_TEXT == head->type && + head->type == ROFFT_TEXT && 0 == strcmp(head->string, "NAME") && NULL != body->child) { @@ -1557,15 +1558,15 @@ assert(NULL != n); for (n = n->child; NULL != n; n = n->next) { switch (n->type) { - case MDOC_ELEM: + case ROFFT_ELEM: /* FALLTHROUGH */ - case MDOC_BLOCK: + case ROFFT_BLOCK: /* FALLTHROUGH */ - case MDOC_HEAD: + case ROFFT_HEAD: /* FALLTHROUGH */ - case MDOC_BODY: + case ROFFT_BODY: /* FALLTHROUGH */ - case MDOC_TAIL: + case ROFFT_TAIL: if (NULL != mdocs[n->tok].fp) if (0 == (*mdocs[n->tok].fp)(mpage, meta, n)) break; @@ -1574,7 +1575,7 @@ mdocs[n->tok].mask); break; default: - assert(MDOC_ROOT != n->type); + assert(n->type != ROFFT_ROOT); continue; } if (NULL != n->child) @@ -1591,7 +1592,7 @@ if (SEC_SYNOPSIS != n->sec || NULL == (n = n->child) || - MDOC_TEXT != n->type) + n->type != ROFFT_TEXT) return(0); /* @@ -1602,7 +1603,7 @@ if (strcmp("#include", n->string)) return(0); - if (NULL == (n = n->next) || MDOC_TEXT != n->type) + if ((n = n->next) == NULL || n->type != ROFFT_TEXT) return(0); /* @@ -1632,7 +1633,7 @@ char *cp; size_t sz; - if (n->type != MDOC_TEXT) + if (n->type != ROFFT_TEXT) return; /* Skip function pointer punctuation. */ @@ -1658,7 +1659,7 @@ parse_mdoc_fname(mpage, n->child); for (n = n->child->next; n != NULL; n = n->next) - if (n->type == MDOC_TEXT) + if (n->type == ROFFT_TEXT) putkey(mpage, n->string, TYPE_Fa); return(0); @@ -1669,7 +1670,7 @@ const struct mdoc_node *n) { - if (n->type != MDOC_HEAD) + if (n->type != ROFFT_HEAD) return(1); if (n->child != NULL) @@ -1703,7 +1704,7 @@ const struct mdoc_node *n) { - if (MDOC_BODY == n->type) + if (n->type == ROFFT_BODY) mdoc_deroff(&mpage->desc, n); return(0); } @@ -1715,7 +1716,7 @@ if (SEC_NAME == n->sec) putmdockey(mpage, n->child, NAME_TITLE); - else if (SEC_SYNOPSIS == n->sec && MDOC_HEAD == n->type) { + else if (n->sec == SEC_SYNOPSIS && n->type == ROFFT_HEAD) { if (n->child == NULL) putkey(mpage, meta->name, NAME_SYN); else @@ -1724,7 +1725,7 @@ if ( ! (mpage->name_head_done || n->child == NULL || n->child->string == NULL || strcasecmp(n->child->string, meta->title))) { - putkey(mpage, n->child->string, NAME_HEAD); + putkey(mpage, n->child->string, ROFFT_HEAD); mpage->name_head_done = 1; } return(0); @@ -1735,7 +1736,7 @@ const struct mdoc_node *n) { - return(SEC_CUSTOM == n->sec && MDOC_HEAD == n->type); + return(n->sec == SEC_CUSTOM && n->type == ROFFT_HEAD); } static int @@ -1743,7 +1744,7 @@ const struct mdoc_node *n) { - return(MDOC_HEAD == n->type); + return(n->type == ROFFT_HEAD); } static int @@ -1751,7 +1752,7 @@ const struct mdoc_node *n) { - return(MDOC_BODY == n->type); + return(n->type == ROFFT_BODY); } /*