summaryrefslogtreecommitdiffstatshomepage
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-03-06 14:13:47 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-03-06 14:13:47 +0000
commit236dae9fb3183b9c1d8bc6f77614797d65800987 (patch)
tree21d3944488650e4b2b02aa011f1ec70b538620f5 /term.c
parent898c9b0f76e9e166aa032a9d01aac9500a114b31 (diff)
downloadmandoc-236dae9fb3183b9c1d8bc6f77614797d65800987.tar.gz
mandoc-236dae9fb3183b9c1d8bc6f77614797d65800987.tar.zst
mandoc-236dae9fb3183b9c1d8bc6f77614797d65800987.zip
Strings abstracted into dynamically-created C files.
Added -V option. Deprecated README files.
Diffstat (limited to 'term.c')
-rw-r--r--term.c38
1 files changed, 26 insertions, 12 deletions
diff --git a/term.c b/term.c
index bc44fc61..a4c75df6 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.42 2009/03/05 13:12:12 kristaps Exp $ */
+/* $Id: term.c,v 1.43 2009/03/06 14:13:47 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -166,6 +166,7 @@ DECL_PRE(termp_xr);
DECL_POST(termp___);
DECL_POST(termp_bl);
DECL_POST(termp_bx);
+DECL_POST(termp_lb);
const struct termact __termacts[MDOC_MAX] = {
{ NULL, NULL }, /* \" */
@@ -274,6 +275,7 @@ const struct termact __termacts[MDOC_MAX] = {
{ NULL, NULL }, /* Hf */
{ NULL, NULL }, /* Fr */
{ termp_ud_pre, NULL }, /* Ud */
+ { NULL, termp_lb_post }, /* lb */
};
const struct termact *termacts = __termacts;
@@ -721,14 +723,13 @@ termp_pp_pre(DECL_ARGS)
static int
termp_st_pre(DECL_ARGS)
{
- const char *tp;
+ const char *cp;
- assert(1 == node->data.elem.argc);
-
- tp = mdoc_st2a(node->data.elem.argv[0].arg);
- word(p, tp);
-
- return(1);
+ /* XXX - if child isn't text? */
+ if (node->child)
+ if ((cp = mdoc_a2st(node->child->data.text.string)))
+ word(p, cp);
+ return(0);
}
@@ -968,6 +969,15 @@ termp_bt_pre(DECL_ARGS)
/* ARGSUSED */
+static void
+termp_lb_post(DECL_ARGS)
+{
+
+ newln(p);
+}
+
+
+/* ARGSUSED */
static int
termp_ud_pre(DECL_ARGS)
{
@@ -1480,15 +1490,19 @@ termp_in_post(DECL_ARGS)
static int
termp_at_pre(DECL_ARGS)
{
- enum mdoc_att c;
+ const char *att;
+
+ att = NULL;
- c = ATT_DEFAULT;
if (node->child) {
assert(MDOC_TEXT == node->child->type);
- c = mdoc_atoatt(node->child->data.text.string);
+ att = mdoc_a2att(node->child->data.text.string);
}
- word(p, mdoc_att2a(c));
+ if (NULL == att)
+ att = "AT&T UNIX";
+
+ word(p, att);
return(0);
}