summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chars.c31
-rw-r--r--html.c25
-rw-r--r--mandoc.324
-rw-r--r--mandoc.c4
-rw-r--r--mandoc.h3
-rw-r--r--term.c22
6 files changed, 0 insertions, 109 deletions
diff --git a/chars.c b/chars.c
index 66bfc5ec..862517e8 100644
--- a/chars.c
+++ b/chars.c
@@ -113,21 +113,6 @@ mchars_spec2cp(struct mchars *arg, const char *p, size_t sz)
return(ln->unicode);
}
-
-/*
- * Reserved word to Unicode codepoint.
- */
-int
-mchars_res2cp(struct mchars *arg, const char *p, size_t sz)
-{
- const struct ln *ln;
-
- ln = find(arg, p, sz);
- if (NULL == ln)
- return(-1);
- return(ln->unicode);
-}
-
/*
* Numbered character string to ASCII codepoint.
* This can only be a printable character (i.e., alnum, punct, space) so
@@ -176,22 +161,6 @@ mchars_spec2str(struct mchars *arg, const char *p, size_t sz, size_t *rsz)
return(ln->ascii);
}
-/*
- * Reserved word to string array.
- */
-const char *
-mchars_res2str(struct mchars *arg, const char *p, size_t sz, size_t *rsz)
-{
- const struct ln *ln;
-
- ln = find(arg, p, sz);
- if (NULL == ln)
- return(NULL);
-
- *rsz = strlen(ln->ascii);
- return(ln->ascii);
-}
-
static const struct ln *
find(struct mchars *tab, const char *p, size_t sz)
{
diff --git a/html.c b/html.c
index 9a8ec3e3..e74da382 100644
--- a/html.c
+++ b/html.c
@@ -109,7 +109,6 @@ static const char *const roffscales[SCALE_MAX] = {
static void bufncat(struct html *, const char *, size_t);
static void print_spec(struct html *, const char *, size_t);
-static void print_res(struct html *, const char *, size_t);
static void print_ctag(struct html *, enum htmltag);
static int print_encode(struct html *, const char *, int);
static void print_metaf(struct html *, enum mandoc_esc);
@@ -238,25 +237,6 @@ print_spec(struct html *h, const char *p, size_t len)
fwrite(rhs, 1, sz, stdout);
}
-
-static void
-print_res(struct html *h, const char *p, size_t len)
-{
- int cp;
- const char *rhs;
- size_t sz;
-
- if ((cp = mchars_res2cp(h->symtab, p, len)) > 0) {
- printf("&#%d;", cp);
- return;
- } else if (-1 == cp)
- return;
-
- if (NULL != (rhs = mchars_res2str(h->symtab, p, len, &sz)))
- fwrite(rhs, 1, sz, stdout);
-}
-
-
static void
print_metaf(struct html *h, enum mandoc_esc deco)
{
@@ -321,8 +301,6 @@ html_strlen(const char *cp)
/* FALLTHROUGH */
case (ESCAPE_NUMBERED):
/* FALLTHROUGH */
- case (ESCAPE_PREDEF):
- /* FALLTHROUGH */
case (ESCAPE_SPECIAL):
sz++;
break;
@@ -388,9 +366,6 @@ print_encode(struct html *h, const char *p, int norecurse)
if ('\0' != c)
putchar(c);
break;
- case (ESCAPE_PREDEF):
- print_res(h, seq, len);
- break;
case (ESCAPE_SPECIAL):
print_spec(h, seq, len);
break;
diff --git a/mandoc.3 b/mandoc.3
index 457e5635..b2e86d9c 100644
--- a/mandoc.3
+++ b/mandoc.3
@@ -27,8 +27,6 @@
.Nm mchars_free ,
.Nm mchars_num2char ,
.Nm mchars_num2uc ,
-.Nm mchars_res2cp ,
-.Nm mchars_res2str ,
.Nm mchars_spec2cp ,
.Nm mchars_spec2str ,
.Nm mdoc_meta ,
@@ -70,20 +68,6 @@
.Ft int
.Fn mchars_num2uc "const char *cp" "size_t sz"
.Ft "const char *"
-.Fo mchars_res2str
-.Fa "struct mchars *p"
-.Fa "const char *cp"
-.Fa "size_t sz"
-.Fa "size_t *rsz"
-.Fc
-.Ft int
-.Fo mchars_res2cp
-.Fa "struct mchars *p"
-.Fa "const char *cp"
-.Fa "size_t sz"
-.Ft "const char *"
-.Fc
-.Ft "const char *"
.Fo mchars_spec2str
.Fa "struct mchars *p"
.Fa "const char *cp"
@@ -262,14 +246,6 @@ Returns \e0 (the nil character) if the input sequence is malformed.
Convert a hexadecimal character index (e.g., the \e[uNNNN] escape) into
a Unicode codepoint.
Returns \e0 (the nil character) if the input sequence is malformed.
-.It Fn mchars_res2cp
-Convert a predefined character into a valid Unicode codepoint.
-Returns \-1 on failure and 0 if no code-point exists (if this occurs,
-the caller should fall back to
-.Fn mchars_res2str ) .
-.It Fn mchars_res2str
-Convert a predefined character into an ASCII string.
-Returns NULL on failure.
.It Fn mchars_spec2cp
Convert a special character into a valid Unicode codepoint.
Returns \-1 on failure and 0 if no code-point exists (if this occurs,
diff --git a/mandoc.c b/mandoc.c
index 9991978d..554c3048 100644
--- a/mandoc.c
+++ b/mandoc.c
@@ -164,10 +164,6 @@ mandoc_escape(const char **end, const char **start, int *sz)
if (ESCAPE_ERROR == gly)
gly = ESCAPE_IGNORE;
/* FALLTHROUGH */
- case ('*'):
- if (ESCAPE_ERROR == gly)
- gly = ESCAPE_PREDEF;
- /* FALLTHROUGH */
case ('f'):
if (ESCAPE_ERROR == gly)
gly = ESCAPE_FONT;
diff --git a/mandoc.h b/mandoc.h
index 8f9c2340..8b436a06 100644
--- a/mandoc.h
+++ b/mandoc.h
@@ -292,7 +292,6 @@ enum mandoc_esc {
ESCAPE_ERROR = 0, /* bail! unparsable escape */
ESCAPE_IGNORE, /* escape to be ignored */
ESCAPE_SPECIAL, /* a regular special character */
- ESCAPE_PREDEF, /* a predefined special character */
ESCAPE_FONT, /* a generic font mode */
ESCAPE_FONTBOLD, /* bold font mode */
ESCAPE_FONTITALIC, /* italic font mode */
@@ -333,8 +332,6 @@ char mchars_num2char(const char *, size_t);
int mchars_num2uc(const char *, size_t);
const char *mchars_spec2str(struct mchars *, const char *, size_t, size_t *);
int mchars_spec2cp(struct mchars *, const char *, size_t);
-const char *mchars_res2str(struct mchars *, const char *, size_t, size_t *);
-int mchars_res2cp(struct mchars *, const char *, size_t);
void mchars_free(struct mchars *);
diff --git a/term.c b/term.c
index 9302d41c..2ae9e7c1 100644
--- a/term.c
+++ b/term.c
@@ -447,12 +447,6 @@ term_word(struct termp *p, const char *word)
break;
encode1(p, uc);
continue;
- case (ESCAPE_PREDEF):
- uc = mchars_res2cp(p->symtab, seq, sz);
- if (uc <= 0)
- break;
- encode1(p, uc);
- continue;
case (ESCAPE_SPECIAL):
uc = mchars_spec2cp(p->symtab, seq, sz);
if (uc <= 0)
@@ -472,11 +466,6 @@ term_word(struct termp *p, const char *word)
if ('\0' != c)
encode(p, &c, 1);
break;
- case (ESCAPE_PREDEF):
- cp = mchars_res2str(p->symtab, seq, sz, &ssz);
- if (NULL != cp)
- encode(p, cp, ssz);
- break;
case (ESCAPE_SPECIAL):
cp = mchars_spec2str(p->symtab, seq, sz, &ssz);
if (NULL != cp)
@@ -648,13 +637,6 @@ term_strlen(const struct termp *p, const char *cp)
break;
sz += (*p->width)(p, c);
continue;
- case (ESCAPE_PREDEF):
- c = mchars_res2cp
- (p->symtab, seq, ssz);
- if (c <= 0)
- break;
- sz += (*p->width)(p, c);
- continue;
case (ESCAPE_SPECIAL):
c = mchars_spec2cp
(p->symtab, seq, ssz);
@@ -677,10 +659,6 @@ term_strlen(const struct termp *p, const char *cp)
if ('\0' != c)
sz += (*p->width)(p, c);
break;
- case (ESCAPE_PREDEF):
- rhs = mchars_res2str
- (p->symtab, seq, ssz, &rsz);
- break;
case (ESCAPE_SPECIAL):
rhs = mchars_spec2str
(p->symtab, seq, ssz, &rsz);