[BACK]Return to mdoc_term.c CVS log [TXT][DIR] Up to [cvsweb.bsd.lv] / mandoc

Diff for /mandoc/mdoc_term.c between version 1.118 and 1.124

version 1.118, 2010/05/09 16:05:13 version 1.124, 2010/05/15 16:24:38
Line 273  terminal_mdoc(void *arg, const struct mdoc *mdoc)
Line 273  terminal_mdoc(void *arg, const struct mdoc *mdoc)
         p = (struct termp *)arg;          p = (struct termp *)arg;
   
         p->overstep = 0;          p->overstep = 0;
         p->maxrmargin = 78;          p->maxrmargin = p->defrmargin;
   
         if (NULL == p->symtab)          if (NULL == p->symtab)
                 switch (p->enc) {                  switch (p->enc) {
Line 337  print_mdoc_node(DECL_ARGS)
Line 337  print_mdoc_node(DECL_ARGS)
                 if (termacts[n->tok].post)                  if (termacts[n->tok].post)
                         (*termacts[n->tok].post)(p, &npair, m, n);                          (*termacts[n->tok].post)(p, &npair, m, n);
   
           if (MDOC_EOS & n->flags)
                   p->flags |= TERMP_SENTENCE;
   
         p->offset = offset;          p->offset = offset;
         p->rmargin = rmargin;          p->rmargin = rmargin;
 }  }
Line 422  print_mdoc_head(DECL_ARGS)
Line 425  print_mdoc_head(DECL_ARGS)
                 strlcat(buf, ")", BUFSIZ);                  strlcat(buf, ")", BUFSIZ);
         }          }
   
         snprintf(title, BUFSIZ, "%s(%d)", m->title, m->msec);          snprintf(title, BUFSIZ, "%s(%s)", m->title, m->msec);
   
         p->offset = 0;          p->offset = 0;
         p->rmargin = (p->maxrmargin - strlen(buf) + 1) / 2;          p->rmargin = (p->maxrmargin - strlen(buf) + 1) / 2;
Line 1082  static int
Line 1085  static int
 termp_nm_pre(DECL_ARGS)  termp_nm_pre(DECL_ARGS)
 {  {
   
         if (SEC_SYNOPSIS == n->sec)          if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
                 term_newln(p);                  term_newln(p);
   
         term_fontpush(p, TERMFONT_BOLD);          term_fontpush(p, TERMFONT_BOLD);
Line 1381  static void
Line 1384  static void
 termp_fd_post(DECL_ARGS)  termp_fd_post(DECL_ARGS)
 {  {
   
         if (n->sec != SEC_SYNOPSIS)          if (n->sec != SEC_SYNOPSIS || ! (MDOC_LINE & n->flags))
                 return;                  return;
   
         term_newln(p);          term_newln(p);
Line 1468  static void
Line 1471  static void
 termp_lb_post(DECL_ARGS)  termp_lb_post(DECL_ARGS)
 {  {
   
         if (SEC_LIBRARY == n->sec)          if (SEC_LIBRARY == n->sec && MDOC_LINE & n->flags)
                 term_newln(p);                  term_newln(p);
 }  }
   
Line 1537  static int
Line 1540  static int
 termp_ft_pre(DECL_ARGS)  termp_ft_pre(DECL_ARGS)
 {  {
   
         if (SEC_SYNOPSIS == n->sec)          if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
                 if (n->prev && MDOC_Fo == n->prev->tok)                  if (n->prev && MDOC_Fo == n->prev->tok)
                         term_vspace(p);                          term_vspace(p);
   
Line 1551  static void
Line 1554  static void
 termp_ft_post(DECL_ARGS)  termp_ft_post(DECL_ARGS)
 {  {
   
         if (SEC_SYNOPSIS == n->sec)          if (SEC_SYNOPSIS == n->sec && MDOC_LINE & n->flags)
                 term_newln(p);                  term_newln(p);
 }  }
   
Line 1592  static void
Line 1595  static void
 termp_fn_post(DECL_ARGS)  termp_fn_post(DECL_ARGS)
 {  {
   
         if (n->sec == SEC_SYNOPSIS && n->next)          if (n->sec == SEC_SYNOPSIS && n->next && MDOC_LINE & n->flags)
                 term_vspace(p);                  term_vspace(p);
 }  }
   
Line 1629  static int
Line 1632  static int
 termp_bd_pre(DECL_ARGS)  termp_bd_pre(DECL_ARGS)
 {  {
         int                      i, type;          int                      i, type;
         size_t                   sv;          size_t                   rm, rmax;
         const struct mdoc_node  *nn;          const struct mdoc_node  *nn;
   
         if (MDOC_BLOCK == n->type) {          if (MDOC_BLOCK == n->type) {
Line 1657  termp_bd_pre(DECL_ARGS)
Line 1660  termp_bd_pre(DECL_ARGS)
         if (MDOC_Literal != type && MDOC_Unfilled != type)          if (MDOC_Literal != type && MDOC_Unfilled != type)
                 return(1);                  return(1);
   
         sv = p->rmargin;          rm = p->rmargin;
         p->rmargin = 100000; /* FIXME */          rmax = p->maxrmargin;
           p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
   
         for (nn = n->child; nn; nn = nn->next) {          for (nn = n->child; nn; nn = nn->next) {
                 p->flags |= TERMP_NOSPACE;                  p->flags |= TERMP_NOSPACE;
Line 1671  termp_bd_pre(DECL_ARGS)
Line 1675  termp_bd_pre(DECL_ARGS)
                         term_flushln(p);                          term_flushln(p);
         }          }
   
         p->rmargin = sv;          p->rmargin = rm;
           p->maxrmargin = rmax;
         return(0);          return(0);
 }  }
   
Line 1681  static void
Line 1686  static void
 termp_bd_post(DECL_ARGS)  termp_bd_post(DECL_ARGS)
 {  {
         int              type;          int              type;
         size_t           sv;          size_t           rm, rmax;
   
         if (MDOC_BODY != n->type)          if (MDOC_BODY != n->type)
                 return;                  return;
Line 1689  termp_bd_post(DECL_ARGS)
Line 1694  termp_bd_post(DECL_ARGS)
         type = arg_disptype(n->parent);          type = arg_disptype(n->parent);
         assert(-1 != type);          assert(-1 != type);
   
         sv = p->rmargin;          rm = p->rmargin;
           rmax = p->maxrmargin;
   
         if (MDOC_Literal == type || MDOC_Unfilled == type)          if (MDOC_Literal == type || MDOC_Unfilled == type)
                 p->rmargin = 100000; /* FIXME */                  p->rmargin = p->maxrmargin = TERM_MAXMARGIN;
   
         p->flags |= TERMP_NOSPACE;          p->flags |= TERMP_NOSPACE;
         term_flushln(p);          term_flushln(p);
   
         p->rmargin = sv;          p->rmargin = rm;
           p->maxrmargin = rmax;
 }  }
   
   
Line 1887  termp_in_post(DECL_ARGS)
Line 1894  termp_in_post(DECL_ARGS)
         term_word(p, ">");          term_word(p, ">");
         term_fontpop(p);          term_fontpop(p);
   
         if (SEC_SYNOPSIS != n->sec)          if (SEC_SYNOPSIS != n->sec && ! (MDOC_LINE & n->flags))
                 return;                  return;
   
         term_newln(p);          term_newln(p);

Legend:
Removed from v.1.118  
changed lines
  Added in v.1.124

CVSweb