Import Upstream version 1.8.5
[hcoop/debian/openafs.git] / src / afsweb / apache_includes / 1.2 / conf.h
1 /* ====================================================================
2 * Copyright (c) 1995-1997 The Apache Group. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in
13 * the documentation and/or other materials provided with the
14 * distribution.
15 *
16 * 3. All advertising materials mentioning features or use of this
17 * software must display the following acknowledgment:
18 * "This product includes software developed by the Apache Group
19 * for use in the Apache HTTP server project (http://www.apache.org/)."
20 *
21 * 4. The names "Apache Server" and "Apache Group" must not be used to
22 * endorse or promote products derived from this software without
23 * prior written permission.
24 *
25 * 5. Redistributions of any form whatsoever must retain the following
26 * acknowledgment:
27 * "This product includes software developed by the Apache Group
28 * for use in the Apache HTTP server project (http://www.apache.org/)."
29 *
30 * THIS SOFTWARE IS PROVIDED BY THE APACHE GROUP ``AS IS'' AND ANY
31 * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
32 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE APACHE GROUP OR
34 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
35 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
36 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
37 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
40 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
41 * OF THE POSSIBILITY OF SUCH DAMAGE.
42 * ====================================================================
43 *
44 * This software consists of voluntary contributions made by many
45 * individuals on behalf of the Apache Group and was originally based
46 * on public domain software written at the National Center for
47 * Supercomputing Applications, University of Illinois, Urbana-Champaign.
48 * For more information on the Apache Group and the Apache HTTP server
49 * project, please see <http://www.apache.org/>.
50 *
51 */
52
53 /*
54 * conf.h: system-dependant #defines and includes...
55 * See PORTING for a listing of what they mean
56 */
57
58 #if !defined(QNX) && !defined(MPE)
59 #include <sys/param.h>
60 #endif
61
62 /* Define one of these according to your system. */
63 #if defined(MPE)
64 #include <sys/times.h>
65 #define JMP_BUF sigjmp_buf
66 #define NO_SETSID
67 #define NO_KILLPG
68 #define NO_WRITEV
69 #define NEED_INITGROUPS
70 #define NEED_STRCASECMP
71 #define NEED_STRDUP
72 #define NEED_STRNCASECMP
73 extern void GETPRIVMODE();
74 extern void GETUSERMODE();
75 extern char *inet_ntoa();
76 #define NO_SLACK
77
78 #elif defined(SUNOS4)
79 #define HAVE_GMTOFF
80 #define HAVE_SYS_RESOURCE_H
81 #undef NO_KILLPG
82 #undef NO_SETSID
83 char *crypt(const char *pw, const char *salt);
84 char *mktemp(char *template);
85 #define JMP_BUF sigjmp_buf
86 #define HAVE_MMAP
87 #include <sys/time.h>
88 #define NEED_STRERROR
89 typedef int rlim_t;
90 #ifndef HAVE_MEMMOVE
91 #define memmove(a,b,c) memcpy(a, b, c)
92 #endif
93 #define NO_LINGCLOSE
94 #define USE_FLOCK_SERIALIZED_ACCEPT
95
96 #elif defined(SOLARIS2)
97 #undef HAVE_GMTOFF
98 #define NO_KILLPG
99 #undef NO_SETSID
100 #define HAVE_SYS_RESOURCE_H
101 #define JMP_BUF sigjmp_buf
102 #define USE_FCNTL_SERIALIZED_ACCEPT
103 #define HAVE_MMAP
104 #define HAVE_CRYPT_H
105 int gethostname(char *name, int namelen);
106
107 #elif defined(IRIX)
108 #undef HAVE_GMTOFF
109 /* IRIX has killpg, but it's only in _BSD_COMPAT, so don't use it in case
110 * there's some weird conflict with non-BSD signals */
111 #define NO_KILLPG
112 #undef NO_SETSID
113 #define JMP_BUF sigjmp_buf
114 #define USE_FCNTL_SERIALIZED_ACCEPT
115 #define HAVE_SHMGET
116 #define HAVE_CRYPT_H
117 #define NO_LONG_DOUBLE
118 #define HAVE_BSTRING_H
119 #define NO_LINGCLOSE
120
121 #elif defined(HIUX)
122 #define HAVE_SYS_RESOURCE_H
123 #undef HAVE_GMTOFF
124 #define NO_KILLPG
125 #undef NO_SETSID
126 #ifndef _HIUX_SOURCE
127 #define _HIUX_SOURCE
128 #endif
129 #define JMP_BUF sigjmp_buf
130 #define HAVE_SHMGET
131 #define SELECT_NEEDS_CAST
132
133 #elif defined(HPUX) || defined(HPUX10)
134 #define HAVE_SYS_RESOURCE_H
135 #undef HAVE_GMTOFF
136 #define NO_KILLPG
137 #undef NO_SETSID
138 #ifndef _HPUX_SOURCE
139 #define _HPUX_SOURCE
140 #endif
141 #define JMP_BUF sigjmp_buf
142 #define HAVE_SHMGET
143 #ifndef HPUX10
144 #define SELECT_NEEDS_CAST
145 typedef int rlim_t;
146 #endif
147
148 #elif defined(AIX)
149 #undef HAVE_GMTOFF
150 #undef NO_KILLPG
151 #undef NO_SETSID
152 #define HAVE_SYS_SELECT_H
153 #define JMP_BUF sigjmp_buf
154 #ifndef __ps2__
155 #define HAVE_MMAP
156 #define DEFAULT_GROUP "nobody"
157 #endif
158 #define DEFAULT_USER "nobody"
159 #ifdef NEED_RLIM_T
160 typedef int rlim_t;
161 #endif
162
163 #elif defined(ULTRIX)
164 #define HAVE_GMTOFF
165 #undef NO_KILLPG
166 #undef NO_SETSID
167 #define ULTRIX_BRAIN_DEATH
168 #define NEED_STRDUP
169 /* If you have Ultrix 4.3, and are using cc, const is broken */
170 #ifndef __ultrix__ /* Hack to check for pre-Ultrix 4.4 cc */
171 #define const /* Not implemented */
172 #endif
173 #define JMP_BUF sigjmp_buf
174
175 #elif defined(OSF1)
176 #define HAVE_GMTOFF
177 #undef NO_KILLPG
178 #undef NO_SETSID
179 #define JMP_BUF sigjmp_buf
180 #define HAVE_MMAP
181 #define HAVE_CRYPT_H
182 #define NO_LONG_DOUBLE
183
184 #elif defined(PARAGON)
185 #define HAVE_GMTOFF
186 #undef NO_KILLPG
187 #undef NO_SETSID
188 #define JMP_BUF sigjmp_buf
189 #define HAVE_MMAP
190 #define HAVE_CRYPT_H
191 #define NO_LONG_DOUBLE
192 typedef int rlim_t;
193
194 #elif defined(SEQUENT)
195 #define HAVE_GMTOFF
196 #undef NO_KILLPG
197 #define NO_SETSID
198 #define NEED_STRDUP
199 #define tolower(c) (isupper(c) ? tolower(c) : c)
200
201 #elif defined(NEXT)
202 typedef unsigned short mode_t;
203 #define HAVE_GMTOFF
204 #undef NO_KILLPG
205 #define NO_SETSID
206 #define NEED_STRDUP
207 #define NO_LINGCLOSE
208 #define NO_UNISTD_H
209 #undef _POSIX_SOURCE
210 #ifndef FD_CLOEXEC
211 #define FD_CLOEXEC 1
212 #endif
213 #ifndef S_ISDIR
214 #define S_ISDIR(m) (((m)&(S_IFMT)) == (S_IFDIR))
215 #endif
216 #ifndef S_ISREG
217 #define S_ISREG(m) (((m)&(S_IFMT)) == (S_IFREG))
218 #endif
219 #ifndef S_IXUSR
220 #define S_IXUSR 00100
221 #endif
222 #ifndef S_IRGRP
223 #define S_IRGRP 00040
224 #endif
225 #ifndef S_IXGRP
226 #define S_IXGRP 00010
227 #endif
228 #ifndef S_IROTH
229 #define S_IROTH 00004
230 #endif
231 #ifndef S_IXOTH
232 #define S_IXOTH 00001
233 #endif
234 #ifndef S_IRUSR
235 #define S_IRUSR S_IREAD
236 #endif
237 #ifndef S_IWUSR
238 #define S_IWUSR S_IWRITE
239 #endif
240 #ifndef S_IWGRP
241 #define S_IWGRP 000020
242 #endif
243 #ifndef S_IWOTH
244 #define S_IWOTH 000002
245 #ifndef rlim_t
246 typedef int rlim_t;
247 #endif
248 typedef u_long n_long;
249 #endif
250
251 #define STDIN_FILENO 0
252 #define STDOUT_FILENO 1
253 #define STDERR_FILENO 2
254 #define waitpid(a,b,c) wait4((a) == -1 ? 0 : (a),(union wait *)(b),c,NULL)
255 typedef int pid_t;
256 #define JMP_BUF jmp_buf
257 #define USE_LONGJMP
258 #define NO_USE_SIGACTION
259
260 #elif defined(LINUX)
261 #if LINUX > 1
262 #define HAVE_SHMGET
263 #define HAVE_SYS_RESOURCE_H
264 typedef int rlim_t;
265 #endif
266 #define USE_FCNTL_SERIALIZED_ACCEPT
267 #undef HAVE_GMTOFF
268 #undef NO_KILLPG
269 #undef NO_SETSID
270 #undef NEED_STRDUP
271 #define JMP_BUF sigjmp_buf
272 #include <sys/time.h>
273
274 #elif defined(SCO)
275 #undef HAVE_GMTOFF
276 #undef NO_KILLPG
277 #undef NO_SETSID
278 #define NEED_INITGROUPS
279 #define NO_WRITEV
280 #define JMP_BUF sigjmp_buf
281 #define SIGURG SIGUSR1 /* but note, this signal will be sent to a process group if enabled (for OOB data). It is not currently enabled. */
282 #include <sys/time.h>
283
284 #elif defined(SCO5)
285
286 #define JMP_BUF sigjmp_buf
287 #define SIGURG SIGUSR1
288 #define HAVE_SYS_SELECT_H
289 #define USE_FCNTL_SERIALIZED_ACCEPT
290 #define HAVE_MMAP
291 #define HAVE_SYS_RESOURCE_H
292 #define SecureWare
293
294 /* Although SCO 5 defines these in <strings.h> (note the "s") they don't have
295 consts. Sigh. */
296 extern int strcasecmp(const char *, const char *);
297 extern int strncasecmp(const char *, const char *, unsigned);
298
299 #elif defined(AUX)
300 /* These are to let -Wall compile more cleanly */
301 extern int strcasecmp(const char *, const char *);
302 extern int strncasecmp(const char *, const char *, unsigned);
303 extern int set42sig(), getopt(), getpeername();
304 extern int listen(), bind(), socket(), getsockname();
305 extern int accept(), gethostname(), connect(), lstat();
306 extern int select(), killpg(), shutdown();
307 extern int initgroups(), setsockopt();
308 extern char *shmat();
309 extern int shmctl();
310 extern int shmget();
311 extern char *sbrk();
312 extern char *crypt();
313 #include <sys/time.h>
314 #undef HAVE_GMTOFF
315 #undef NO_KILLPG
316 #undef NO_SETSID
317 #define NEED_STRDUP
318 #define JMP_BUF sigjmp_buf
319 /* fcntl() locking is expensive with NFS */
320 #define USE_FLOCK_SERIALIZED_ACCEPT
321 #define HAVE_SHMGET
322 /*
323 * NOTE: If when you run Apache under A/UX and you get a warning
324 * that httpd couldn't move break, then the below value for
325 * MOVEBREAK (64megs) is too large for your setup. Try reducing
326 * to 0x2000000 which is still PLENTY of space. I doubt if
327 * even on heavy systems sbrk() would be called at all...
328 */
329 #define MOVEBREAK 0x4000000
330 #define NO_LINGCLOSE
331 #define NO_SLACK
332
333 #elif defined(SVR4)
334 #define NO_KILLPG
335 #undef NO_SETSID
336 #undef NEED_STRDUP
337 #define NEED_STRCASECMP
338 #define NEED_STRNCASECMP
339 #define JMP_BUF sigjmp_buf
340 /* A lot of SVR4 systems need this */
341 #define USE_FCNTL_SERIALIZED_ACCEPT
342
343 #elif defined(UW)
344 #define NO_LINGCLOSE
345 #define NO_KILLPG
346 #undef NO_SETSID
347 #undef NEED_STRDUP
348 #define NEED_STRCASECMP
349 #define NEED_STRNCASECMP
350 #define JMP_BUF sigjmp_buf
351 #define HAVE_RESOURCE
352 #define HAVE_MMAP
353 #define HAVE_SHMGET
354 #define HAVE_CRYPT_H
355 #define HAVE_SYS_SELECT_H
356 #define HAVE_SYS_RESOURCE_H
357 #include <sys/time.h>
358 #define _POSIX_SOURCE
359
360 #elif defined(DGUX)
361 #define NO_KILLPG
362 #undef NO_SETSID
363 #undef NEED_STRDUP
364 #define NEED_STRCASECMP
365 #define NEED_STRNCASECMP
366 #define JMP_BUF sigjmp_buf
367 /* A lot of SVR4 systems need this */
368 #define USE_FCNTL_SERIALIZED_ACCEPT
369
370 #elif defined(__NetBSD__) || defined(__OpenBSD__)
371 #define HAVE_SYS_RESOURCE_H
372 #define HAVE_GMTOFF
373 #undef NO_KILLPG
374 #undef NO_SETSID
375 #define JMP_BUF sigjmp_buf
376 #define DEFAULT_USER "nobody"
377 #define DEFAULT_GROUP "nogroup"
378
379 #elif defined(UTS21)
380 #undef HAVE_GMTOFF
381 #undef NO_KILLPG
382 #define NO_SETSID
383 #define NEED_WAITPID
384 #define STDIN_FILENO 0
385 #define STDOUT_FILENO 1
386 #define STDERR_FILENO 2
387 #define strftime(buf,bufsize,fmt,tm) ascftime(buf,fmt,tm)
388 #include <sys/types.h>
389
390 #elif defined(APOLLO)
391 #undef HAVE_GMTOFF
392 #undef NO_KILLPG
393 #undef NO_SETSID
394
395 #elif defined(__FreeBSD__) || defined(__bsdi__)
396 #if defined(__FreeBSD__)
397 #include <osreldate.h>
398 #endif
399 #define HAVE_SYS_RESOURCE_H
400 #define HAVE_GMTOFF
401 #undef NO_KILLPG
402 #undef NO_SETSID
403 #define JMP_BUF sigjmp_buf
404 #define HAVE_MMAP
405 #define DEFAULT_USER "nobody"
406 #define DEFAULT_GROUP "nogroup"
407 #if defined(__bsdi__) || \
408 (defined(__FreeBSD_version) && (__FreeBSD_version < 220000))
409 typedef quad_t rlim_t;
410 #endif
411 #define USE_FLOCK_SERIALIZED_ACCEPT
412
413 #elif defined(QNX)
414 #ifndef crypt
415 char *crypt(const char *pw, const char *salt);
416 #endif
417 #ifndef initgroups
418 int initgroups(char *, int);
419 #endif
420 #ifndef strncasecmp
421 #define strncasecmp strnicmp
422 #endif
423 #undef NO_KILLPG
424 #undef NO_SETSID
425 #define NEED_INITGROUPS
426 #define NEED_SELECT_H
427 #define NEED_PROCESS_H
428 #define HAVE_SYS_SELECT_H
429 #include <unix.h>
430 #define JMP_BUF sigjmp_buf
431
432 #elif defined(LYNXOS)
433 #undef NO_KILLPG
434 #undef NO_SETSID
435 #define NEED_STRCASECMP
436 #define NEED_STRNCASECMP
437 #define NEED_INITGROUPS
438 #define JMP_BUF jmp_buf
439
440 #elif defined(UXPDS)
441 #undef NEED_STRCASECMP
442 #undef NEED_STRNCASECMP
443 #undef NEED_STRDUP
444 #undef HAVE_GMTOFF
445 #define NO_KILLPG
446 #undef NO_SETSID
447 #define HAVE_RESOURCE 1
448 #define JMP_BUF sigjmp_buf
449 #define USE_FCNTL_SERIALIZED_ACCEPT
450 #define HAVE_MMAP
451 #define HAVE_CRYPT_H
452
453 #elif defined(__EMX__)
454 /* Defines required for EMX OS/2 port. */
455 #define JMP_BUF sigjmp_buf
456 #define NO_KILLPG
457 #define NEED_STRCASECMP
458 #define NEED_STRNCASECMP
459 #define NO_SETSID
460 /* Add some drive name support */
461 #define chdir _chdir2
462 #include <sys/time.h>
463 #define MAXSOCKETS 4096
464 #define HAVE_MMAP
465
466 #elif defined(__MACHTEN__)
467 typedef int rlim_t;
468 #define JMP_BUF sigjmp_buf
469 #undef NO_KILLPG
470 #define NO_SETSID
471 #define HAVE_GMTOFF
472 #ifndef __MACHTEN_PPC__
473 #ifndef __MACHTEN_68K__
474 #define __MACHTEN_68K__
475 #endif
476 #define USE_FLOCK_SERIALIZED_ACCEPT
477 #define NO_USE_SIGACTION
478 #define USE_LONGJMP
479 #undef NEED_STRDUP
480 #else
481 #define HAVE_SHMGET
482 #define USE_FCNTL_SERIALIZED_ACCEPT
483 #endif
484
485 /* Convex OS v11 */
486 #elif defined(CONVEXOS11)
487 #undef HAVE_GMTOFF
488 #undef NO_KILLPG
489 #undef NO_SETSID
490 #undef NEED_STRDUP
491 #define HAVE_MMAP
492
493 #define NO_TIMEZONE
494 #include <stdio.h>
495 #include <sys/types.h>
496 #define JMP_BUF jmp_buf
497 typedef int rlim_t;
498
499 #elif defined(ISC)
500 #include <net/errno.h>
501 #define NO_KILLPG
502 #undef NO_SETSID
503 #define HAVE_SHMGET
504 #define SIGURG SIGUSR1
505 #define JMP_BUF sigjmp_buf
506 #define USE_FCNTL_SERIALIZED_ACCEPT
507
508 /* Unknown system - Edit these to match */
509 #else
510 #ifdef BSD
511 #define HAVE_GMTOFF
512 #else
513 #undef HAVE_GMTOFF
514 #endif
515 /* NO_KILLPG is set on systems that don't have killpg */
516 #undef NO_KILLPG
517 /* NO_SETSID is set on systems that don't have setsid */
518 #undef NO_SETSID
519 /* NEED_STRDUP is set on stupid systems that don't have strdup. */
520 #undef NEED_STRDUP
521 #endif
522
523 /* Do we have sys/resource.h; assume that BSD does. */
524 #ifndef HAVE_SYS_RESOURCE_H
525 #ifdef BSD
526 #define HAVE_SYS_RESOURCE_H
527 #endif
528 #endif /* HAVE_SYS_RESOURCE_H */
529
530 /*
531 * The particular directory style your system supports. If you have dirent.h
532 * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
533 * that file and define DIR_TYPE to be dirent. Otherwise, if you have
534 * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
535 * file. If you have neither, I'm confused.
536 */
537
538 #include <sys/types.h>
539 #include <stdarg.h>
540 /*
541 * We use snprintf() to avoid overflows, but we include
542 * our own version (ap_snprintf). Allow for people to use their
543 * snprintf() if they want
544 */
545 #ifdef HAVE_SNPRINTF
546 #define ap_snprintf snprintf
547 #define ap_vsnprintf vsnprintf
548 #else
549 int ap_snprintf(char *buf, size_t len, const char *format, ...);
550 int ap_vsnprintf(char *buf, size_t len, const char *format, va_list ap);
551 #endif
552
553 #if !defined(NEXT)
554 #include <dirent.h>
555 #define DIR_TYPE dirent
556 #else
557 #include <sys/dir.h>
558 #define DIR_TYPE direct
559 #endif
560
561 #include <stdio.h>
562 #include <stdlib.h>
563 #include <string.h>
564 #include <sys/stat.h>
565 #ifndef MPE
566 #include <sys/file.h>
567 #endif
568 #include <sys/socket.h>
569 #ifdef HAVE_SYS_SELECT_H
570 #include <sys/select.h>
571 #endif
572 #include <ctype.h>
573 #include <netinet/in.h>
574 #include <netdb.h>
575 #include <sys/ioctl.h>
576 #ifndef MPE
577 #include <arpa/inet.h> /* for inet_ntoa */
578 #endif
579 #include <time.h> /* for ctime */
580 #include <signal.h>
581 #include <errno.h>
582 #include <sys/wait.h>
583 #include <pwd.h>
584 #include <grp.h>
585 #include <fcntl.h>
586 #include <limits.h>
587 #if !defined(QNX) && !defined(CONVEXOS11) && !defined(NEXT)
588 #include <memory.h>
589 #endif
590 #ifdef NEED_PROCESS_H
591 #include <process.h>
592 #endif
593
594 #include <regex.h>
595
596 #ifdef HAVE_SYS_RESOURCE_H
597 #include <sys/resource.h>
598 #ifdef SUNOS4
599 int getrlimit(int, struct rlimit *);
600 int setrlimit(int, struct rlimit *);
601 #endif
602 #endif
603 #ifdef HAVE_MMAP
604 #ifndef __EMX__
605 /* This file is not needed for OS/2 */
606 #include <sys/mman.h>
607 #endif
608 #endif
609 #if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
610 #define MAP_ANON MAP_ANONYMOUS
611 #endif
612
613 #if defined(HAVE_MMAP) && defined(NO_MMAP)
614 #undef HAVE_MMAP
615 #endif
616
617 #ifndef LOGNAME_MAX
618 #define LOGNAME_MAX 25
619 #endif
620
621 #ifndef NEXT
622 #include <unistd.h>
623 #endif
624
625 #ifdef ultrix
626 #define ULTRIX_BRAIN_DEATH
627 #endif
628
629 #ifndef S_ISLNK
630 #ifndef __EMX__
631 /* Don't define this for OS/2 */
632 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
633 #endif
634 #endif
635
636 #ifndef INADDR_NONE
637 #define INADDR_NONE ((unsigned long) -1)
638 #endif
639
640 /*
641 * Replace signal function with sigaction equivalent
642 */
643 #ifndef NO_USE_SIGACTION
644 typedef void Sigfunc(int);
645
646 #if defined(SIG_IGN) && !defined(SIG_ERR)
647 #define SIG_ERR ((Sigfunc *)-1)
648 #endif
649
650 /*
651 * For some strange reason, QNX defines signal to signal. Eliminate it.
652 */
653 #ifdef signal
654 #undef signal
655 #endif
656 #define signal(s,f) ap_signal(s,f)
657 Sigfunc *signal(int signo, Sigfunc * func);
658 #endif
659
660 #include <setjmp.h>
661
662 #if defined(USE_LONGJMP)
663 #define ap_longjmp(x, y) longjmp((x), (y))
664 #define ap_setjmp(x) setjmp(x)
665 #else
666 #define ap_longjmp(x, y) siglongjmp((x), (y))
667 #define ap_setjmp(x) sigsetjmp((x), 1)
668 #endif
669
670 /* Finding offsets of elements within structures.
671 * Taken from the X code... they've sweated portability of this stuff
672 * so we don't have to. Sigh...
673 */
674
675 #if defined(CRAY) || defined(__arm)
676 #if __STDC__
677 #define XtOffset(p_type,field) _Offsetof(p_type,field)
678 #else
679 #ifdef CRAY2
680 #define XtOffset(p_type,field) \
681 (sizeof(int)*((unsigned int)&(((p_type)NULL)->field)))
682
683 #else /* !CRAY2 */
684
685 #define XtOffset(p_type,field) ((unsigned int)&(((p_type)NULL)->field))
686
687 #endif /* !CRAY2 */
688 #endif /* __STDC__ */
689 #else /* ! (CRAY || __arm) */
690
691 #define XtOffset(p_type,field) \
692 ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
693
694 #endif /* !CRAY */
695
696 #ifdef offsetof
697 #define XtOffsetOf(s_type,field) offsetof(s_type,field)
698 #else
699 #define XtOffsetOf(s_type,field) XtOffset(s_type*,field)
700 #endif
701
702 #ifdef SUNOS_LIB_PROTOTYPES
703 /* Prototypes needed to get a clean compile with gcc -Wall.
704 * Believe it or not, these do have to be declared, at least on SunOS,
705 * because they aren't mentioned in the relevant system headers.
706 * Sun Quality Software. Gotta love it.
707 */
708
709 int getopt(int, char **, char *);
710
711 int strcasecmp(char *, char *);
712 int strncasecmp(char *, char *, int);
713 int toupper(int);
714 int tolower(int);
715
716 int printf(char *, ...);
717 int fprintf(FILE *, char *, ...);
718 int fputs(char *, FILE *);
719 int fread(char *, int, int, FILE *);
720 int fwrite(char *, int, int, FILE *);
721 int fflush(FILE *);
722 int fclose(FILE *);
723 int ungetc(int, FILE *);
724 int _filbuf(FILE *); /* !!! */
725 int _flsbuf(unsigned char, FILE *); /* !!! */
726 int sscanf(char *, char *, ...);
727 void setbuf(FILE *, char *);
728 void perror(char *);
729
730 time_t time(time_t *);
731 int strftime(char *, int, char *, struct tm *);
732
733 int initgroups(char *, int);
734 int wait3(int *, int, void *); /* Close enough for us... */
735 int lstat(const char *, struct stat *);
736 int stat(const char *, struct stat *);
737 int flock(int, int);
738 #ifndef NO_KILLPG
739 int killpg(int, int);
740 #endif
741 int socket(int, int, int);
742 int setsockopt(int, int, int, const char *, int);
743 int listen(int, int);
744 int bind(int, struct sockaddr *, int);
745 int connect(int, struct sockaddr *, int);
746 int accept(int, struct sockaddr *, int *);
747 int shutdown(int, int);
748
749 int getsockname(int s, struct sockaddr *name, int *namelen);
750 int getpeername(int s, struct sockaddr *name, int *namelen);
751 int gethostname(char *name, int namelen);
752 void syslog(int, char *, ...);
753 char *mktemp(char *);
754
755 long vfprintf(FILE *, char *, va_list);
756
757 #endif