summaryrefslogtreecommitdiffstats
path: root/mdocterm.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-02-23 09:33:34 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-02-23 09:33:34 +0000
commite6d5d6c4fa9992652ddd38c1f1a1bd0c10a275a2 (patch)
treed8b9fd946d7e6a443abba618088edc43f5936b3e /mdocterm.c
parent63967ed8bf5ca40c3477ce83deda9051e813afd4 (diff)
downloadmandoc-e6d5d6c4fa9992652ddd38c1f1a1bd0c10a275a2.tar.gz
Considerable mdoc.3 documentation.
Added a few more escapes and macros.
Diffstat (limited to 'mdocterm.c')
-rw-r--r--mdocterm.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/mdocterm.c b/mdocterm.c
index 7e1370ed..bffdd1f8 100644
--- a/mdocterm.c
+++ b/mdocterm.c
@@ -45,6 +45,7 @@ static void pword(struct termp *, const char *, size_t);
static void pescape(struct termp *,
const char *, size_t *, size_t);
static void chara(struct termp *, char);
+static void stringa(struct termp *, const char *);
static void style(struct termp *, enum termstyle);
#ifdef __linux__
@@ -231,6 +232,16 @@ vspace(struct termp *p)
static void
+stringa(struct termp *p, const char *s)
+{
+
+ /* XXX - speed up if not passing to chara. */
+ for ( ; *s; s++)
+ chara(p, *s);
+}
+
+
+static void
chara(struct termp *p, char c)
{
@@ -284,6 +295,10 @@ pescape(struct termp *p, const char *word, size_t *i, size_t len)
chara(p, ']');
else if ('l' == word[*i] && 'B' == word[*i + 1])
chara(p, '[');
+ else if ('<' == word[*i] && '-' == word[*i + 1])
+ stringa(p, "<-");
+ else if ('-' == word[*i] && '>' == word[*i + 1])
+ stringa(p, "->");
(*i)++;
return;