-/* $OpenBSD: libman.h,v 1.41 2014/11/28 05:51:29 schwarze Exp $ */
+/* $OpenBSD: libman.h,v 1.42 2014/12/28 14:39:08 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
struct man {
struct mparse *parse; /* parse pointer */
+ const char *defos; /* default OS argument for .TH */
int quick; /* abort parse early */
int flags; /* parse flags */
#define MAN_ELINE (1 << 1) /* Next-line element scope. */
-/* $OpenBSD: libmandoc.h,v 1.38 2014/12/21 00:17:24 daniel Exp $ */
+/* $OpenBSD: libmandoc.h,v 1.39 2014/12/28 14:39:08 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
void mdoc_addeqn(struct mdoc *, const struct eqn *);
void man_free(struct man *);
-struct man *man_alloc(struct roff *, struct mparse *, int);
+struct man *man_alloc(struct roff *, struct mparse *,
+ const char *, int);
void man_reset(struct man *);
int man_parseln(struct man *, int, char *, int);
int man_endparse(struct man *);
-.\" $OpenBSD: man.1,v 1.7 2014/12/18 20:45:50 jmc Exp $
+.\" $OpenBSD: man.1,v 1.8 2014/12/28 14:39:08 schwarze Exp $
.\"
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" @(#)man.1 8.2 (Berkeley) 1/2/94
.\"
-.Dd $Mdocdate: December 18 2014 $
+.Dd $Mdocdate: December 28 2014 $
.Dt MAN 1
.Os
.Sh NAME
for the
.Xr mdoc 7
.Ic \&Os
+and for the
+.Xr man 7
+.Ic \&TH
macro.
.It Fl h
Display only the SYNOPSIS lines of the requested manual pages.
-/* $OpenBSD: man.c,v 1.93 2014/11/28 06:26:46 schwarze Exp $ */
+/* $OpenBSD: man.c,v 1.94 2014/12/28 14:39:08 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
}
struct man *
-man_alloc(struct roff *roff, struct mparse *parse, int quick)
+man_alloc(struct roff *roff, struct mparse *parse,
+ const char *defos, int quick)
{
struct man *p;
man_hash_init();
p->parse = parse;
+ p->defos = defos;
p->quick = quick;
p->roff = roff;
-/* $OpenBSD: man_validate.c,v 1.78 2014/11/28 05:51:29 schwarze Exp $ */
+/* $OpenBSD: man_validate.c,v 1.79 2014/12/28 14:39:08 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
if (n && (n = n->next))
man->meta.source = mandoc_strdup(n->string);
+ else if (man->defos != NULL)
+ man->meta.source = mandoc_strdup(man->defos);
/* TITLE MSEC DATE SOURCE ->VOL<- */
/* If missing, use the default VOL name for MSEC. */
-.\" $OpenBSD: mandoc.1,v 1.69 2014/12/15 17:36:47 schwarze Exp $
+.\" $OpenBSD: mandoc.1,v 1.70 2014/12/28 14:39:08 schwarze Exp $
.\"
.\" Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
.\" Copyright (c) 2012, 2014 Ingo Schwarze <schwarze@openbsd.org>
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: December 15 2014 $
+.Dd $Mdocdate: December 28 2014 $
.Dt MANDOC 1
.Os
.Sh NAME
for the
.Xr mdoc 7
.Sq \&Os
+and for the
+.Xr man 7
+.Sq \&TH
macro.
.It Fl h
Display only the SYNOPSIS lines.
-/* $OpenBSD: read.c,v 1.80 2014/12/16 23:44:16 schwarze Exp $ */
+/* $OpenBSD: read.c,v 1.81 2014/12/28 14:39:08 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org>
/* Fall back to man(7) as a last resort. */
if (NULL == curp->pman)
- curp->pman = man_alloc(curp->roff, curp,
+ curp->pman = man_alloc(
+ curp->roff, curp, curp->defos,
MPARSE_QUICK & curp->options ? 1 : 0);
assert(curp->pman);
curp->man = curp->pman;
curp->mdoc = curp->pmdoc;
else {
if (curp->pman == NULL)
- curp->pman = man_alloc(curp->roff, curp,
+ curp->pman = man_alloc(
+ curp->roff, curp, curp->defos,
curp->options & MPARSE_QUICK ? 1 : 0);
curp->man = curp->pman;
}
curp->roff, curp, curp->defos,
curp->options & MPARSE_QUICK ? 1 : 0);
if (curp->options & MPARSE_MAN)
- curp->pman = man_alloc(curp->roff, curp,
+ curp->pman = man_alloc(
+ curp->roff, curp, curp->defos,
curp->options & MPARSE_QUICK ? 1 : 0);
return(curp);