xenocara/app/xman/vendor.h

216 lines
6.3 KiB
C
Raw Normal View History

2006-11-25 13:07:29 -07:00
/*
Copyright (c) 1991 X Consortium
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of the X Consortium shall
not be used in advertising or otherwise to promote the sale, use or
other dealings in this Software without prior written authorization
from the X Consortium.
*/
/* Vendor-specific definitions */
#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
/*
* The directories to search. Assume that the manual directories are more
* complete than the cat directories.
*/
2013-09-28 10:22:59 -06:00
#define SEARCHDIR MAN
2006-11-25 13:07:29 -07:00
2013-09-28 10:22:59 -06:00
#if (defined(sgi) || (defined(SVR4) && !defined(sun)) || (defined(BSD) && (BSD >= 199103)) || defined(linux) || defined(__CYGWIN__) )
2006-11-25 13:07:29 -07:00
# define SEARCHOTHER CAT
#endif
/*
* The default manual page directory.
*
2013-09-28 10:22:59 -06:00
* The MANPATH environment variable will override this.
2006-11-25 13:07:29 -07:00
*/
#ifndef SYSMANPATH
2013-09-28 10:22:59 -06:00
#if defined(__bsdi__)
2006-11-25 13:07:29 -07:00
# 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(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
/*
* Compression Definitions.
*/
2013-09-28 10:22:59 -06:00
#if defined(sgi)
2006-11-25 13:07:29 -07:00
# define COMPRESSION_EXTENSION "z"
# define UNCOMPRESS_FORMAT "pcat %s > %s"
2013-09-28 10:22:59 -06:00
# define NO_COMPRESS /* mac can't handle using pack as a filter and
xman needs it to be done that way. */
2006-11-25 13:07:29 -07:00
#elif defined (ISC) || defined(__SCO__) || defined(__UNIXWARE__)
2013-09-28 10:22:59 -06:00
# define COMPRESSION_EXTENSION "Z" /* dummy */
2006-11-25 13:07:29 -07:00
# if !defined(__SCO__) && !defined(__UNIXWARE__)
2013-09-28 10:22:59 -06:00
# define COMPRESSION_EXTENSIONS "zZF" /* pack, compress, freeze */
2006-11-25 13:07:29 -07:00
# else
2013-09-28 10:22:59 -06:00
# define COMPRESSION_EXTENSIONS "zZ" /* pack, compress */
2006-11-25 13:07:29 -07:00
# 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"
2013-09-28 10:22:59 -06:00
# define UNCOMPRESS_FORMAT "zcat < %s >> %s"
2006-11-25 13:07:29 -07:00
# define COMPRESS "compress"
# define GZIP_EXTENSION "gz"
2013-09-28 10:22:59 -06:00
# define GUNZIP_FORMAT "gzip -c -d < %s >> %s"
2006-11-25 13:07:29 -07:00
# define GZIP_COMPRESS "gzip"
2009-10-24 09:00:51 -06:00
# define BZIP2_EXTENSION "bz2"
2013-09-28 10:22:59 -06:00
# define BUNZIP2_FORMAT "bunzip2 -c -d < %s >> %s"
2009-10-24 09:00:51 -06:00
# define BZIP2_COMPRESS "bzip2"
2013-09-28 10:22:59 -06:00
# define LZMA_EXTENSION "lzma"
# define UNLZMA_FORMAT "unlzma -c -d < %s >> %s"
2009-10-24 09:00:51 -06:00
# define LZMA_COMPRESS "lzma"
2006-11-25 13:07:29 -07:00
#endif
/*
* The command filters for the manual and apropos searches.
*/
2013-09-28 10:22:59 -06:00
#if defined(hpux)
2006-11-25 13:07:29 -07:00
# define NO_MANPATH_SUPPORT
#endif
2013-09-28 10:22:59 -06:00
#ifdef NO_MANPATH_SUPPORT
# define APROPOS_FORMAT ("man -k %s | pr -h Apropos >> %s")
2006-11-25 13:07:29 -07:00
#else
2013-09-28 10:22:59 -06:00
# define APROPOS_FORMAT ("man -M %s -k %s | pr -h Apropos >> %s")
2006-11-25 13:07:29 -07:00
#endif
#ifndef HANDLE_ROFFSEQ
# if defined(__OpenBSD__)
# define FORMAT "| mandoc -Tascii"
2006-11-25 13:07:29 -07:00
# elif defined(CSRG_BASED)
# define FORMAT "| eqn | tbl | nroff -mandoc"
# elif defined(BSD) && (BSD >= 199103)
# define FORMAT "| eqn | tbl | nroff -man"
2009-10-24 09:00:51 -06:00
# elif defined(linux) || defined(__CYGWIN__)
2006-11-25 13:07:29 -07:00
# define FORMAT "| pic | eqn | tbl -Tlatin1 | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
# else
2013-09-28 10:22:59 -06:00
# define FORMAT "| neqn | nroff -man" /* The format command. */
2006-11-25 13:07:29 -07:00
# endif
# define TBL "tbl"
2013-09-28 10:22:59 -06:00
#else /* HANDLE_ROFFSEQ */
2006-11-25 13:07:29 -07:00
# if defined(linux)
# define ZSOELIM "zsoelim"
# else
# define ZSOELIM "soelim"
# endif
2006-11-25 13:07:29 -07:00
# define EQN "eqn"
# define TBL "tbl"
# define GRAP "grap"
2013-09-28 10:22:59 -06:00
# define ROFF_PIC "pic"
2006-11-25 13:07:29 -07:00
# define VGRIND "vgrind"
# define REFER "refer"
# if defined(__OpenBSD__)
# define FORMAT "mandoc -Tascii"
# elif defined(CSRG_BASED)
2006-11-25 13:07:29 -07:00
# 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 /*HANDLE_ROFFSEQ */
#if defined(__OpenBSD__)
# define TBL "cat"
#endif
2006-11-25 13:07:29 -07:00
/*
* Names of the man and cat dirs.
*/
#ifdef __bsdi__
#define MAN "cat"
#else
#define MAN "man"
#endif
2013-09-28 10:22:59 -06:00
#if defined(SCO)
2006-11-25 13:07:29 -07:00
# define CAT "cat."
#else
# define CAT "cat"
#endif
/* Solaris has nroff man pages in "man" and sgml man pages in "sman" */
#if defined(sun) && defined(SVR4)
# define SFORMAT "/usr/lib/sgml/sgml2roff"
# define SMAN "sman"
# undef SEARCHOTHER
# define SEARCHOTHER SMAN
2013-09-28 10:22:59 -06:00
# define SGMLENT_EXTENSION "ent" /* SGML entity files end in ".ent" */
2006-11-25 13:07:29 -07:00
#endif
typedef struct _SectionList {
2013-09-28 10:22:59 -06:00
struct _SectionList *next;
char *label; /* section label */
char *directory; /* section directory */
int flags;
2006-11-25 13:07:29 -07:00
} SectionList;
2013-09-28 10:22:59 -06:00
extern char *CreateManpageName(const char *entry, int section, int flags);
extern void AddStandardSections(SectionList ** list, const char *path);
extern void AddNewSection(SectionList ** list, const char *path,
const char *file, const char *label, int flags);