version 1.23, 2009/07/06 13:04:52 |
version 1.26, 2009/07/12 20:30:35 |
|
|
int (*post)(POST_ARGS); |
int (*post)(POST_ARGS); |
}; |
}; |
|
|
static int concat(struct mdoc *, const struct mdoc_node *, |
|
char *, size_t); |
|
|
|
static int post_ar(POST_ARGS); |
static int post_ar(POST_ARGS); |
|
static int post_at(POST_ARGS); |
static int post_bl(POST_ARGS); |
static int post_bl(POST_ARGS); |
static int post_bl_head(POST_ARGS); |
static int post_bl_head(POST_ARGS); |
static int post_bl_width(POST_ARGS); |
|
static int post_bl_tagwidth(POST_ARGS); |
static int post_bl_tagwidth(POST_ARGS); |
|
static int post_bl_width(POST_ARGS); |
static int post_dd(POST_ARGS); |
static int post_dd(POST_ARGS); |
static int post_display(POST_ARGS); |
static int post_display(POST_ARGS); |
static int post_dt(POST_ARGS); |
static int post_dt(POST_ARGS); |
Line 48 static int post_nm(POST_ARGS); |
|
Line 46 static int post_nm(POST_ARGS); |
|
static int post_os(POST_ARGS); |
static int post_os(POST_ARGS); |
static int post_prol(POST_ARGS); |
static int post_prol(POST_ARGS); |
static int post_sh(POST_ARGS); |
static int post_sh(POST_ARGS); |
|
static int post_st(POST_ARGS); |
static int post_std(POST_ARGS); |
static int post_std(POST_ARGS); |
|
|
static int pre_bd(PRE_ARGS); |
static int pre_bd(PRE_ARGS); |
Line 91 const struct actions mdoc_actions[MDOC_MAX] = { |
|
Line 90 const struct actions mdoc_actions[MDOC_MAX] = { |
|
{ NULL, NULL }, /* Ot */ |
{ NULL, NULL }, /* Ot */ |
{ NULL, NULL }, /* Pa */ |
{ NULL, NULL }, /* Pa */ |
{ NULL, post_std }, /* Rv */ |
{ NULL, post_std }, /* Rv */ |
{ NULL, NULL }, /* St */ |
{ NULL, post_st }, /* St */ |
{ NULL, NULL }, /* Va */ |
{ NULL, NULL }, /* Va */ |
{ NULL, NULL }, /* Vt */ |
{ NULL, NULL }, /* Vt */ |
{ NULL, NULL }, /* Xr */ |
{ NULL, NULL }, /* Xr */ |
Line 109 const struct actions mdoc_actions[MDOC_MAX] = { |
|
Line 108 const struct actions mdoc_actions[MDOC_MAX] = { |
|
{ NULL, NULL }, /* Ac */ |
{ NULL, NULL }, /* Ac */ |
{ NULL, NULL }, /* Ao */ |
{ NULL, NULL }, /* Ao */ |
{ NULL, NULL }, /* Aq */ |
{ NULL, NULL }, /* Aq */ |
{ NULL, NULL }, /* At */ |
{ NULL, post_at }, /* At */ |
{ NULL, NULL }, /* Bc */ |
{ NULL, NULL }, /* Bc */ |
{ NULL, NULL }, /* Bf */ |
{ NULL, NULL }, /* Bf */ |
{ NULL, NULL }, /* Bo */ |
{ NULL, NULL }, /* Bo */ |
Line 174 const struct actions mdoc_actions[MDOC_MAX] = { |
|
Line 173 const struct actions mdoc_actions[MDOC_MAX] = { |
|
{ NULL, NULL }, /* %Q */ |
{ NULL, NULL }, /* %Q */ |
}; |
}; |
|
|
|
static int concat(struct mdoc *, const struct mdoc_node *, |
|
char *, size_t); |
|
|
#ifdef __linux__ |
#ifdef __linux__ |
extern size_t strlcat(char *, const char *, size_t); |
extern size_t strlcat(char *, const char *, size_t); |
#endif |
#endif |
|
|
|
|
Line 290 post_nm(POST_ARGS) |
|
Line 291 post_nm(POST_ARGS) |
|
|
|
|
|
static int |
static int |
|
post_st(POST_ARGS) |
|
{ |
|
const char *p; |
|
|
|
assert(MDOC_TEXT == m->last->child->type); |
|
p = mdoc_a2st(m->last->child->string); |
|
assert(p); |
|
free(m->last->child->string); |
|
m->last->child->string = strdup(p); |
|
if (NULL == m->last->child->string) |
|
return(mdoc_nerr(m, m->last, EMALLOC)); |
|
return(1); |
|
} |
|
|
|
|
|
static int |
|
post_at(POST_ARGS) |
|
{ |
|
struct mdoc_node *n; |
|
const char *p; |
|
|
|
if (m->last->child) { |
|
assert(MDOC_TEXT == m->last->child->type); |
|
p = mdoc_a2att(m->last->child->string); |
|
assert(p); |
|
free(m->last->child->string); |
|
m->last->child->string = strdup(p); |
|
if (NULL == m->last->child->string) |
|
return(mdoc_nerr(m, m->last, EMALLOC)); |
|
return(1); |
|
} |
|
|
|
n = m->last; |
|
m->next = MDOC_NEXT_CHILD; |
|
|
|
if ( ! mdoc_word_alloc(m, n->line, n->pos, "AT&T UNIX")) |
|
return(0); |
|
|
|
m->last = n; |
|
m->next = MDOC_NEXT_SIBLING; |
|
return(1); |
|
} |
|
|
|
|
|
static int |
post_sh(POST_ARGS) |
post_sh(POST_ARGS) |
{ |
{ |
enum mdoc_sec sec; |
enum mdoc_sec sec; |
Line 665 post_lk(POST_ARGS) |
|
Line 711 post_lk(POST_ARGS) |
|
|
|
n = m->last; |
n = m->last; |
m->next = MDOC_NEXT_CHILD; |
m->next = MDOC_NEXT_CHILD; |
/* FIXME: this isn't documented anywhere! */ |
|
if ( ! mdoc_word_alloc(m, m->last->line, |
/* XXX: this isn't documented anywhere! */ |
m->last->pos, "~")) |
if ( ! mdoc_word_alloc(m, m->last->line, m->last->pos, "~")) |
return(0); |
return(0); |
|
|
m->last = n; |
m->last = n; |
Line 686 post_ar(POST_ARGS) |
|
Line 732 post_ar(POST_ARGS) |
|
|
|
n = m->last; |
n = m->last; |
m->next = MDOC_NEXT_CHILD; |
m->next = MDOC_NEXT_CHILD; |
if ( ! mdoc_word_alloc(m, m->last->line, |
if ( ! mdoc_word_alloc(m, m->last->line, m->last->pos, "file")) |
m->last->pos, "file")) |
|
return(0); |
return(0); |
m->next = MDOC_NEXT_SIBLING; |
m->next = MDOC_NEXT_SIBLING; |
if ( ! mdoc_word_alloc(m, m->last->line, |
if ( ! mdoc_word_alloc(m, m->last->line, m->last->pos, "...")) |
m->last->pos, "...")) |
|
return(0); |
return(0); |
|
|
m->last = n; |
m->last = n; |