summaryrefslogtreecommitdiff
path: root/vendor.h
blob: 1b57574dcf25872541f9a9d8057dcedee70a7d23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
/* $XConsortium: vendor.h,v 1.12 94/04/17 20:44:00 rws Exp $ */
/*

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.

*/
/* $XFree86: xc/programs/xman/vendor.h,v 1.13 2003/07/29 21:16:56 dawes Exp $ */

/* Vendor-specific definitions */

#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.
 */

#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(BSD) && (BSD >= 199103)) || defined(linux) )
# define SEARCHOTHER CAT
#endif

/*
 * The default manual page directory.
 *
 * The MANPATH enviornment variable will override this.
 */

#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(__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)
#  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

/*
 * Compression Definitions.
 */

#if defined( macII ) || defined( hcx ) || \
	(defined(SYSV) && defined(i386) && !defined(ISC) && !defined(SCO)) || \
	defined(sgi)
#  define COMPRESSION_EXTENSION   "z"
#  define UNCOMPRESS_FORMAT       "pcat %s > %s"
#  define NO_COMPRESS		/* mac can't handle using pack as a filter and
				   xman needs it to be done that way. */
#elif defined(UTEK)
#  define COMPRESSION_EXTENSION "C"
#  define UNCOMPRESS_FORMAT     "ccat < %s > %s"
#  define COMPRESS              "compact"
#elif defined (ISC) || defined(SCO)
#  define COMPRESSION_EXTENSION   "Z"     /* dummy */
#  ifndef SCO
#    define COMPRESSION_EXTENSIONS  "zZF" /* pack, compress, freeze */
#  else
#    define COMPRESSION_EXTENSIONS  "zZ"  /* pack, compress */
#  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"
#endif



/*
 * The command filters for the manual and apropos searches.
 */

#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
/* with mkstemp the temp output file is already created */
#  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"             /* The format command. */
# elif defined(CSRG_BASED)
#  define FORMAT "| eqn | tbl | nroff -mandoc"
# elif defined(BSD) && (BSD >= 199103)
#  define FORMAT "| eqn | tbl | nroff -man"
# elif defined(linux)
#  define FORMAT "| eqn | tbl | GROFF_NO_SGR= groff -Tlatin1 -mandoc"
# else
#  define FORMAT "| neqn | nroff -man"      /* The format command. */
# endif
# define TBL "tbl"
#else /* HANDLE_ROFFSEQ */
# 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 /*HANDLE_ROFFSEQ */

/*
 * Names of the man and cat dirs.
 */

#ifdef __bsdi__
#define MAN "cat"
#else
#define MAN "man"
#endif

/*
 * The Apple, Cray,, SYSV386, and HCX folks put the preformatted pages in the
 * "man" directories.
 */
#if (defined(macII) || defined(CRAY) || defined(hcx) || \
	(defined(SYSV) && defined(i386))) && !defined(SCO)
#  define CAT MAN
#elif defined(SCO)
#  define CAT "cat."
#else
#  define CAT "cat"
#endif

typedef struct _SectionList {
  struct _SectionList * next;
  char * label;			/* section label */
  char * directory;		/* section 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);