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

Diff for /mandoc/mandocdb.c between version 1.130 and 1.131

version 1.130, 2014/04/04 16:43:16 version 1.131, 2014/04/04 18:23:30
Line 147  static void *hash_alloc(size_t, void *);
Line 147  static void *hash_alloc(size_t, void *);
 static  void     hash_free(void *, size_t, void *);  static  void     hash_free(void *, size_t, void *);
 static  void    *hash_halloc(size_t, void *);  static  void    *hash_halloc(size_t, void *);
 static  void     mlink_add(struct mlink *, const struct stat *);  static  void     mlink_add(struct mlink *, const struct stat *);
 static  int      mlink_check(struct mpage *, struct mlink *);  static  void     mlink_check(struct mpage *, struct mlink *);
 static  void     mlink_free(struct mlink *);  static  void     mlink_free(struct mlink *);
 static  void     mlinks_undupe(struct mpage *);  static  void     mlinks_undupe(struct mpage *);
 static  void     mpages_free(void);  static  void     mpages_free(void);
Line 924  nextlink:
Line 924  nextlink:
         }          }
 }  }
   
 static int  static void
 mlink_check(struct mpage *mpage, struct mlink *mlink)  mlink_check(struct mpage *mpage, struct mlink *mlink)
 {  {
         int      match;          struct str      *str;
           unsigned int     slot;
   
         match = 1;  
   
         /*          /*
          * Check whether the manual section given in a file           * Check whether the manual section given in a file
          * agrees with the directory where the file is located.           * agrees with the directory where the file is located.
Line 941  mlink_check(struct mpage *mpage, struct mlink *mlink)
Line 940  mlink_check(struct mpage *mpage, struct mlink *mlink)
          */           */
   
         if (FORM_SRC == mpage->form &&          if (FORM_SRC == mpage->form &&
             strcasecmp(mpage->sec, mlink->dsec)) {              strcasecmp(mpage->sec, mlink->dsec))
                 match = 0;  
                 say(mlink->file, "Section \"%s\" manual in %s directory",                  say(mlink->file, "Section \"%s\" manual in %s directory",
                     mpage->sec, mlink->dsec);                      mpage->sec, mlink->dsec);
         }  
   
         /*          /*
          * Manual page directories exist for each kernel           * Manual page directories exist for each kernel
Line 960  mlink_check(struct mpage *mpage, struct mlink *mlink)
Line 957  mlink_check(struct mpage *mpage, struct mlink *mlink)
          * on amd64, i386, sparc, and sparc64.           * on amd64, i386, sparc, and sparc64.
          */           */
   
         if (strcasecmp(mpage->arch, mlink->arch)) {          if (strcasecmp(mpage->arch, mlink->arch))
                 match = 0;  
                 say(mlink->file, "Architecture \"%s\" manual in "                  say(mlink->file, "Architecture \"%s\" manual in "
                     "\"%s\" directory", mpage->arch, mlink->arch);                      "\"%s\" directory", mpage->arch, mlink->arch);
         }  
   
         if (strcasecmp(mpage->title, mlink->name))          /*
                 match = 0;           * XXX
            * parse_cat() doesn't set TYPE_Nm and TYPE_NAME yet.
            */
   
         return(match);          if (FORM_CAT == mpage->form)
                   return;
   
           /*
            * Check whether this mlink
            * appears as a name in the NAME section.
            */
   
           slot = ohash_qlookup(&strings, mlink->name);
           str = ohash_find(&strings, slot);
           assert(NULL != str);
           if ( ! (TYPE_NAME & str->mask))
                   say(mlink->file, "Name missing in NAME section");
 }  }
   
 /*  /*
Line 992  mpages_merge(struct mchars *mc, struct mparse *mp)
Line 1001  mpages_merge(struct mchars *mc, struct mparse *mp)
         char                    *sodest;          char                    *sodest;
         char                    *cp;          char                    *cp;
         pid_t                    child_pid;          pid_t                    child_pid;
         int                      match, status;          int                      status;
         unsigned int             pslot;          unsigned int             pslot;
         enum mandoclevel         lvl;          enum mandoclevel         lvl;
   
Line 1140  mpages_merge(struct mchars *mc, struct mparse *mp)
Line 1149  mpages_merge(struct mchars *mc, struct mparse *mp)
                         putkey(mpage, mlink->name, TYPE_Nm);                          putkey(mpage, mlink->name, TYPE_Nm);
                 }                  }
   
                 if (warnings && !use_all) {  
                         match = 0;  
                         for (mlink = mpage->mlinks; mlink;  
                              mlink = mlink->next)  
                                 if (mlink_check(mpage, mlink))  
                                         match = 1;  
                 } else  
                         match = 1;  
   
                 if (NULL != mdoc) {                  if (NULL != mdoc) {
                         if (NULL != (cp = mdoc_meta(mdoc)->name))                          if (NULL != (cp = mdoc_meta(mdoc)->name))
                                 putkey(mpage, cp, TYPE_Nm);                                  putkey(mpage, cp, TYPE_Nm);
Line 1160  mpages_merge(struct mchars *mc, struct mparse *mp)
Line 1160  mpages_merge(struct mchars *mc, struct mparse *mp)
                         parse_man(mpage, man_node(man));                          parse_man(mpage, man_node(man));
                 else                  else
                         parse_cat(mpage, fd[0]);                          parse_cat(mpage, fd[0]);
   
                   if (warnings && !use_all)
                           for (mlink = mpage->mlinks; mlink;
                                mlink = mlink->next)
                                   mlink_check(mpage, mlink);
   
                 dbadd(mpage, mc);                  dbadd(mpage, mc);
   

Legend:
Removed from v.1.130  
changed lines
  Added in v.1.131

CVSweb