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

Diff for /mandoc/mandocdb.c between version 1.15 and 1.16

version 1.15, 2011/11/27 23:11:37 version 1.16, 2011/11/27 23:27:31
Line 97  static void    dbt_put(DB *, const char *, DBT *, DBT 
Line 97  static void    dbt_put(DB *, const char *, DBT *, DBT 
 static  void              hash_put(DB *, const struct buf *, uint64_t);  static  void              hash_put(DB *, const struct buf *, uint64_t);
 static  void              hash_reset(DB **);  static  void              hash_reset(DB **);
 static  void              index_merge(const struct of *, struct mparse *,  static  void              index_merge(const struct of *, struct mparse *,
                                 struct buf *, struct buf *,                                  struct buf *, struct buf *, DB *,
                                 DB *, DB *, const char *,                                  DB *, const char *, DB *, const char *,
                                 DB *, const char *, int, int,  
                                 recno_t, const recno_t *, size_t);                                  recno_t, const recno_t *, size_t);
 static  void              index_prune(const struct of *, DB *,  static  void              index_prune(const struct of *, DB *,
                                 const char *, DB *, const char *,                                  const char *, DB *, const char *,
                                 int, recno_t *, recno_t **, size_t *);                                  recno_t *, recno_t **, size_t *);
 static  void              ofile_argbuild(char *[], int, int, int,  static  void              ofile_argbuild(int, char *[], struct of **);
                                 struct of **);  
 static  int               ofile_dirbuild(const char *, const char *,  static  int               ofile_dirbuild(const char *, const char *,
                                 const char *, int, int, int,                                  const char *, int, struct of **);
                                 struct of **);  
 static  void              ofile_free(struct of *);  static  void              ofile_free(struct of *);
 static  void              pformatted(DB *, struct buf *, struct buf *,  static  void              pformatted(DB *, struct buf *, struct buf *,
                                 const struct of *);                                  const struct of *);
Line 258  static const pmdoc_nf   mdocs[MDOC_MAX] = {
Line 255  static const pmdoc_nf   mdocs[MDOC_MAX] = {
 };  };
   
 static  const char       *progname;  static  const char       *progname;
   static  int               use_all;  /* Use all directories and files. */
   static  int               verb;  /* Output verbosity level. */
   
 int  int
 main(int argc, char *argv[])  main(int argc, char *argv[])
Line 268  main(int argc, char *argv[])
Line 267  main(int argc, char *argv[])
         const char      *dir;          const char      *dir;
         char             ibuf[MAXPATHLEN], /* index fname */          char             ibuf[MAXPATHLEN], /* index fname */
                          fbuf[MAXPATHLEN];  /* btree fname */                           fbuf[MAXPATHLEN];  /* btree fname */
         int              verb, /* output verbosity */          int              ch, i, flags;
                          use_all, /* use all directories and files */  
                          ch, i, flags;  
         DB              *idx, /* index database */          DB              *idx, /* index database */
                         *db, /* keyword database */                          *db, /* keyword database */
                         *hash; /* temporary keyword hashtable */                          *hash; /* temporary keyword hashtable */
Line 377  main(int argc, char *argv[])
Line 374  main(int argc, char *argv[])
                         printf("%s: Opened\n", ibuf);                          printf("%s: Opened\n", ibuf);
                 }                  }
   
                 ofile_argbuild(argv, argc, use_all, verb, &of);                  ofile_argbuild(argc, argv, &of);
                 if (NULL == of)                  if (NULL == of)
                         goto out;                          goto out;
   
                 of = of->first;                  of = of->first;
   
                 index_prune(of, db, fbuf, idx, ibuf, verb,                  index_prune(of, db, fbuf, idx, ibuf,
                                 &maxrec, &recs, &recsz);                                  &maxrec, &recs, &recsz);
   
                 if (OP_UPDATE == op)                  if (OP_UPDATE == op)
                         index_merge(of, mp, &dbuf, &buf, hash,                          index_merge(of, mp, &dbuf, &buf, hash,
                                         db, fbuf, idx, ibuf, use_all,                                          db, fbuf, idx, ibuf,
                                         verb, maxrec, recs, reccur);                                          maxrec, recs, reccur);
   
                 goto out;                  goto out;
         }          }
