aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/man_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-10-17 20:54:58 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-10-17 20:54:58 +0000
commit80da5c33753e6423f0c705cd021a073af20577a9 (patch)
tree86853f332a4ac8f07b3d088aeccb48fc5611ebc6 /man_validate.c
parentde451aaf7a927d2994d3e526df07235dee8005af (diff)
downloadmandoc-80da5c33753e6423f0c705cd021a073af20577a9.tar.gz
mandoc-80da5c33753e6423f0c705cd021a073af20577a9.tar.zst
mandoc-80da5c33753e6423f0c705cd021a073af20577a9.zip
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.
Diffstat (limited to 'man_validate.c')
-rw-r--r--man_validate.c19
1 files changed, 17 insertions, 2 deletions
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 <kristaps@bsd.lv>
- * Copyright (c) 2010, 2012 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2010, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
*
* 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 */
};
@@ -246,6 +250,17 @@ 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)
{
char *cp;