summaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 10:53:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 10:53:58 +0000
commit52078b04137667fec0f8506ad5417fffefd8f82d (patch)
tree206c99ff4874368c5c3874ffe02f5bee49456266 /man_validate.c
parente100896ec287b69a49978cc7502276f0759544b0 (diff)
downloadmandoc-52078b04137667fec0f8506ad5417fffefd8f82d.tar.gz
mandoc-52078b04137667fec0f8506ad5417fffefd8f82d.tar.zst
mandoc-52078b04137667fec0f8506ad5417fffefd8f82d.zip
Moved all formatted libman warn/error into man.c/libman.h.
Converted all formatted warn/errors into regular syntax.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c32
1 files changed, 3 insertions, 29 deletions
diff --git a/man_validate.c b/man_validate.c
index be022d6f..6cf7db01 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -1,4 +1,4 @@
-/* $Id: man_validate.c,v 1.11 2009/06/18 10:32:00 kristaps Exp $ */
+/* $Id: man_validate.c,v 1.12 2009/06/18 10:53:58 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -25,10 +25,6 @@
#define POSTARGS struct man *m, const struct man_node *n
-enum merr {
- WPRINT
-};
-
typedef int (*v_post)(POSTARGS);
struct man_valid {
@@ -42,7 +38,6 @@ static int check_le1(POSTARGS);
static int check_le2(POSTARGS);
static int check_le5(POSTARGS);
static int check_text(POSTARGS);
-static int perr(struct man *, int, int, int, enum merr);
static v_post posts_le1[] = { check_le1, NULL };
static v_post posts_le2[] = { check_le2, NULL };
@@ -106,27 +101,6 @@ man_valid_post(struct man *m)
static int
-perr(struct man *m, int line, int pos,
- int iserr, enum merr type)
-{
- const char *p;
-
- p = NULL;
- switch (type) {
- case (WPRINT):
- p = "invalid character";
- break;
- }
- assert(p);
-
- if (iserr)
- return(man_verr(m, line, pos, p));
-
- return(man_vwarn(m, line, pos, p));
-}
-
-
-static int
check_text(POSTARGS)
{
const char *p;
@@ -139,8 +113,8 @@ check_text(POSTARGS)
continue;
if (MAN_IGN_CHARS & m->pflags)
- return(perr(m, n->line, pos, 0, WPRINT));
- return(perr(m, n->line, pos, 1, WPRINT));
+ return(man_pwarn(m, n->line, pos, WNPRINT));
+ return(man_perr(m, n->line, pos, WNPRINT));
}
return(1);