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

Diff for /mandoc/mdoc.c between version 1.225 and 1.226

version 1.225, 2014/09/06 23:24:32 version 1.226, 2014/10/16 01:11:20
Line 91  static struct mdoc_node *node_alloc(struct mdoc *, int
Line 91  static struct mdoc_node *node_alloc(struct mdoc *, int
                                 enum mdoct, enum mdoc_type);                                  enum mdoct, enum mdoc_type);
 static  int               node_append(struct mdoc *,  static  int               node_append(struct mdoc *,
                                 struct mdoc_node *);                                  struct mdoc_node *);
 #if 0  
 static  int               mdoc_preptext(struct mdoc *, int, char *, int);  
 #endif  
 static  int               mdoc_ptext(struct mdoc *, int, char *, int);  static  int               mdoc_ptext(struct mdoc *, int, char *, int);
 static  int               mdoc_pmacro(struct mdoc *, int, char *, int);  static  int               mdoc_pmacro(struct mdoc *, int, char *, int);
   
Line 608  mdoc_node_relink(struct mdoc *mdoc, struct mdoc_node *
Line 605  mdoc_node_relink(struct mdoc *mdoc, struct mdoc_node *
         mdoc_node_unlink(mdoc, p);          mdoc_node_unlink(mdoc, p);
         return(node_append(mdoc, p));          return(node_append(mdoc, p));
 }  }
   
 #if 0  
 /*  
  * Pre-treat a text line.  
  * Text lines can consist of equations, which must be handled apart from  
  * the regular text.  
  * Thus, use this function to step through a line checking if it has any  
  * equations embedded in it.  
  * This must handle multiple equations AND equations that do not end at  
  * the end-of-line, i.e., will re-enter in the next roff parse.  
  */  
 static int  
 mdoc_preptext(struct mdoc *mdoc, int line, char *buf, int offs)  
 {  
         char            *start, *end;  
         char             delim;  
   
         while ('\0' != buf[offs]) {  
                 /* Mark starting position if eqn is set. */  
                 start = NULL;  
                 if ('\0' != (delim = roff_eqndelim(mdoc->roff)))  
                         if (NULL != (start = strchr(buf + offs, delim)))  
                                 *start++ = '\0';  
   
                 /* Parse text as normal. */  
                 if ( ! mdoc_ptext(mdoc, line, buf, offs))  
                         return(0);  
   
                 /* Continue only if an equation exists. */  
                 if (NULL == start)  
                         break;  
   
                 /* Read past the end of the equation. */  
                 offs += start - (buf + offs);  
                 assert(start == &buf[offs]);  
                 if (NULL != (end = strchr(buf + offs, delim))) {  
                         *end++ = '\0';  
                         while (' ' == *end)  
                                 end++;  
                 }  
   
                 /* Parse the equation itself. */  
                 roff_openeqn(mdoc->roff, NULL, line, offs, buf);  
   
                 /* Process a finished equation? */  
                 if (roff_closeeqn(mdoc->roff))  
                         if ( ! mdoc_addeqn(mdoc, roff_eqn(mdoc->roff)))  
                                 return(0);  
                 offs += (end - (buf + offs));  
         }  
   
         return(1);  
 }  
 #endif  
   
 /*  /*
  * Parse free-form text, that is, a line that does not begin with the   * Parse free-form text, that is, a line that does not begin with the

Legend:
Removed from v.1.225  
changed lines
  Added in v.1.226

CVSweb