summaryrefslogtreecommitdiffstatshomepage
path: root/man_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-03-24 20:10:53 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-03-24 20:10:53 +0000
commitbdcaee420fe7a05a2069049d14aa31dce93be009 (patch)
tree497c84386ad0639f035b07c56b0fcd0e16c719fb /man_action.c
parent0cbe61642c46c73e81d998bc81f574b30674e3cb (diff)
downloadmandoc-bdcaee420fe7a05a2069049d14aa31dce93be009.tar.gz
mandoc-bdcaee420fe7a05a2069049d14aa31dce93be009.tar.zst
mandoc-bdcaee420fe7a05a2069049d14aa31dce93be009.zip
Using man_node_delete() instead of man_node_free()/man_node_freelist() and friends (much simpler).
Split blk_imp() into blk_exp() (explicit macros), blk_dotted() (roff macros), and the original. Added de, dei, am, ami, and ig roff macros (for now, these are discarded within the parse).
Diffstat (limited to 'man_action.c')
-rw-r--r--man_action.c32
1 files changed, 28 insertions, 4 deletions
diff --git a/man_action.c b/man_action.c
index c4a8cd4c..53f79b3b 100644
--- a/man_action.c
+++ b/man_action.c
@@ -1,4 +1,4 @@
-/* $Id: man_action.c,v 1.28 2010/03/24 03:46:02 kristaps Exp $ */
+/* $Id: man_action.c,v 1.29 2010/03/24 20:10:53 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -30,6 +30,7 @@ struct actions {
};
static int post_TH(struct man *);
+static int post_de(struct man *);
static int post_fi(struct man *);
static int post_nf(struct man *);
@@ -69,6 +70,12 @@ const struct actions man_actions[MAN_MAX] = {
{ NULL }, /* Sp */
{ post_nf }, /* Vb */
{ post_fi }, /* Ve */
+ { post_de }, /* de */
+ { post_de }, /* dei */
+ { post_de }, /* am */
+ { post_de }, /* ami */
+ { post_de }, /* ig */
+ { NULL }, /* . */
};
@@ -108,6 +115,21 @@ post_fi(struct man *m)
static int
+post_de(struct man *m)
+{
+
+ /*
+ * XXX: for the time being, we indiscriminately remove roff
+ * instructions from the parse stream.
+ */
+ if (MAN_BLOCK == m->last->type)
+ man_node_delete(m, m->last);
+
+ return(1);
+}
+
+
+static int
post_nf(struct man *m)
{
@@ -179,8 +201,10 @@ post_TH(struct man *m)
if (n && (n = n->next))
m->meta.vol = mandoc_strdup(n->string);
- n = m->last;
- man_node_unlink(m, n);
- man_node_freelist(n);
+ /*
+ * Remove the `TH' node after we've processed it for our
+ * meta-data.
+ */
+ man_node_delete(m, m->last);
return(1);
}