version 1.28, 2010/03/24 03:46:02 |
version 1.34, 2010/05/15 22:44:04 |
|
|
/* $Id$ */ |
/* $Id$ */ |
/* |
/* |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> |
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv> |
* |
* |
* Permission to use, copy, modify, and distribute this software for any |
* Permission to use, copy, modify, and distribute this software for any |
* purpose with or without fee is hereby granted, provided that the above |
* purpose with or without fee is hereby granted, provided that the above |
|
|
post_TH(struct man *m) |
post_TH(struct man *m) |
{ |
{ |
struct man_node *n; |
struct man_node *n; |
char *ep; |
|
long lval; |
|
|
|
if (m->meta.title) |
if (m->meta.title) |
free(m->meta.title); |
free(m->meta.title); |
Line 132 post_TH(struct man *m) |
|
Line 130 post_TH(struct man *m) |
|
free(m->meta.vol); |
free(m->meta.vol); |
if (m->meta.source) |
if (m->meta.source) |
free(m->meta.source); |
free(m->meta.source); |
|
if (m->meta.msec) |
|
free(m->meta.msec); |
|
|
m->meta.title = m->meta.vol = m->meta.source = NULL; |
m->meta.title = m->meta.vol = |
m->meta.msec = 0; |
m->meta.msec = m->meta.source = NULL; |
m->meta.date = 0; |
m->meta.date = 0; |
|
|
/* ->TITLE<- MSEC DATE SOURCE VOL */ |
/* ->TITLE<- MSEC DATE SOURCE VOL */ |
Line 147 post_TH(struct man *m) |
|
Line 147 post_TH(struct man *m) |
|
|
|
n = n->next; |
n = n->next; |
assert(n); |
assert(n); |
|
m->meta.msec = mandoc_strdup(n->string); |
|
|
lval = strtol(n->string, &ep, 10); |
|
if (n->string[0] != '\0' && *ep == '\0') |
|
m->meta.msec = (int)lval; |
|
else if ( ! man_nwarn(m, n, WMSEC)) |
|
return(0); |
|
|
|
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
/* TITLE MSEC ->DATE<- SOURCE VOL */ |
|
|
n = n->next; |
n = n->next; |
if (n) { |
if (n) { |
m->meta.date = mandoc_a2time |
m->meta.date = mandoc_a2time |
(MTIME_ISO_8601, n->string); |
(MTIME_ISO_8601, n->string); |
|
|
if (0 == m->meta.date) { |
if (0 == m->meta.date) { |
if ( ! man_nwarn(m, n, WDATE)) |
if ( ! man_nwarn(m, n, WDATE)) |
return(0); |
return(0); |
Line 179 post_TH(struct man *m) |
|
Line 173 post_TH(struct man *m) |
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
m->meta.vol = mandoc_strdup(n->string); |
m->meta.vol = mandoc_strdup(n->string); |
|
|
n = m->last; |
/* |
man_node_unlink(m, n); |
* Remove the `TH' node after we've processed it for our |
man_node_freelist(n); |
* meta-data. |
|
*/ |
|
man_node_delete(m, m->last); |
return(1); |
return(1); |
} |
} |