version 1.40, 2010/08/20 00:53:35 |
version 1.41, 2010/10/15 20:45:03 |
|
|
#include "libman.h" |
#include "libman.h" |
#include "libmandoc.h" |
#include "libmandoc.h" |
|
|
|
#include "tbl.h" |
|
|
const char *const __man_macronames[MAN_MAX] = { |
const char *const __man_macronames[MAN_MAX] = { |
"br", "TH", "SH", "SS", |
"br", "TH", "SH", "SS", |
"TP", "LP", "PP", "P", |
"TP", "LP", "PP", "P", |
|
|
"nf", "fi", "r", "RE", |
"nf", "fi", "r", "RE", |
"RS", "DT", "UC", "PD", |
"RS", "DT", "UC", "PD", |
"Sp", "Vb", "Ve", "AT", |
"Sp", "Vb", "Ve", "AT", |
"in" |
"in", "TS", "TE" |
}; |
}; |
|
|
const char * const *man_macronames = __man_macronames; |
const char * const *man_macronames = __man_macronames; |
|
|
int |
int |
man_parseln(struct man *m, int ln, char *buf, int offs) |
man_parseln(struct man *m, int ln, char *buf, int offs) |
{ |
{ |
|
struct man_node *n; |
|
|
if (MAN_HALT & m->flags) |
if (MAN_HALT & m->flags) |
return(0); |
return(0); |
|
|
|
n = m->last; |
|
|
|
if (n && MAN_TS == n->tok && MAN_BODY == n->type && |
|
strncmp(buf+offs, ".TE", 3)) { |
|
n = n->parent; |
|
return(tbl_read(n->data.TS, "<man>", ln, buf+offs, |
|
strlen(buf+offs)) ? 1 : 0); |
|
} |
|
|
return(('.' == buf[offs] || '\'' == buf[offs]) ? |
return(('.' == buf[offs] || '\'' == buf[offs]) ? |
man_pmacro(m, ln, buf, offs) : |
man_pmacro(m, ln, buf, offs) : |
man_ptext(m, ln, buf, offs)); |
man_ptext(m, ln, buf, offs)); |
|
|
|
|
if (p->string) |
if (p->string) |
free(p->string); |
free(p->string); |
|
if (p->data.TS) |
|
tbl_free(p->data.TS); |
free(p); |
free(p); |
} |
} |
|
|