home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 8 / CDACTUAL8.iso / share / os2 / varios / apache / conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-06-29  |  12.8 KB  |  512 lines

  1.  
  2. /* ====================================================================
  3.  * Copyright (c) 1995 The Apache Group.  All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms, with or without
  6.  * modification, are permitted provided that the following conditions
  7.  * are met:
  8.  *
  9.  * 1. Redistributions of source code must retain the above copyright
  10.  *    notice, this list of conditions and the following disclaimer. 
  11.  *
  12.  * 2. Redistributions in binary form must reproduce the above copyright
  13.  *    notice, this list of conditions and the following disclaimer in
  14.  *    the documentation and/or other materials provided with the
  15.  *    distribution.
  16.  *
  17.  * 3. All advertising materials mentioning features or use of this
  18.  *    software must display the following acknowledgment:
  19.  *    "This product includes software developed by the Apache Group
  20.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  21.  *
  22.  * 4. The names "Apache Server" and "Apache Group" must not be used to
  23.  *    endorse or promote products derived from this software without
  24.  *    prior written permission.
  25.  *
  26.  * 5. Redistributions of any form whatsoever must retain the following
  27.  *    acknowledgment:
  28.  *    "This product includes software developed by the Apache Group
  29.  *    for use in the Apache HTTP server project (http://www.apache.org/)."
  30.  *
  31.  * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
  32.  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  33.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  34.  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE APACHE GROUP OR
  35.  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  36.  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  37.  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  38.  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  39.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  40.  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  41.  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  42.  * OF THE POSSIBILITY OF SUCH DAMAGE.
  43.  * ====================================================================
  44.  *
  45.  * This software consists of voluntary contributions made by many
  46.  * individuals on behalf of the Apache Group and was originally based
  47.  * on public domain software written at the National Center for
  48.  * Supercomputing Applications, University of Illinois, Urbana-Champaign.
  49.  * For more information on the Apache Group and the Apache HTTP server
  50.  * project, please see <http://www.apache.org/>.
  51.  *
  52.  */
  53.  
  54.  
  55. /*
  56.  * conf.h: system-dependant #defines and includes...
  57.  * See README for a listing of what they mean
  58.  */
  59.  
  60. #ifndef QNX
  61. #include <sys/param.h>
  62. #endif
  63.  
  64. /* Define one of these according to your system. */
  65. #if defined(SUNOS4)
  66. #define HAS_GMTOFF
  67. #define HAVE_RESOURCE 1
  68. #undef NO_KILLPG
  69. #undef NO_SETSID
  70. char *crypt(char *pw, char *salt);
  71. #define JMP_BUF sigjmp_buf
  72. #define HAVE_MMAP
  73. #include <sys/time.h>     
  74. #define NEED_STRERROR
  75.  
  76. #elif defined(SOLARIS2)
  77. #undef HAS_GMTOFF
  78. #define NO_KILLPG
  79. #undef NO_SETSID
  80. #define HAVE_RESOURCE 1
  81. #define bzero(a,b) memset(a,0,b)
  82. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  83. #define JMP_BUF sigjmp_buf
  84. #define FCNTL_SERIALIZED_ACCEPT
  85. #define HAVE_MMAP
  86. #define HAVE_CRYPT_H
  87.  
  88. #elif defined(IRIX)
  89. #undef HAS_GMTOFF
  90. #undef NO_KILLPG
  91. #undef NO_SETSID
  92. #define JMP_BUF sigjmp_buf
  93. #define FCNTL_SERIALIZED_ACCEPT
  94. #define HAVE_SHMGET
  95. #define HAVE_CRYPT_H
  96.  
  97. #elif defined(HPUX)
  98. #define HAVE_RESOURCE 1
  99. #undef HAS_GMTOFF
  100. #define NO_KILLPG
  101. #undef NO_SETSID
  102. #ifndef _HPUX_SOURCE
  103. #define _HPUX_SOURCE
  104. #endif
  105. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  106. #define JMP_BUF sigjmp_buf
  107. #define HAVE_MMAP
  108.  
  109. #elif defined(AIX)
  110. #undef HAS_GMTOFF
  111. #undef NO_KILLPG
  112. #undef NO_SETSID
  113. #define NEED_SELECT_H
  114. #define JMP_BUF sigjmp_buf
  115.  
  116. #elif defined(ULTRIX)
  117. #define HAS_GMTOFF
  118. #undef NO_KILLPG
  119. #undef NO_SETSID
  120. #define ULTRIX_BRAIN_DEATH
  121. #define NEED_STRDUP
  122. /* If you have Ultrix 4.3, and are using cc, const is broken */
  123. #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
  124. #define const /* Not implemented */
  125. #endif
  126. #define JMP_BUF sigjmp_buf
  127.  
  128. #elif defined(OSF1)
  129. #define HAS_GMTOFF
  130. #undef NO_KILLPG
  131. #undef NO_SETSID
  132. #define JMP_BUF sigjmp_buf
  133. #define HAVE_MMAP
  134. #define HAVE_CRYPT_H
  135.  
  136. #elif defined(SEQUENT)
  137. #define HAS_GMTOFF
  138. #undef NO_KILLPG
  139. #define NO_SETSID
  140. #define NEED_STRDUP
  141. #define tolower(c) (isupper(c) ? tolower(c) : c)
  142.  
  143. #elif defined(NEXT)
  144. #include <libc.h>
  145. typedef unsigned short mode_t;
  146. #define HAS_GMTOFF
  147. #undef NO_KILLPG
  148. #define NO_SETSID
  149. #define NEED_STRDUP
  150. #undef _POSIX_SOURCE
  151. #ifndef FD_CLOEXEC
  152. #define FD_CLOEXEC 1
  153. #endif
  154. #ifndef S_ISDIR
  155. #define S_ISDIR(m)      (((m)&(S_IFMT)) == (S_IFDIR))
  156. #endif
  157. #ifndef S_ISREG
  158. #define S_ISREG(m)      (((m)&(S_IFMT)) == (S_IFREG))
  159. #endif
  160. #ifndef S_IXUSR
  161. #define S_IXUSR 00100
  162. #endif
  163. #ifndef S_IRGRP
  164. #define S_IRGRP 00040
  165. #endif
  166. #ifndef S_IXGRP
  167. #define S_IXGRP 00010
  168. #endif
  169. #ifndef S_IROTH
  170. #define S_IROTH 00004
  171. #endif
  172. #ifndef S_IXOTH
  173. #define S_IXOTH 00001
  174. #endif
  175. #ifndef S_IRUSR
  176. #define S_IRUSR S_IREAD
  177. #endif
  178. #ifndef S_IWUSR
  179. #define S_IWUSR S_IWRITE
  180. #endif
  181. #define STDIN_FILENO  0
  182. #define STDOUT_FILENO 1
  183. #define STDERR_FILENO 2
  184. #define waitpid(a,b,c) wait4(a,(union wait *)b,c,NULL)
  185. typedef int pid_t;
  186. #define JMP_BUF jmp_buf
  187. #define NO_USE_SIGACTION
  188.  
  189. #elif defined(LINUX)
  190. #undef HAS_GMTOFF
  191. #undef NO_KILLPG
  192. #undef NO_SETSID
  193. #undef NEED_STRDUP
  194. #define JMP_BUF sigjmp_buf
  195. #define FCNTL_SERIALIZED_ACCEPT
  196. #include <sys/time.h>     
  197.  
  198. #elif defined(SCO)
  199. #undef HAS_GMTOFF
  200. #undef NO_KILLPG
  201. #undef NO_SETSID
  202. #define NEED_INITGROUPS
  203. #define JMP_BUF sigjmp_buf
  204. #define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */
  205. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  206.  
  207. #elif defined(SCO5)
  208.  
  209. #define JMP_BUF sigjmp_buf
  210. #define SIGURG SIGUSR1
  211. #define NEED_SELECT_H
  212. #define FCNTL_SERIALIZED_ACCEPT
  213. #define HAVE_MMAP
  214. #define SecureWare
  215.  
  216. /* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
  217. consts. Sigh. */
  218. extern int strcasecmp(const char *,const char *);
  219. extern int strncasecmp(const char *,const char *,unsigned);
  220.  
  221. #elif defined(CONVEXOS)
  222. #define HAS_GMTOFF
  223. #define NEED_STRDUP
  224. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  225.  
  226. #elif defined(AUX)
  227. #undef HAS_GMTOFF
  228. #undef NO_KILLPG
  229. #undef NO_SETSID
  230. #define NEED_STRDUP
  231. #define JMP_BUF sigjmp_buf
  232. /* fcntl() locking is expensive with NFS */
  233. #undef FLOCK_SERIALIZED_ACCEPT
  234. #define HAVE_SHMGET
  235. #define MOVEBREAK        0x4000000
  236. /* These are to let -Wall compile more cleanly */
  237. extern int strcasecmp(const char *, const char *);
  238. extern int strncasecmp(const char *,const char *,unsigned);
  239.  
  240. #elif defined(SVR4)
  241. #define NO_KILLPG
  242. #undef  NO_SETSID
  243. #undef NEED_STRDUP
  244. #define NEED_STRCASECMP
  245. #define NEED_STRNCASECMP
  246. #define bzero(a,b) memset(a,0,b)
  247. #define JMP_BUF sigjmp_buf
  248. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  249. /* A lot of SVR4 systems need this */
  250. #define FCNTL_SERIALIZED_ACCEPT
  251.  
  252. #elif defined(DGUX)
  253. #define NO_KILLPG
  254. #undef  NO_SETSID
  255. #undef NEED_STRDUP
  256. #define NEED_STRCASECMP
  257. #define NEED_STRNCASECMP
  258. #define bzero(a,b) memset(a,0,b)
  259. #define JMP_BUF sigjmp_buf
  260. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  261. /* A lot of SVR4 systems need this */
  262. #define FCNTL_SERIALIZED_ACCEPT
  263.  
  264. #elif defined(__NetBSD__)
  265. #define HAS_GMTOFF
  266. #undef NO_KILLPG
  267. #undef NO_SETSID
  268. #define JMP_BUF sigjmp_buf
  269.  
  270. #elif defined(UTS21)
  271. #undef HAS_GMTOFF
  272. #undef NO_KILLPG
  273. #define NO_SETSID
  274. #define NEED_WAITPID
  275. #define STDIN_FILENO 0
  276. #define STDOUT_FILENO 1
  277. #define STDERR_FILENO 2
  278. #define strftime(buf,bufsize,fmt,tm)    ascftime(buf,fmt,tm)
  279. #include <sys/types.h>
  280.  
  281. #elif defined(APOLLO)
  282. #undef HAS_GMTOFF
  283. #undef NO_KILLPG
  284. #undef NO_SETSID
  285. #define timezone    _bky_timezone
  286.  
  287. #elif defined(__FreeBSD__) || defined(__bsdi__)
  288. #define HAS_GMTOFF
  289. #undef NO_KILLPG
  290. #undef NO_SETSID
  291. #define JMP_BUF sigjmp_buf
  292. #define HAVE_MMAP
  293.  
  294. #elif defined(QNX)
  295. #undef NO_KILLPG
  296. #undef NO_SETSID
  297. #define NEED_INITGROUPS
  298. #define NEED_SELECT_H
  299. #define JMP_BUF sigjmp_buf
  300.  
  301. #elif defined(LYNXOS)
  302. #undef NO_KILLPG
  303. #undef NO_SETSID
  304. #define NO_TIMEZONE
  305. #define NEED_STRCASECMP
  306. #define NEED_STRNCASECMP
  307. #define NEED_INITGROUPS
  308. #define JMP_BUF jmp_buf
  309.  
  310. #elif defined(__EMX__)
  311. /* Defines required for EMX OS/2 port. */
  312. #define JMP_BUF sigjmp_buf
  313. #define NO_KILLPG
  314. #define NEED_STRCASECMP
  315. #define NEED_STRNCASECMP
  316. #define NO_SETSID
  317. /* Add some drive name support */
  318. #define chdir _chdir2
  319.  
  320. /* Unknown system - Edit these to match */
  321. #else
  322. #ifdef BSD
  323. #define HAS_GMTOFF
  324. #else
  325. #undef HAS_GMTOFF
  326. #endif
  327. /* NO_KILLPG is set on systems that don't have killpg */
  328. #undef NO_KILLPG
  329. /* NO_SETSID is set on systems that don't have setsid */
  330. #undef NO_SETSID
  331. /* NEED_STRDUP is set on stupid systems that don't have strdup. */
  332. #undef NEED_STRDUP
  333. #endif
  334.  
  335. /* Do we have sys/resource.h; assume that BSD does. */
  336. #ifndef HAVE_RESOURCE
  337. #ifdef BSD
  338. #define HAVE_RESOURCE 1
  339. #else
  340. #define HAVE_RESOURCE 0
  341. #endif
  342. #endif /* HAVE_RESOURCE */
  343.  
  344. /*
  345.  * The particular directory style your system supports. If you have dirent.h
  346.  * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include 
  347.  * that file and define DIR_TYPE to be dirent. Otherwise, if you have 
  348.  * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
  349.  * file. If you have neither, I'm confused.
  350.  */
  351.  
  352. #include <sys/types.h>
  353.  
  354. #if !defined(NEXT) && !defined(CONVEXOS)
  355. #include <dirent.h>
  356. #define DIR_TYPE dirent
  357. #else
  358. #include <sys/dir.h>
  359. #define DIR_TYPE direct
  360. #endif
  361.  
  362. #include <stdio.h>
  363. #include <stdlib.h>
  364. #include <string.h>
  365. #include <sys/stat.h>
  366. #include <sys/file.h>
  367. #include <sys/socket.h>
  368. #ifdef NEED_SELECT_H
  369. #include <sys/select.h>
  370. #endif
  371. #include <ctype.h>
  372. #include <netinet/in.h>
  373. #include <netdb.h>
  374. #include <sys/ioctl.h>
  375. #include <arpa/inet.h>  /* for inet_ntoa */
  376. #include <time.h>  /* for ctime */
  377. #include <signal.h>
  378. #include <errno.h>
  379. #include <sys/wait.h>
  380. #include <pwd.h>
  381. #include <grp.h>
  382. #include <fcntl.h>
  383. #include <limits.h>
  384. #ifndef QNX
  385. #include <memory.h>
  386. #endif
  387.  
  388. #if HAVE_RESOURCE
  389. #include <sys/resource.h>
  390. #ifdef SUNOS4
  391. int getrlimit( int, struct rlimit *);
  392. int setrlimit( int, struct rlimit *);
  393. #endif
  394. #endif
  395. #ifdef HAVE_MMAP
  396. #include <sys/mman.h>
  397. #endif
  398. #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
  399. #define MAP_ANON MAP_ANONYMOUS
  400. #endif
  401.  
  402. #if defined(HAVE_MMAP) && defined(NO_MMAP)
  403. #undef HAVE_MMAP
  404. #endif
  405.  
  406. #ifndef LOGNAME_MAX
  407. #define LOGNAME_MAX 25
  408. #endif
  409.  
  410. #ifndef NEXT
  411. #include <unistd.h>
  412. #endif
  413.  
  414. #ifdef ultrix
  415. #define ULTRIX_BRAIN_DEATH
  416. #endif
  417.  
  418. #ifndef S_ISLNK
  419. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  420. #endif
  421.  
  422. /* Finding offsets of elements within structures.
  423.  * Taken from the X code... they've sweated portability of this stuff
  424.  * so we don't have to.  Sigh...
  425.  */
  426.  
  427. #if defined(CRAY) || defined(__arm)
  428. #if __STDC__
  429. #define XtOffset(p_type,field) _Offsetof(p_type,field)
  430. #else
  431. #ifdef CRAY2
  432. #define XtOffset(p_type,field) \
  433.     (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
  434.  
  435. #else    /* !CRAY2 */
  436.  
  437. #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
  438.  
  439. #endif    /* !CRAY2 */
  440. #endif  /* __STDC__ */
  441. #else    /* ! (CRAY || __arm) */
  442.  
  443. #define XtOffset(p_type,field) \
  444.     ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
  445.  
  446. #endif /* !CRAY */
  447.  
  448. #ifdef offsetof
  449. #define XtOffsetOf(s_type,field) offsetof(s_type,field)
  450. #else
  451. #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
  452. #endif
  453.  
  454. #ifdef SUNOS_LIB_PROTOTYPES
  455. /* Prototypes needed to get a clean compile with gcc -Wall.
  456.  * Believe it or not, these do have to be declared, at least on SunOS,
  457.  * because they aren't mentioned in the relevant system headers.
  458.  * Sun Quality Software.  Gotta love it.
  459.  */
  460.  
  461. int getopt (int, char **, char *);
  462.  
  463. int strcasecmp (char *, char *);
  464. int strncasecmp (char *, char *, int);
  465. int toupper(int);
  466. int tolower(int);     
  467.      
  468. int printf (char *, ...);     
  469. int fprintf (FILE *, char *, ...);
  470. int fputs (char *, FILE *);
  471. int fread (char *, int, int, FILE *);     
  472. int fwrite (char *, int, int, FILE *);     
  473. int fflush (FILE *);
  474. int fclose (FILE *);
  475. int ungetc (int, FILE *);
  476. int _filbuf (FILE *);        /* !!! */
  477. int _flsbuf (unsigned char, FILE *); /* !!! */
  478. int sscanf (char *, char *, ...);
  479. void setbuf (FILE *, char *);
  480. void perror (char *);
  481.      
  482. time_t time (time_t *);
  483. int strftime (char *, int, char *, struct tm *);
  484.      
  485. int initgroups (char *, int);     
  486. int wait3 (int *, int, void*);    /* Close enough for us... */
  487. int lstat (const char *, struct stat *);
  488. int stat (const char *, struct stat *);     
  489. int flock (int, int);
  490. int getwd (char *);
  491. #ifndef NO_KILLPG
  492. int killpg(int, int);
  493. #endif
  494. int socket (int, int, int);     
  495. int setsockopt (int, int, int, const char*, int);
  496. int listen (int, int);     
  497. int bind (int, struct sockaddr *, int);     
  498. int connect (int, struct sockaddr *, int);
  499. int accept (int, struct sockaddr *, int *);
  500. int shutdown (int, int);     
  501.  
  502. int getsockname (int s, struct sockaddr *name, int *namelen);
  503. int getpeername (int s, struct sockaddr *name, int *namelen);
  504. int gethostname (char *name, int namelen);     
  505. void syslog (int, char *, ...);
  506. char *mktemp (char *);
  507.      
  508. #include <stdarg.h>
  509. long vfprintf (FILE *, char *, va_list);
  510.      
  511. #endif
  512.