From 80da5c33753e6423f0c705cd021a073af20577a9 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 17 Oct 2013 20:54:58 +0000 Subject: Implement the .UR/.UE block (uniform resource identifier) introduced in the man-ext macros by Eric S. Raymond, enabled by default in groff_man(7). Usual disclaimer: You don't write new man(7) code, so you are not going to use these, either. Improves e.g. the bzr(1) and etherape(1) manuals. Thanks to naddy@ for bringing these to my attention. --- man_validate.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index 7a9deede..da2e557e 100644 --- a/man_validate.c +++ b/man_validate.c @@ -1,7 +1,7 @@ -/* $Id: man_validate.c,v 1.85 2012/11/17 00:26:33 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.86 2013/10/17 20:54:58 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons - * Copyright (c) 2010, 2012 Ingo Schwarze + * Copyright (c) 2010, 2012, 2013 Ingo Schwarze * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -49,6 +49,7 @@ static int check_eq2(CHKARGS); static int check_le1(CHKARGS); static int check_ge2(CHKARGS); static int check_le5(CHKARGS); +static int check_head1(CHKARGS); static int check_par(CHKARGS); static int check_part(CHKARGS); static int check_root(CHKARGS); @@ -80,6 +81,7 @@ static v_check posts_sec[] = { post_sec, NULL }; static v_check posts_sp[] = { post_vs, check_le1, NULL }; static v_check posts_th[] = { check_ge2, check_le5, post_TH, NULL }; static v_check posts_uc[] = { post_UC, NULL }; +static v_check posts_ur[] = { check_head1, check_part, NULL }; static v_check pres_sec[] = { pre_sec, NULL }; static const struct man_valid man_valids[MAN_MAX] = { @@ -119,6 +121,8 @@ static const struct man_valid man_valids[MAN_MAX] = { { NULL, posts_eq2 }, /* OP */ { NULL, posts_nf }, /* EX */ { NULL, posts_fi }, /* EE */ + { NULL, posts_ur }, /* UR */ + { NULL, NULL }, /* UE */ }; @@ -245,6 +249,17 @@ INEQ_DEFINE(1, <=, le1) INEQ_DEFINE(2, >=, ge2) INEQ_DEFINE(5, <=, le5) +static int +check_head1(CHKARGS) +{ + + if (MAN_HEAD == n->type && 1 != n->nchild) + mandoc_vmsg(MANDOCERR_ARGCOUNT, man->parse, n->line, + n->pos, "line arguments eq 1 (have %d)", n->nchild); + + return(1); +} + static int post_ft(CHKARGS) { -- cgit v1.2.3-56-ge451