version 1.207, 2014/03/30 23:28:06 |
version 1.209, 2014/04/15 00:41:09 |
Line 332 static const char * const secnames[SEC__MAX] = { |
|
Line 332 static const char * const secnames[SEC__MAX] = { |
|
"LIBRARY", |
"LIBRARY", |
"SYNOPSIS", |
"SYNOPSIS", |
"DESCRIPTION", |
"DESCRIPTION", |
|
"CONTEXT", |
"IMPLEMENTATION NOTES", |
"IMPLEMENTATION NOTES", |
"RETURN VALUES", |
"RETURN VALUES", |
"ENVIRONMENT", |
"ENVIRONMENT", |
|
|
post_sh_head(POST_ARGS) |
post_sh_head(POST_ARGS) |
{ |
{ |
struct mdoc_node *n; |
struct mdoc_node *n; |
const char *secname; |
char *secname; |
enum mdoc_sec sec; |
enum mdoc_sec sec; |
|
|
/* |
/* |
Line 1961 post_sh_head(POST_ARGS) |
|
Line 1962 post_sh_head(POST_ARGS) |
|
|
|
secname = NULL; |
secname = NULL; |
sec = SEC_CUSTOM; |
sec = SEC_CUSTOM; |
n = mdoc->last; |
mdoc_deroff(&secname, mdoc->last); |
if (n->child) { |
sec = NULL == secname ? SEC_CUSTOM : a2sec(secname); |
assert(1 == n->nchild); |
|
n = n->child; |
|
assert(NULL != n); |
|
assert(MDOC_TEXT == n->type); |
|
secname = n->string; |
|
sec = a2sec(secname); |
|
} |
|
|
|
/* The NAME should be first. */ |
/* The NAME should be first. */ |
|
|
Line 2006 post_sh_head(POST_ARGS) |
|
Line 2000 post_sh_head(POST_ARGS) |
|
|
|
/* We don't care about custom sections after this. */ |
/* We don't care about custom sections after this. */ |
|
|
if (SEC_CUSTOM == sec) |
if (SEC_CUSTOM == sec) { |
|
free(secname); |
return(1); |
return(1); |
|
} |
|
|
/* |
/* |
* Check whether our non-custom section is being repeated or is |
* Check whether our non-custom section is being repeated or is |
Line 2040 post_sh_head(POST_ARGS) |
|
Line 2036 post_sh_head(POST_ARGS) |
|
break; |
break; |
if (*mdoc->meta.msec == '3') |
if (*mdoc->meta.msec == '3') |
break; |
break; |
|
/* FALLTHROUGH */ |
|
case (SEC_CONTEXT): |
if (*mdoc->meta.msec == '9') |
if (*mdoc->meta.msec == '9') |
break; |
break; |
mandoc_msg(MANDOCERR_SECMSEC, mdoc->parse, |
mandoc_msg(MANDOCERR_SECMSEC, mdoc->parse, |
Line 2049 post_sh_head(POST_ARGS) |
|
Line 2047 post_sh_head(POST_ARGS) |
|
break; |
break; |
} |
} |
|
|
|
free(secname); |
return(1); |
return(1); |
} |
} |
|
|