diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-22 13:09:17 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-06-22 13:09:17 +0000 |
commit | 369129e10cecda27554b9987d819367bcfcf3353 (patch) | |
tree | 1d9055d8a6102e9072cd7bb27103aea9b53689b5 /man_validate.c | |
parent | 47256364f90726421cafc28ec2f147ee98c59f94 (diff) | |
download | mandoc-369129e10cecda27554b9987d819367bcfcf3353.tar.gz mandoc-369129e10cecda27554b9987d819367bcfcf3353.tar.zst mandoc-369129e10cecda27554b9987d819367bcfcf3353.zip |
libman documents require `TH' and at least one node.
libman requirements documented in man.7 STRUCTURE section.
Added STRUCTURE section to mdoc.7, too.
Diffstat (limited to 'man_validate.c')
-rw-r--r-- | man_validate.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/man_validate.c b/man_validate.c index 7c06e47d..7a573b76 100644 --- a/man_validate.c +++ b/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.13 2009/06/22 10:40:04 kristaps Exp $ */ +/* $Id: man_validate.c,v 1.14 2009/06/22 13:09:17 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -38,6 +38,7 @@ static int check_le1(POSTARGS); static int check_le2(POSTARGS); static int check_le5(POSTARGS); static int check_text(POSTARGS); +static int check_root(POSTARGS); static v_post posts_le1[] = { check_le1, NULL }; static v_post posts_le2[] = { check_le2, NULL }; @@ -85,8 +86,7 @@ man_valid_post(struct man *m) case (MAN_TEXT): return(check_text(m, m->last)); case (MAN_ROOT): - /* FIXME: validate that TH has been invoked! */ - return(1); + return(check_root(m, m->last)); default: break; } @@ -102,6 +102,19 @@ man_valid_post(struct man *m) static int +check_root(POSTARGS) +{ + + if (NULL == m->first->child) + return(man_nerr(m, n, WNODATA)); + if (NULL == m->meta.title) + return(man_nerr(m, n, WNOTITLE)); + + return(1); +} + + +static int check_text(POSTARGS) { const char *p; |