1 /* $NetBSD: externs.h,v 1.3 1998/07/26 13:27:34 mycroft Exp $ */
3 /* Copyright 1993,1994 by Paul Vixie
6 * Distribute freely, except: don't remove my name from the source or
7 * documentation (don't take credit for my work), mark your changes (don't
8 * get me blamed for your possible bugs), don't alter or remove this
9 * notice. May be sold if buildable source is provided to buyer. No
10 * warrantee of any kind, express or implied, is included with this
11 * software; use at your own risk, responsibility for damages (if any) to
12 * anyone resulting from the use of this software rests entirely with the
15 * Send bug reports, bug fixes, enhancements, requests, flames, etc., and
16 * I'll try to keep a version up to date. I can be reached as follows:
17 * Paul Vixie <paul@vix.com> uunet!decwrl!vixie!paul
20 #if defined(POSIX) || defined(ATT)
25 # define DIR_T struct dirent
27 # define WAIT_IS_INT 1
28 # define TZONE(tm) tzname[(tm).tm_isdst]
34 # define WAIT_T union wait
39 # define TIME_T time_t
49 #if !defined(POSIX) && !defined(ATT)
52 extern unsigned sleep();
53 extern struct tm
*localtime();
54 extern struct passwd
*getpwnam();
56 extern void perror(), exit(), free();
57 extern char *getenv(), *strcpy(), *strchr(), *strtok();
58 extern void *malloc(), *realloc();
62 # define WAIT_T union wait
63 # define DIR_T struct direct
65 # define TZONE(tm) (tm).tm_zone
68 /* getopt() isn't part of POSIX. some systems define it in <stdlib.h> anyway.
69 * of those that do, some complain that our definition is different and some
70 * do not. to add to the misery and confusion, some systems define getopt()
71 * in ways that we cannot predict or comprehend, yet do not define the adjunct
72 * external variables needed for the interface.
74 #if (!defined(BSD) || (BSD < 198911)) && !defined(ATT) && !defined(UNICOS)
75 int getopt(int, char * const *, const char *);
78 #if (!defined(BSD) || (BSD < 199103))
80 extern int optind
, opterr
, optopt
;
85 # define WEXITSTATUS(x) (((x) >> 8) & 0xff)
88 # define WTERMSIG(x) ((x) & 0x7f)
91 # define WCOREDUMP(x) ((x) & 0x80)
95 # define WEXITSTATUS(x) ((x).w_retcode)
98 # define WTERMSIG(x) ((x).w_termsig)
101 # define WCOREDUMP(x) ((x).w_coredump)
103 #endif /*WAIT_IS_INT*/
106 #define WIFSIGNALED(x) (WTERMSIG(x) != 0)
109 #define WIFEXITED(x) (WTERMSIG(x) == 0)
112 #ifdef NEED_STRCASECMP
113 extern int strcasecmp(char *, char *);
117 extern char *strdup(char *);
121 extern char *strerror(int);
125 extern int flock(int, int);
133 extern int setsid(void);
136 #ifdef NEED_GETDTABLESIZE
137 extern int getdtablesize(void);
141 extern int setenv(char *, char *, int);
145 extern PID_T
vfork(void);