aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/html.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-04-29 22:18:12 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-04-29 22:18:12 +0000
commit4d1bc0c8c120742600a57c849edf1b2481c45e26 (patch)
treea34e167ede1a560af694e85311e4283146871c92 /html.c
parent8686868cc9a1d5c5f474b8cdbd718b152b4d6188 (diff)
downloadmandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.tar.gz
mandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.tar.zst
mandoc-4d1bc0c8c120742600a57c849edf1b2481c45e26.zip
Move "chars" interface out of out.h and into mandoc.h. This doesn't
change any code but for renaming functions and types to be consistent with other mandoc.h stuff. The reason for moving into libmandoc is that the rendering of special characters is part of mandoc itself---not an external part. From mandoc(1)'s perspective, this changes nothing, but for other utilities, it's important to have these part of libmandoc. Note this isn't documented [yet] in mandoc.3 because there are some parts I'd like to change around beforehand.
Diffstat (limited to 'html.c')
-rw-r--r--html.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/html.c b/html.c
index 812a1847..b445efa1 100644
--- a/html.c
+++ b/html.c
@@ -1,4 +1,4 @@
-/* $Id: html.c,v 1.132 2011/04/09 15:29:40 kristaps Exp $ */
+/* $Id: html.c,v 1.133 2011/04/29 22:18:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -122,7 +122,7 @@ ml_alloc(char *outopts, enum htmltype type)
h->type = type;
h->tags.head = NULL;
- h->symtab = chars_init(CHARS_HTML);
+ h->symtab = mchars_init(MCHARS_HTML);
while (outopts && *outopts)
switch (getsubopt(&outopts, UNCONST(toks), &v)) {
@@ -172,7 +172,7 @@ html_free(void *p)
}
if (h->symtab)
- chars_free(h->symtab);
+ mchars_free(h->symtab);
free(h);
}
@@ -214,7 +214,7 @@ print_num(struct html *h, const char *p, size_t len)
{
const char *rhs;
- rhs = chars_num2char(p, len);
+ rhs = mchars_num2char(p, len);
if (rhs)
putchar((int)*rhs);
}
@@ -226,7 +226,7 @@ print_spec(struct html *h, const char *p, size_t len)
const char *rhs;
size_t sz;
- if ((cp = chars_spec2cp(h->symtab, p, len)) > 0) {
+ if ((cp = mchars_spec2cp(h->symtab, p, len)) > 0) {
printf("&#%d;", cp);
return;
} else if (-1 == cp && 1 == len) {
@@ -235,7 +235,7 @@ print_spec(struct html *h, const char *p, size_t len)
} else if (-1 == cp)
return;
- if (NULL != (rhs = chars_spec2str(h->symtab, p, len, &sz)))
+ if (NULL != (rhs = mchars_spec2str(h->symtab, p, len, &sz)))
fwrite(rhs, 1, sz, stdout);
}
@@ -247,13 +247,13 @@ print_res(struct html *h, const char *p, size_t len)
const char *rhs;
size_t sz;
- if ((cp = chars_res2cp(h->symtab, p, len)) > 0) {
+ if ((cp = mchars_res2cp(h->symtab, p, len)) > 0) {
printf("&#%d;", cp);
return;
} else if (-1 == cp)
return;
- if (NULL != (rhs = chars_res2str(h->symtab, p, len, &sz)))
+ if (NULL != (rhs = mchars_res2str(h->symtab, p, len, &sz)))
fwrite(rhs, 1, sz, stdout);
}