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

Diff for /mandoc/roff.c between version 1.46 and 1.48

version 1.46, 2008/12/06 19:41:41 version 1.48, 2008/12/07 14:38:57
Line 92  static int     roffparse(struct rofftree *, char *);
Line 92  static int     roffparse(struct rofftree *, char *);
 static  int               textparse(struct rofftree *, char *);  static  int               textparse(struct rofftree *, char *);
 static  int               roffdata(struct rofftree *, int, char *);  static  int               roffdata(struct rofftree *, int, char *);
 static  int               roffspecial(struct rofftree *, int,  static  int               roffspecial(struct rofftree *, int,
                                 const char *, size_t, char **);                                  const char *, const int *,
                                   const char **, size_t, char **);
 static  int               roffsetname(struct rofftree *, char **);  static  int               roffsetname(struct rofftree *, char **);
   
 #ifdef __linux__  #ifdef __linux__
Line 618  roffnode_free(struct rofftree *tree)
Line 619  roffnode_free(struct rofftree *tree)
   
   
 static int  static int
 roffspecial(struct rofftree *tree, int tok,  roffspecial(struct rofftree *tree, int tok, const char *start,
                 const char *start, size_t sz, char **ordp)                  const int *argc, const char **argv,
                   size_t sz, char **ordp)
 {  {
   
         switch (tok) {          switch (tok) {
Line 651  roffspecial(struct rofftree *tree, int tok, 
Line 653  roffspecial(struct rofftree *tree, int tok, 
                         return(0);                          return(0);
                 break;                  break;
   
           case (ROFF_Rv):
                   /* FALLTHROUGH*/
         case (ROFF_Sx):          case (ROFF_Sx):
                 /* FALLTHROUGH*/                  /* FALLTHROUGH*/
         case (ROFF_Ex):          case (ROFF_Ex):
                 if (1 != sz) {                  if (1 == sz)
                         roff_err(tree, start, "`%s' expects one arg",                          break;
                                         toknames[tok]);                  roff_err(tree, start, "`%s' expects one arg",
                         return(0);                                  toknames[tok]);
                 }                  return(0);
                 break;  
   
         case (ROFF_Sm):          case (ROFF_Sm):
                 if (1 != sz) {                  if (1 != sz) {
Line 689  roffspecial(struct rofftree *tree, int tok, 
Line 692  roffspecial(struct rofftree *tree, int tok, 
                 break;                  break;
         }          }
   
         return((*tree->cb.roffspecial)          return((*tree->cb.roffspecial)(tree->arg, tok,
                         (tree->arg, tok, tree->cur, ordp));                                  tree->cur, argc, argv, ordp));
 }  }
   
   
Line 987  roff_Ns(ROFFCALL_ARGS)
Line 990  roff_Ns(ROFFCALL_ARGS)
         first = (*argv++ == tree->cur);          first = (*argv++ == tree->cur);
         morep[0] = NULL;          morep[0] = NULL;
   
         if ( ! roffspecial(tree, tok, *argv, 0, morep))          if ( ! roffspecial(tree, tok, *argv, NULL, NULL, 0, morep))
                 return(0);                  return(0);
   
         while (*argv) {          while (*argv) {
Line 1199  roff_ordered(ROFFCALL_ARGS) 
Line 1202  roff_ordered(ROFFCALL_ARGS) 
                 return(0);                  return(0);
   
         if (NULL == *argv)          if (NULL == *argv)
                 return(roffspecial(tree, tok, p, 0, ordp));                  return(roffspecial(tree, tok, p, argcp,
                                           (const char **)argvp, 0, ordp));
   
         i = 0;          i = 0;
         while (*argv && i < ROFF_MAXLINEARG) {          while (*argv && i < ROFF_MAXLINEARG) {
Line 1215  roff_ordered(ROFFCALL_ARGS) 
Line 1219  roff_ordered(ROFFCALL_ARGS) 
                 if (ROFF_MAX == c)                  if (ROFF_MAX == c)
                         break;                          break;
   
                 if ( ! roffspecial(tree, tok, p, (size_t)i, ordp))                  if ( ! roffspecial(tree, tok, p, argcp,
                                           (const char **)argvp,
                                           (size_t)i, ordp))
                         return(0);                          return(0);
   
                 return(roffcall(tree, c, argv));                  return(roffcall(tree, c, argv));
Line 1224  roff_ordered(ROFFCALL_ARGS) 
Line 1230  roff_ordered(ROFFCALL_ARGS) 
         assert(i != ROFF_MAXLINEARG);          assert(i != ROFF_MAXLINEARG);
         ordp[i] = NULL;          ordp[i] = NULL;
   
         if ( ! roffspecial(tree, tok, p, (size_t)i, ordp))          if ( ! roffspecial(tree, tok, p, argcp,
                                   (const char**)argvp,
                                   (size_t)i, ordp))
                 return(0);                  return(0);
   
         /* FIXME: error if there's stuff after the punctuation. */          /* FIXME: error if there's stuff after the punctuation. */

Legend:
Removed from v.1.46  
changed lines
  Added in v.1.48

CVSweb