-#define SECNAME_MAX (18)
-
-static const struct mdoc_secname secnames[SECNAME_MAX] = {
- { "NAME", SEC_NAME },
- { "LIBRARY", SEC_LIBRARY },
- { "SYNOPSIS", SEC_SYNOPSIS },
- { "DESCRIPTION", SEC_DESCRIPTION },
- { "IMPLEMENTATION NOTES", SEC_IMPLEMENTATION },
- { "RETURN VALUES", SEC_RETURN_VALUES },
- { "ENVIRONMENT", SEC_ENVIRONMENT },
- { "FILES", SEC_FILES },
- { "EXAMPLES", SEC_EXAMPLES },
- { "DIAGNOSTICS", SEC_DIAGNOSTICS },
- { "COMPATIBILITY", SEC_COMPATIBILITY },
- { "ERRORS", SEC_ERRORS },
- { "SEE ALSO", SEC_SEE_ALSO },
- { "STANDARDS", SEC_STANDARDS },
- { "HISTORY", SEC_HISTORY },
- { "AUTHORS", SEC_AUTHORS },
- { "CAVEATS", SEC_CAVEATS },
- { "BUGS", SEC_BUGS },
-};
-
-#ifdef __linux__
-extern char *strptime(const char *, const char *, struct tm *);
-#endif
-
-
-size_t
-mdoc_isescape(const char *p)
-{
- size_t c;
-
- if ('\\' != *p++)
- return(0);
-
- switch (*p) {
- case ('\\'):
- /* FALLTHROUGH */
- case ('\''):
- /* FALLTHROUGH */
- case ('`'):
- /* FALLTHROUGH */
- case ('q'):
- /* FALLTHROUGH */
- case ('-'):
- /* FALLTHROUGH */
- case ('~'):
- /* FALLTHROUGH */
- case ('^'):
- /* FALLTHROUGH */
- case ('%'):
- /* FALLTHROUGH */
- case ('0'):
- /* FALLTHROUGH */
- case (' '):
- /* FALLTHROUGH */
- case ('|'):
- /* FALLTHROUGH */
- case ('&'):
- /* FALLTHROUGH */
- case ('.'):
- /* FALLTHROUGH */
- case (':'):
- /* FALLTHROUGH */
- case ('e'):
- return(2);
- case ('*'):
- if (0 == *++p || ! isgraph((u_char)*p))
- return(0);
- switch (*p) {
- case ('('):
- if (0 == *++p || ! isgraph((u_char)*p))
- return(0);
- return(4);
- case ('['):
- for (c = 3, p++; *p && ']' != *p; p++, c++)
- if ( ! isgraph((u_char)*p))
- break;
- return(*p == ']' ? c : 0);
- default:
- break;
- }
- return(3);
- case ('('):
- if (0 == *++p || ! isgraph((u_char)*p))
- return(0);
- if (0 == *++p || ! isgraph((u_char)*p))
- return(0);
- return(4);
- case ('['):
- break;
- default:
- return(0);
- }
-
- for (c = 3, p++; *p && ']' != *p; p++, c++)
- if ( ! isgraph((u_char)*p))
- break;
-
- return(*p == ']' ? c : 0);
-}
-
-
-int