version 1.7, 2011/03/28 21:49:42 |
version 1.14, 2011/04/30 10:18:24 |
|
|
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
*/ |
*/ |
|
#ifdef HAVE_CONFIG_H |
|
#include "config.h" |
|
#endif |
|
|
#include <sys/stat.h> |
#include <sys/stat.h> |
#include <sys/mman.h> |
#include <sys/mman.h> |
|
|
Line 138 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 142 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
"tab in non-literal context", |
"tab in non-literal context", |
"end of line whitespace", |
"end of line whitespace", |
"bad comment style", |
"bad comment style", |
"unknown escape sequence", |
"bad escape sequence", |
"unterminated quoted string", |
"unterminated quoted string", |
|
|
"generic error", |
"generic error", |
Line 350 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
Line 354 mparse_buf_r(struct mparse *curp, struct buf blk, int |
|
continue; |
continue; |
} |
} |
|
|
if ('"' == blk.buf[i + 1]) { |
if ('"' == blk.buf[i + 1] || '#' == blk.buf[i + 1]) { |
i += 2; |
i += 2; |
/* Comment, skip to end of line */ |
/* Comment, skip to end of line */ |
for (; i < (int)blk.sz; ++i) { |
for (; i < (int)blk.sz; ++i) { |
|
|
|
|
/* |
/* |
* If input parsers have not been allocated, do so now. |
* If input parsers have not been allocated, do so now. |
* We keep these instanced betwen parsers, but set them |
* We keep these instanced between parsers, but set them |
* locally per parse routine since we can use different |
* locally per parse routine since we can use different |
* parsers with each one. |
* parsers with each one. |
*/ |
*/ |
Line 662 mparse_alloc(enum mparset inttype, enum mandoclevel wl |
|
Line 666 mparse_alloc(enum mparset inttype, enum mandoclevel wl |
|
{ |
{ |
struct mparse *curp; |
struct mparse *curp; |
|
|
|
assert(wlevel <= MANDOCLEVEL_FATAL); |
|
|
curp = mandoc_calloc(1, sizeof(struct mparse)); |
curp = mandoc_calloc(1, sizeof(struct mparse)); |
|
|
curp->wlevel = wlevel; |
curp->wlevel = wlevel; |
|
|
mparse_result(struct mparse *curp, struct mdoc **mdoc, struct man **man) |
mparse_result(struct mparse *curp, struct mdoc **mdoc, struct man **man) |
{ |
{ |
|
|
*mdoc = curp->mdoc; |
if (mdoc) |
*man = curp->man; |
*mdoc = curp->mdoc; |
|
if (man) |
|
*man = curp->man; |
} |
} |
|
|
void |
void |
Line 740 mandoc_msg(enum mandocerr er, struct mparse *m, |
|
Line 748 mandoc_msg(enum mandocerr er, struct mparse *m, |
|
if (level < m->wlevel) |
if (level < m->wlevel) |
return; |
return; |
|
|
(*m->mmsg)(er, level, m->file, ln, col, msg); |
if (m->mmsg) |
|
(*m->mmsg)(er, level, m->file, ln, col, msg); |
|
|
if (m->file_status < level) |
if (m->file_status < level) |
m->file_status = level; |
m->file_status = level; |