version 1.164, 2014/12/24 09:58:35 |
version 1.165, 2014/12/24 18:04:10 |
|
|
|
|
#define DECL_ARGS struct termp *p, \ |
#define DECL_ARGS struct termp *p, \ |
struct mtermp *mt, \ |
struct mtermp *mt, \ |
const struct man_node *n, \ |
struct man_node *n, \ |
const struct man_meta *meta |
const struct man_meta *meta |
|
|
struct termact { |
struct termact { |
|
|
pre_alternate(DECL_ARGS) |
pre_alternate(DECL_ARGS) |
{ |
{ |
enum termfont font[2]; |
enum termfont font[2]; |
const struct man_node *nn; |
struct man_node *nn; |
int savelit, i; |
int savelit, i; |
|
|
switch (n->tok) { |
switch (n->tok) { |
|
|
pre_TP(DECL_ARGS) |
pre_TP(DECL_ARGS) |
{ |
{ |
struct roffsu su; |
struct roffsu su; |
const struct man_node *nn; |
struct man_node *nn; |
int len, savelit; |
int len, savelit; |
|
|
switch (n->type) { |
switch (n->type) { |
|
|
pre_RS(DECL_ARGS) |
pre_RS(DECL_ARGS) |
{ |
{ |
struct roffsu su; |
struct roffsu su; |
int len; |
|
|
|
switch (n->type) { |
switch (n->type) { |
case MAN_BLOCK: |
case MAN_BLOCK: |
Line 852 pre_RS(DECL_ARGS) |
|
Line 851 pre_RS(DECL_ARGS) |
|
break; |
break; |
} |
} |
|
|
len = SHRT_MAX + 1; |
n = n->parent->head; |
if ((n = n->parent->head->child) != NULL && |
n->aux = SHRT_MAX + 1; |
a2roffsu(n->string, &su, SCALE_EN)) |
if (n->child != NULL && a2roffsu(n->child->string, &su, SCALE_EN)) |
len = term_hspan(p, &su); |
n->aux = term_hspan(p, &su); |
if (len > SHRT_MAX) |
if (n->aux < 0 && (size_t)(-n->aux) > mt->offset) |
len = term_len(p, p->defindent); |
n->aux = -mt->offset; |
|
else if (n->aux > SHRT_MAX) |
|
n->aux = term_len(p, p->defindent); |
|
|
if (len > 0 || (size_t)(-len) < mt->offset) |
mt->offset += n->aux; |
mt->offset += len; |
|
else |
|
mt->offset = 0; |
|
p->offset = mt->offset; |
p->offset = mt->offset; |
p->rmargin = p->maxrmargin; |
p->rmargin = p->maxrmargin; |
|
|
Line 876 pre_RS(DECL_ARGS) |
|
Line 874 pre_RS(DECL_ARGS) |
|
static void |
static void |
post_RS(DECL_ARGS) |
post_RS(DECL_ARGS) |
{ |
{ |
struct roffsu su; |
|
int len; |
|
|
|
switch (n->type) { |
switch (n->type) { |
case MAN_BLOCK: |
case MAN_BLOCK: |
Line 889 post_RS(DECL_ARGS) |
|
Line 885 post_RS(DECL_ARGS) |
|
break; |
break; |
} |
} |
|
|
len = SHRT_MAX + 1; |
mt->offset -= n->parent->head->aux; |
if ((n = n->parent->head->child) != NULL && |
|
a2roffsu(n->string, &su, SCALE_EN)) |
|
len = term_hspan(p, &su); |
|
if (len > SHRT_MAX) |
|
len = term_len(p, p->defindent); |
|
|
|
if (len < 0 || (size_t)len < mt->offset) |
|
mt->offset -= len; |
|
else |
|
mt->offset = 0; |
|
p->offset = mt->offset; |
p->offset = mt->offset; |
|
|
if (--mt->lmarginsz < MAXMARGINS) |
if (--mt->lmarginsz < MAXMARGINS) |