[BACK]Return to man.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / man

Diff for /src/usr.bin/man/Attic/man.c between version 1.20 and 1.21

version 1.20, 2002/02/16 21:27:48 version 1.21, 2002/09/17 19:37:39
Line 85 
Line 85 
 sigset_t        blocksigs;  sigset_t        blocksigs;
   
 int  int
 main(argc, argv)  main(int argc, char *argv[])
         int argc;  
         char *argv[];  
 {  {
         extern char *optarg;          extern char *optarg;
         extern int optind;          extern int optind;
Line 270 
Line 268 
                                 if ((ep = malloc(sizeof(ENTRY))) == NULL ||                                  if ((ep = malloc(sizeof(ENTRY))) == NULL ||
                                     (ep->s = strdup(buf)) == NULL)                                      (ep->s = strdup(buf)) == NULL)
                                         err(1, NULL);                                          err(1, NULL);
                                 /* puts it at the end, should be at the top, but then the added                                  /*
                                         entries would be in reverse order, fix later when all are added*/                                   * puts it at the end, should be at the top,
                                    * but then the added entries would be in
                                    * reverse order, fix later when all are added
                                    */
                                 TAILQ_INSERT_TAIL(&defp->list, ep, q);                                  TAILQ_INSERT_TAIL(&defp->list, ep, q);
                                 if (e_sectp == NULL)    /* save first added, to-be the new top */                                  if (e_sectp == NULL)
                                           /* save first added, to-be the new top */
                                         e_sectp = ep;                                          e_sectp = ep;
                         }                          }
                 }                  }
                 if (e_sectp != NULL) { /* entries added, fix order */                  if (e_sectp != NULL) { /* entries added, fix order */
                         ep->q.tqe_next = defp->list.tqh_first;  /* save original head                   */                          /* save original head */
                         defp->list.tqh_first = e_sectp;                 /* first added entry, new top */                          ep->q.tqe_next = defp->list.tqh_first;
                         *e_sectp->q.tqe_prev = NULL;                            /* terminate list                                       */                          /* first added entry, new top */
                           defp->list.tqh_first = e_sectp;
                           /* terminate list */
                           *e_sectp->q.tqe_prev = NULL;
                 }                  }
         }          }
         /*          /*
Line 529 
Line 534 
  *      Build a man page for display.   *      Build a man page for display.
  */   */
 static void  static void
 build_page(fmt, pathp)  build_page(char *fmt, char **pathp)
         char *fmt, **pathp;  
 {  {
         static int warned;          static int warned;
         ENTRY *ep;          ENTRY *ep;
Line 614 
Line 618 
  *      display how information   *      display how information
  */   */
 static void  static void
 how(fname)  how(char *fname)
         char *fname;  
 {  {
         FILE *fp;          FILE *fp;
   
Line 661 
Line 664 
  *      cat out the file   *      cat out the file
  */   */
 static void  static void
 cat(fname)  cat(char *fname)
         char *fname;  
 {  {
         int fd, n;          int fd, n;
         char buf[2048];          char buf[2048];
Line 691 
Line 693 
  *      check the user supplied page information   *      check the user supplied page information
  */   */
 static char *  static char *
 check_pager(name)  check_pager(char *name)
         char *name;  
 {  {
         char *p, *save;          char *p, *save;
   
Line 724 
Line 725 
  *      strip out flag argument and jump   *      strip out flag argument and jump
  */   */
 static void  static void
 jump(argv, flag, name)  jump(char **argv, char *flag, char *name)
         char **argv, *flag, *name;  
 {  {
         char **arg;          char **arg;
   
Line 745 
Line 745 
  *      If signaled, delete the temporary files.   *      If signaled, delete the temporary files.
  */   */
 static void  static void
 onsig(signo)  onsig(int signo)
         int signo;  
 {  {
         (void)cleanup();          (void)cleanup();        /* XXX signal race */
   
         (void)signal(signo, SIG_DFL);          (void)signal(signo, SIG_DFL);
         (void)kill(getpid(), signo);          (void)kill(getpid(), signo);
Line 762 
Line 761 
  *      Clean up temporary files, show any error messages.   *      Clean up temporary files, show any error messages.
  */   */
 static int  static int
 cleanup()  cleanup(void)
 {  {
         TAG *intmpp, *missp;          TAG *intmpp, *missp;
         ENTRY *ep;          ENTRY *ep;
Line 793 
Line 792 
  *      print usage message and die   *      print usage message and die
  */   */
 static void  static void
 usage()  usage(void)
 {  {
         (void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] "          (void)fprintf(stderr, "usage: %s [-achw] [-C file] [-M path] [-m path] "
             "[-s section] [-S subsection] [section] title ...\n", __progname);              "[-s section] [-S subsection] [section] title ...\n", __progname);

Legend:
Removed from v.1.20  
changed lines
  Added in v.1.21