summaryrefslogtreecommitdiffstats
path: root/validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-02 09:29:06 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-02 09:29:06 +0000
commitbc8a9947a973470047f9e7e24928ad2a2ecabf6a (patch)
treeec563a093abf0c69a944c97fb3258f7a2b61d137 /validate.c
parent8df8a36888bd7cf090c351097d6c520905c2bfd9 (diff)
downloadmandoc-bc8a9947a973470047f9e7e24928ad2a2ecabf6a.tar.gz
*** empty log message ***
Diffstat (limited to 'validate.c')
-rw-r--r--validate.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/validate.c b/validate.c
index df0be728..db90e627 100644
--- a/validate.c
+++ b/validate.c
@@ -29,6 +29,7 @@ typedef int (*v_args)(struct mdoc *, int, int, int,
typedef int (*v_post)(struct mdoc *, int, int);
static int need_head_child(struct mdoc *, int, int);
+static int no_head_child(struct mdoc *, int, int);
static int assert_eq0(struct mdoc *, int, int, int);
static int assert_le1(struct mdoc *, int, int, int);
@@ -59,6 +60,11 @@ struct valids {
};
+/*
+ * FIXME: have arrays of function pointers in case we want multiple
+ * check callbacks per macro.
+ */
+
const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, NULL, NULL }, /* \" */
{ NULL, NULL, NULL }, /* Dd */ /* TODO */
@@ -70,9 +76,9 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ NULL, args_blocknest, need_head_child }, /* D1 */
{ NULL, args_blocknest, need_head_child }, /* Dl */
{ NULL, args_blocknest, NULL }, /* Bd */
- { NULL, NULL, NULL }, /* Ed */
+ { NULL, NULL, no_head_child }, /* Ed */
{ NULL, NULL, NULL }, /* Bl */
- { NULL, NULL, NULL }, /* El */
+ { NULL, NULL, no_head_child }, /* El */
{ NULL, NULL, NULL }, /* It */
{ need_ge1, NULL, NULL }, /* Ad */
{ NULL, NULL, NULL }, /* An */
@@ -242,6 +248,15 @@ need_ge1(struct mdoc *mdoc, int tok, int pos, int sz)
static int
+no_head_child(struct mdoc *mdoc, int tok, int pos)
+{
+
+ /* TODO */
+ return(1);
+}
+
+
+static int
need_head_child(struct mdoc *mdoc, int tok, int pos)
{
struct mdoc_node *n;