Print this page
*** NO COMMENTS ***


 135                                         { "3x", "3curses" },
 136                                         { "3xc", "3xcurses" },
 137                                         { "3xn", "3xnet" }
 138 };
 139 
 140 /*
 141  * A list of known preprocessors to precede the formatter itself
 142  * in the formatting pipeline.  Preprocessors are specified by
 143  * starting a manual page with a line of the form:
 144  *      '\" X
 145  * where X is a string consisting of letters from the p_tag fields
 146  * below.
 147  */
 148 static const struct preprocessor {
 149         char    p_tag;
 150         char    *p_nroff,
 151                 *p_troff,
 152                 *p_stdin_char;
 153 } preprocessors [] = {
 154         {'c',   "cw",                           "cw",           "-"},
 155         {'e',   "neqn /usr/share/lib/pub/eqnchar",
 156                         "eqn /usr/share/lib/pub/eqnchar",       "-"},
 157         {'p',   "gpic",                         "gpic",         "-"},
 158         {'r',   "refer",                        "refer",        "-"},
 159         {'t',   "tbl",                          "tbl",          ""},
 160         {'v',   "vgrind -f",                    "vgrind -f",    "-"},
 161         {0,     0,                              0,              0}
 162 };
 163 
 164 struct suffix {
 165         char *ds;
 166         char *fs;
 167 };
 168 
 169 /*
 170  * Flags that control behavior of build_manpath()
 171  *
 172  *   BMP_ISPATH         pathv is a vector constructed from PATH.
 173  *                      Perform appropriate path translations for
 174  *                      manpath.
 175  *   BMP_APPEND_MANDIR  Add /usr/share/man to the end if it
 176  *                      hasn't already appeared earlier.


2754                                 if ((new_m = strrchr(manbuf, '/')) != NULL) {
2755                 (void) fprintf(md, ".so man%s%s\n", dir+plen, new_m);
2756                                                         } else {
2757 /*
2758  * TRANSLATION_NOTE - message for catman -c
2759  * Error message if unable to get file name
2760  */
2761                                 (void) fprintf(stderr,
2762                                     gettext("file not found\n"));
2763                                 (void) fflush(stderr);
2764                                 return (-1);
2765                                 }
2766                                                         (void) fclose(md);
2767                                                 }
2768                                         }
2769                                 }
2770                                 if (catmando && compargs)
2771                                         (void) sprintf(cmdbuf, "cat %s > %s",
2772                                             tmpdir, manpname_sgml);
2773                                 else
2774         (void) sprintf(cmdbuf, " cat %s | tbl | eqn | %s %s - %s > %s",
2775             tmpdir, troffit ? troffcmd : "nroff -u0 -Tlp",
2776             macros, troffit ? "" : " | col -x", tmpname);
2777                         } else
2778                                 if (catmando && compargs)
2779                                         (void) sprintf(cbp, " > %s",
2780                                             manpname_sgml);
2781                                 else
2782         (void) sprintf(cbp, " | tbl | eqn | %s %s - %s > %s",
2783             troffit ? troffcmd : "nroff -u0 -Tlp",
2784             macros, troffit ? "" : " | col -x", tmpname);
2785 
2786                 } else
2787         (void) sprintf(cbp, "%s %s %s%s > %s",
2788             troffit ? troffcmd : "nroff -u0 -Tlp",
2789             macros, pipestage == 0 ? manpname : "-",
2790             troffit ? "" : " | col -x", tmpname);
2791 
2792                 /* Reformat the page. */
2793                 if (sys(cmdbuf)) {
2794 /*
2795  * TRANSLATION_NOTE - message for man -d or catman -p
2796  * Error message if sys(%s) failed
2797  */
2798                         (void) fprintf(stderr, gettext(
2799                             "sys(%s) fail!\n"), cmdbuf);
2800                         (void) fprintf(stderr, gettext(" aborted (sorry)\n"));
2801                         (void) fflush(stderr);
2802                         (void) unlink(tmpname);
2803                         /* release memory for tmpname */
2804                         if (!catmando)
2805                                 free(tmpname);
2806                         return (-1);
2807                 }
2808 




 135                                         { "3x", "3curses" },
 136                                         { "3xc", "3xcurses" },
 137                                         { "3xn", "3xnet" }
 138 };
 139 
 140 /*
 141  * A list of known preprocessors to precede the formatter itself
 142  * in the formatting pipeline.  Preprocessors are specified by
 143  * starting a manual page with a line of the form:
 144  *      '\" X
 145  * where X is a string consisting of letters from the p_tag fields
 146  * below.
 147  */
 148 static const struct preprocessor {
 149         char    p_tag;
 150         char    *p_nroff,
 151                 *p_troff,
 152                 *p_stdin_char;
 153 } preprocessors [] = {
 154         {'c',   "cw",                           "cw",           "-"},
 155         {'e',   "/usr/bin/neqn /usr/share/lib/pub/eqnchar",
 156                         "/usr/bin/eqn /usr/share/lib/pub/eqnchar",      "-"},
 157         {'p',   "gpic",                         "gpic",         "-"},
 158         {'r',   "refer",                        "refer",        "-"},
 159         {'t',   "tbl",                          "tbl",          ""},
 160         {'v',   "vgrind -f",                    "vgrind -f",    "-"},
 161         {0,     0,                              0,              0}
 162 };
 163 
 164 struct suffix {
 165         char *ds;
 166         char *fs;
 167 };
 168 
 169 /*
 170  * Flags that control behavior of build_manpath()
 171  *
 172  *   BMP_ISPATH         pathv is a vector constructed from PATH.
 173  *                      Perform appropriate path translations for
 174  *                      manpath.
 175  *   BMP_APPEND_MANDIR  Add /usr/share/man to the end if it
 176  *                      hasn't already appeared earlier.


2754                                 if ((new_m = strrchr(manbuf, '/')) != NULL) {
2755                 (void) fprintf(md, ".so man%s%s\n", dir+plen, new_m);
2756                                                         } else {
2757 /*
2758  * TRANSLATION_NOTE - message for catman -c
2759  * Error message if unable to get file name
2760  */
2761                                 (void) fprintf(stderr,
2762                                     gettext("file not found\n"));
2763                                 (void) fflush(stderr);
2764                                 return (-1);
2765                                 }
2766                                                         (void) fclose(md);
2767                                                 }
2768                                         }
2769                                 }
2770                                 if (catmando && compargs)
2771                                         (void) sprintf(cmdbuf, "cat %s > %s",
2772                                             tmpdir, manpname_sgml);
2773                                 else
2774         (void) sprintf(cmdbuf, " cat %s | tbl | /usr/bin/eqn | %s %s - %s > %s",
2775             tmpdir, troffit ? troffcmd : "/usr/bin/nroff -u0 -Tlp",
2776             macros, troffit ? "" : " | col -x", tmpname);
2777                         } else
2778                                 if (catmando && compargs)
2779                                         (void) sprintf(cbp, " > %s",
2780                                             manpname_sgml);
2781                                 else
2782         (void) sprintf(cbp, " | tbl | /usr/bin/eqn | %s %s - %s > %s",
2783             troffit ? troffcmd : "/usr/bin/nroff -u0 -Tlp",
2784             macros, troffit ? "" : " | col -x", tmpname);
2785 
2786                 } else
2787         (void) sprintf(cbp, "%s %s %s%s > %s",
2788             troffit ? troffcmd : "/usr/bin/nroff -u0 -Tlp",
2789             macros, pipestage == 0 ? manpname : "-",
2790             troffit ? "" : " | col -x", tmpname);
2791 
2792                 /* Reformat the page. */
2793                 if (sys(cmdbuf)) {
2794 /*
2795  * TRANSLATION_NOTE - message for man -d or catman -p
2796  * Error message if sys(%s) failed
2797  */
2798                         (void) fprintf(stderr, gettext(
2799                             "sys(%s) fail!\n"), cmdbuf);
2800                         (void) fprintf(stderr, gettext(" aborted (sorry)\n"));
2801                         (void) fflush(stderr);
2802                         (void) unlink(tmpname);
2803                         /* release memory for tmpname */
2804                         if (!catmando)
2805                                 free(tmpname);
2806                         return (-1);
2807                 }
2808