#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#ifdef CSRG_BASED
#include <sys/param.h>
#endif
#define SUFFIX "suffix"
#define FOLD "fold"
#define FOLDSUFFIX "foldsuffix"
#define MNULL 0
#define MSUFFIX 1
#define MFOLD 2
#define MFOLDSUFFIX 3
#if ( defined(UTEK) || defined(apollo) || defined(Lynx) )
# define SEARCHDIR CAT
#else
# define SEARCHDIR MAN
#endif
#if ( defined(sgi) || (defined(i386) && (defined(SYSV) || defined(SVR4)) && !defined(sun)) || (defined(BSD) && (BSD >= 199103)) || defined(linux) || defined(__CYGWIN__) )
# define SEARCHOTHER CAT
#endif
#ifndef SYSMANPATH
#if defined(macII)
# define SYSMANPATH "/usr/catman/u_man:/usr/catman/a_man"
#elif defined(__bsdi__)
# define SYSMANPATH "/usr/share/man:/usr/contrib/man:/usr/contrib/isode/man:/usr/local/man"
#elif defined(__OpenBSD__) || defined(__DARWIN__)
# define SYSMANPATH "/usr/share/man:/usr/local/man:/usr/X11R6/man"
#elif defined(SVR4) && defined(sun)
# define SYSMANPATH "/usr/share/man:/usr/X11/man:/usr/openwin/share/man:/usr/dt/share/man:/usr/sfw/share/man"
#elif defined(SVR4) || defined(__osf__) || (defined(BSD) && (BSD >= 199103))
# define SYSMANPATH "/usr/share/man"
#elif defined(hcx)
# define SYSMANPATH "/usr/catman/local_man:/usr/catman/u_man:/usr/catman/a_man:/usr/catman/p_man:/usr/catman/ada_man"
#elif defined(SYSV) && defined(i386) && !defined(__SCO__) && !defined(sun)
# define SYSMANPATH "/usr/catman/u_man:/usr/catman/p_man"
#elif defined(sgi)
# define SYSMANPATH "/usr/catman/a_man:/usr/catman/g_man:/usr/catman/p_man:/usr/catman/u_man:/usr/man/p_man:/usr/man/u_man:/usr/man"
#endif
#ifndef SYSMANPATH
# define SYSMANPATH "/usr/man"
#endif
#endif
#if defined( macII ) || defined( hcx ) || \
(defined(SYSV) && defined(i386) && !defined(ISC) && \
!defined(__UNIXWARE__) && !defined(__SCO__) && !defined(sun)) || defined(sgi)
# define COMPRESSION_EXTENSION "z"
# define UNCOMPRESS_FORMAT "pcat %s > %s"
# define NO_COMPRESS
#elif defined(UTEK)
# define COMPRESSION_EXTENSION "C"
# define UNCOMPRESS_FORMAT "ccat < %s > %s"
# define COMPRESS "compact"
#elif defined (ISC) || defined(__SCO__) || defined(__UNIXWARE__)
# define COMPRESSION_EXTENSION "Z"
# if !defined(__SCO__) && !defined(__UNIXWARE__)
# define COMPRESSION_EXTENSIONS "zZF"
# else
# define COMPRESSION_EXTENSIONS "zZ"
# endif
# define UNCOMPRESS_FORMAT uncompress_format
# define UNCOMPRESS_FORMAT_1 "pcat %s > %s"
# define UNCOMPRESS_FORMAT_2 "zcat < %s > %s"
# define UNCOMPRESS_FORMAT_3 "fcat < %s > %s"
# define NO_COMPRESS
#else
# define COMPRESSION_EXTENSION "Z"
# ifndef HAS_MKSTEMP
# define UNCOMPRESS_FORMAT "zcat < %s > %s"
# else
# define UNCOMPRESS_FORMAT "zcat < %s >> %s"
# endif
# define COMPRESS "compress"
# define GZIP_EXTENSION "gz"
# ifndef HAS_MKSTEMP
# define GUNZIP_FORMAT "gzip -c -d < %s > %s"
# else
# define GUNZIP_FORMAT "gzip -c -d < %s >> %s"
# endif
# define GZIP_COMPRESS "gzip"
# define BZIP2_EXTENSION "bz2"
# define LZMA_EXTENSION "lzma"
# ifndef HAS_MKSTEMP
# define BUNZIP2_FORMAT "bunzip2 -c -d < %s > %s"
# define UNLZMA_FORMAT "unlzma -c -d < %s > %s"
# else
# define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s"
# define UNLZMA_FORMAT "unlzma -c -d < %s >> %s"
# endif
# define BZIP2_COMPRESS "bzip2"
# define LZMA_COMPRESS "lzma"
#endif
#if (defined(hpux) || defined(macII) || defined(CRAY) || defined(ultrix) || \
defined(hcx) )
# define NO_MANPATH_SUPPORT
#endif
#ifndef HAS_MKSTEMP
# ifdef NO_MANPATH_SUPPORT
# define APROPOS_FORMAT ("man -k %s | pr -h Apropos > %s")
# else
# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos > %s")
# endif
#else
# ifdef NO_MANPATH_SUPPORT
# define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s")
# else
# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s")
# endif
#endif
#ifndef HANDLE_ROFFSEQ
# if defined(ultrix)
# define FORMAT "| nroff -man"
# elif defined(CSRG_BASED)
# define FORMAT "| eqn | tbl | nroff -mandoc"
# elif defined(BSD) && (BSD >= 199103)
# define FORMAT "| eqn | tbl | nroff -man"
# elif defined(linux) || defined(__CYGWIN__)
# define FORMAT "| pic | eqn | tbl -Tlatin1 | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
# else
# define FORMAT "| neqn | nroff -man"
# endif
# define TBL "tbl"
#else
# if defined(linux)
# define ZSOELIM "zsoelim"
# else
# define ZSOELIM "soelim"
#endif
# define EQN "eqn"
# define TBL "tbl"
# define GRAP "grap"
# define PIC "pic"
# define VGRIND "vgrind"
# define REFER "refer"
# if defined(CSRG_BASED)
# define FORMAT "nroff -mandoc"
# elif defined(linux)
# define FORMAT "GROFF_NO_SGR= groff -Tlatin1 -mandoc"
# elif defined(__DARWIN__)
# define FORMAT "nroff -man"
# else
# define FORMAT "groff -man"
# endif
# define DEFAULT_MANROFFSEQ "et"
#endif
#ifdef __bsdi__
#define MAN "cat"
#else
#define MAN "man"
#endif
#if (defined(macII) || defined(CRAY) || defined(hcx) || \
(defined(SYSV) && defined(i386))) && !defined(SCO) && !defined(sun)
# define CAT MAN
#elif defined(SCO)
# define CAT "cat."
#else
# define CAT "cat"
#endif
#if defined(sun) && defined(SVR4)
# define SFORMAT "/usr/lib/sgml/sgml2roff"
# define SMAN "sman"
# undef SEARCHOTHER
# define SEARCHOTHER SMAN
# define SGMLENT_EXTENSION "ent"
#endif
typedef struct _SectionList {
struct _SectionList * next;
char * label;
char * directory;
int flags;
} SectionList;
extern char * CreateManpageName(char * entry, int section, int flags);
extern void AddStandardSections(SectionList **list, char * path);
extern void AddNewSection(SectionList **list, char * path, char * file, char * label, int flags);