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

Diff for /mandoc/main.c between version 1.230 and 1.235

version 1.230, 2015/03/27 21:33:20 version 1.235, 2015/04/18 16:34:25
Line 34 
Line 34 
 #include <string.h>  #include <string.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "mandoc.h"  
 #include "mandoc_aux.h"  #include "mandoc_aux.h"
 #include "main.h"  #include "mandoc.h"
   #include "roff.h"
 #include "mdoc.h"  #include "mdoc.h"
 #include "man.h"  #include "man.h"
   #include "main.h"
 #include "manconf.h"  #include "manconf.h"
 #include "mansearch.h"  #include "mansearch.h"
   
Line 57  enum outmode {
Line 58  enum outmode {
         OUTMODE_ONE          OUTMODE_ONE
 };  };
   
 typedef void            (*out_mdoc)(void *, const struct mdoc *);  typedef void            (*out_mdoc)(void *, const struct roff_man *);
 typedef void            (*out_man)(void *, const struct man *);  typedef void            (*out_man)(void *, const struct roff_man *);
 typedef void            (*out_free)(void *);  typedef void            (*out_free)(void *);
   
 enum    outt {  enum    outt {
Line 575  fs_lookup(const struct manpaths *paths, size_t ipath,
Line 576  fs_lookup(const struct manpaths *paths, size_t ipath,
   
 found:  found:
 #if HAVE_SQLITE3  #if HAVE_SQLITE3
         fprintf(stderr, "%s: outdated mandoc.db lacks %s(%s) entry,\n"          fprintf(stderr, "%s: outdated mandoc.db lacks %s(%s) entry, run "
             "     consider running  # makewhatis %s\n",              "makewhatis %s\n", progname, name, sec, paths->paths[ipath]);
             progname, name, sec, paths->paths[ipath]);  
 #endif  #endif
   
         *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage));          *res = mandoc_reallocarray(*res, ++*ressz, sizeof(struct manpage));
         page = *res + (*ressz - 1);          page = *res + (*ressz - 1);
         page->file = file;          page->file = file;
Line 633  static void
Line 632  static void
 parse(struct curparse *curp, int fd, const char *file)  parse(struct curparse *curp, int fd, const char *file)
 {  {
         enum mandoclevel  rctmp;          enum mandoclevel  rctmp;
         struct mdoc      *mdoc;          struct roff_man  *man;
         struct man       *man;  
   
         /* Begin by parsing the file itself. */          /* Begin by parsing the file itself. */
   
Line 721  parse(struct curparse *curp, int fd, const char *file)
Line 719  parse(struct curparse *curp, int fd, const char *file)
                 }                  }
         }          }
   
         mparse_result(curp->mp, &mdoc, &man, NULL);          mparse_result(curp->mp, &man, NULL);
   
         /* Execute the out device, if it exists. */          /* Execute the out device, if it exists. */
   
         if (man && curp->outman)          if (man == NULL)
                   return;
           if (curp->outmdoc != NULL && man->macroset == MACROSET_MDOC)
                   (*curp->outmdoc)(curp->outdata, man);
           if (curp->outman != NULL && man->macroset == MACROSET_MAN)
                 (*curp->outman)(curp->outdata, man);                  (*curp->outman)(curp->outdata, man);
         if (mdoc && curp->outmdoc)  
                 (*curp->outmdoc)(curp->outdata, mdoc);  
 }  }
   
 static void  static void
Line 996  spawn_pager(void)
Line 996  spawn_pager(void)
         if (pager == NULL || *pager == '\0')          if (pager == NULL || *pager == '\0')
                 pager = getenv("PAGER");                  pager = getenv("PAGER");
         if (pager == NULL || *pager == '\0')          if (pager == NULL || *pager == '\0')
                 pager = "/usr/bin/more -s";                  pager = "more -s";
         cp = mandoc_strdup(pager);          cp = mandoc_strdup(pager);
   
         /*          /*

Legend:
Removed from v.1.230  
changed lines
  Added in v.1.235

CVSweb