11abf7346Smrg/*
21abf7346Smrg
31abf7346SmrgCopyright (c) 1987, 1988  X Consortium
41abf7346Smrg
51abf7346SmrgPermission is hereby granted, free of charge, to any person obtaining
61abf7346Smrga copy of this software and associated documentation files (the
71abf7346Smrg"Software"), to deal in the Software without restriction, including
81abf7346Smrgwithout limitation the rights to use, copy, modify, merge, publish,
91abf7346Smrgdistribute, sublicense, and/or sell copies of the Software, and to
101abf7346Smrgpermit persons to whom the Software is furnished to do so, subject to
111abf7346Smrgthe following conditions:
121abf7346Smrg
131abf7346SmrgThe above copyright notice and this permission notice shall be included
141abf7346Smrgin all copies or substantial portions of the Software.
151abf7346Smrg
161abf7346SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
171abf7346SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
181abf7346SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
191abf7346SmrgIN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
201abf7346SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
211abf7346SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
221abf7346SmrgOTHER DEALINGS IN THE SOFTWARE.
231abf7346Smrg
241abf7346SmrgExcept as contained in this notice, the name of the X Consortium shall
251abf7346Smrgnot be used in advertising or otherwise to promote the sale, use or
261abf7346Smrgother dealings in this Software without prior written authorization
271abf7346Smrgfrom the X Consortium.
281abf7346Smrg
291abf7346Smrg*/
301abf7346Smrg
311abf7346Smrg/*
321abf7346Smrg * xman - X window system manual page display program.
331abf7346Smrg * Author:    Chris D. Peterson, MIT Project Athena
341abf7346Smrg * Created:   October 22, 1987
351abf7346Smrg */
361abf7346Smrg
376d36ef34Smrg#ifdef HAVE_CONFIG_H
386d36ef34Smrg# include "config.h"
396d36ef34Smrg#endif
406d36ef34Smrg
411abf7346Smrg#ifndef HELPFILE
426d36ef34Smrg#define HELPFILE "/usr/lib/X11/xman.help"  /* name of the default helpfile. */
431abf7346Smrg#endif
441abf7346Smrg
451abf7346Smrg/* The default cursors */
461abf7346Smrg
476d36ef34Smrg#define XMAN_CURSOR "left_ptr"          /* Top level cursor. */
486d36ef34Smrg#define HELP_CURSOR "left_ptr"          /* The help cursor. */
496d36ef34Smrg#define MANPAGE_CURSOR "left_ptr"       /* The manpage cursor. */
506d36ef34Smrg#define SEARCH_ENTRY_CURSOR "question_arrow"    /* The search text widget
516d36ef34Smrg                                                   cursor. */
526d36ef34Smrg#define DIRECTORY_NORMAL "fixed"        /* The default dir font */
536d36ef34Smrg
546d36ef34Smrg#define OPTION_MENU "optionMenu"        /* Name of the Option Menu. */
556d36ef34Smrg#define SECTION_MENU "sectionMenu"      /* Name of the Section Menu. */
566d36ef34Smrg
576d36ef34Smrg#define HELP_BUTTON "helpButton"        /* Name of top help button */
586d36ef34Smrg#define QUIT_BUTTON "quitButton"        /* Name of top quit button */
596d36ef34Smrg#define MANPAGE_BUTTON "manpageButton"  /* Name of top manpage button */
606d36ef34Smrg
616d36ef34Smrg#define TOPBOXNAME  "topBox"            /* Name of the Top Box. */
626d36ef34Smrg#define MANNAME "manualBrowser"         /* name for each manual page widget. */
636d36ef34Smrg#define SEARCHNAME "search"             /* The name for the search widget. */
646d36ef34Smrg#define HELPNAME  "help"                /* The name of the help widget. */
656d36ef34Smrg#define DIRECTORY_NAME "directory"      /* name of the directory widget. */
666d36ef34Smrg#define MANUALPAGE "manualPage"         /* name of the Scrollbyline widget that
676d36ef34Smrg                                           contains the man page. */
681abf7346Smrg#define DIALOG         "dialog"
691abf7346Smrg
701abf7346Smrg/* Names of the menu buttons */
711abf7346Smrg
726d36ef34Smrg#define NUM_OPTIONS 9           /* Number of menu options. */
731abf7346Smrg
741abf7346Smrg#define DIRECTORY      "displayDirectory"
751abf7346Smrg#define MANPAGE        "displayManualPage"
761abf7346Smrg#define HELP           "help"
771abf7346Smrg#define SEARCH         "search"
781abf7346Smrg#define BOTH_SCREENS   "showBothScreens"
791abf7346Smrg#define REMOVE_MANPAGE "removeThisManpage"
801abf7346Smrg#define OPEN_MANPAGE   "openNewManpage"
811abf7346Smrg#define SHOW_VERSION   "showVersion"
821abf7346Smrg#define QUIT           "quit"
831abf7346Smrg
841abf7346Smrg/* definitions of string to use for show both and show one. */
851abf7346Smrg
861abf7346Smrg#define SHOW_BOTH "Show Both Screens"
871abf7346Smrg#define SHOW_ONE "Show One Screen"
881abf7346Smrg
896d36ef34Smrg/*
906d36ef34Smrg * Things will not look right if you change these names to make
911abf7346Smrg * MANUALSEARCH longer APROPOSSEARCH, see search.c for details.
921abf7346Smrg */
931abf7346Smrg
941abf7346Smrg#define MANUALSEARCH "manualPage"
951abf7346Smrg#define APROPOSSEARCH "apropos"
961abf7346Smrg#define CANCEL "cancel"
971abf7346Smrg
981abf7346Smrg#define MANUAL 0
991abf7346Smrg#define APROPOS 1
1001abf7346Smrg
1011abf7346Smrg#define NO_SECTION_DEFAULTS ("no default sections")
1021abf7346Smrg
1031abf7346Smrg/*
1041abf7346Smrg * Define HANDLE_ROFFSEQ to enable parsing of '\" <string>
1051abf7346Smrg * sequences in source files to set the format pipeline.
1061abf7346Smrg * This is necessary because the default pipeline causes incorrect
1071abf7346Smrg * display of ascii(7) on Linux.
1081abf7346Smrg * This depends on GNU roff.
1091abf7346Smrg */
1101abf7346Smrg#ifdef HAS_GROFF
1111abf7346Smrg#define HANDLE_ROFFSEQ
1121abf7346Smrg#endif
1131abf7346Smrg
1146d36ef34Smrg#define DEFAULT_WIDTH 500       /* The default width of xman. */
1156d36ef34Smrg#define SECTALLOC  8            /* The number of entries allocated
1166d36ef34Smrg                                   at a time for the manual structures. */
1176d36ef34Smrg#define ENTRYALLOC 100          /* The number of entries allocated
1186d36ef34Smrg                                   at a time for a section. */
1191abf7346Smrg
1206d36ef34Smrg#define INITIAL_DIR 0           /* The Initial Directory displayed. */
1211abf7346Smrg
1226d36ef34Smrg#define COPY "cp"               /* copy command */
1236d36ef34Smrg#define CHMOD_MODE 00666        /* permissions set on saved formatted files */
1246d36ef34Smrg#define MANDESC "mandesc"       /* name of the mandesc files */
1251abf7346Smrg
1261abf7346Smrg#define INDENT 15
1271abf7346Smrg#define TYP20STR "MMMMMMMMMMMMMMMMMMMM"
1281abf7346Smrg
1291abf7346Smrg#define FILE_SAVE "yes"
1301abf7346Smrg#define CANCEL_FILE_SAVE "no"
1311abf7346Smrg#define MANTEMP "/tmp/xmanXXXXXX"
1321abf7346Smrg
1331abf7346Smrg/*
1341abf7346Smrg * Macro Definitions.
1351abf7346Smrg */
1361abf7346Smrg
1371abf7346Smrg#define streq(a, b)        ( strcmp((a), (b)) == 0 )
1381abf7346Smrg
1396d36ef34Smrg/*
1401abf7346Smrg * Function definitions moved to man.h
1411abf7346Smrg */
142