version 1.3, 2009/03/25 16:08:30 |
version 1.5, 2009/03/26 14:38:11 |
|
|
|
|
|
|
static int post_TH(struct man *); |
static int post_TH(struct man *); |
static time_t man_atotime(const char *); |
static time_t man_atotime(const char *); |
|
|
const struct actions man_actions[MAN_MAX] = { |
const struct actions man_actions[MAN_MAX] = { |
{ NULL }, /* __ */ |
{ NULL }, /* __ */ |
Line 60 const struct actions man_actions[MAN_MAX] = { |
|
Line 60 const struct actions man_actions[MAN_MAX] = { |
|
{ NULL }, /* B */ |
{ NULL }, /* B */ |
{ NULL }, /* I */ |
{ NULL }, /* I */ |
{ NULL }, /* IR */ |
{ NULL }, /* IR */ |
|
{ NULL }, /* RI */ |
}; |
}; |
|
|
|
|
Line 125 post_TH(struct man *m) |
|
Line 126 post_TH(struct man *m) |
|
|
|
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
|
|
if (NULL == (n = n->next)) { |
if (NULL == (n = n->next)) |
m->meta.date = time(NULL); |
m->meta.date = time(NULL); |
return(1); |
else if (0 == (m->meta.date = man_atotime(n->string))) { |
} |
|
|
|
if (0 == (m->meta.date = man_atotime(n->string))) { |
|
if ( ! man_vwarn(m, n->line, n->pos, "invalid date")) |
if ( ! man_vwarn(m, n->line, n->pos, "invalid date")) |
return(0); |
return(0); |
m->meta.date = time(NULL); |
m->meta.date = time(NULL); |
Line 138 post_TH(struct man *m) |
|
Line 136 post_TH(struct man *m) |
|
|
|
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
|
|
if ((n = n->next)) |
if (n && (n = n->next)) |
if (NULL == (m->meta.source = strdup(n->string))) |
if (NULL == (m->meta.source = strdup(n->string))) |
return(man_verr(m, n->line, n->pos, "malloc")); |
return(man_verr(m, n->line, n->pos, "malloc")); |
|
|
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
|
|
if ((n = n->next)) |
if (n && (n = n->next)) |
if (NULL == (m->meta.vol = strdup(n->string))) |
if (NULL == (m->meta.vol = strdup(n->string))) |
return(man_verr(m, n->line, n->pos, "malloc")); |
return(man_verr(m, n->line, n->pos, "malloc")); |
|
|
Line 153 post_TH(struct man *m) |
|
Line 151 post_TH(struct man *m) |
|
* of the syntax tree (they encompass only meta-data). |
* of the syntax tree (they encompass only meta-data). |
*/ |
*/ |
|
|
assert(MAN_ROOT == m->last->parent->type); |
if (m->last->parent->child == m->last) { |
m->last->parent->child = NULL; |
assert(MAN_ROOT == m->last->parent->type); |
n = m->last; |
m->last->parent->child = NULL; |
m->last = m->last->parent; |
n = m->last; |
m->next = MAN_NEXT_CHILD; |
m->last = m->last->parent; |
assert(m->last == m->first); |
m->next = MAN_NEXT_CHILD; |
|
assert(m->last == m->first); |
|
} else { |
|
assert(m->last->prev); |
|
m->last->prev->next = NULL; |
|
n = m->last; |
|
m->last = m->last->prev; |
|
m->next = MAN_NEXT_SIBLING; |
|
} |
|
|
man_node_freelist(n); |
man_node_freelist(n); |
return(1); |
return(1); |