aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/out.h
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-09 15:29:40 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-09 15:29:40 +0000
commitdc6820cf87c36506f7d235493e75c1520231e9d9 (patch)
treee5c60975fd48bf07a47693f981a0ff9991db03b9 /out.h
parent0383763dbd62d52405be4dc65ae9aaff035c8f79 (diff)
downloadmandoc-dc6820cf87c36506f7d235493e75c1520231e9d9.tar.gz
mandoc-dc6820cf87c36506f7d235493e75c1520231e9d9.tar.zst
mandoc-dc6820cf87c36506f7d235493e75c1520231e9d9.zip
Remove a2roffdeco() and mandoc_special() functions and replace them with
a public (mandoc.h) function mandoc_escape(), which merges the functionality of both prior functions. Reason: code duplication. The a2roffdeco() and mandoc_special() functions were pretty much the same thing and both quite complex. This allows one function to receive improvements in (e.g.) subexpression handling and performance, instead of having to replicate functionality. As such, the mandoc_escape() function already handles a superset of the escapes handled in previous versions and has improvements in performance (using strcspn(), for example) and reliable handling of subexpressions. This code Works For Me, but may need work to catch any regressions. Since the benefits are great (leaner code, simpler API), I'd rather have it in-tree than floating as a patch.
Diffstat (limited to 'out.h')
-rw-r--r--out.h19
1 files changed, 1 insertions, 18 deletions
diff --git a/out.h b/out.h
index 9bf5357b..7b33b8fc 100644
--- a/out.h
+++ b/out.h
@@ -1,4 +1,4 @@
-/* $Id: out.h,v 1.18 2011/03/22 10:13:01 kristaps Exp $ */
+/* $Id: out.h,v 1.19 2011/04/09 15:29:40 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -31,22 +31,6 @@ enum roffscale {
SCALE_MAX
};
-enum roffdeco {
- DECO_NONE,
- DECO_NUMBERED, /* numbered character */
- DECO_SPECIAL, /* special character */
- DECO_SSPECIAL, /* single-char special */
- DECO_RESERVED, /* reserved word */
- DECO_BOLD, /* bold font */
- DECO_ITALIC, /* italic font */
- DECO_ROMAN, /* "normal" undecorated font */
- DECO_PREVIOUS, /* revert to previous font */
- DECO_NOSPACE, /* suppress spacing */
- DECO_FONT, /* font */
- DECO_FFONT, /* font family */
- DECO_MAX
-};
-
enum chars {
CHARS_ASCII, /* 7-bit ascii representation */
CHARS_HTML /* unicode values */
@@ -85,7 +69,6 @@ __BEGIN_DECLS
while (/* CONSTCOND */ 0)
int a2roffsu(const char *, struct roffsu *, enum roffscale);
-int a2roffdeco(enum roffdeco *, const char **, size_t *);
void time2a(time_t, char *, size_t);
void tblcalc(struct rofftbl *tbl, const struct tbl_span *);