-/* $Id: man.c,v 1.99 2011/02/06 22:05:20 kristaps Exp $ */
+/* $Id: man.c,v 1.100 2011/02/08 07:40:23 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
enum man_type, enum mant);
static int man_node_append(struct man *,
struct man_node *);
-static int man_span_alloc(struct man *,
- const struct tbl_span *);
static void man_node_free(struct man_node *);
static void man_node_unlink(struct man *,
struct man_node *);
return(1);
}
-static int
-man_span_alloc(struct man *m, const struct tbl_span *span)
-{
- struct man_node *n;
-
- n = man_node_alloc(m, span->line, 0, MAN_TBL, MAN_MAX);
- n->span = span;
-
- if ( ! man_node_append(m, n))
- return(0);
-
- m->next = MAN_NEXT_SIBLING;
- return(1);
-}
-
int
man_word_alloc(struct man *m, int line, int pos, const char *word)
{
int
man_addspan(struct man *m, const struct tbl_span *sp)
{
+ struct man_node *n;
assert( ! (MAN_HALT & m->flags));
- if ( ! man_span_alloc(m, sp))
+
+ n = man_node_alloc(m, sp->line, 0, MAN_TBL, MAN_MAX);
+ n->span = sp;
+
+ if ( ! man_node_append(m, n))
return(0);
+
+ m->next = MAN_NEXT_SIBLING;
return(man_descope(m, sp->line, 0));
}
-/* $Id: mdoc.c,v 1.179 2011/02/06 22:05:20 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.180 2011/02/08 07:40:23 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
struct mdoc_node *);
static int mdoc_ptext(struct mdoc *, int, char *, int);
static int mdoc_pmacro(struct mdoc *, int, char *, int);
-static int mdoc_span_alloc(struct mdoc *,
- const struct tbl_span *);
-
const struct mdoc_node *
mdoc_node(const struct mdoc *m)
int
mdoc_addspan(struct mdoc *m, const struct tbl_span *sp)
{
+ struct mdoc_node *n;
assert( ! (MDOC_HALT & m->flags));
return(1);
}
- return(mdoc_span_alloc(m, sp));
+ n = node_alloc(m, sp->line, 0, MDOC_MAX, MDOC_TBL);
+ n->span = sp;
+
+ if ( ! node_append(m, n))
+ return(0);
+
+ m->next = MDOC_NEXT_SIBLING;
+ return(1);
}
return(1);
}
-static int
-mdoc_span_alloc(struct mdoc *m, const struct tbl_span *sp)
-{
- struct mdoc_node *n;
-
- n = node_alloc(m, sp->line, 0, MDOC_MAX, MDOC_TBL);
- n->span = sp;
-
- if ( ! node_append(m, n))
- return(0);
-
- m->next = MDOC_NEXT_SIBLING;
- return(1);
-}
-
-
int
mdoc_word_alloc(struct mdoc *m, int line, int pos, const char *p)
{