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

Diff for /mandoc/tbl_data.c between version 1.5 and 1.9

version 1.5, 2011/01/01 17:10:20 version 1.9, 2011/01/02 12:04:23
Line 18 
Line 18 
 #include <ctype.h>  #include <ctype.h>
 #include <stdlib.h>  #include <stdlib.h>
 #include <string.h>  #include <string.h>
   #include <time.h>
   
 #include "mandoc.h"  #include "mandoc.h"
 #include "libmandoc.h"  #include "libmandoc.h"
 #include "libroff.h"  #include "libroff.h"
   
 static  void    data(struct tbl *, struct tbl_span *,  static  void    data(struct tbl_node *, struct tbl_span *,
                         int, const char *, int *);                          int, const char *, int *);
   
 void  void
 data(struct tbl *tbl, struct tbl_span *dp,  data(struct tbl_node *tbl, struct tbl_span *dp,
                 int ln, const char *p, int *pos)                  int ln, const char *p, int *pos)
 {  {
         struct tbl_dat  *dat;          struct tbl_dat  *dat;
Line 51  data(struct tbl *tbl, struct tbl_span *dp, 
Line 52  data(struct tbl *tbl, struct tbl_span *dp, 
         dat = mandoc_calloc(1, sizeof(struct tbl_dat));          dat = mandoc_calloc(1, sizeof(struct tbl_dat));
         dat->layout = cp;          dat->layout = cp;
   
           if (NULL == dat->layout)
                   TBL_MSG(tbl, MANDOCERR_TBLEXTRADAT, ln, *pos);
   
         if (dp->last) {          if (dp->last) {
                 dp->last->next = dat;                  dp->last->next = dat;
                 dp->last = dat;                  dp->last = dat;
Line 58  data(struct tbl *tbl, struct tbl_span *dp, 
Line 62  data(struct tbl *tbl, struct tbl_span *dp, 
                 dp->last = dp->first = dat;                  dp->last = dp->first = dat;
   
         sv = *pos;          sv = *pos;
         while (p[*pos] && p[*pos] != tbl->tab)          while (p[*pos] && p[*pos] != tbl->opts.tab)
                 (*pos)++;                  (*pos)++;
   
         dat->string = mandoc_malloc(*pos - sv + 1);          dat->string = mandoc_malloc(*pos - sv + 1);
Line 81  data(struct tbl *tbl, struct tbl_span *dp, 
Line 85  data(struct tbl *tbl, struct tbl_span *dp, 
 }  }
   
 int  int
 tbl_data(struct tbl *tbl, int ln, const char *p)  tbl_data(struct tbl_node *tbl, int ln, const char *p)
 {  {
         struct tbl_span *dp;          struct tbl_span *dp;
         struct tbl_row  *rp;          struct tbl_row  *rp;
Line 110  tbl_data(struct tbl *tbl, int ln, const char *p)
Line 114  tbl_data(struct tbl *tbl, int ln, const char *p)
                 rp = tbl->first_row;                  rp = tbl->first_row;
   
         dp = mandoc_calloc(1, sizeof(struct tbl_span));          dp = mandoc_calloc(1, sizeof(struct tbl_span));
           dp->tbl = &tbl->opts;
         dp->layout = rp;          dp->layout = rp;
           dp->head = tbl->first_head;
   
         if (tbl->last_span) {          if (tbl->last_span) {
                 tbl->last_span->next = dp;                  tbl->last_span->next = dp;
                 tbl->last_span = dp;                  tbl->last_span = dp;
         } else          } else {
                 tbl->last_span = tbl->first_span = dp;                  tbl->last_span = tbl->first_span = dp;
                   dp->flags |= TBL_SPAN_FIRST;
           }
   
         if ( ! strcmp(p, "_")) {          if ( ! strcmp(p, "_")) {
                 dp->pos = TBL_SPAN_HORIZ;                  dp->pos = TBL_SPAN_HORIZ;

Legend:
Removed from v.1.5  
changed lines
  Added in v.1.9

CVSweb