diff options
-rw-r--r-- | libman.h | 3 | ||||
-rw-r--r-- | man.c | 19 | ||||
-rw-r--r-- | man.h | 4 | ||||
-rw-r--r-- | tree.c | 7 |
4 files changed, 29 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: libman.h,v 1.48 2011/03/22 14:33:05 kristaps Exp $ */ +/* $Id: libman.h,v 1.49 2011/03/23 12:33:01 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -67,6 +67,7 @@ __BEGIN_DECLS int man_word_alloc(struct man *, int, int, const char *); int man_block_alloc(struct man *, int, int, enum mant); int man_head_alloc(struct man *, int, int, enum mant); +int man_tail_alloc(struct man *, int, int, enum mant); int man_body_alloc(struct man *, int, int, enum mant); int man_elem_alloc(struct man *, int, int, enum mant); void man_node_delete(struct man *, struct man_node *); @@ -1,4 +1,4 @@ -/* $Id: man.c,v 1.105 2011/03/22 14:33:05 kristaps Exp $ */ +/* $Id: man.c,v 1.106 2011/03/23 12:33:01 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -203,6 +203,10 @@ man_node_append(struct man *man, struct man_node *p) assert(MAN_BLOCK == p->parent->type); p->parent->head = p; break; + case (MAN_TAIL): + assert(MAN_BLOCK == p->parent->type); + p->parent->tail = p; + break; case (MAN_BODY): assert(MAN_BLOCK == p->parent->type); p->parent->body = p; @@ -261,6 +265,19 @@ man_elem_alloc(struct man *m, int line, int pos, enum mant tok) int +man_tail_alloc(struct man *m, int line, int pos, enum mant tok) +{ + struct man_node *p; + + p = man_node_alloc(m, line, pos, MAN_TAIL, tok); + if ( ! man_node_append(m, p)) + return(0); + m->next = MAN_NEXT_CHILD; + return(1); +} + + +int man_head_alloc(struct man *m, int line, int pos, enum mant tok) { struct man_node *p; @@ -1,4 +1,4 @@ -/* $Id: man.h,v 1.57 2011/03/22 13:28:22 kristaps Exp $ */ +/* $Id: man.h,v 1.58 2011/03/23 12:33:01 kristaps Exp $ */ /* * Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -61,6 +61,7 @@ enum man_type { MAN_BLOCK, MAN_HEAD, MAN_BODY, + MAN_TAIL, MAN_TBL, MAN_EQN }; @@ -89,6 +90,7 @@ struct man_node { enum man_type type; /* AST node type */ char *string; /* TEXT node argument */ struct man_node *head; /* BLOCK node HEAD ptr */ + struct man_node *tail; /* BLOCK node TAIL ptr */ struct man_node *body; /* BLOCK node BODY ptr */ const struct tbl_span *span; /* TBL */ const struct eqn *eqn; /* EQN */ @@ -1,4 +1,4 @@ -/* $Id: tree.c,v 1.36 2011/02/09 09:18:15 kristaps Exp $ */ +/* $Id: tree.c,v 1.37 2011/03/23 12:33:01 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -201,6 +201,9 @@ print_man(const struct man_node *n, int indent) case (MAN_BODY): t = "block-body"; break; + case (MAN_TAIL): + t = "block-tail"; + break; case (MAN_TBL): t = "tbl"; break; @@ -224,6 +227,8 @@ print_man(const struct man_node *n, int indent) /* FALLTHROUGH */ case (MAN_HEAD): /* FALLTHROUGH */ + case (MAN_TAIL): + /* FALLTHROUGH */ case (MAN_BODY): p = man_macronames[n->tok]; break; |