version 1.18, 2009/08/21 12:32:38 |
version 1.22, 2009/10/30 05:58:37 |
|
|
#include <string.h> |
#include <string.h> |
|
|
#include "libman.h" |
#include "libman.h" |
|
#include "libmandoc.h" |
|
|
struct actions { |
struct actions { |
int (*post)(struct man *); |
int (*post)(struct man *); |
Line 62 const struct actions man_actions[MAN_MAX] = { |
|
Line 63 const struct actions man_actions[MAN_MAX] = { |
|
{ NULL }, /* RE */ |
{ NULL }, /* RE */ |
{ NULL }, /* RS */ |
{ NULL }, /* RS */ |
{ NULL }, /* DT */ |
{ NULL }, /* DT */ |
|
{ NULL }, /* UC */ |
|
{ NULL }, /* PD */ |
}; |
}; |
|
|
static time_t man_atotime(const char *); |
static time_t man_atotime(const char *); |
Line 139 post_TH(struct man *m) |
|
Line 142 post_TH(struct man *m) |
|
|
|
n = m->last->child; |
n = m->last->child; |
assert(n); |
assert(n); |
|
m->meta.title = mandoc_strdup(n->string); |
|
|
if (NULL == (m->meta.title = strdup(n->string))) |
|
return(man_nerr(m, n, WNMEM)); |
|
|
|
/* TITLE ->MSEC<- DATE SOURCE VOL */ |
/* TITLE ->MSEC<- DATE SOURCE VOL */ |
|
|
n = n->next; |
n = n->next; |
Line 168 post_TH(struct man *m) |
|
Line 169 post_TH(struct man *m) |
|
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
/* TITLE MSEC DATE ->SOURCE<- VOL */ |
|
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
if (NULL == (m->meta.source = strdup(n->string))) |
m->meta.source = mandoc_strdup(n->string); |
return(man_nerr(m, n, WNMEM)); |
|
|
|
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
/* TITLE MSEC DATE SOURCE ->VOL<- */ |
|
|
if (n && (n = n->next)) |
if (n && (n = n->next)) |
if (NULL == (m->meta.vol = strdup(n->string))) |
m->meta.vol = mandoc_strdup(n->string); |
return(man_nerr(m, n, WNMEM)); |
|
|
|
/* |
/* |
* The end document shouldn't have the prologue macros as part |
* The end document shouldn't have the prologue macros as part |
Line 206 man_atotime(const char *p) |
|
Line 205 man_atotime(const char *p) |
|
struct tm tm; |
struct tm tm; |
char *pp; |
char *pp; |
|
|
bzero(&tm, sizeof(struct tm)); |
memset(&tm, 0, sizeof(struct tm)); |
|
|
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) |
return(mktime(&tm)); |
return(mktime(&tm)); |