From d8072843f9a4a4d270b86fee59886720c7f48a68 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Fri, 2 Jan 2009 09:29:06 +0000 Subject: *** empty log message *** --- validate.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/validate.c b/validate.c index 6b47e895..07edbd89 100644 --- a/validate.c +++ b/validate.c @@ -1,4 +1,4 @@ -/* $Id: validate.c,v 1.11 2009/01/01 20:40:16 kristaps Exp $ */ +/* $Id: validate.c,v 1.12 2009/01/02 09:29:06 kristaps Exp $ */ /* * Copyright (c) 2008 Kristaps Dzonsons * @@ -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 */ @@ -241,6 +247,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) { -- cgit v1.2.3-56-ge451