version 1.21, 2009/08/13 12:31:50 |
version 1.22, 2009/08/13 12:54:52 |
Line 66 static int pre_sp(DECL_ARGS); |
|
Line 66 static int pre_sp(DECL_ARGS); |
|
|
|
static void post_B(DECL_ARGS); |
static void post_B(DECL_ARGS); |
static void post_I(DECL_ARGS); |
static void post_I(DECL_ARGS); |
|
static void post_IP(DECL_ARGS); |
static void post_HP(DECL_ARGS); |
static void post_HP(DECL_ARGS); |
static void post_SH(DECL_ARGS); |
static void post_SH(DECL_ARGS); |
static void post_SS(DECL_ARGS); |
static void post_SS(DECL_ARGS); |
Line 81 static const struct termact termacts[MAN_MAX] = { |
|
Line 82 static const struct termact termacts[MAN_MAX] = { |
|
{ pre_PP, NULL }, /* LP */ |
{ pre_PP, NULL }, /* LP */ |
{ pre_PP, NULL }, /* PP */ |
{ pre_PP, NULL }, /* PP */ |
{ pre_PP, NULL }, /* P */ |
{ pre_PP, NULL }, /* P */ |
{ pre_IP, NULL }, /* IP */ |
{ pre_IP, post_IP }, /* IP */ |
{ pre_HP, post_HP }, /* HP */ |
{ pre_HP, post_HP }, /* HP */ |
{ NULL, NULL }, /* SM */ |
{ NULL, NULL }, /* SM */ |
{ pre_B, post_B }, /* SB */ |
{ pre_B, post_B }, /* SB */ |
Line 468 pre_PP(DECL_ARGS) |
|
Line 469 pre_PP(DECL_ARGS) |
|
static int |
static int |
pre_IP(DECL_ARGS) |
pre_IP(DECL_ARGS) |
{ |
{ |
/* TODO */ |
const struct man_node *nn; |
#if 0 |
size_t len; |
const struct man_node *nn; |
int ival; |
size_t offs, sv; |
|
int ival; |
|
|
|
fmt_block_vspace(p, n); |
switch (n->type) { |
|
case (MAN_BLOCK): |
p->flags |= TERMP_NOSPACE; |
fmt_block_vspace(p, n); |
|
|
sv = p->offset; |
|
p->offset = INDENT; |
|
|
|
if (NULL == n->child) |
|
return(1); |
return(1); |
|
case (MAN_BODY): |
|
p->flags |= TERMP_NOLPAD; |
|
p->flags |= TERMP_NOSPACE; |
|
break; |
|
case (MAN_HEAD): |
|
p->flags |= TERMP_NOBREAK; |
|
p->flags |= TERMP_TWOSPACE; |
|
break; |
|
default: |
|
return(1); |
|
} |
|
|
p->flags |= TERMP_NOBREAK; |
len = INDENT * 2; |
|
ival = -1; |
|
|
offs = sv; |
/* Calculate offset. */ |
|
|
/* |
if (NULL != (nn = n->parent->head->child)) |
* If the last token is number-looking (3m, 3n, 3) then |
if (NULL != (nn = nn->next)) { |
* interpret it as the width specifier, else we stick with the |
for ( ; nn->next; nn = nn->next) |
* prior saved offset. XXX - obviously not documented. |
/* Do nothing. */ ; |
*/ |
if ((ival = arg_width(nn)) >= 0) |
for (nn = n->child; nn; nn = nn->next) { |
len = (size_t)ival; |
if (NULL == nn->next) { |
|
ival = arg_width(nn); |
|
if (ival >= 0) { |
|
offs = (size_t)ival; |
|
break; |
|
} |
|
} |
} |
print_node(p, fl, nn, m); |
|
} |
|
|
|
p->rmargin = p->offset + offs; |
switch (n->type) { |
|
case (MAN_BODY): |
|
p->offset = INDENT + len; |
|
p->rmargin = p->maxrmargin; |
|
break; |
|
case (MAN_HEAD): |
|
p->offset = INDENT; |
|
p->rmargin = INDENT + len; |
|
if (ival < 0) |
|
break; |
|
|
term_flushln(p); |
/* Don't print the length value. */ |
|
for (nn = n->child; nn->next; nn = nn->next) |
|
print_node(p, fl, nn, m); |
|
return(0); |
|
default: |
|
break; |
|
} |
|
|
p->offset = offs; |
return(1); |
p->rmargin = p->maxrmargin; |
} |
|
|
p->flags |= TERMP_NOLPAD | TERMP_NOSPACE; |
|
|
|
return(0); |
/* ARGSUSED */ |
#endif |
static void |
return(1); |
post_IP(DECL_ARGS) |
|
{ |
|
|
|
switch (n->type) { |
|
case (MAN_HEAD): |
|
term_flushln(p); |
|
p->flags &= ~TERMP_NOBREAK; |
|
p->flags &= ~TERMP_TWOSPACE; |
|
p->rmargin = p->maxrmargin; |
|
break; |
|
case (MAN_BODY): |
|
term_flushln(p); |
|
p->flags &= ~TERMP_NOLPAD; |
|
break; |
|
default: |
|
break; |
|
} |
} |
} |
|
|
|
|
Line 613 post_SS(DECL_ARGS) |
|
Line 641 post_SS(DECL_ARGS) |
|
static int |
static int |
pre_SH(DECL_ARGS) |
pre_SH(DECL_ARGS) |
{ |
{ |
/* |
|
* XXX: undocumented: using two `SH' macros in sequence has no |
|
* vspace between calls, only a newline. |
|
*/ |
|
switch (n->type) { |
switch (n->type) { |
case (MAN_BLOCK): |
case (MAN_BLOCK): |
|
/* If following a prior empty `SH', no vspace. */ |
if (n->prev && MAN_SH == n->prev->tok) |
if (n->prev && MAN_SH == n->prev->tok) |
if (NULL == n->prev->body->child) |
if (NULL == n->prev->body->child) |
break; |
break; |