version 1.36, 2013/06/01 22:57:35 |
version 1.39, 2013/09/16 00:25:07 |
|
|
#include "man.h" |
#include "man.h" |
#include "main.h" |
#include "main.h" |
|
|
#ifndef MAP_FILE |
|
#define MAP_FILE 0 |
|
#endif |
|
|
|
#define REPARSE_LIMIT 1000 |
#define REPARSE_LIMIT 1000 |
|
|
struct buf { |
struct buf { |
Line 74 static void mparse_buf_r(struct mparse *, struct buf |
|
Line 70 static void mparse_buf_r(struct mparse *, struct buf |
|
static void pset(const char *, int, struct mparse *); |
static void pset(const char *, int, struct mparse *); |
static int read_whole_file(const char *, int, struct buf *, int *); |
static int read_whole_file(const char *, int, struct buf *, int *); |
static void mparse_end(struct mparse *); |
static void mparse_end(struct mparse *); |
|
static void mparse_parse_buffer(struct mparse *, struct buf, |
|
const char *); |
|
|
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = { |
static const enum mandocerr mandoclimits[MANDOCLEVEL_MAX] = { |
MANDOCERR_OK, |
MANDOCERR_OK, |
Line 108 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 106 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
"bad NAME section contents", |
"bad NAME section contents", |
"sections out of conventional order", |
"sections out of conventional order", |
"duplicate section name", |
"duplicate section name", |
"section not in conventional manual section", |
"section header suited to sections 2, 3, and 9 only", |
|
|
/* related to macros and nesting */ |
/* related to macros and nesting */ |
"skipping obsolete macro", |
"skipping obsolete macro", |
Line 187 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
Line 185 static const char * const mandocerrs[MANDOCERR_MAX] = |
|
"macro requires line argument(s)", |
"macro requires line argument(s)", |
"macro requires body argument(s)", |
"macro requires body argument(s)", |
"macro requires argument(s)", |
"macro requires argument(s)", |
|
"request requires a numeric argument", |
"missing list type", |
"missing list type", |
"line argument(s) will be lost", |
"line argument(s) will be lost", |
"body argument(s) will be lost", |
"body argument(s) will be lost", |
Line 595 read_whole_file(const char *file, int fd, struct buf * |
|
Line 594 read_whole_file(const char *file, int fd, struct buf * |
|
} |
} |
*with_mmap = 1; |
*with_mmap = 1; |
fb->sz = (size_t)st.st_size; |
fb->sz = (size_t)st.st_size; |
fb->buf = mmap(NULL, fb->sz, PROT_READ, |
fb->buf = mmap(NULL, fb->sz, PROT_READ, MAP_SHARED, fd, 0); |
MAP_FILE|MAP_SHARED, fd, 0); |
|
if (fb->buf != MAP_FAILED) |
if (fb->buf != MAP_FAILED) |
return(1); |
return(1); |
} |
} |