version 1.4, 2009/03/26 09:55:39 |
version 1.9, 2009/04/05 16:34:22 |
|
|
#include <sys/utsname.h> |
#include <sys/utsname.h> |
|
|
#include <assert.h> |
#include <assert.h> |
#include <err.h> |
|
#include <errno.h> |
#include <errno.h> |
#include <stdio.h> |
|
#include <stdlib.h> |
#include <stdlib.h> |
#include <string.h> |
#include <string.h> |
|
|
|
|
|
|
|
|
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 58 const struct actions man_actions[MAN_MAX] = { |
|
{ NULL }, /* B */ |
{ NULL }, /* B */ |
{ NULL }, /* I */ |
{ NULL }, /* I */ |
{ NULL }, /* IR */ |
{ NULL }, /* IR */ |
|
{ NULL }, /* RI */ |
|
{ NULL }, /* br */ |
|
{ NULL }, /* na */ |
|
{ NULL }, /* i */ |
}; |
}; |
|
|
|
|
Line 109 post_TH(struct man *m) |
|
Line 111 post_TH(struct man *m) |
|
assert(n); |
assert(n); |
|
|
if (NULL == (m->meta.title = strdup(n->string))) |
if (NULL == (m->meta.title = strdup(n->string))) |
return(man_verr(m, n->line, n->pos, "malloc")); |
return(man_verr(m, n->line, n->pos, |
|
"memory exhausted")); |
|
|
/* TITLE ->MSEC<- DATE SOURCE VOL */ |
/* TITLE ->MSEC<- DATE SOURCE VOL */ |
|
|
Line 125 post_TH(struct man *m) |
|
Line 128 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 138 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, |
|
"memory exhausted")); |
|
|
/* 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, |
|
"memory exhausted")); |
|
|
/* |
/* |
* The end document shouldn't have the prologue macros as part |
* The end document shouldn't have the prologue macros as part |