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

Diff for /mandoc/mdoc.c between version 1.149 and 1.152

version 1.149, 2010/06/27 15:52:41 version 1.152, 2010/06/29 19:20:38
Line 192  mdoc_free(struct mdoc *mdoc)
Line 192  mdoc_free(struct mdoc *mdoc)
  * Allocate volatile and non-volatile parse resources.   * Allocate volatile and non-volatile parse resources.
  */   */
 struct mdoc *  struct mdoc *
 mdoc_alloc(const struct regset *regs,  mdoc_alloc(struct regset *regs, void *data,
                 void *data, int pflags, mandocmsg msg)                  int pflags, mandocmsg msg)
 {  {
         struct mdoc     *p;          struct mdoc     *p;
   
Line 332  node_append(struct mdoc *mdoc, struct mdoc_node *p)
Line 332  node_append(struct mdoc *mdoc, struct mdoc_node *p)
                 p->parent->tail = p;                  p->parent->tail = p;
                 break;                  break;
         case (MDOC_BODY):          case (MDOC_BODY):
                   if (p->end)
                           break;
                 assert(MDOC_BLOCK == p->parent->type);                  assert(MDOC_BLOCK == p->parent->type);
                 p->parent->body = p;                  p->parent->body = p;
                 break;                  break;
Line 368  node_alloc(struct mdoc *m, int line, int pos, 
Line 370  node_alloc(struct mdoc *m, int line, int pos, 
         p->pos = pos;          p->pos = pos;
         p->tok = tok;          p->tok = tok;
         p->type = type;          p->type = type;
   
           /* Flag analysis. */
   
         if (MDOC_NEWLINE & m->flags)          if (MDOC_NEWLINE & m->flags)
                 p->flags |= MDOC_LINE;                  p->flags |= MDOC_LINE;
         m->flags &= ~MDOC_NEWLINE;          m->flags &= ~MDOC_NEWLINE;
   
           /* Section analysis. */
   
           if (SEC_SYNOPSIS == p->sec)
                   p->flags |= MDOC_SYNPRETTY;
   
           /* Register analysis. */
   
           if (m->regs->regs[(int)REG_nS].set) {
                   if (m->regs->regs[(int)REG_nS].v.u)
                           p->flags |= MDOC_SYNPRETTY;
                   else
                           p->flags &= ~MDOC_SYNPRETTY;
           }
   
         return(p);          return(p);
 }  }
   
Line 413  mdoc_body_alloc(struct mdoc *m, int line, int pos, enu
Line 433  mdoc_body_alloc(struct mdoc *m, int line, int pos, enu
         if ( ! node_append(m, p))          if ( ! node_append(m, p))
                 return(0);                  return(0);
         m->next = MDOC_NEXT_CHILD;          m->next = MDOC_NEXT_CHILD;
           return(1);
   }
   
   
   int
   mdoc_endbody_alloc(struct mdoc *m, int line, int pos, enum mdoct tok,
                   struct mdoc_node *body, enum mdoc_endbody end)
   {
           struct mdoc_node *p;
   
           p = node_alloc(m, line, pos, tok, MDOC_BODY);
           p->pending = body;
           p->end = end;
           if ( ! node_append(m, p))
                   return(0);
           m->next = MDOC_NEXT_SIBLING;
         return(1);          return(1);
 }  }
   

Legend:
Removed from v.1.149  
changed lines
  Added in v.1.152

CVSweb