version 1.42, 2009/10/24 05:45:04 |
version 1.44, 2009/10/27 08:26:12 |
Line 40 const char *const __man_merrnames[WERRMAX] = { |
|
Line 40 const char *const __man_merrnames[WERRMAX] = { |
|
"expected block head arguments", /* WHEADARGS */ |
"expected block head arguments", /* WHEADARGS */ |
"expected block body arguments", /* WBODYARGS */ |
"expected block body arguments", /* WBODYARGS */ |
"expected empty block head", /* WNHEADARGS */ |
"expected empty block head", /* WNHEADARGS */ |
"unknown macro", /* WMACRO */ |
|
"ill-formed macro", /* WMACROFORM */ |
"ill-formed macro", /* WMACROFORM */ |
"scope open on exit", /* WEXITSCOPE */ |
"scope open on exit", /* WEXITSCOPE */ |
"no scope context", /* WNOSCOPE */ |
"no scope context", /* WNOSCOPE */ |
Line 71 static void man_free1(struct man *); |
|
Line 70 static void man_free1(struct man *); |
|
static int man_alloc1(struct man *); |
static int man_alloc1(struct man *); |
static int pstring(struct man *, int, int, |
static int pstring(struct man *, int, int, |
const char *, size_t); |
const char *, size_t); |
|
static int macrowarn(struct man *, int, const char *); |
|
|
#ifdef __linux__ |
#ifdef __linux__ |
extern size_t strlcpy(char *, const char *, size_t); |
extern size_t strlcpy(char *, const char *, size_t); |
|
|
man_alloc1(struct man *m) |
man_alloc1(struct man *m) |
{ |
{ |
|
|
bzero(&m->meta, sizeof(struct man_meta)); |
memset(&m->meta, 0, sizeof(struct man_meta)); |
m->flags = 0; |
m->flags = 0; |
m->last = calloc(1, sizeof(struct man_node)); |
m->last = calloc(1, sizeof(struct man_node)); |
if (NULL == m->last) |
if (NULL == m->last) |
|
|
} |
} |
|
|
|
|
|
static int |
|
macrowarn(struct man *m, int ln, const char *buf) |
|
{ |
|
if ( ! (MAN_IGN_MACRO & m->pflags)) |
|
return(man_verr(m, ln, 0, |
|
"unknown macro: %s%s", |
|
buf, strlen(buf) > 3 ? "..." : "")); |
|
return(man_vwarn(m, ln, 0, "unknown macro: %s%s", |
|
buf, strlen(buf) > 3 ? "..." : "")); |
|
} |
|
|
|
|
int |
int |
man_pmacro(struct man *m, int ln, char *buf) |
man_pmacro(struct man *m, int ln, char *buf) |
{ |
{ |
Line 510 man_pmacro(struct man *m, int ln, char *buf) |
|
Line 522 man_pmacro(struct man *m, int ln, char *buf) |
|
} |
} |
|
|
if (MAN_MAX == (c = man_hash_find(mac))) { |
if (MAN_MAX == (c = man_hash_find(mac))) { |
if ( ! (MAN_IGN_MACRO & m->pflags)) { |
if ( ! macrowarn(m, ln, mac)) |
(void)man_perr(m, ln, ppos, WMACRO); |
|
goto err; |
|
} |
|
if ( ! man_pwarn(m, ln, ppos, WMACRO)) |
|
goto err; |
goto err; |
return(1); |
return(1); |
} |
} |