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

Diff for /mandoc/mandocdb.c between version 1.70 and 1.71

version 1.70, 2013/07/02 12:58:54 version 1.71, 2013/07/02 13:26:52
Line 140  static int  inocheck(const struct stat *);
Line 140  static int  inocheck(const struct stat *);
 static  void     ofadd(int, const char *, const char *, const char *,  static  void     ofadd(int, const char *, const char *, const char *,
                         const char *, const char *, const struct stat *);                          const char *, const char *, const struct stat *);
 static  void     offree(void);  static  void     offree(void);
 static  void     ofmerge(struct mchars *, struct mparse *,  static  void     ofmerge(struct mchars *, struct mparse *, int);
                         struct ohash_info*, int);  
 static  void     parse_catpage(struct of *);  static  void     parse_catpage(struct of *);
 static  void     parse_man(struct of *, const struct man_node *);  static  void     parse_man(struct of *, const struct man_node *);
 static  void     parse_mdoc(struct of *, const struct mdoc_node *);  static  void     parse_mdoc(struct of *, const struct mdoc_node *);
Line 316  main(int argc, char *argv[])
Line 315  main(int argc, char *argv[])
         struct mchars    *mc;          struct mchars    *mc;
         struct manpaths   dirs;          struct manpaths   dirs;
         struct mparse    *mp;          struct mparse    *mp;
         struct ohash_info ino_info, filename_info, str_info;          struct ohash_info ino_info, filename_info;
   
         memset(stmts, 0, STMT__MAX * sizeof(sqlite3_stmt *));          memset(stmts, 0, STMT__MAX * sizeof(sqlite3_stmt *));
         memset(&dirs, 0, sizeof(struct manpaths));          memset(&dirs, 0, sizeof(struct manpaths));
   
         ino_info.halloc = filename_info.halloc =          ino_info.alloc  = filename_info.alloc  = hash_alloc;
                 str_info.halloc = hash_halloc;          ino_info.halloc = filename_info.halloc = hash_halloc;
         ino_info.hfree = filename_info.hfree =          ino_info.hfree  = filename_info.hfree  = hash_free;
                 str_info.hfree = hash_free;  
         ino_info.alloc = filename_info.alloc =  
                 str_info.alloc = hash_alloc;  
   
         ino_info.key_offset = offsetof(struct of, id);          ino_info.key_offset = offsetof(struct of, id);
         filename_info.key_offset = offsetof(struct of, file);          filename_info.key_offset = offsetof(struct of, file);
         str_info.key_offset = offsetof(struct str, key);  
   
         progname = strrchr(argv[0], '/');          progname = strrchr(argv[0], '/');
         if (progname == NULL)          if (progname == NULL)
Line 427  main(int argc, char *argv[])
Line 422  main(int argc, char *argv[])
                 if (OP_TEST != op)                  if (OP_TEST != op)
                         dbprune();                          dbprune();
                 if (OP_DELETE != op)                  if (OP_DELETE != op)
                         ofmerge(mc, mp, &str_info, 0);                          ofmerge(mc, mp, 0);
                 dbclose(1);                  dbclose(1);
         } else {          } else {
                 /*                  /*
Line 471  main(int argc, char *argv[])
Line 466  main(int argc, char *argv[])
                         if (0 == dbopen(0))                          if (0 == dbopen(0))
                                 goto out;                                  goto out;
   
                         ofmerge(mc, mp, &str_info, warnings && !use_all);                          ofmerge(mc, mp, warnings && !use_all);
                         dbclose(0);                          dbclose(0);
   
                         if (j + 1 < dirs.sz) {                          if (j + 1 < dirs.sz) {
Line 892  offree(void)
Line 887  offree(void)
  * and filename to determine whether the file is parsable or not.   * and filename to determine whether the file is parsable or not.
  */   */
 static void  static void
 ofmerge(struct mchars *mc, struct mparse *mp,  ofmerge(struct mchars *mc, struct mparse *mp, int check_reachable)
                 struct ohash_info *infop, int check_reachable)  
 {  {
         struct ohash             title_table;          struct ohash             title_table;
         struct ohash_info        title_info;          struct ohash_info        title_info, str_info;
         char                     buf[PATH_MAX];          char                     buf[PATH_MAX];
         struct of               *of;          struct of               *of;
         struct mdoc             *mdoc;          struct mdoc             *mdoc;
Line 910  ofmerge(struct mchars *mc, struct mparse *mp,
Line 904  ofmerge(struct mchars *mc, struct mparse *mp,
         unsigned int             slot;          unsigned int             slot;
         enum mandoclevel         lvl;          enum mandoclevel         lvl;
   
           str_info.alloc = hash_alloc;
           str_info.halloc = hash_halloc;
           str_info.hfree = hash_free;
           str_info.key_offset = offsetof(struct str, key);
   
         if (check_reachable) {          if (check_reachable) {
                 title_info.alloc = hash_alloc;                  title_info.alloc = hash_alloc;
                 title_info.halloc = hash_halloc;                  title_info.halloc = hash_halloc;
Line 947  ofmerge(struct mchars *mc, struct mparse *mp,
Line 946  ofmerge(struct mchars *mc, struct mparse *mp,
                         }                          }
                 }                  }
   
                 ohash_init(&strings, 6, infop);                  ohash_init(&strings, 6, &str_info);
                 mparse_reset(mp);                  mparse_reset(mp);
                 mdoc = NULL;                  mdoc = NULL;
                 man = NULL;                  man = NULL;

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

CVSweb