summaryrefslogtreecommitdiffstats
path: root/mdoc_strings.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2010-05-15 08:54:04 +0000
committerIngo Schwarze <schwarze@openbsd.org>2010-05-15 08:54:04 +0000
commit5fadafddea49706c5055def118c8904d73035bcc (patch)
treef057963290f09cf5a35666f3a40cdd59169db1ea /mdoc_strings.c
parent3064cfc6740a059eb0e9762939e5241b95eeba7e (diff)
downloadmandoc-5fadafddea49706c5055def118c8904d73035bcc.tar.gz
Distinguish OPEN, MIDDLE and CLOSE delimiters (using an enum).
Only OPEN are drawn before the beginning of a macro; this is new, before this, MIDDLE ('|') were drawn in front, too. Only CLOSE are pushed after the end of a macro (as before). ok kristaps@
Diffstat (limited to 'mdoc_strings.c')
-rw-r--r--mdoc_strings.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/mdoc_strings.c b/mdoc_strings.c
index a852394b..a5ebdc83 100644
--- a/mdoc_strings.c
+++ b/mdoc_strings.c
@@ -57,17 +57,17 @@ static const char * const secnames[SEC__MAX] = {
* FIXME: this is repeated in print_text() (html.c) and term_word()
* (term.c).
*/
-int
+enum mdelim
mdoc_iscdelim(char p)
{
switch (p) {
- case('|'):
- /* FALLTHROUGH */
case('('):
/* FALLTHROUGH */
case('['):
- return(1);
+ return(DELIM_OPEN);
+ case('|'):
+ return(DELIM_MIDDLE);
case('.'):
/* FALLTHROUGH */
case(','):
@@ -83,16 +83,16 @@ mdoc_iscdelim(char p)
case(')'):
/* FALLTHROUGH */
case(']'):
- return(2);
+ return(DELIM_CLOSE);
default:
break;
}
- return(0);
+ return(DELIM_NONE);
}
-int
+enum mdelim
mdoc_isdelim(const char *p)
{
@@ -106,7 +106,7 @@ mdoc_isdelim(const char *p)
* is treated in exactly the same way as the vertical bar. This
* is the only function that checks for this.
*/
- return(0 == strcmp(p, "\\*(Ba"));
+ return(strcmp(p, "\\*(Ba") ? DELIM_NONE : DELIM_MIDDLE);
}