[BACK]Return to mdoc.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / mandoc

Diff for /src/usr.bin/mandoc/mdoc.c between version 1.137 and 1.138

version 1.137, 2015/04/19 13:59:37 version 1.138, 2015/04/19 14:25:05
Line 94 
Line 94 
         mdoc_macroend(mdoc);          mdoc_macroend(mdoc);
 }  }
   
 void  
 mdoc_addeqn(struct roff_man *mdoc, const struct eqn *ep)  
 {  
         struct roff_node *n;  
   
         n = roff_node_alloc(mdoc, ep->ln, ep->pos, ROFFT_EQN, TOKEN_NONE);  
         n->eqn = ep;  
         if (ep->ln > mdoc->last->line)  
                 n->flags |= MDOC_LINE;  
         roff_node_append(mdoc, n);  
         mdoc->next = ROFF_NEXT_SIBLING;  
 }  
   
 void  
 mdoc_addspan(struct roff_man *mdoc, const struct tbl_span *sp)  
 {  
         struct roff_node *n;  
   
         n = roff_node_alloc(mdoc, sp->line, 0, ROFFT_TBL, TOKEN_NONE);  
         n->span = sp;  
         roff_node_append(mdoc, n);  
         mdoc_valid_post(mdoc);  
         mdoc->next = ROFF_NEXT_SIBLING;  
 }  
   
 /*  /*
  * Main parse routine.  Parses a single line -- really just hands off to   * Main parse routine.  Parses a single line -- really just hands off to
  * the macro (mdoc_pmacro()) or text parser (mdoc_ptext()).   * the macro (mdoc_pmacro()) or text parser (mdoc_ptext()).
Line 253 
Line 228 
 }  }
   
 void  void
 mdoc_word_alloc(struct roff_man *mdoc, int line, int pos, const char *p)  
 {  
         struct roff_node *n;  
   
         n = roff_node_alloc(mdoc, line, pos, ROFFT_TEXT, TOKEN_NONE);  
         n->string = roff_strdup(mdoc->roff, p);  
         roff_node_append(mdoc, n);  
         mdoc_valid_post(mdoc);  
         mdoc->next = ROFF_NEXT_SIBLING;  
 }  
   
 void  
 mdoc_word_append(struct roff_man *mdoc, const char *p)  
 {  
         struct roff_node        *n;  
         char                    *addstr, *newstr;  
   
         n = mdoc->last;  
         addstr = roff_strdup(mdoc->roff, p);  
         mandoc_asprintf(&newstr, "%s %s", n->string, addstr);  
         free(addstr);  
         free(n->string);  
         n->string = newstr;  
         mdoc->next = ROFF_NEXT_SIBLING;  
 }  
   
 void  
 mdoc_node_relink(struct roff_man *mdoc, struct roff_node *p)  mdoc_node_relink(struct roff_man *mdoc, struct roff_node *p)
 {  {
   
Line 385 
Line 333 
                 return(1);                  return(1);
         }          }
   
         mdoc_word_alloc(mdoc, line, offs, buf+offs);          roff_word_alloc(mdoc, line, offs, buf+offs);
   
         if (mdoc->flags & MDOC_LITERAL)          if (mdoc->flags & MDOC_LITERAL)
                 return(1);                  return(1);

Legend:
Removed from v.1.137  
changed lines
  Added in v.1.138