version 1.309, 2018/06/25 16:54:59 |
version 1.311, 2018/08/17 20:33:37 |
|
|
#include "html.h" |
#include "html.h" |
#include "main.h" |
#include "main.h" |
|
|
#define INDENT 5 |
|
|
|
#define MDOC_ARGS const struct roff_meta *meta, \ |
#define MDOC_ARGS const struct roff_meta *meta, \ |
struct roff_node *n, \ |
struct roff_node *n, \ |
struct html *h |
struct html *h |
|
|
#define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b)) |
#define MIN(a,b) ((/*CONSTCOND*/(a)<(b))?(a):(b)) |
#endif |
#endif |
|
|
struct htmlmdoc { |
struct mdoc_html_act { |
int (*pre)(MDOC_ARGS); |
int (*pre)(MDOC_ARGS); |
void (*post)(MDOC_ARGS); |
void (*post)(MDOC_ARGS); |
}; |
}; |
Line 121 static int mdoc_vt_pre(MDOC_ARGS); |
|
Line 119 static int mdoc_vt_pre(MDOC_ARGS); |
|
static int mdoc_xr_pre(MDOC_ARGS); |
static int mdoc_xr_pre(MDOC_ARGS); |
static int mdoc_xx_pre(MDOC_ARGS); |
static int mdoc_xx_pre(MDOC_ARGS); |
|
|
static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_Dd] = { |
static const struct mdoc_html_act mdoc_html_acts[MDOC_MAX - MDOC_Dd] = { |
{NULL, NULL}, /* Dd */ |
{NULL, NULL}, /* Dd */ |
{NULL, NULL}, /* Dt */ |
{NULL, NULL}, /* Dt */ |
{NULL, NULL}, /* Os */ |
{NULL, NULL}, /* Os */ |
Line 243 static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_D |
|
Line 241 static const struct htmlmdoc __mdocs[MDOC_MAX - MDOC_D |
|
{mdoc__x_pre, mdoc__x_post}, /* %U */ |
{mdoc__x_pre, mdoc__x_post}, /* %U */ |
{NULL, NULL}, /* Ta */ |
{NULL, NULL}, /* Ta */ |
}; |
}; |
static const struct htmlmdoc *const mdocs = __mdocs - MDOC_Dd; |
|
|
|
|
|
/* |
/* |
Line 404 print_mdoc_node(MDOC_ARGS) |
|
Line 401 print_mdoc_node(MDOC_ARGS) |
|
break; |
break; |
} |
} |
assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); |
assert(n->tok >= MDOC_Dd && n->tok < MDOC_MAX); |
if (mdocs[n->tok].pre != NULL && |
if (mdoc_html_acts[n->tok - MDOC_Dd].pre != NULL && |
(n->end == ENDBODY_NOT || n->child != NULL)) |
(n->end == ENDBODY_NOT || n->child != NULL)) |
child = (*mdocs[n->tok].pre)(meta, n, h); |
child = (*mdoc_html_acts[n->tok - MDOC_Dd].pre)(meta, |
|
n, h); |
break; |
break; |
} |
} |
|
|
Line 425 print_mdoc_node(MDOC_ARGS) |
|
Line 423 print_mdoc_node(MDOC_ARGS) |
|
break; |
break; |
default: |
default: |
if (n->tok < ROFF_MAX || |
if (n->tok < ROFF_MAX || |
mdocs[n->tok].post == NULL || |
mdoc_html_acts[n->tok - MDOC_Dd].post == NULL || |
n->flags & NODE_ENDED) |
n->flags & NODE_ENDED) |
break; |
break; |
(*mdocs[n->tok].post)(meta, n, h); |
(*mdoc_html_acts[n->tok - MDOC_Dd].post)(meta, n, h); |
if (n->end != ENDBODY_NOT) |
if (n->end != ENDBODY_NOT) |
n->body->flags |= NODE_ENDED; |
n->body->flags |= NODE_ENDED; |
break; |
break; |