version 1.189, 2015/04/02 22:48:17 |
version 1.192, 2015/04/18 16:34:25 |
|
|
STMT__MAX |
STMT__MAX |
}; |
}; |
|
|
typedef int (*mdoc_fp)(struct mpage *, const struct mdoc_meta *, |
typedef int (*mdoc_fp)(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
|
|
struct mdoc_handler { |
struct mdoc_handler { |
Line 156 static void mpages_free(void); |
|
Line 156 static void mpages_free(void); |
|
static void mpages_merge(struct mparse *); |
static void mpages_merge(struct mparse *); |
static void names_check(void); |
static void names_check(void); |
static void parse_cat(struct mpage *, int); |
static void parse_cat(struct mpage *, int); |
static void parse_man(struct mpage *, const struct man_meta *, |
static void parse_man(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static void parse_mdoc(struct mpage *, const struct mdoc_meta *, |
static void parse_mdoc(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_body(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_body(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_head(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_head(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Fd(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Fd(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static void parse_mdoc_fname(struct mpage *, const struct roff_node *); |
static void parse_mdoc_fname(struct mpage *, const struct roff_node *); |
static int parse_mdoc_Fn(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Fn(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Fo(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Fo(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Nd(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Nd(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Nm(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Nm(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Sh(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Sh(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static int parse_mdoc_Xr(struct mpage *, const struct mdoc_meta *, |
static int parse_mdoc_Xr(struct mpage *, const struct roff_meta *, |
const struct roff_node *); |
const struct roff_node *); |
static void putkey(const struct mpage *, char *, uint64_t); |
static void putkey(const struct mpage *, char *, uint64_t); |
static void putkeys(const struct mpage *, char *, size_t, uint64_t); |
static void putkeys(const struct mpage *, char *, size_t, uint64_t); |
Line 1107 mpages_merge(struct mparse *mp) |
|
Line 1107 mpages_merge(struct mparse *mp) |
|
struct ohash_info str_info; |
struct ohash_info str_info; |
struct mpage *mpage, *mpage_dest; |
struct mpage *mpage, *mpage_dest; |
struct mlink *mlink, *mlink_dest; |
struct mlink *mlink, *mlink_dest; |
struct mdoc *mdoc; |
struct roff_man *man; |
struct man *man; |
|
char *sodest; |
char *sodest; |
char *cp; |
char *cp; |
int fd; |
int fd; |
Line 1135 mpages_merge(struct mparse *mp) |
|
Line 1134 mpages_merge(struct mparse *mp) |
|
ohash_init(&names, 4, &str_info); |
ohash_init(&names, 4, &str_info); |
ohash_init(&strings, 6, &str_info); |
ohash_init(&strings, 6, &str_info); |
mparse_reset(mp); |
mparse_reset(mp); |
mdoc = NULL; |
|
man = NULL; |
man = NULL; |
sodest = NULL; |
sodest = NULL; |
|
|
Line 1151 mpages_merge(struct mparse *mp) |
|
Line 1149 mpages_merge(struct mparse *mp) |
|
*/ |
*/ |
if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { |
if (mlink->dform != FORM_CAT || mlink->fform != FORM_CAT) { |
mparse_readfd(mp, fd, mlink->file); |
mparse_readfd(mp, fd, mlink->file); |
mparse_result(mp, &mdoc, &man, &sodest); |
mparse_result(mp, &man, &sodest); |
} |
} |
|
|
if (sodest != NULL) { |
if (sodest != NULL) { |
Line 1195 mpages_merge(struct mparse *mp) |
|
Line 1193 mpages_merge(struct mparse *mp) |
|
mpage->mlinks = NULL; |
mpage->mlinks = NULL; |
} |
} |
goto nextpage; |
goto nextpage; |
} else if (mdoc != NULL) { |
} else if (man != NULL && man->macroset == MACROSET_MDOC) { |
mpage->form = FORM_SRC; |
mpage->form = FORM_SRC; |
mpage->sec = mdoc_meta(mdoc)->msec; |
mpage->sec = mdoc_meta(man)->msec; |
mpage->sec = mandoc_strdup( |
mpage->sec = mandoc_strdup( |
mpage->sec == NULL ? "" : mpage->sec); |
mpage->sec == NULL ? "" : mpage->sec); |
mpage->arch = mdoc_meta(mdoc)->arch; |
mpage->arch = mdoc_meta(man)->arch; |
mpage->arch = mandoc_strdup( |
mpage->arch = mandoc_strdup( |
mpage->arch == NULL ? "" : mpage->arch); |
mpage->arch == NULL ? "" : mpage->arch); |
mpage->title = |
mpage->title = |
mandoc_strdup(mdoc_meta(mdoc)->title); |
mandoc_strdup(mdoc_meta(man)->title); |
} else if (man != NULL) { |
} else if (man != NULL && man->macroset == MACROSET_MAN) { |
mpage->form = FORM_SRC; |
mpage->form = FORM_SRC; |
mpage->sec = mandoc_strdup(man_meta(man)->msec); |
mpage->sec = mandoc_strdup(man_meta(man)->msec); |
mpage->arch = mandoc_strdup(mlink->arch); |
mpage->arch = mandoc_strdup(mlink->arch); |
Line 1231 mpages_merge(struct mparse *mp) |
|
Line 1229 mpages_merge(struct mparse *mp) |
|
} |
} |
|
|
assert(mpage->desc == NULL); |
assert(mpage->desc == NULL); |
if (mdoc != NULL) |
if (man != NULL && man->macroset == MACROSET_MDOC) |
parse_mdoc(mpage, mdoc_meta(mdoc), mdoc_node(mdoc)); |
parse_mdoc(mpage, mdoc_meta(man), mdoc_node(man)); |
else if (man != NULL) |
else if (man != NULL) |
parse_man(mpage, man_meta(man), man_node(man)); |
parse_man(mpage, man_meta(man), man_node(man)); |
else |
else |
Line 1443 putmdockey(const struct mpage *mpage, |
|
Line 1441 putmdockey(const struct mpage *mpage, |
|
} |
} |
|
|
static void |
static void |
parse_man(struct mpage *mpage, const struct man_meta *meta, |
parse_man(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
const struct roff_node *head, *body; |
const struct roff_node *head, *body; |
Line 1569 parse_man(struct mpage *mpage, const struct man_meta * |
|
Line 1567 parse_man(struct mpage *mpage, const struct man_meta * |
|
} |
} |
|
|
static void |
static void |
parse_mdoc(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1602 parse_mdoc(struct mpage *mpage, const struct mdoc_meta |
|
Line 1600 parse_mdoc(struct mpage *mpage, const struct mdoc_meta |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Fd(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Fd(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
char *start, *end; |
char *start, *end; |
Line 1667 parse_mdoc_fname(struct mpage *mpage, const struct rof |
|
Line 1665 parse_mdoc_fname(struct mpage *mpage, const struct rof |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Fn(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Fn(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1684 parse_mdoc_Fn(struct mpage *mpage, const struct mdoc_m |
|
Line 1682 parse_mdoc_Fn(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Fo(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Fo(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1698 parse_mdoc_Fo(struct mpage *mpage, const struct mdoc_m |
|
Line 1696 parse_mdoc_Fo(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Xr(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
char *cp; |
char *cp; |
Line 1718 parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_m |
|
Line 1716 parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Nd(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1728 parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_m |
|
Line 1726 parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Nm(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1750 parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_m |
|
Line 1748 parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_Sh(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_Sh(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1758 parse_mdoc_Sh(struct mpage *mpage, const struct mdoc_m |
|
Line 1756 parse_mdoc_Sh(struct mpage *mpage, const struct mdoc_m |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_head(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_head(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|
Line 1766 parse_mdoc_head(struct mpage *mpage, const struct mdoc |
|
Line 1764 parse_mdoc_head(struct mpage *mpage, const struct mdoc |
|
} |
} |
|
|
static int |
static int |
parse_mdoc_body(struct mpage *mpage, const struct mdoc_meta *meta, |
parse_mdoc_body(struct mpage *mpage, const struct roff_meta *meta, |
const struct roff_node *n) |
const struct roff_node *n) |
{ |
{ |
|
|