summaryrefslogtreecommitdiffstatshomepage
path: root/man_action.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 10:53:58 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-18 10:53:58 +0000
commit52078b04137667fec0f8506ad5417fffefd8f82d (patch)
tree206c99ff4874368c5c3874ffe02f5bee49456266 /man_action.c
parente100896ec287b69a49978cc7502276f0759544b0 (diff)
downloadmandoc-52078b04137667fec0f8506ad5417fffefd8f82d.tar.gz
mandoc-52078b04137667fec0f8506ad5417fffefd8f82d.tar.zst
mandoc-52078b04137667fec0f8506ad5417fffefd8f82d.zip
Moved all formatted libman warn/error into man.c/libman.h.
Converted all formatted warn/errors into regular syntax.
Diffstat (limited to 'man_action.c')
-rw-r--r--man_action.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/man_action.c b/man_action.c
index df9cb5f0..b9a78e5b 100644
--- a/man_action.c
+++ b/man_action.c
@@ -1,4 +1,4 @@
-/* $Id: man_action.c,v 1.12 2009/06/16 19:55:28 kristaps Exp $ */
+/* $Id: man_action.c,v 1.13 2009/06/18 10:53:58 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -108,8 +108,7 @@ post_TH(struct man *m)
assert(n);
if (NULL == (m->meta.title = strdup(n->string)))
- return(man_verr(m, n->line, n->pos,
- "memory exhausted"));
+ return(man_nerr(m, n, WNMEM));
/* TITLE ->MSEC<- DATE SOURCE VOL */
@@ -120,7 +119,7 @@ post_TH(struct man *m)
lval = strtol(n->string, &ep, 10);
if (n->string[0] != '\0' && *ep == '\0')
m->meta.msec = (int)lval;
- else if ( ! man_vwarn(m, n->line, n->pos, "invalid section"))
+ else if ( ! man_nwarn(m, n, WMSEC))
return(0);
/* TITLE MSEC ->DATE<- SOURCE VOL */
@@ -128,7 +127,7 @@ post_TH(struct man *m)
if (NULL == (n = n->next))
m->meta.date = time(NULL);
else if (0 == (m->meta.date = man_atotime(n->string))) {
- if ( ! man_vwarn(m, n->line, n->pos, "invalid date"))
+ if ( ! man_nwarn(m, n, WDATE))
return(0);
m->meta.date = time(NULL);
}
@@ -137,15 +136,13 @@ post_TH(struct man *m)
if (n && (n = n->next))
if (NULL == (m->meta.source = strdup(n->string)))
- return(man_verr(m, n->line, n->pos,
- "memory exhausted"));
+ return(man_nerr(m, n, WNMEM));
/* TITLE MSEC DATE SOURCE ->VOL<- */
if (n && (n = n->next))
if (NULL == (m->meta.vol = strdup(n->string)))
- return(man_verr(m, n->line, n->pos,
- "memory exhausted"));
+ return(man_nerr(m, n, WNMEM));
/*
* The end document shouldn't have the prologue macros as part
@@ -178,7 +175,7 @@ man_atotime(const char *p)
struct tm tm;
char *pp;
- (void)memset(&tm, 0, sizeof(struct tm));
+ bzero(&tm, sizeof(struct tm));
if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp)
return(mktime(&tm));