-const char *const __man_macronames[MAN_MAX] = {
- "br", "TH", "SH", "SS",
- "TP", "LP", "PP", "P",
- "IP", "HP", "SM", "SB",
- "BI", "IB", "BR", "RB",
- "R", "B", "I", "IR",
- "RI", "na", "i", "sp",
- "nf", "fi", "r", "RE",
- "RS", "DT", "UC", "PD",
- "Sp", "Vb", "Ve", "AT",
- "in"
- };
-
-const char * const *man_macronames = __man_macronames;
-
-static struct man_node *man_node_alloc(int, int,
- enum man_type, enum mant);
-static int man_node_append(struct man *,
- struct man_node *);
-static void man_node_free(struct man_node *);
-static void man_node_unlink(struct man *,
- struct man_node *);
-static int man_ptext(struct man *, int, char *, int);
-static int man_pmacro(struct man *, int, char *, int);
-static void man_free1(struct man *);
-static void man_alloc1(struct man *);
-static int macrowarn(struct man *, int, const char *, int);
-
-
-const struct man_node *
-man_node(const struct man *m)
-{
-
- return(MAN_HALT & m->flags ? NULL : m->first);
-}
-
-
-const struct man_meta *
-man_meta(const struct man *m)
-{
-
- return(MAN_HALT & m->flags ? NULL : &m->meta);
-}
-
-
-void
-man_reset(struct man *man)
-{
-
- man_free1(man);
- man_alloc1(man);
-}
-
-
-void
-man_free(struct man *man)
-{
-
- man_free1(man);
- free(man);
-}
-
-
-struct man *
-man_alloc(struct regset *regs, void *data,
- int pflags, mandocmsg msg)
-{
- struct man *p;
-
- p = mandoc_calloc(1, sizeof(struct man));
-
- man_hash_init();
- p->data = data;
- p->pflags = pflags;
- p->msg = msg;
- p->regs = regs;
-
- man_alloc1(p);
- return(p);
-}
-
-
-int
-man_endparse(struct man *m)
-{
-
- if (MAN_HALT & m->flags)
- return(0);
- else if (man_macroend(m))
- return(1);
- m->flags |= MAN_HALT;
- return(0);
-}