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

Diff for /mandoc/mandocdb.c between version 1.92 and 1.93

version 1.92, 2013/12/31 19:40:20 version 1.93, 2014/01/02 18:52:15
Line 143  static void *hash_alloc(size_t, void *);
Line 143  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_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 885  nextlink:
Line 886  nextlink:
         }          }
 }  }
   
   static int
   mlink_check(struct mpage *mpage, struct mlink *mlink)
   {
           int      match;
   
           match = 1;
   
           /*
            * Check whether the manual section given in a file
            * agrees with the directory where the file is located.
            * Some manuals have suffixes like (3p) on their
            * section number either inside the file or in the
            * directory name, some are linked into more than one
            * section, like encrypt(1) = makekey(8).
            */
   
           if (FORM_SRC == mpage->form &&
               strcasecmp(mpage->sec, mlink->dsec)) {
                   match = 0;
                   say(mlink->file, "Section \"%s\" manual in %s directory",
                       mpage->sec, mlink->dsec);
           }
   
           /*
            * Manual page directories exist for each kernel
            * architecture as returned by machine(1).
            * However, many manuals only depend on the
            * application architecture as returned by arch(1).
            * For example, some (2/ARM) manuals are shared
            * across the "armish" and "zaurus" kernel
            * architectures.
            * A few manuals are even shared across completely
            * different architectures, for example fdformat(1)
            * on amd64, i386, sparc, and sparc64.
            */
   
           if (strcasecmp(mpage->arch, mlink->arch)) {
                   match = 0;
                   say(mlink->file, "Architecture \"%s\" manual in "
                       "\"%s\" directory", mpage->arch, mlink->arch);
           }
   
           if (strcasecmp(mpage->title, mlink->name))
                   match = 0;
   
           return(match);
   }
   
 /*  /*
  * Run through the files in the global vector "mpages"   * Run through the files in the global vector "mpages"
  * and add them to the database specified in "basedir".   * and add them to the database specified in "basedir".
Line 898  mpages_merge(struct mchars *mc, struct mparse *mp, int
Line 947  mpages_merge(struct mchars *mc, struct mparse *mp, int
         struct ohash             title_table;          struct ohash             title_table;
         struct ohash_info        title_info, str_info;          struct ohash_info        title_info, str_info;
         struct mpage            *mpage;          struct mpage            *mpage;
           struct mlink            *mlink;
         struct mdoc             *mdoc;          struct mdoc             *mdoc;
         struct man              *man;          struct man              *man;
         struct title            *title_entry;          struct title            *title_entry;
Line 932  mpages_merge(struct mchars *mc, struct mparse *mp, int
Line 982  mpages_merge(struct mchars *mc, struct mparse *mp, int
                 mparse_reset(mp);                  mparse_reset(mp);
                 mdoc = NULL;                  mdoc = NULL;
                 man = NULL;                  man = NULL;
                 match = 1;  
   
                 /*                  /*
                  * Try interpreting the file as mdoc(7) or man(7)                   * Try interpreting the file as mdoc(7) or man(7)
Line 973  mpages_merge(struct mchars *mc, struct mparse *mp, int
Line 1022  mpages_merge(struct mchars *mc, struct mparse *mp, int
                             mandoc_strdup(mpage->mlinks->name);                              mandoc_strdup(mpage->mlinks->name);
                 }                  }
   
                 /*                  for (mlink = mpage->mlinks; mlink; mlink = mlink->next)
                  * Check whether the manual section given in a file                          putkey(mpage, mlink->name, TYPE_Nm);
                  * agrees with the directory where the file is located.  
                  * Some manuals have suffixes like (3p) on their  
                  * section number either inside the file or in the  
                  * directory name, some are linked into more than one  
                  * section, like encrypt(1) = makekey(8).  Do not skip  
                  * manuals for such reasons.  
                  */  
                 if (warnings && !use_all && FORM_SRC == mpage->form &&  
                     strcasecmp(mpage->sec, mpage->mlinks->dsec)) {  
                         match = 0;  
                         say(mpage->mlinks->file, "Section \"%s\" "  
                                 "manual in %s directory",  
                                 mpage->sec, mpage->mlinks->dsec);  
                 }  
   
                 /*                  if (warnings && !use_all) {
                  * Manual page directories exist for each kernel  
                  * architecture as returned by machine(1).  
                  * However, many manuals only depend on the  
                  * application architecture as returned by arch(1).  
                  * For example, some (2/ARM) manuals are shared  
                  * across the "armish" and "zaurus" kernel  
                  * architectures.  
                  * A few manuals are even shared across completely  
                  * different architectures, for example fdformat(1)  
                  * on amd64, i386, sparc, and sparc64.  
                  * Thus, warn about architecture mismatches,  
                  * but don't skip manuals for this reason.  
                  */  
                 if (warnings && !use_all &&  
                     strcasecmp(mpage->arch, mpage->mlinks->arch)) {  
                         match = 0;                          match = 0;
                         say(mpage->mlinks->file, "Architecture \"%s\" "                          for (mlink = mpage->mlinks; mlink;
                                 "manual in \"%s\" directory",                               mlink = mlink->next)
                                 mpage->arch, mpage->mlinks->arch);                                  if (mlink_check(mpage, mlink))
                 }                                          match = 1;
                 if (warnings && !use_all &&                  } else
                     strcasecmp(mpage->title, mpage->mlinks->name))                          match = 1;
                         match = 0;  
   
                 putkey(mpage, mpage->mlinks->name, TYPE_Nm);  
   
                 if (NULL != mdoc) {                  if (NULL != mdoc) {
                         if (NULL != (cp = mdoc_meta(mdoc)->name))                          if (NULL != (cp = mdoc_meta(mdoc)->name))

Legend:
Removed from v.1.92  
changed lines
  Added in v.1.93

CVSweb