=================================================================== RCS file: /cvs/mandoc/Attic/mdoc_strings.c,v retrieving revision 1.19 retrieving revision 1.24 diff -u -p -r1.19 -r1.24 --- mandoc/Attic/mdoc_strings.c 2010/05/12 08:41:17 1.19 +++ mandoc/Attic/mdoc_strings.c 2010/07/31 23:52:58 1.24 @@ -1,6 +1,6 @@ -/* $Id: mdoc_strings.c,v 1.19 2010/05/12 08:41:17 kristaps Exp $ */ +/* $Id: mdoc_strings.c,v 1.24 2010/07/31 23:52:58 schwarze Exp $ */ /* - * Copyright (c) 2008 Kristaps Dzonsons + * Copyright (c) 2008, 2009, 2010 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -26,6 +26,7 @@ #include #include +#include "mandoc.h" #include "libmdoc.h" static const char * const secnames[SEC__MAX] = { @@ -57,17 +58,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,21 +84,21 @@ 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) { if ('\0' == p[0]) - return(0); + return(DELIM_NONE); if ('\0' == p[1]) return(mdoc_iscdelim(p[0])); @@ -106,7 +107,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); }