version 1.11, 2009/12/22 23:58:00 |
version 1.12, 2009/12/23 22:30:17 |
|
|
} |
} |
|
|
|
|
time_t |
|
mdoc_atotime(const char *p) |
|
{ |
|
struct tm tm; |
|
char *pp; |
|
|
|
memset(&tm, 0, sizeof(struct tm)); |
|
|
|
if (0 == strcmp(p, "$" "Mdocdate$")) |
|
return(time(NULL)); |
|
if ((pp = strptime(p, "$" "Mdocdate: %b %d %Y $", &tm)) && 0 == *pp) |
|
return(mktime(&tm)); |
|
/* XXX - this matches "June 1999", which is wrong. */ |
|
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |
|
return(mktime(&tm)); |
|
if ((pp = strptime(p, "%b %d, %Y", &tm)) && 0 == *pp) |
|
return(mktime(&tm)); |
|
|
|
return(0); |
|
} |
|
|
|
|
|
/* FIXME: move this into an editable .in file. */ |
/* FIXME: move this into an editable .in file. */ |
size_t |
size_t |
mdoc_macro2len(int macro) |
mdoc_macro2len(int macro) |