version 1.86, 2015/02/11 14:15:12 |
version 1.87, 2015/02/12 12:24:33 |
|
|
#include "mdoc.h" |
#include "mdoc.h" |
#include "main.h" |
#include "main.h" |
|
|
#define DECL_ARGS const struct mdoc_meta *meta, \ |
#define DECL_ARGS const struct mdoc_meta *meta, struct mdoc_node *n |
const struct mdoc_node *n |
|
|
|
struct manact { |
struct manact { |
int (*cond)(DECL_ARGS); /* DON'T run actions */ |
int (*cond)(DECL_ARGS); /* DON'T run actions */ |
|
|
man_mdoc(void *arg, const struct mdoc *mdoc) |
man_mdoc(void *arg, const struct mdoc *mdoc) |
{ |
{ |
const struct mdoc_meta *meta; |
const struct mdoc_meta *meta; |
const struct mdoc_node *n; |
struct mdoc_node *n; |
|
|
meta = mdoc_meta(mdoc); |
meta = mdoc_meta(mdoc); |
n = mdoc_node(mdoc); |
n = mdoc_node(mdoc)->child; |
|
|
printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", |
printf(".TH \"%s\" \"%s\" \"%s\" \"%s\" \"%s\"\n", |
meta->title, |
meta->title, |
Line 567 man_mdoc(void *arg, const struct mdoc *mdoc) |
|
Line 566 man_mdoc(void *arg, const struct mdoc *mdoc) |
|
fontqueue.head = fontqueue.tail = mandoc_malloc(8); |
fontqueue.head = fontqueue.tail = mandoc_malloc(8); |
*fontqueue.tail = 'R'; |
*fontqueue.tail = 'R'; |
} |
} |
print_node(meta, n); |
while (n != NULL) { |
|
print_node(meta, n); |
|
n = n->next; |
|
} |
putchar('\n'); |
putchar('\n'); |
} |
} |
|
|
static void |
static void |
print_node(DECL_ARGS) |
print_node(DECL_ARGS) |
{ |
{ |
const struct mdoc_node *sub; |
|
const struct manact *act; |
const struct manact *act; |
|
struct mdoc_node *sub; |
int cond, do_sub; |
int cond, do_sub; |
|
|
/* |
/* |
Line 588 print_node(DECL_ARGS) |
|
Line 590 print_node(DECL_ARGS) |
|
act = NULL; |
act = NULL; |
cond = 0; |
cond = 0; |
do_sub = 1; |
do_sub = 1; |
|
n->flags &= ~MDOC_ENDED; |
|
|
if (MDOC_TEXT == n->type) { |
if (MDOC_TEXT == n->type) { |
/* |
/* |
Line 635 print_node(DECL_ARGS) |
|
Line 638 print_node(DECL_ARGS) |
|
(*act->post)(meta, n); |
(*act->post)(meta, n); |
|
|
if (ENDBODY_NOT != n->end) |
if (ENDBODY_NOT != n->end) |
n->pending->flags |= MDOC_ENDED; |
n->body->flags |= MDOC_ENDED; |
|
|
if (ENDBODY_NOSPACE == n->end) |
if (ENDBODY_NOSPACE == n->end) |
outflags &= ~(MMAN_spc | MMAN_nl); |
outflags &= ~(MMAN_spc | MMAN_nl); |