version 1.2, 2008/12/15 02:23:12 |
version 1.3, 2008/12/17 17:18:38 |
|
|
|
|
#include "private.h" |
#include "private.h" |
|
|
extern int macro_text(struct mdoc *, int, int, int *, char *); |
|
extern int macro_scoped_implicit(struct mdoc *, |
|
int, int, int *, char *); |
|
|
|
const char *const __mdoc_macronames[MDOC_MAX] = { |
const char *const __mdoc_macronames[MDOC_MAX] = { |
"\\\"", "Dd", "Dt", "Os", |
"\\\"", "Dd", "Dt", "Os", |
"Sh", "Ss", "Pp", "D1", |
"Sh", "Ss", "Pp", "D1", |
Line 88 const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
|
Line 84 const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
|
|
|
const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
{ NULL, 0 }, /* \" */ |
{ NULL, 0 }, /* \" */ |
{ NULL, 0 }, /* Dd */ |
{ macro_prologue_ddate, 0 }, /* Dd */ |
{ NULL, 0 }, /* Dt */ |
{ macro_prologue_dtitle, 0 }, /* Dt */ |
{ NULL, 0 }, /* Os */ |
{ NULL, 0 }, /* Os */ |
{ macro_scoped_implicit, 0 }, /* Sh */ |
{ macro_scoped_implicit, 0 }, /* Sh */ |
{ macro_scoped_implicit, 0 }, /* Ss */ |
{ macro_scoped_implicit, 0 }, /* Ss */ |
Line 310 mdoc_parseln(struct mdoc *mdoc, char *buf) |
|
Line 306 mdoc_parseln(struct mdoc *mdoc, char *buf) |
|
while (buf[i] && isspace(buf[i])) |
while (buf[i] && isspace(buf[i])) |
i++; |
i++; |
|
|
if (NULL == (mdoc_macros[c].fp)) { |
return(mdoc_macro(mdoc, c, 1, &i, buf)); |
(void)mdoc_err(mdoc, c, 1, ERR_MACRO_NOTSUP); |
|
return(0); |
|
} |
|
|
|
return((*mdoc_macros[c].fp)(mdoc, c, 1, &i, buf)); |
|
} |
} |
|
|
|
|
Line 363 mdoc_macro(struct mdoc *mdoc, int tok, int ppos, int * |
|
Line 354 mdoc_macro(struct mdoc *mdoc, int tok, int ppos, int * |
|
if (NULL == (mdoc_macros[tok].fp)) { |
if (NULL == (mdoc_macros[tok].fp)) { |
(void)mdoc_err(mdoc, tok, ppos, ERR_MACRO_NOTSUP); |
(void)mdoc_err(mdoc, tok, ppos, ERR_MACRO_NOTSUP); |
return(0); |
return(0); |
} else if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) { |
} |
|
|
|
if (1 != ppos && ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) { |
(void)mdoc_err(mdoc, tok, ppos, ERR_MACRO_NOTCALL); |
(void)mdoc_err(mdoc, tok, ppos, ERR_MACRO_NOTCALL); |
return(0); |
return(0); |
} |
} |