11abf7346Smrg/*
21abf7346Smrg
31abf7346SmrgCopyright (c) 1991  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/* Vendor-specific definitions */
321abf7346Smrg#ifdef HAVE_CONFIG_H
331abf7346Smrg# include "config.h"
341abf7346Smrg#endif
351abf7346Smrg
361abf7346Smrg#ifdef CSRG_BASED
371abf7346Smrg#include <sys/param.h>
381abf7346Smrg#endif
391abf7346Smrg
401abf7346Smrg#define SUFFIX "suffix"
411abf7346Smrg#define FOLD "fold"
421abf7346Smrg#define FOLDSUFFIX "foldsuffix"
431abf7346Smrg#define MNULL 0
441abf7346Smrg#define MSUFFIX 1
451abf7346Smrg#define MFOLD 2
461abf7346Smrg#define MFOLDSUFFIX 3
471abf7346Smrg
481abf7346Smrg/*
491abf7346Smrg * The directories to search.  Assume that the manual directories are more
501abf7346Smrg * complete than the cat directories.
511abf7346Smrg */
521abf7346Smrg
5336ffeb23Smrg#define SEARCHDIR  MAN
546448b35cSmrg#define SEARCHOTHER CAT
551abf7346Smrg
561abf7346Smrg/*
571abf7346Smrg * The default manual page directory.
581abf7346Smrg *
5936ffeb23Smrg * The MANPATH environment variable will override this.
601abf7346Smrg */
611abf7346Smrg
621abf7346Smrg#ifndef SYSMANPATH
631abf7346Smrg
646448b35cSmrg#if defined(__OpenBSD__) || defined(__DARWIN__)
651abf7346Smrg#  define SYSMANPATH "/usr/share/man:/usr/local/man:/usr/X11R6/man"
661abf7346Smrg#elif defined(SVR4) && defined(sun)
671abf7346Smrg#  define SYSMANPATH "/usr/share/man:/usr/X11/man:/usr/openwin/share/man:/usr/dt/share/man:/usr/sfw/share/man"
681abf7346Smrg#endif
691abf7346Smrg
701abf7346Smrg#ifndef SYSMANPATH
716448b35cSmrg#  define SYSMANPATH "/usr/share/man"
721abf7346Smrg#endif
731abf7346Smrg
741abf7346Smrg#endif
751abf7346Smrg
761abf7346Smrg/*
771abf7346Smrg * Compression Definitions.
781abf7346Smrg */
791abf7346Smrg
806448b35cSmrg#define COMPRESSION_EXTENSION "Z"
816448b35cSmrg#define UNCOMPRESS_FORMAT     "zcat < %s >> %s"
826448b35cSmrg#define COMPRESS              "compress"
836448b35cSmrg#define GZIP_EXTENSION "gz"
846448b35cSmrg#define GUNZIP_FORMAT "gzip -c -d < %s >> %s"
856448b35cSmrg#define GZIP_COMPRESS "gzip"
866448b35cSmrg#define BZIP2_EXTENSION "bz2"
876448b35cSmrg#define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s"
886448b35cSmrg#define BZIP2_COMPRESS "bzip2"
896448b35cSmrg#define LZMA_EXTENSION "lzma"
906448b35cSmrg#define UNLZMA_FORMAT "unlzma -c -d < %s >> %s"
916448b35cSmrg#define LZMA_COMPRESS "lzma"
921abf7346Smrg
931abf7346Smrg
941abf7346Smrg/*
951abf7346Smrg * The command filters for the manual and apropos searches.
961abf7346Smrg */
971abf7346Smrg
986448b35cSmrg#define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s")
991abf7346Smrg
1001abf7346Smrg#ifndef HANDLE_ROFFSEQ
10136ffeb23Smrg# if defined(CSRG_BASED)
1021abf7346Smrg#  define FORMAT "| eqn | tbl | nroff -mandoc"
103189427b7Smrg# elif defined(linux) || defined(__CYGWIN__)
1041abf7346Smrg#  define FORMAT "| pic | eqn | tbl -Tlatin1 | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
1051abf7346Smrg# else
10636ffeb23Smrg#  define FORMAT "| neqn | nroff -man"  /* The format command. */
1071abf7346Smrg# endif
1081abf7346Smrg# define TBL "tbl"
10936ffeb23Smrg#else                           /* HANDLE_ROFFSEQ */
1101abf7346Smrg# if defined(linux)
1111abf7346Smrg#  define ZSOELIM	"zsoelim"
1121abf7346Smrg# else
1131abf7346Smrg#  define ZSOELIM	"soelim"
1141abf7346Smrg#endif
1151abf7346Smrg# define EQN		"eqn"
1161abf7346Smrg# define TBL		"tbl"
1171abf7346Smrg# define GRAP		"grap"
1185e248323Swiz# define ROFF_PIC	"pic"
1191abf7346Smrg# define VGRIND		"vgrind"
1201abf7346Smrg# define REFER		"refer"
1211abf7346Smrg# if defined(CSRG_BASED)
1221abf7346Smrg#  define FORMAT	"nroff -mandoc"
1233653852eSmrg# elif defined(linux) || defined(__CYGWIN__)
1241abf7346Smrg#  define FORMAT	"GROFF_NO_SGR= groff -Tlatin1 -mandoc"
1251abf7346Smrg# elif defined(__DARWIN__)
1261abf7346Smrg#  define FORMAT	"nroff -man"
1271abf7346Smrg# else
1283653852eSmrg#  define FORMAT	"GROFF_NO_SGR= groff -Tlatin1 -man"
1291abf7346Smrg# endif
1301abf7346Smrg# define DEFAULT_MANROFFSEQ "et"
13136ffeb23Smrg#endif                          /*HANDLE_ROFFSEQ */
1321abf7346Smrg
1331abf7346Smrg/*
1341abf7346Smrg * Names of the man and cat dirs.
1351abf7346Smrg */
1361abf7346Smrg
1371abf7346Smrg#define MAN "man"
1386448b35cSmrg#define CAT "cat"
1391abf7346Smrg
1401abf7346Smrg/* Solaris has nroff man pages in "man" and sgml man pages in "sman" */
1411abf7346Smrg#if defined(sun) && defined(SVR4)
1421abf7346Smrg#  define SFORMAT		"/usr/lib/sgml/sgml2roff"
1431abf7346Smrg#  define SMAN			"sman"
1441abf7346Smrg#  undef SEARCHOTHER
1451abf7346Smrg#  define SEARCHOTHER 		SMAN
14636ffeb23Smrg#  define SGMLENT_EXTENSION	"ent"   /* SGML entity files end in ".ent" */
1471abf7346Smrg#endif
1481abf7346Smrg
1491abf7346Smrg
1501abf7346Smrgtypedef struct _SectionList {
15136ffeb23Smrg    struct _SectionList *next;
15236ffeb23Smrg    char *label;                /* section label */
15336ffeb23Smrg    char *directory;            /* section directory */
15436ffeb23Smrg    int flags;
1551abf7346Smrg} SectionList;
1561abf7346Smrg
15736ffeb23Smrgextern char *CreateManpageName(const char *entry, int section, int flags);
15836ffeb23Smrgextern void AddStandardSections(SectionList ** list, const char *path);
15936ffeb23Smrgextern void AddNewSection(SectionList ** list, const char *path,
16036ffeb23Smrg                          const char *file, const char *label, int flags);
161