- int c, i;
- char tmp[5];
-
- if (MDOC_HALT & mdoc->flags)
- return(0);
-
- mdoc->linetok = 0;
-
- if ('.' != *buf) {
- /*
- * Free-form text. Not allowed in the prologue.
- */
- if (SEC_PROLOGUE == mdoc->lastnamed)
- return(mdoc_perr(mdoc, line, 0,
- "no text in prologue"));
-
- if ( ! mdoc_word_alloc(mdoc, line, 0, buf))
- return(0);
- mdoc->next = MDOC_NEXT_SIBLING;
- return(1);
- }
-
- /*
- * Control-character detected. Begin the parsing sequence.
- */
-
- if (buf[1] && '\\' == buf[1])
- if (buf[2] && '\"' == buf[2])
- return(1);
-
- i = 1;
- while (buf[i] && ! isspace((u_char)buf[i]) &&
- i < (int)sizeof(tmp))
- i++;
-
- if (i == (int)sizeof(tmp)) {
- mdoc->flags |= MDOC_HALT;
- return(mdoc_perr(mdoc, line, 1, "unknown macro"));
- } else if (i <= 2) {
- mdoc->flags |= MDOC_HALT;
- return(mdoc_perr(mdoc, line, 1, "unknown macro"));
- }