1 /* 2 * (c) 1998-2018 by Columbia University; all rights reserved 3 * 4 * SPDX-License-Identifier: BSD-3-Clause 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: 9 * 1. Redistributions of source code must retain the above copyright 10 * notice, this list of conditions and the following disclaimer. 11 * 2. Redistributions in binary form must reproduce the above copyright 12 * notice, this list of conditions and the following disclaimer in the 13 * documentation and/or other materials provided with the distribution. 14 * 3. Neither the name of the University nor the names of its contributors 15 * may be used to endorse or promote products derived from this software 16 * without specific prior written permission. 17 * 18 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 19 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 22 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 23 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 24 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 26 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 27 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 28 * SUCH DAMAGE. 29 */ 30 31 /* 32 * Declarations for ANSI compiler, missing from SunOS. 33 */ 34 #if sun 35 /* ctype.h */ 36 extern int tolower(int); 37 extern int toupper(int); 38 39 /* curses.h */ 40 #ifdef WINDOW 41 extern int endwin(); 42 extern int waddch(); 43 extern int waddstr(); 44 extern int wclear(); 45 extern int wclrtoeol(); 46 extern int wgetch(WINDOW *win); 47 extern int wmove(); 48 extern int wrefresh(); 49 extern int wstandend(); 50 extern int wstandout(); 51 #endif 52 53 /* <malloc.h> */ 54 55 /* <string.h> */ 56 #ifdef __string_h 57 extern int strncasecmp(const char *s1, const char *s2, size_t n); 58 extern int strcasecmp(const char *s1, const char *s2); 59 extern char *strerror(int); 60 #endif 61 62 /* <stdio.h> */ 63 #ifdef FILE 64 extern int fclose(FILE *stream); 65 extern int fprintf(FILE *stream, char *, ...); 66 extern char *sprintf(); /* gcc also defines this... */ 67 extern int printf(char *fmt, ...); 68 extern int sscanf(char *s, char *fmt, ...); 69 extern int fgetc(FILE *stream); 70 extern int _flsbuf(); 71 extern int _filbuf(); 72 extern int fread(char *ptr, int size, int nitems, FILE *stream); 73 extern int fseek(FILE *stream, long offset, int ptrname); 74 extern int puts(char *s); 75 extern int fputs(char *s, FILE *stream); 76 extern int fputc(char, FILE *stream); 77 extern int fwrite(char *ptr, int size, int nitems, FILE *stream); 78 extern int fflush(FILE *stream); 79 extern int setlinebuf(FILE *stream); 80 extern void setbuf(FILE *stream, char *buf); 81 #if defined(_sys_varargs_h) || defined(_STDARG_H) || defined(_ANSI_STDARG_H) 82 extern char *vsprintf(char *s, char *format, va_list ap); 83 #endif 84 #endif 85 86 /* stdlib.h */ 87 #ifdef __stdlib_h 88 extern int getopt(int argc, char **argv, char *optstring); 89 extern void perror(char *s); 90 extern int qsort(void *base, long unsigned nel, long unsigned int 91 width, int (*compar)(const void *, const void *)); 92 extern long strtol(char *str, char **ptr, int base); 93 extern int atoi(const char *str); 94 extern int system(char *cmd); 95 #endif 96 97 /* search.h */ 98 #ifdef _search_h 99 extern int hcreate(int nel); 100 extern ENTRY *hsearch(ENTRY item, ACTION action); 101 #endif 102 103 /* sys/socket.h */ 104 #ifdef _sys_socket_h 105 extern int accept(int, void *, int *); 106 extern int bind(int, const void *, int); 107 extern int connect(int, const void *, int); 108 extern int getpeername(int, void *, int *); 109 extern int getsockname(int, void *, int *); 110 extern int listen(int, int); 111 extern int recvfrom(int, void *, int, int, void *, int *); 112 extern int sendmsg(int, const struct msghdr *, int); 113 extern int sendto(int, const void *, int, int, const void *, int); 114 extern int setsockopt(int, int, int, const void *, int); 115 extern int socket(int, int, int); 116 #endif 117 118 /* time.h */ 119 #ifdef __time_h 120 extern time_t time(time_t *); 121 extern clock_t clock(void); 122 extern int strftime(char *buf, int bufsize, char *fmt, struct tm *tm); 123 #endif 124 125 /* sgtty.h */ 126 #ifdef _sgtty_h 127 extern int stty(int fd, struct sgttyb *buf); 128 extern int gtty(int fd, struct sgttyb *buf); 129 #endif 130 131 /* sys/time.h */ 132 #ifdef _sys_time_h 133 /* 134 extern int gettimeofday(struct timeval *tp, struct timezone *tzp); 135 */ 136 extern unsigned mktime(struct tm *tm); 137 #endif 138 139 /* <sys/time.h> (Solaris) */ 140 #ifdef _SYS_TIME_H 141 /* 142 extern int gettimeofday(struct timeval *tp, struct timezone *tzp); 143 */ 144 #endif 145 146 /* <unistd.h> */ 147 #ifdef __sys_unistd_h 148 extern int ioctl(int fd, int request, ...); 149 extern int gethostname(char *name, int namelen); 150 extern int getdomainname(char *name, int namelen); 151 extern uid_t getuid(void); 152 extern int close(int); 153 extern int unlink(const char *fn); 154 extern int truncate(char *path, off_t length); 155 extern int ftruncate(int fd, off_t length); 156 #ifdef _sys_uio_h 157 extern int writev(int fd, struct iovec *iov, int iovcnt); 158 #endif 159 #ifdef _sys_time_h 160 extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *); 161 #endif 162 #endif 163 164 /* <unistd.h> (Solaris) */ 165 #ifdef _UNISTD_H 166 extern int getdomainname(char *name, int namelen); 167 #endif 168 169 #endif /* sun */ 170 171 /*** SGI ***/ 172 #ifdef sgi 173 174 #ifdef __RPCSVC_YPCLNT_H__ 175 extern int yp_get_default_domain(char **outdomain); 176 #endif 177 #endif /* sgi */ 178 179 /*** HP ***/ 180 #ifdef hp 181 182 /* <unistd.h> */ 183 #ifdef _UNISTD_INCLUDED 184 extern int getdomainname(char *name, int namelen); 185 #endif 186 #endif /* hp */ 187 188 /*** IBM ***/ 189 #ifdef ibm 190 #ifdef _UNISTD 191 #include <select.h> 192 #endif 193 #endif /* ibm */ 194