home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Internet / WWW / apache_1.0.5 / src / conf.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-16  |  11.2 KB  |  451 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.  */
  58.  
  59. #ifndef QNX
  60. #include <sys/param.h>
  61. #endif
  62.  
  63. /* Define one of these according to your system. */
  64. #if defined(SUNOS4)
  65. #define HAS_GMTOFF
  66. #define HAVE_RESOURCE 1
  67. #undef NO_KILLPG
  68. #undef NO_SETSID
  69. char *crypt(char *pw, char *salt);
  70. #define JMP_BUF sigjmp_buf
  71. #define NEED_STRERROR
  72. #include <sys/time.h>     
  73.  
  74. #elif defined(SOLARIS2)
  75. #undef HAS_GMTOFF
  76. #define NO_KILLPG
  77. #undef NO_SETSID
  78. #define HAVE_RESOURCE 1
  79. #define bzero(a,b) memset(a,0,b)
  80. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  81. #define JMP_BUF sigjmp_buf
  82. #define FCNTL_SERIALIZED_ACCEPT
  83.  
  84. #elif defined(IRIX)
  85. #undef HAS_GMTOFF
  86. #undef NO_KILLPG
  87. #undef NO_SETSID
  88. #define JMP_BUF sigjmp_buf
  89. #define FCNTL_SERIALIZED_ACCEPT
  90.  
  91. #elif defined(HPUX)
  92. #define HAVE_RESOURCE 1
  93. #undef HAS_GMTOFF
  94. #define NO_KILLPG
  95. #undef NO_SETSID
  96. #ifndef _HPUX_SOURCE
  97. #define _HPUX_SOURCE
  98. #endif
  99. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  100. #define JMP_BUF sigjmp_buf
  101.  
  102. #elif defined(AIX)
  103. #undef HAS_GMTOFF
  104. #undef NO_KILLPG
  105. #undef NO_SETSID
  106. #define NEED_SELECT_H
  107. #define JMP_BUF sigjmp_buf
  108.  
  109. #elif defined(ULTRIX)
  110. #define HAS_GMTOFF
  111. #undef NO_KILLPG
  112. #undef NO_SETSID
  113. #define ULTRIX_BRAIN_DEATH
  114. #define NEED_STRDUP
  115. /* If you have Ultrix 4.3, and are using cc, const is broken */
  116. #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
  117. #define const /* Not implemented */
  118. #endif
  119. #define JMP_BUF sigjmp_buf
  120.  
  121. #elif defined(OSF1)
  122. #define HAS_GMTOFF
  123. #undef NO_KILLPG
  124. #undef NO_SETSID
  125. #define JMP_BUF sigjmp_buf
  126.  
  127. #elif defined(SEQUENT)
  128. #define HAS_GMTOFF
  129. #undef NO_KILLPG
  130. #define NO_SETSID
  131. #define NEED_STRDUP
  132. #define tolower(c) (isupper(c) ? tolower(c) : c)
  133.  
  134. #elif defined(NEXT)
  135. #include <libc.h>
  136. typedef unsigned short mode_t;
  137. #define HAS_GMTOFF
  138. #undef NO_KILLPG
  139. #define NO_SETSID
  140. #define NEED_STRDUP
  141. #undef _POSIX_SOURCE
  142. #ifndef FD_CLOEXEC
  143. #define FD_CLOEXEC 1
  144. #endif
  145. #ifndef S_ISDIR
  146. #define S_ISDIR(m)      (((m)&(S_IFMT)) == (S_IFDIR))
  147. #endif
  148. #ifndef S_ISREG
  149. #define S_ISREG(m)      (((m)&(S_IFMT)) == (S_IFREG))
  150. #endif
  151. #ifndef S_IXUSR
  152. #define S_IXUSR 00100
  153. #endif
  154. #ifndef S_IRGRP
  155. #define S_IRGRP 00040
  156. #endif
  157. #ifndef S_IXGRP
  158. #define S_IXGRP 00010
  159. #endif
  160. #ifndef S_IROTH
  161. #define S_IROTH 00004
  162. #endif
  163. #ifndef S_IXOTH
  164. #define S_IXOTH 00001
  165. #endif
  166. #ifndef S_IRUSR
  167. #define S_IRUSR S_IREAD
  168. #endif
  169. #ifndef S_IWUSR
  170. #define S_IWUSR S_IWRITE
  171. #endif
  172. #define STDIN_FILENO  0
  173. #define STDOUT_FILENO 1
  174. #define STDERR_FILENO 2
  175. #define waitpid(a,b,c) wait4(a,(union wait *)b,c,NULL)
  176. typedef int pid_t;
  177. #define JMP_BUF jmp_buf
  178.  
  179. #elif defined(LINUX)
  180. #undef HAS_GMTOFF
  181. #undef NO_KILLPG
  182. #undef NO_SETSID
  183. #undef NEED_STRDUP
  184. #define JMP_BUF sigjmp_buf
  185. #define FCNTL_SERIALIZED_ACCEPT
  186.  
  187. #elif defined(SCO)
  188. #undef HAS_GMTOFF
  189. #undef NO_KILLPG
  190. #undef NO_SETSID
  191. #define NEED_INITGROUPS
  192. #define JMP_BUF sigjmp_buf
  193. #define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */
  194. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  195.  
  196. #elif defined(SCO5)
  197.  
  198. #define JMP_BUF sigjmp_buf
  199. #define SIGURG SIGUSR1
  200.  
  201. #elif defined(CONVEXOS)
  202. #define HAS_GMTOFF
  203. #define NEED_STRDUP
  204. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  205.  
  206. #elif defined(AUX)
  207. #undef HAS_GMTOFF
  208. #undef NO_KILLPG
  209. #undef NO_SETSID
  210. #define NEED_STRDUP
  211. #define JMP_BUF sigjmp_buf
  212.  
  213. #elif defined(SVR4)
  214. #define NO_KILLPG
  215. #undef  NO_SETSID
  216. #undef NEED_STRDUP
  217. #define NEED_STRCASECMP
  218. #define NEED_STRNCASECMP
  219. #define bzero(a,b) memset(a,0,b)
  220. #define JMP_BUF sigjmp_buf
  221. #define getwd(d) getcwd(d,MAX_STRING_LEN)
  222. /* A lot of SVR4 systems need this */
  223. #define FCNTL_SERIALIZED_ACCEPT
  224.  
  225. #elif defined(__NetBSD__)
  226. #define HAS_GMTOFF
  227. #undef NO_KILLPG
  228. #undef NO_SETSID
  229. #define JMP_BUF sigjmp_buf
  230.  
  231. #elif defined(UTS21)
  232. #undef HAS_GMTOFF
  233. #undef NO_KILLPG
  234. #define NO_SETSID
  235. #define NEED_WAITPID
  236. #define STDIN_FILENO 0
  237. #define STDOUT_FILENO 1
  238. #define STDERR_FILENO 2
  239. #define strftime(buf,bufsize,fmt,tm)    ascftime(buf,fmt,tm)
  240. #include <sys/types.h>
  241.  
  242. #elif defined(APOLLO)
  243. #undef HAS_GMTOFF
  244. #undef NO_KILLPG
  245. #undef NO_SETSID
  246. #define timezone    _bky_timezone
  247.  
  248. #elif defined(__FreeBSD__) || defined(__bsdi__)
  249. #define HAS_GMTOFF
  250. #undef NO_KILLPG
  251. #undef NO_SETSID
  252. #define JMP_BUF sigjmp_buf
  253.  
  254. #elif defined(QNX)
  255. #undef NO_KILLPG
  256. #undef NO_SETSID
  257. #define NEED_INITGROUPS
  258. #define JMP_BUF sigjmp_buf
  259.  
  260. #elif defined(LYNXOS)
  261. #undef NO_KILLPG
  262. #undef NO_SETSID
  263. #define NO_TIMEZONE
  264. #define NEED_STRCASECMP
  265. #define NEED_STRNCASECMP
  266. #define NEED_INITGROUPS
  267. #define JMP_BUF jmp_buf
  268.  
  269. /* Unknown system - Edit these to match */
  270. #else
  271. #ifdef BSD
  272. #define HAS_GMTOFF
  273. #else
  274. #undef HAS_GMTOFF
  275. #endif
  276. /* NO_KILLPG is set on systems that don't have killpg */
  277. #undef NO_KILLPG
  278. /* NO_SETSID is set on systems that don't have setsid */
  279. #undef NO_SETSID
  280. /* NEED_STRDUP is set on stupid systems that don't have strdup. */
  281. #undef NEED_STRDUP
  282. #endif
  283.  
  284. /* Do we have sys/resource.h; assume that BSD does. */
  285. #ifndef HAVE_RESOURCE
  286. #ifdef BSD
  287. #define HAVE_RESOURCE 1
  288. #else
  289. #define HAVE_RESOURCE 0
  290. #endif
  291. #endif /* HAVE_RESOURCE */
  292.  
  293. /*
  294.  * The particular directory style your system supports. If you have dirent.h
  295.  * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include 
  296.  * that file and define DIR_TYPE to be dirent. Otherwise, if you have 
  297.  * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
  298.  * file. If you have neither, I'm confused.
  299.  */
  300.  
  301. #include <sys/types.h>
  302.  
  303. #if !defined(NEXT) && !defined(CONVEXOS)
  304. #include <dirent.h>
  305. #define DIR_TYPE dirent
  306. #else
  307. #include <sys/dir.h>
  308. #define DIR_TYPE direct
  309. #endif
  310.  
  311. #include <stdio.h>
  312. #include <stdlib.h>
  313. #include <string.h>
  314. #include <sys/stat.h>
  315. #include <sys/file.h>
  316. #include <sys/socket.h>
  317. #ifdef NEED_SELECT_H
  318. #include <sys/select.h>
  319. #endif
  320. #include <ctype.h>
  321. #include <netinet/in.h>
  322. #include <netdb.h>
  323. #include <sys/ioctl.h>
  324. #include <arpa/inet.h>  /* for inet_ntoa */
  325. #include <time.h>  /* for ctime */
  326. #include <signal.h>
  327. #include <errno.h>
  328. #include <sys/wait.h>
  329. #include <pwd.h>
  330. #include <grp.h>
  331. #include <fcntl.h>
  332. #include <limits.h>
  333. #ifndef QNX
  334. #include <memory.h>
  335. #endif
  336.  
  337. #if HAVE_RESOURCE
  338. #include <sys/resource.h>
  339. #ifdef SUNOS4
  340. int getrlimit( int, struct rlimit *);
  341. int setrlimit( int, struct rlimit *);
  342. #endif
  343. #endif
  344.  
  345. #ifndef LOGNAME_MAX
  346. #define LOGNAME_MAX 25
  347. #endif
  348.  
  349. #ifndef NEXT
  350. #include <unistd.h>
  351. #endif
  352.  
  353. #ifdef ultrix
  354. #define ULTRIX_BRAIN_DEATH
  355. #endif
  356.  
  357. #ifndef S_ISLNK
  358. #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
  359. #endif
  360.  
  361. /* Finding offsets of elements within structures.
  362.  * Taken from the X code... they've sweated portability of this stuff
  363.  * so we don't have to.  Sigh...
  364.  */
  365.  
  366. #if defined(CRAY) || defined(__arm)
  367. #if __STDC__
  368. #define XtOffset(p_type,field) _Offsetof(p_type,field)
  369. #else
  370. #ifdef CRAY2
  371. #define XtOffset(p_type,field) \
  372.     (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
  373.  
  374. #else    /* !CRAY2 */
  375.  
  376. #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
  377.  
  378. #endif    /* !CRAY2 */
  379. #endif  /* __STDC__ */
  380. #else    /* ! (CRAY || __arm) */
  381.  
  382. #define XtOffset(p_type,field) \
  383.     ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
  384.  
  385. #endif /* !CRAY */
  386.  
  387. #ifdef offsetof
  388. #define XtOffsetOf(s_type,field) offsetof(s_type,field)
  389. #else
  390. #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
  391. #endif
  392.  
  393. #ifdef SUNOS_LIB_PROTOTYPES
  394. /* Prototypes needed to get a clean compile with gcc -Wall.
  395.  * Believe it or not, these do have to be declared, at least on SunOS,
  396.  * because they aren't mentioned in the relevant system headers.
  397.  * Sun Quality Software.  Gotta love it.
  398.  */
  399.  
  400. int getopt (int, char **, char *);
  401.  
  402. int strcasecmp (char *, char *);
  403. int strncasecmp (char *, char *, int);
  404. int toupper(int);
  405. int tolower(int);     
  406.      
  407. int printf (char *, ...);     
  408. int fprintf (FILE *, char *, ...);
  409. int fputs (char *, FILE *);
  410. int fread (char *, int, int, FILE *);     
  411. int fwrite (char *, int, int, FILE *);     
  412. int fflush (FILE *);
  413. int fclose (FILE *);
  414. int ungetc (int, FILE *);
  415. int _filbuf (FILE *);        /* !!! */
  416. int _flsbuf (unsigned char, FILE *); /* !!! */
  417. int sscanf (char *, char *, ...);
  418. void setbuf (FILE *, char *);
  419. void perror (char *);
  420.      
  421. time_t time (time_t *);
  422. int strftime (char *, int, char *, struct tm *);
  423.      
  424. int initgroups (char *, int);     
  425. int wait3 (int *, int, void*);    /* Close enough for us... */
  426. int lstat (const char *, struct stat *);
  427. int stat (const char *, struct stat *);     
  428. int flock (int, int);
  429. int getwd (char *);
  430. #ifndef NO_KILLPG
  431. int killpg(int, int);
  432. #endif
  433. int socket (int, int, int);     
  434. int setsockopt (int, int, int, const char*, int);
  435. int listen (int, int);     
  436. int bind (int, struct sockaddr *, int);     
  437. int connect (int, struct sockaddr *, int);
  438. int accept (int, struct sockaddr *, int *);
  439. int shutdown (int, int);     
  440.  
  441. int getsockname (int s, struct sockaddr *name, int *namelen);
  442. int getpeername (int s, struct sockaddr *name, int *namelen);
  443. int gethostname (char *name, int namelen);     
  444. void syslog (int, char *, ...);
  445. char *mktemp (char *);
  446.      
  447. #include <stdarg.h>
  448. long vfprintf (FILE *, char *, va_list);
  449.      
  450. #endif
  451.