summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libman.h2
-rw-r--r--libmdoc.h2
-rw-r--r--man.c6
-rw-r--r--man.h11
-rw-r--r--man_html.c6
-rw-r--r--man_term.c32
-rw-r--r--man_validate.c26
-rw-r--r--mandoc_headers.325
-rw-r--r--mandocdb.c46
-rw-r--r--mdoc.c8
-rw-r--r--mdoc.h12
-rw-r--r--mdoc_html.c2
-rw-r--r--mdoc_man.c4
-rw-r--r--mdoc_term.c18
-rw-r--r--roff.h11
-rw-r--r--term.c6
-rw-r--r--term.h11
17 files changed, 111 insertions, 117 deletions
diff --git a/libman.h b/libman.h
index eeff4a9b..7404b795 100644
--- a/libman.h
+++ b/libman.h
@@ -33,7 +33,7 @@ struct man {
enum man_next next; /* where to put the next node */
struct roff_node *last; /* the last parsed node */
struct roff_node *first; /* the first parsed node */
- struct man_meta meta; /* document meta-data */
+ struct roff_meta meta; /* document meta-data */
struct roff *roff;
};
diff --git a/libmdoc.h b/libmdoc.h
index e0e1e2b1..d8e86a7f 100644
--- a/libmdoc.h
+++ b/libmdoc.h
@@ -40,7 +40,7 @@ struct mdoc {
struct roff_node *last; /* the last node parsed */
struct roff_node *first; /* the first node parsed */
struct roff_node *last_es; /* the most recent Es node */
- struct mdoc_meta meta; /* document meta-data */
+ struct roff_meta meta; /* document meta-data */
enum roff_sec lastnamed;
enum roff_sec lastsec;
struct roff *roff;
diff --git a/man.c b/man.c
index 4e842e5e..08ffdd11 100644
--- a/man.c
+++ b/man.c
@@ -69,7 +69,7 @@ man_node(const struct man *man)
return(man->first);
}
-const struct man_meta *
+const struct roff_meta *
man_meta(const struct man *man)
{
@@ -136,7 +136,7 @@ man_free1(struct man *man)
if (man->first)
man_node_delete(man, man->first);
free(man->meta.title);
- free(man->meta.source);
+ free(man->meta.os);
free(man->meta.date);
free(man->meta.vol);
free(man->meta.msec);
@@ -146,7 +146,7 @@ static void
man_alloc1(struct man *man)
{
- memset(&man->meta, 0, sizeof(struct man_meta));
+ memset(&man->meta, 0, sizeof(man->meta));
man->flags = 0;
man->last = mandoc_calloc(1, sizeof(*man->last));
man->first = man->last;
diff --git a/man.h b/man.h
index 88afb0d2..49c2aa00 100644
--- a/man.h
+++ b/man.h
@@ -56,15 +56,6 @@
#define MAN_ll 37
#define MAN_MAX 38
-struct man_meta {
- char *msec; /* `TH' section (1, 3p, etc.) */
- char *date; /* `TH' normalised date */
- char *vol; /* `TH' volume */
- char *title; /* `TH' title (e.g., FOO) */
- char *source; /* `TH' source (e.g., GNU) */
- int hasbody; /* document is not empty */
-};
-
/* Names of macros. */
extern const char *const *man_macronames;
@@ -73,7 +64,7 @@ __BEGIN_DECLS
struct man;
const struct roff_node *man_node(const struct man *);
-const struct man_meta *man_meta(const struct man *);
+const struct roff_meta *man_meta(const struct man *);
const struct mparse *man_mparse(const struct man *);
void man_deroff(char **, const struct roff_node *);
diff --git a/man_html.c b/man_html.c
index 72be19bc..b1dc315d 100644
--- a/man_html.c
+++ b/man_html.c
@@ -37,7 +37,7 @@
#define INDENT 5
-#define MAN_ARGS const struct man_meta *man, \
+#define MAN_ARGS const struct roff_meta *man, \
const struct roff_node *n, \
struct mhtml *mh, \
struct html *h
@@ -348,8 +348,8 @@ man_root_post(MAN_ARGS)
PAIR_CLASS_INIT(&tag, "foot-os");
print_otag(h, TAG_TD, 1, &tag);
- if (man->source)
- print_text(h, man->source);
+ if (man->os)
+ print_text(h, man->os);
print_tagq(h, t);
}
diff --git a/man_term.c b/man_term.c
index 4fdd8a2b..473b25e4 100644
--- a/man_term.c
+++ b/man_term.c
@@ -49,7 +49,7 @@ struct mtermp {
#define DECL_ARGS struct termp *p, \
struct mtermp *mt, \
struct roff_node *n, \
- const struct man_meta *meta
+ const struct roff_meta *meta
struct termact {
int (*pre)(DECL_ARGS);
@@ -60,8 +60,10 @@ struct termact {
static void print_man_nodelist(DECL_ARGS);
static void print_man_node(DECL_ARGS);
-static void print_man_head(struct termp *, const void *);
-static void print_man_foot(struct termp *, const void *);
+static void print_man_head(struct termp *,
+ const struct roff_meta *);
+static void print_man_foot(struct termp *,
+ const struct roff_meta *);
static void print_bvspace(struct termp *,
const struct roff_node *, int);
@@ -139,7 +141,7 @@ void
terminal_man(void *arg, const struct man *man)
{
struct termp *p;
- const struct man_meta *meta;
+ const struct roff_meta *meta;
struct roff_node *n;
struct mtermp mt;
@@ -1012,13 +1014,11 @@ print_man_nodelist(DECL_ARGS)
}
static void
-print_man_foot(struct termp *p, const void *arg)
+print_man_foot(struct termp *p, const struct roff_meta *meta)
{
- const struct man_meta *meta;
char *title;
size_t datelen, titlen;
- meta = (const struct man_meta *)arg;
assert(meta->title);
assert(meta->msec);
assert(meta->date);
@@ -1030,8 +1030,8 @@ print_man_foot(struct termp *p, const void *arg)
/*
* Temporary, undocumented option to imitate mdoc(7) output.
- * In the bottom right corner, use the source instead of
- * the title.
+ * In the bottom right corner, use the operating system
+ * instead of the title.
*/
if ( ! p->mdocstyle) {
@@ -1041,14 +1041,14 @@ print_man_foot(struct termp *p, const void *arg)
}
mandoc_asprintf(&title, "%s(%s)",
meta->title, meta->msec);
- } else if (meta->source) {
- title = mandoc_strdup(meta->source);
+ } else if (meta->os) {
+ title = mandoc_strdup(meta->os);
} else {
title = mandoc_strdup("");
}
datelen = term_strlen(p, meta->date);
- /* Bottom left corner: manual source. */
+ /* Bottom left corner: operating system. */
p->flags |= TERMP_NOSPACE | TERMP_NOBREAK;
p->trailspace = 1;
@@ -1056,8 +1056,8 @@ print_man_foot(struct termp *p, const void *arg)
p->rmargin = p->maxrmargin > datelen ?
(p->maxrmargin + term_len(p, 1) - datelen) / 2 : 0;
- if (meta->source)
- term_word(p, meta->source);
+ if (meta->os)
+ term_word(p, meta->os);
term_flushln(p);
/* At the bottom in the middle: manual date. */
@@ -1084,14 +1084,12 @@ print_man_foot(struct termp *p, const void *arg)
}
static void
-print_man_head(struct termp *p, const void *arg)
+print_man_head(struct termp *p, const struct roff_meta *meta)
{
- const struct man_meta *meta;
const char *volume;
char *title;
size_t vollen, titlen;
- meta = (const struct man_meta *)arg;
assert(meta->title);
assert(meta->msec);
diff --git a/man_validate.c b/man_validate.c
index a73be7ca..3a695d00 100644
--- a/man_validate.c
+++ b/man_validate.c
@@ -305,16 +305,16 @@ post_TH(CHKARGS)
free(man->meta.title);
free(man->meta.vol);
- free(man->meta.source);
+ free(man->meta.os);
free(man->meta.msec);
free(man->meta.date);
man->meta.title = man->meta.vol = man->meta.date =
- man->meta.msec = man->meta.source = NULL;
+ man->meta.msec = man->meta.os = NULL;
nb = n;
- /* ->TITLE<- MSEC DATE SOURCE VOL */
+ /* ->TITLE<- MSEC DATE OS VOL */
n = n->child;
if (n && n->string) {
@@ -336,7 +336,7 @@ post_TH(CHKARGS)
nb->line, nb->pos, "TH");
}
- /* TITLE ->MSEC<- DATE SOURCE VOL */
+ /* TITLE ->MSEC<- DATE OS VOL */
if (n)
n = n->next;
@@ -348,7 +348,7 @@ post_TH(CHKARGS)
nb->line, nb->pos, "TH %s", man->meta.title);
}
- /* TITLE MSEC ->DATE<- SOURCE VOL */
+ /* TITLE MSEC ->DATE<- OS VOL */
if (n)
n = n->next;
@@ -364,14 +364,14 @@ post_TH(CHKARGS)
n ? n->pos : nb->pos, "TH");
}
- /* TITLE MSEC DATE ->SOURCE<- VOL */
+ /* TITLE MSEC DATE ->OS<- VOL */
if (n && (n = n->next))
- man->meta.source = mandoc_strdup(n->string);
+ man->meta.os = mandoc_strdup(n->string);
else if (man->defos != NULL)
- man->meta.source = mandoc_strdup(man->defos);
+ man->meta.os = mandoc_strdup(man->defos);
- /* TITLE MSEC DATE SOURCE ->VOL<- */
+ /* TITLE MSEC DATE OS ->VOL<- */
/* If missing, use the default VOL name for MSEC. */
if (n && (n = n->next))
@@ -446,8 +446,8 @@ post_UC(CHKARGS)
p = bsd_versions[0];
}
- free(man->meta.source);
- man->meta.source = mandoc_strdup(p);
+ free(man->meta.os);
+ man->meta.os = mandoc_strdup(p);
}
static void
@@ -485,8 +485,8 @@ post_AT(CHKARGS)
p = unix_versions[0];
}
- free(man->meta.source);
- man->meta.source = mandoc_strdup(p);
+ free(man->meta.os);
+ man->meta.os = mandoc_strdup(p);
}
static void
diff --git a/mandoc_headers.3 b/mandoc_headers.3
index d3400876..85cf1894 100644
--- a/mandoc_headers.3
+++ b/mandoc_headers.3
@@ -121,6 +121,7 @@ Provides
.Vt enum mdoc_endbody ,
.Vt enum roff_sec ,
.Vt enum roff_type ,
+.Vt struct roff_meta ,
and
.Vt struct roff_node .
.Pp
@@ -154,7 +155,6 @@ Provides
.Vt enum mdoc_list ,
.Vt enum mdoc_auth ,
.Vt enum mdoc_font ,
-.Vt struct mdoc_meta ,
.Vt struct mdoc_argv ,
.Vt struct mdoc_arg ,
.Vt struct mdoc_bd ,
@@ -188,9 +188,7 @@ Requires
for
.Vt enum roff_type .
.Pp
-Provides
-.Vt struct man_meta
-and the functions
+Provides the functions
.Fn man_*
described in
.Xr mandoc 3 .
@@ -226,11 +224,16 @@ are included, the same file should not include any formatter headers.
Requires
.In sys/types.h
for
-.Vt size_t
-and
+.Vt size_t ,
.Qq Pa mandoc.h
for
-.Vt enum mandocerr .
+.Vt enum mandocerr ,
+and
+.Qq Pa roff.h
+for
+.Vt struct roff_meta
+and
+.Vt struct roff_node .
.Pp
Provides
.Vt enum rofferr ,
@@ -297,7 +300,9 @@ or
Requires
.Qq Pa roff.h
for
-.Vt struct roff_node.
+.Vt struct roff_meta
+and
+.Vt struct roff_node .
.Pp
Provides
.Vt enum man_next ,
@@ -420,6 +425,10 @@ and
.Vt struct eqn
from
.Pa mandoc.h
+and
+.Vt struct roff_meta
+from
+.Qq Pa roff.h
as opaque types for function prototypes.
.Pp
When this header is included, the same file should not include
diff --git a/mandocdb.c b/mandocdb.c
index d75d79cb..d17d4215 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -130,7 +130,7 @@ enum stmt {
STMT__MAX
};
-typedef int (*mdoc_fp)(struct mpage *, const struct mdoc_meta *,
+typedef int (*mdoc_fp)(struct mpage *, const struct roff_meta *,
const struct roff_node *);
struct mdoc_handler {
@@ -156,28 +156,28 @@ static void mpages_free(void);
static void mpages_merge(struct mparse *);
static void names_check(void);
static void parse_cat(struct mpage *, int);
-static void parse_man(struct mpage *, const struct man_meta *,
+static void parse_man(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static void parse_mdoc(struct mpage *, const struct mdoc_meta *,
+static void parse_mdoc(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_body(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_body(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_head(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_head(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Fd(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Fd(struct mpage *, const struct roff_meta *,
const struct roff_node *);
static void parse_mdoc_fname(struct mpage *, const struct roff_node *);
-static int parse_mdoc_Fn(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Fn(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Fo(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Fo(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Nd(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Nd(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Nm(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Nm(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Sh(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Sh(struct mpage *, const struct roff_meta *,
const struct roff_node *);
-static int parse_mdoc_Xr(struct mpage *, const struct mdoc_meta *,
+static int parse_mdoc_Xr(struct mpage *, const struct roff_meta *,
const struct roff_node *);
static void putkey(const struct mpage *, char *, uint64_t);
static void putkeys(const struct mpage *, char *, size_t, uint64_t);
@@ -1443,7 +1443,7 @@ putmdockey(const struct mpage *mpage,
}
static void
-parse_man(struct mpage *mpage, const struct man_meta *meta,
+parse_man(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
const struct roff_node *head, *body;
@@ -1569,7 +1569,7 @@ parse_man(struct mpage *mpage, const struct man_meta *meta,
}
static void
-parse_mdoc(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1602,7 +1602,7 @@ parse_mdoc(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Fd(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
char *start, *end;
@@ -1667,7 +1667,7 @@ parse_mdoc_fname(struct mpage *mpage, const struct roff_node *n)
}
static int
-parse_mdoc_Fn(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Fn(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1684,7 +1684,7 @@ parse_mdoc_Fn(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Fo(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Fo(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1698,7 +1698,7 @@ parse_mdoc_Fo(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Xr(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
char *cp;
@@ -1718,7 +1718,7 @@ parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Nd(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1728,7 +1728,7 @@ parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Nm(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1750,7 +1750,7 @@ parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_Sh(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_Sh(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1758,7 +1758,7 @@ parse_mdoc_Sh(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_head(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_head(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
@@ -1766,7 +1766,7 @@ parse_mdoc_head(struct mpage *mpage, const struct mdoc_meta *meta,
}
static int
-parse_mdoc_body(struct mpage *mpage, const struct mdoc_meta *meta,
+parse_mdoc_body(struct mpage *mpage, const struct roff_meta *meta,
const struct roff_node *n)
{
diff --git a/mdoc.c b/mdoc.c
index 055babd8..44678358 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -7,9 +7,9 @@
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
@@ -102,7 +102,7 @@ mdoc_node(const struct mdoc *mdoc)
return(mdoc->first);
}
-const struct mdoc_meta *
+const struct roff_meta *
mdoc_meta(const struct mdoc *mdoc)
{
@@ -134,7 +134,7 @@ static void
mdoc_alloc1(struct mdoc *mdoc)
{
- memset(&mdoc->meta, 0, sizeof(struct mdoc_meta));
+ memset(&mdoc->meta, 0, sizeof(mdoc->meta));
mdoc->flags = 0;
mdoc->lastnamed = mdoc->lastsec = SEC_NONE;
mdoc->last = mandoc_calloc(1, sizeof(*mdoc->last));
diff --git a/mdoc.h b/mdoc.h
index 1da5b05c..d670fdcf 100644
--- a/mdoc.h
+++ b/mdoc.h
@@ -172,16 +172,6 @@ enum mdocargt {
MDOC_ARG_MAX
};
-struct mdoc_meta {
- char *msec; /* `Dt' section (1, 3p, etc.) */
- char *vol; /* `Dt' volume (implied) */
- char *arch; /* `Dt' arch (i386, etc.) */
- char *date; /* `Dd' normalised date */
- char *title; /* `Dt' title (FOO, etc.) */
- char *os; /* `Os' system (OpenBSD, etc.) */
- char *name; /* leading `Nm' name */
-};
-
/*
* An argument to a macro (multiple values = `-column xxx yyy').
*/
@@ -295,7 +285,7 @@ __BEGIN_DECLS
struct mdoc;
const struct roff_node *mdoc_node(const struct mdoc *);
-const struct mdoc_meta *mdoc_meta(const struct mdoc *);
+const struct roff_meta *mdoc_meta(const struct mdoc *);
void mdoc_deroff(char **, const struct roff_node *);
__END_DECLS
diff --git a/mdoc_html.c b/mdoc_html.c
index 86f4bb91..3c2061c1 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -35,7 +35,7 @@
#define INDENT 5
-#define MDOC_ARGS const struct mdoc_meta *meta, \
+#define MDOC_ARGS const struct roff_meta *meta, \
struct roff_node *n, \
struct html *h
diff --git a/mdoc_man.c b/mdoc_man.c
index 011f1efc..e4d00390 100644
--- a/mdoc_man.c
+++ b/mdoc_man.c
@@ -30,7 +30,7 @@
#include "out.h"
#include "main.h"
-#define DECL_ARGS const struct mdoc_meta *meta, struct roff_node *n
+#define DECL_ARGS const struct roff_meta *meta, struct roff_node *n
struct manact {
int (*cond)(DECL_ARGS); /* DON'T run actions */
@@ -547,7 +547,7 @@ man_man(void *arg, const struct man *man)
void
man_mdoc(void *arg, const struct mdoc *mdoc)
{
- const struct mdoc_meta *meta;
+ const struct roff_meta *meta;
struct roff_node *n;
meta = mdoc_meta(mdoc);
diff --git a/mdoc_term.c b/mdoc_term.c
index aa4aec31..55598c4f 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -43,7 +43,7 @@ struct termpair {
#define DECL_ARGS struct termp *p, \
struct termpair *pair, \
- const struct mdoc_meta *meta, \
+ const struct roff_meta *meta, \
struct roff_node *n
struct termact {
@@ -58,8 +58,8 @@ static void print_bvspace(struct termp *,
const struct roff_node *);
static void print_mdoc_node(DECL_ARGS);
static void print_mdoc_nodelist(DECL_ARGS);
-static void print_mdoc_head(struct termp *, const void *);
-static void print_mdoc_foot(struct termp *, const void *);
+static void print_mdoc_head(struct termp *, const struct roff_meta *);
+static void print_mdoc_foot(struct termp *, const struct roff_meta *);
static void synopsis_pre(struct termp *,
const struct roff_node *);
@@ -253,7 +253,7 @@ static const struct termact termacts[MDOC_MAX] = {
void
terminal_mdoc(void *arg, const struct mdoc *mdoc)
{
- const struct mdoc_meta *meta;
+ const struct roff_meta *meta;
struct roff_node *n;
struct termp *p;
@@ -407,13 +407,10 @@ print_mdoc_node(DECL_ARGS)
}
static void
-print_mdoc_foot(struct termp *p, const void *arg)
+print_mdoc_foot(struct termp *p, const struct roff_meta *meta)
{
- const struct mdoc_meta *meta;
size_t sz;
- meta = (const struct mdoc_meta *)arg;
-
term_fontrepl(p, TERMFONT_NONE);
/*
@@ -459,14 +456,11 @@ print_mdoc_foot(struct termp *p, const void *arg)
}
static void
-print_mdoc_head(struct termp *p, const void *arg)
+print_mdoc_head(struct termp *p, const struct roff_meta *meta)
{
- const struct mdoc_meta *meta;
char *volume, *title;
size_t vollen, titlen;
- meta = (const struct mdoc_meta *)arg;
-
/*
* The header is strange. It has three components, which are
* really two with the first duplicated. It goes like this:
diff --git a/roff.h b/roff.h
index 232100c8..42bc5615 100644
--- a/roff.h
+++ b/roff.h
@@ -104,3 +104,14 @@ struct roff_node {
enum roff_sec sec; /* Current named section. */
enum mdoc_endbody end; /* BODY */
};
+
+struct roff_meta {
+ char *msec; /* Manual section, usually a digit. */
+ char *vol; /* Manual volume title. */
+ char *os; /* Operating system. */
+ char *arch; /* Machine architecture. */
+ char *title; /* Manual title, usually CAPS. */
+ char *name; /* Leading manual name. */
+ char *date; /* Normalized date. */
+ int hasbody; /* Document is not empty. */
+};
diff --git a/term.c b/term.c
index 5480be34..b1360388 100644
--- a/term.c
+++ b/term.c
@@ -7,9 +7,9 @@
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
@@ -49,7 +49,7 @@ term_free(struct termp *p)
void
term_begin(struct termp *p, term_margin head,
- term_margin foot, const void *arg)
+ term_margin foot, const struct roff_meta *arg)
{
p->headf = head;
diff --git a/term.h b/term.h
index 351b2ee0..b6bd13bf 100644
--- a/term.h
+++ b/term.h
@@ -1,15 +1,15 @@
/* $Id$ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2015 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
* copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHORS DISCLAIM ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
@@ -38,9 +38,10 @@ enum termfont {
#define TERM_MAXMARGIN 100000 /* FIXME */
+struct roff_meta;
struct termp;
-typedef void (*term_margin)(struct termp *, const void *);
+typedef void (*term_margin)(struct termp *, const struct roff_meta *);
struct termp_tbl {
int width; /* width in fixed chars */
@@ -117,7 +118,7 @@ void term_vspace(struct termp *);
void term_word(struct termp *, const char *);
void term_flushln(struct termp *);
void term_begin(struct termp *, term_margin,
- term_margin, const void *);
+ term_margin, const struct roff_meta *);
void term_end(struct termp *);
void term_setwidth(struct termp *, const char *);