=================================================================== RCS file: /cvs/mandoc/man_validate.c,v retrieving revision 1.113 retrieving revision 1.114 diff -u -p -r1.113 -r1.114 --- mandoc/man_validate.c 2015/02/06 11:54:36 1.113 +++ mandoc/man_validate.c 2015/04/02 21:36:50 1.114 @@ -1,4 +1,4 @@ -/* $OpenBSD: man_validate.c,v 1.113 2015/02/06 11:54:36 schwarze Exp $ */ +/* $OpenBSD: man_validate.c,v 1.114 2015/04/02 21:36:50 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2015 Ingo Schwarze @@ -7,9 +7,9 @@ * purpose with or without fee is hereby granted, provided that the above * copyright notice and this permission notice appear in all copies. * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF @@ -28,11 +28,12 @@ #include #include -#include "man.h" -#include "mandoc.h" #include "mandoc_aux.h" -#include "libman.h" +#include "mandoc.h" +#include "roff.h" +#include "man.h" #include "libmandoc.h" +#include "libman.h" #define CHKARGS struct man *man, struct man_node *n @@ -108,15 +109,15 @@ man_valid_post(struct man *man) n->flags |= MAN_VALID; switch (n->type) { - case MAN_TEXT: + case ROFFT_TEXT: check_text(man, n); break; - case MAN_ROOT: + case ROFFT_ROOT: check_root(man, n); break; - case MAN_EQN: + case ROFFT_EQN: /* FALLTHROUGH */ - case MAN_TBL: + case ROFFT_TBL: break; default: cp = man_valids + n->tok; @@ -186,7 +187,7 @@ static void post_UR(CHKARGS) { - if (n->type == MAN_HEAD && n->child == NULL) + if (n->type == ROFFT_HEAD && n->child == NULL) mandoc_vmsg(MANDOCERR_UR_NOHEAD, man->parse, n->line, n->pos, "UR"); check_part(man, n); @@ -243,7 +244,7 @@ static void check_part(CHKARGS) { - if (n->type == MAN_BODY && n->child == NULL) + if (n->type == ROFFT_BODY && n->child == NULL) mandoc_msg(MANDOCERR_BLK_EMPTY, man->parse, n->line, n->pos, man_macronames[n->tok]); } @@ -253,17 +254,17 @@ check_par(CHKARGS) { switch (n->type) { - case MAN_BLOCK: + case ROFFT_BLOCK: if (0 == n->body->nchild) man_node_delete(man, n); break; - case MAN_BODY: + case ROFFT_BODY: if (0 == n->nchild) mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos, "%s empty", man_macronames[n->tok]); break; - case MAN_HEAD: + case ROFFT_HEAD: if (n->nchild) mandoc_vmsg(MANDOCERR_ARG_SKIP, man->parse, n->line, n->pos, @@ -281,11 +282,11 @@ post_IP(CHKARGS) { switch (n->type) { - case MAN_BLOCK: + case ROFFT_BLOCK: if (0 == n->head->nchild && 0 == n->body->nchild) man_node_delete(man, n); break; - case MAN_BODY: + case ROFFT_BODY: if (0 == n->parent->head->nchild && 0 == n->nchild) mandoc_vmsg(MANDOCERR_PAR_SKIP, man->parse, n->line, n->pos, @@ -427,7 +428,7 @@ post_UC(CHKARGS) n = n->child; - if (NULL == n || MAN_TEXT != n->type) + if (n == NULL || n->type != ROFFT_TEXT) p = bsd_versions[0]; else { s = n->string; @@ -464,7 +465,7 @@ post_AT(CHKARGS) n = n->child; - if (NULL == n || MAN_TEXT != n->type) + if (n == NULL || n->type != ROFFT_TEXT) p = unix_versions[0]; else { s = n->string; @@ -474,7 +475,9 @@ post_AT(CHKARGS) p = unix_versions[1]; else if (0 == strcmp(s, "5")) { nn = n->next; - if (nn && MAN_TEXT == nn->type && nn->string[0]) + if (nn != NULL && + nn->type == ROFFT_TEXT && + nn->string[0] != '\0') p = unix_versions[3]; else p = unix_versions[2];