Line 450  main(int argc, char *argv[])
Line 447  main(int argc, char *argv[])
                 of = NULL;                  of = NULL;
   
                 if ( ! ofile_dirbuild(dirs.paths[i], NULL, NULL,                  if ( ! ofile_dirbuild(dirs.paths[i], NULL, NULL,
                                 0, use_all, verb, &of))                                          0, &of))
                         exit((int)MANDOCLEVEL_SYSERR);                          exit((int)MANDOCLEVEL_SYSERR);
   
                 if (NULL == of)                  if (NULL == of)
Line 459  main(int argc, char *argv[])
Line 456  main(int argc, char *argv[])
                 of = of->first;                  of = of->first;
   
                 index_merge(of, mp, &dbuf, &buf, hash, db, fbuf,                  index_merge(of, mp, &dbuf, &buf, hash, db, fbuf,
                                 idx, ibuf, use_all, verb,                                  idx, ibuf, maxrec, recs, reccur);
                                 maxrec, recs, reccur);  
         }          }
   
 out:  out:
Line 484  out:
Line 480  out:
   
 void  void
 index_merge(const struct of *of, struct mparse *mp,  index_merge(const struct of *of, struct mparse *mp,
                 struct buf *dbuf, struct buf *buf,                  struct buf *dbuf, struct buf *buf, DB *hash,
                 DB *hash, DB *db, const char *dbf,                  DB *db, const char *dbf, DB *idx, const char *idxf,
                 DB *idx, const char *idxf, int use_all, int verb,  
                 recno_t maxrec, const recno_t *recs, size_t reccur)                  recno_t maxrec, const recno_t *recs, size_t reccur)
 {  {
         recno_t          rec;          recno_t          rec;
Line 662  index_merge(const struct of *of, struct mparse *mp,
Line 657  index_merge(const struct of *of, struct mparse *mp,
  */   */
 static void  static void
 index_prune(const struct of *ofile, DB *db, const char *dbf,  index_prune(const struct of *ofile, DB *db, const char *dbf,
                 DB *idx, const char *idxf, int verb,                  DB *idx, const char *idxf,
                 recno_t *maxrec, recno_t **recs, size_t *recsz)                  recno_t *maxrec, recno_t **recs, size_t *recsz)
 {  {
         const struct of *of;          const struct of *of;
Line 1336  pformatted(DB *hash, struct buf *buf, struct buf *dbuf
Line 1331  pformatted(DB *hash, struct buf *buf, struct buf *dbuf
 }  }
   
 static void  static void
 ofile_argbuild(char *argv[], int argc, int use_all, int verb,  ofile_argbuild(int argc, char *argv[], struct of **of)
                 struct of **of)  
 {  {
         char             buf[MAXPATHLEN];          char             buf[MAXPATHLEN];
         char            *sec, *arch, *title, *p;          char            *sec, *arch, *title, *p;
Line 1429  ofile_argbuild(char *argv[], int argc, int use_all, in
Line 1423  ofile_argbuild(char *argv[], int argc, int use_all, in
  */   */
 static int  static int
 ofile_dirbuild(const char *dir, const char* psec, const char *parch,  ofile_dirbuild(const char *dir, const char* psec, const char *parch,
                 int p_src_form, int use_all, int verb, struct of **of)                  int p_src_form, struct of **of)
 {  {
         char             buf[MAXPATHLEN];          char             buf[MAXPATHLEN];
         struct stat      sb;          struct stat      sb;
Line 1495  ofile_dirbuild(const char *dir, const char* psec, cons
Line 1489  ofile_dirbuild(const char *dir, const char* psec, cons
                                 printf("%s: Scanning\n", buf);                                  printf("%s: Scanning\n", buf);
   
                         if ( ! ofile_dirbuild(buf, sec, arch,                          if ( ! ofile_dirbuild(buf, sec, arch,
                                         src_form, use_all, verb, of))                                          src_form, of))
                                 return(0);                                  return(0);
                 }                  }
                 if (DT_REG != dp->d_type ||                  if (DT_REG != dp->d_type ||

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

CVSweb