version 1.31, 2009/01/15 17:38:57 |
version 1.34, 2009/01/17 16:15:27 |
Line 99 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 99 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ macro_scoped_close, MDOC_EXPLICIT }, /* El */ |
{ macro_scoped_close, MDOC_EXPLICIT }, /* El */ |
{ macro_scoped, MDOC_PARSED | MDOC_TABSEP}, /* It */ |
{ macro_scoped, MDOC_PARSED | MDOC_TABSEP}, /* It */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ad */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ad */ |
{ macro_constant, MDOC_PARSED }, /* An */ |
{ macro_text, MDOC_PARSED }, /* An */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ar */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ar */ |
{ macro_constant, MDOC_QUOTABLE }, /* Cd */ |
{ macro_constant, MDOC_QUOTABLE }, /* Cd */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Cm */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Cm */ |
Line 111 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 111 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ macro_constant, 0 }, /* Fd */ |
{ macro_constant, 0 }, /* Fd */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Fl */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Fl */ |
{ macro_text, MDOC_CALLABLE | MDOC_QUOTABLE | MDOC_PARSED }, /* Fn */ |
{ macro_text, MDOC_CALLABLE | MDOC_QUOTABLE | MDOC_PARSED }, /* Fn */ |
{ macro_text, MDOC_PARSED }, /* Ft */ |
{ macro_text, MDOC_PARSED | MDOC_QUOTABLE }, /* Ft */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ic */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Ic */ |
{ macro_constant, 0 }, /* In */ |
{ macro_constant, 0 }, /* In */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ |
{ macro_text, MDOC_CALLABLE | MDOC_PARSED }, /* Li */ |
Line 140 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 140 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Ac */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Ac */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Ao */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Ao */ |
{ macro_scoped_line, MDOC_CALLABLE | MDOC_PARSED }, /* Aq */ |
{ macro_scoped_line, MDOC_CALLABLE | MDOC_PARSED }, /* Aq */ |
{ macro_constant, 0 }, /* At */ |
{ macro_constant_delimited, 0 }, /* At */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Bc */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Bc */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Bf */ |
{ macro_scoped, MDOC_EXPLICIT }, /* Bf */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Bo */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Bo */ |
Line 162 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
Line 162 const struct mdoc_macro __mdoc_macros[MDOC_MAX] = { |
|
{ macro_constant_delimited, MDOC_PARSED }, /* Nx */ |
{ macro_constant_delimited, MDOC_PARSED }, /* Nx */ |
{ macro_constant_delimited, MDOC_PARSED }, /* Ox */ |
{ macro_constant_delimited, MDOC_PARSED }, /* Ox */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Pc */ |
{ macro_constant, MDOC_PARSED }, /* Pf */ |
{ macro_constant_delimited, MDOC_PARSED }, /* Pf */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Po */ |
{ macro_constant_scoped, MDOC_CALLABLE | MDOC_PARSED | MDOC_EXPLICIT }, /* Po */ |
{ macro_scoped_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pq */ |
{ macro_scoped_line, MDOC_CALLABLE | MDOC_PARSED }, /* Pq */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Qc */ |
{ macro_scoped_close, MDOC_EXPLICIT | MDOC_CALLABLE | MDOC_PARSED }, /* Qc */ |
Line 221 mdoc_result(struct mdoc *mdoc) |
|
Line 221 mdoc_result(struct mdoc *mdoc) |
|
|
|
|
|
void |
void |
|
mdoc_meta_free(struct mdoc *mdoc) |
|
{ |
|
|
|
if (mdoc->meta.title) |
|
free(mdoc->meta.title); |
|
if (mdoc->meta.os) |
|
free(mdoc->meta.os); |
|
if (mdoc->meta.name) |
|
free(mdoc->meta.name); |
|
} |
|
|
|
|
|
void |
mdoc_free(struct mdoc *mdoc) |
mdoc_free(struct mdoc *mdoc) |
{ |
{ |
|
|
Line 241 mdoc_alloc(void *data, const struct mdoc_cb *cb) |
|
Line 254 mdoc_alloc(void *data, const struct mdoc_cb *cb) |
|
p = xcalloc(1, sizeof(struct mdoc)); |
p = xcalloc(1, sizeof(struct mdoc)); |
|
|
p->data = data; |
p->data = data; |
(void)memcpy(&p->cb, cb, sizeof(struct mdoc_cb)); |
if (cb) |
|
(void)memcpy(&p->cb, cb, sizeof(struct mdoc_cb)); |
|
|
p->last = xcalloc(1, sizeof(struct mdoc_node)); |
p->last = xcalloc(1, sizeof(struct mdoc_node)); |
p->last->type = MDOC_ROOT; |
p->last->type = MDOC_ROOT; |
Line 438 mdoc_node_append(struct mdoc *mdoc, struct mdoc_node * |
|
Line 452 mdoc_node_append(struct mdoc *mdoc, struct mdoc_node * |
|
} |
} |
|
|
if ( ! mdoc_valid_pre(mdoc, p)) |
if ( ! mdoc_valid_pre(mdoc, p)) |
return(0); |
|
if ( ! mdoc_action_pre(mdoc, p)) |
|
return(0); |
return(0); |
|
|
switch (p->type) { |
switch (p->type) { |