1 /*
2 
3 Copyright (c) 1987, 1988  X Consortium
4 
5 Permission is hereby granted, free of charge, to any person obtaining
6 a copy of this software and associated documentation files (the
7 "Software"), to deal in the Software without restriction, including
8 without limitation the rights to use, copy, modify, merge, publish,
9 distribute, sublicense, and/or sell copies of the Software, and to
10 permit persons to whom the Software is furnished to do so, subject to
11 the following conditions:
12 
13 The above copyright notice and this permission notice shall be included
14 in all copies or substantial portions of the Software.
15 
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
19 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 OTHER DEALINGS IN THE SOFTWARE.
23 
24 Except as contained in this notice, the name of the X Consortium shall
25 not be used in advertising or otherwise to promote the sale, use or
26 other dealings in this Software without prior written authorization
27 from the X Consortium.
28 
29 */
30 
31 /*
32  * xman - X window system manual page display program.
33  * Author:    Chris D. Peterson, MIT Project Athena
34  * Created:   October 22, 1987
35  */
36 
37 #ifdef HAVE_CONFIG_H
38 # include "config.h"
39 #endif
40 
41 #ifndef HELPFILE
42 #define HELPFILE "/usr/lib/X11/xman.help"  /* name of the default helpfile. */
43 #endif
44 
45 /* The default cursors */
46 
47 #define XMAN_CURSOR "left_ptr"          /* Top level cursor. */
48 #define HELP_CURSOR "left_ptr"          /* The help cursor. */
49 #define MANPAGE_CURSOR "left_ptr"       /* The manpage cursor. */
50 #define SEARCH_ENTRY_CURSOR "question_arrow"    /* The search text widget
51                                                    cursor. */
52 #define DIRECTORY_NORMAL "fixed"        /* The default dir font */
53 
54 #define OPTION_MENU "optionMenu"        /* Name of the Option Menu. */
55 #define SECTION_MENU "sectionMenu"      /* Name of the Section Menu. */
56 
57 #define HELP_BUTTON "helpButton"        /* Name of top help button */
58 #define QUIT_BUTTON "quitButton"        /* Name of top quit button */
59 #define MANPAGE_BUTTON "manpageButton"  /* Name of top manpage button */
60 
61 #define TOPBOXNAME  "topBox"            /* Name of the Top Box. */
62 #define MANNAME "manualBrowser"         /* name for each manual page widget. */
63 #define SEARCHNAME "search"             /* The name for the search widget. */
64 #define HELPNAME  "help"                /* The name of the help widget. */
65 #define DIRECTORY_NAME "directory"      /* name of the directory widget. */
66 #define MANUALPAGE "manualPage"         /* name of the Scrollbyline widget that
67                                            contains the man page. */
68 #define DIALOG         "dialog"
69 
70 /* Names of the menu buttons */
71 
72 #ifdef INCLUDE_XPRINT_SUPPORT
73 #define NUM_OPTIONS 10          /* Number of menu options. */
74 #else                           /* !INCLUDE_XPRINT_SUPPORT */
75 #define NUM_OPTIONS 9           /* Number of menu options. */
76 #endif                          /* !INCLUDE_XPRINT_SUPPORT */
77 
78 #define DIRECTORY      "displayDirectory"
79 #define MANPAGE        "displayManualPage"
80 #define HELP           "help"
81 #define SEARCH         "search"
82 #define BOTH_SCREENS   "showBothScreens"
83 #define REMOVE_MANPAGE "removeThisManpage"
84 #define OPEN_MANPAGE   "openNewManpage"
85 #ifdef INCLUDE_XPRINT_SUPPORT
86 #define PRINT_MANPAGE  "printManualPage"
87 #endif                          /* INCLUDE_XPRINT_SUPPORT */
88 #define SHOW_VERSION   "showVersion"
89 #define QUIT           "quit"
90 
91 /* definitions of string to use for show both and show one. */
92 
93 #define SHOW_BOTH "Show Both Screens"
94 #define SHOW_ONE "Show One Screen"
95 
96 /*
97  * Things will not look right if you change these names to make
98  * MANUALSEARCH longer APROPOSSEARCH, see search.c for details.
99  */
100 
101 #define MANUALSEARCH "manualPage"
102 #define APROPOSSEARCH "apropos"
103 #define CANCEL "cancel"
104 
105 #define MANUAL 0
106 #define APROPOS 1
107 
108 #define NO_SECTION_DEFAULTS ("no default sections")
109 
110 /*
111  * Define HANDLE_ROFFSEQ to enable parsing of '\" <string>
112  * sequences in source files to set the format pipeline.
113  * This is necessary because the default pipeline causes incorrect
114  * display of ascii(7) on Linux.
115  * This depends on GNU roff.
116  */
117 #ifdef HAS_GROFF
118 #define HANDLE_ROFFSEQ
119 #endif
120 
121 #define DEFAULT_WIDTH 500       /* The default width of xman. */
122 #define SECTALLOC  8            /* The number of entries allocated
123                                    at a time for the manual structures. */
124 #define ENTRYALLOC 100          /* The number of entries allocated
125                                    at a time for a section. */
126 
127 #define INITIAL_DIR 0           /* The Initial Directory displayed. */
128 
129 #define COPY "cp"               /* copy command */
130 #define CHMOD_MODE 00666        /* permissions set on saved formatted files */
131 #define MANDESC "mandesc"       /* name of the mandesc files */
132 
133 #define INDENT 15
134 #define TYP20STR "MMMMMMMMMMMMMMMMMMMM"
135 
136 #define FILE_SAVE "yes"
137 #define CANCEL_FILE_SAVE "no"
138 #define MANTEMP "/tmp/xmanXXXXXX"
139 
140 /*
141  * Macro Definitions.
142  */
143 
144 #define streq(a, b)        ( strcmp((a), (b)) == 0 )
145 
146 /*
147  * Function definitions moved to man.h
148  */
149