version 1.261, 2017/03/03 13:55:31 |
version 1.262, 2017/04/24 23:06:18 |
|
|
#include "roff_int.h" |
#include "roff_int.h" |
#include "libmdoc.h" |
#include "libmdoc.h" |
|
|
const char *const __mdoc_macronames[MDOC_MAX + 1] = { |
|
"text", |
|
"Ap", "Dd", "Dt", "Os", |
|
"Sh", "Ss", "Pp", "D1", |
|
"Dl", "Bd", "Ed", "Bl", |
|
"El", "It", "Ad", "An", |
|
"Ar", "Cd", "Cm", "Dv", |
|
"Er", "Ev", "Ex", "Fa", |
|
"Fd", "Fl", "Fn", "Ft", |
|
"Ic", "In", "Li", "Nd", |
|
"Nm", "Op", "Ot", "Pa", |
|
"Rv", "St", "Va", "Vt", |
|
"Xr", "%A", "%B", "%D", |
|
"%I", "%J", "%N", "%O", |
|
"%P", "%R", "%T", "%V", |
|
"Ac", "Ao", "Aq", "At", |
|
"Bc", "Bf", "Bo", "Bq", |
|
"Bsx", "Bx", "Db", "Dc", |
|
"Do", "Dq", "Ec", "Ef", |
|
"Em", "Eo", "Fx", "Ms", |
|
"No", "Ns", "Nx", "Ox", |
|
"Pc", "Pf", "Po", "Pq", |
|
"Qc", "Ql", "Qo", "Qq", |
|
"Re", "Rs", "Sc", "So", |
|
"Sq", "Sm", "Sx", "Sy", |
|
"Tn", "Ux", "Xc", "Xo", |
|
"Fo", "Fc", "Oo", "Oc", |
|
"Bk", "Ek", "Bt", "Hf", |
|
"Fr", "Ud", "Lb", "Lp", |
|
"Lk", "Mt", "Brq", "Bro", |
|
"Brc", "%C", "Es", "En", |
|
"Dx", "%Q", "br", "sp", |
|
"%U", "Ta", "ll", |
|
}; |
|
|
|
const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
"split", "nosplit", "ragged", |
"split", "nosplit", "ragged", |
"unfilled", "literal", "file", |
"unfilled", "literal", "file", |
Line 80 const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
|
Line 45 const char *const __mdoc_argnames[MDOC_ARG_MAX] = { |
|
"width", "compact", "std", |
"width", "compact", "std", |
"filled", "words", "emphasis", |
"filled", "words", "emphasis", |
"symbolic", "nested", "centered" |
"symbolic", "nested", "centered" |
}; |
}; |
|
|
const char * const *mdoc_macronames = __mdoc_macronames + 1; |
|
const char * const *mdoc_argnames = __mdoc_argnames; |
const char * const *mdoc_argnames = __mdoc_argnames; |
|
|
static int mdoc_ptext(struct roff_man *, int, char *, int); |
static int mdoc_ptext(struct roff_man *, int, char *, int); |
Line 119 mdoc_parseln(struct roff_man *mdoc, int ln, char *buf, |
|
Line 82 mdoc_parseln(struct roff_man *mdoc, int ln, char *buf, |
|
void |
void |
mdoc_macro(MACRO_PROT_ARGS) |
mdoc_macro(MACRO_PROT_ARGS) |
{ |
{ |
assert(tok > TOKEN_NONE && tok < MDOC_MAX); |
assert(tok >= MDOC_Dd && tok < MDOC_MAX); |
|
|
(*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf); |
(*mdoc_macros[tok].fp)(mdoc, tok, line, ppos, pos, buf); |
} |
} |
|
|
void |
void |
mdoc_tail_alloc(struct roff_man *mdoc, int line, int pos, int tok) |
mdoc_tail_alloc(struct roff_man *mdoc, int line, int pos, enum roff_tok tok) |
{ |
{ |
struct roff_node *p; |
struct roff_node *p; |
|
|
Line 135 mdoc_tail_alloc(struct roff_man *mdoc, int line, int p |
|
Line 97 mdoc_tail_alloc(struct roff_man *mdoc, int line, int p |
|
} |
} |
|
|
struct roff_node * |
struct roff_node * |
mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, int tok, |
mdoc_endbody_alloc(struct roff_man *mdoc, int line, int pos, |
struct roff_node *body) |
enum roff_tok tok, struct roff_node *body) |
{ |
{ |
struct roff_node *p; |
struct roff_node *p; |
|
|
Line 153 mdoc_endbody_alloc(struct roff_man *mdoc, int line, in |
|
Line 115 mdoc_endbody_alloc(struct roff_man *mdoc, int line, in |
|
|
|
struct roff_node * |
struct roff_node * |
mdoc_block_alloc(struct roff_man *mdoc, int line, int pos, |
mdoc_block_alloc(struct roff_man *mdoc, int line, int pos, |
int tok, struct mdoc_arg *args) |
enum roff_tok tok, struct mdoc_arg *args) |
{ |
{ |
struct roff_node *p; |
struct roff_node *p; |
|
|
Line 180 mdoc_block_alloc(struct roff_man *mdoc, int line, int |
|
Line 142 mdoc_block_alloc(struct roff_man *mdoc, int line, int |
|
|
|
void |
void |
mdoc_elem_alloc(struct roff_man *mdoc, int line, int pos, |
mdoc_elem_alloc(struct roff_man *mdoc, int line, int pos, |
int tok, struct mdoc_arg *args) |
enum roff_tok tok, struct mdoc_arg *args) |
{ |
{ |
struct roff_node *p; |
struct roff_node *p; |
|
|
Line 340 mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, |
|
Line 302 mdoc_pmacro(struct roff_man *mdoc, int ln, char *buf, |
|
{ |
{ |
struct roff_node *n; |
struct roff_node *n; |
const char *cp; |
const char *cp; |
int tok; |
enum roff_tok tok; |
int i, sv; |
int i, sv; |
char mac[5]; |
char mac[5]; |
|
|