1/*	$NetBSD: externs.h,v 1.2 2010/05/06 18:53:17 christos Exp $	*/
2
3/* Copyright 1993,1994 by Paul Vixie
4 * All rights reserved
5 */
6
7/*
8 * Copyright (c) 2004 by Internet Systems Consortium, Inc. ("ISC")
9 * Copyright (c) 1997,2000 by Internet Software Consortium, Inc.
10 *
11 * Permission to use, copy, modify, and distribute this software for any
12 * purpose with or without fee is hereby granted, provided that the above
13 * copyright notice and this permission notice appear in all copies.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES
16 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
17 * MERCHANTABILITY AND FITNESS.  IN NO EVENT SHALL ISC BE LIABLE FOR
18 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
20 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT
21 * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 */
23
24/* reorder these #include's at your peril */
25
26#include <sys/param.h>
27#include <sys/types.h>
28#include <sys/time.h>
29#include <sys/wait.h>
30#include <sys/fcntl.h>
31#include <sys/file.h>
32#include <sys/stat.h>
33
34#include <bitstring.h>
35#include <ctype.h>
36#ifndef isascii
37#define isascii(c)      ((unsigned)(c)<=0177)
38#endif
39#include <dirent.h>
40#include <errno.h>
41#include <fcntl.h>
42#include <grp.h>
43#include <locale.h>
44#include <pwd.h>
45#include <err.h>
46#include <signal.h>
47#include <stdarg.h>
48#include <stdio.h>
49#include <stdlib.h>
50#include <string.h>
51#include <time.h>
52#include <unistd.h>
53#include <utime.h>
54
55#if defined(SYSLOG)
56# include <syslog.h>
57#endif
58
59#if defined(LOGIN_CAP)
60# include <login_cap.h>
61#endif /*LOGIN_CAP*/
62
63#if defined(BSD_AUTH)
64# include <bsd_auth.h>
65#endif /*BSD_AUTH*/
66
67#define DIR_T	struct dirent
68#define WAIT_T	int
69#define SIG_T	sig_t
70#define TIME_T	time_t
71#define PID_T	pid_t
72
73#define TZONE(tm) tzname[(tm).tm_isdst]
74
75#if (defined(BSD)) && (BSD >= 198606) || defined(__linux)
76# define HAVE_FCHOWN
77# define HAVE_FCHMOD
78#endif
79
80#if (defined(BSD)) && (BSD >= 199103) || defined(__linux)
81# define HAVE_SAVED_UIDS
82#endif
83
84#define MY_UID(pw) getuid()
85#define MY_GID(pw) getgid()
86
87/* getopt() isn't part of POSIX.  some systems define it in <stdlib.h> anyway.
88 * of those that do, some complain that our definition is different and some
89 * do not.  to add to the misery and confusion, some systems define getopt()
90 * in ways that we cannot predict or comprehend, yet do not define the adjunct
91 * external variables needed for the interface.
92 */
93#if (!defined(BSD) || (BSD < 198911))
94int	getopt(int, char * const *, const char *);
95#endif
96
97#if (!defined(BSD) || (BSD < 199103))
98extern	char *optarg;
99extern	int optind, opterr, optopt;
100#endif
101
102/* digital unix needs this but does not give us a way to identify it.
103 */
104extern	int		flock(int, int);
105
106/* not all systems who provide flock() provide these definitions.
107 */
108#ifndef LOCK_SH
109# define LOCK_SH 1
110#endif
111#ifndef LOCK_EX
112# define LOCK_EX 2
113#endif
114#ifndef LOCK_NB
115# define LOCK_NB 4
116#endif
117#ifndef LOCK_UN
118# define LOCK_UN 8
119#endif
120
121#ifndef WCOREDUMP
122# define WCOREDUMP(st)          (((st) & 0200) != 0)
123#endif
124