2 * Copyright (c) 1995, 1996, 1997 Kungliga Tekniska Högskolan
3 * (Royal Institute of Technology, Stockholm, Sweden).
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of the Institute nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * Add here functions that don't have a prototype on your system.
37 * $Id: protos.h,v 1.1.1.1 2000/06/16 19:18:30 thorpej Exp $
40 #ifdef NEED_CRYPT_PROTO
41 char *crypt(const char*, const char*);
44 #ifdef NEED_STRTOK_R_PROTO
45 char *strtok_r (char *s1
, const char *s2
, char **lasts
);
48 #ifndef HAVE_OPTARG_DECLARATION
51 #ifndef HAVE_OPTERR_DECLARATION
54 #ifndef HAVE_OPTIND_DECLARATION
57 #ifndef HAVE_OPTOPT_DECLARATION
61 #if defined(__GNUC__) && SunOS == 4
63 /* To get type fd_set */
64 #include <sys/types.h>
67 /* To get struct sockaddr, struct in_addr and struct hostent */
68 #include <sys/socket.h>
69 #include <netinet/in.h>
72 /* To get struct stat */
75 /* To get struct utimbuf */
78 #if !defined(HAVE_ATEXIT) && defined(HAVE_ON_EXIT)
79 #define atexit(X) on_exit(X, NULL)
82 #ifdef NEED_UTIME_PROTO
83 int utime(const char *, const struct utimbuf
*);
85 int syscall(int, ...);
87 int ftruncate(int, off_t
);
88 int fchmod(int, mode_t
);
89 int fchown(int fd
, int owner
, int group
);
92 int setreuid(int, int);
94 int gettimeofday(struct timeval
*tp
, struct timezone
*tzp
);
95 int lstat(const char *, struct stat
*);
96 int ioctl(int, int, void *);
97 int getpriority(int which
, int who
);
98 int setpriority(int which
, int who
, int priority
);
99 int getdtablesize(void);
100 int initgroups(const char *name
, int basegid
);
101 long ulimit(int cmd
, long newlimit
);
106 int setitimer(int which
, struct itimerval
*value
, struct itimerval
*ovalue
);
108 int munmap(caddr_t addr
, int len
);
110 int socket(int, int, int);
111 int setsockopt(int, int, int, void *, int);
112 int bind(int, void *, int);
113 int getsockname(int, struct sockaddr
*, int *);
114 int accept(int, struct sockaddr
*, int *);
115 int connect(int, struct sockaddr
*, int);
116 int listen(int, int);
117 int recv(int s
, void *buf
, int len
, int flags
);
118 int recvfrom(int, char *, int, int, void *, int *);
119 int sendto(int, const char *, int, int, void *, int);
120 int select(int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*);
121 int shutdown(int, int);
122 int getpeername(int, struct sockaddr
*, int *);
123 int getsockopt(int, int, int, void *, int *);
124 int send(int s
, const void *msg
, int len
, int flags
);
126 int getmsg(int fd
, struct strbuf
*ctlptr
, struct strbuf
*dataptr
, int *flags
);
128 char *inet_ntoa(struct in_addr in
);
129 unsigned long inet_addr(const char *cp
);
130 int gethostname(char *, int);
131 struct hostent
*gethostbyname(const char *);
132 int dn_expand(const u_char
*msg
,
133 const u_char
*eomorig
,
134 const u_char
*comp_dn
,
137 int res_search(const char *dname
,
143 int yp_get_default_domain (char **outdomain
);
144 int innetgr(const char *netgroup
, const char *machine
,
145 const char *user
, const char *domain
);
147 char *getwd(char *pathname
);
149 void bzero(char *b
, int length
);
150 int strcasecmp(const char *, const char *);
151 void swab(const char *, char *, int);
152 int atoi(const char *str
);
153 char *mktemp(char *);
154 void srandom(int seed
);
157 int rcmd(char **, unsigned short, char *, char *, char *, int *);
158 int rresvport(int *);
159 int openlog(const char *ident
, int logopt
, int facility
);
160 int syslog(int priority
, const char *message
, ...);
163 char *getpass(const char *);
165 char *getusershell(void);
176 #include <sys/types.h>
177 #include <sys/resource.h>
179 char *getusershell(void);
180 char *strtok_r(char *, const char *, char **);
181 int getpriority (int which
, id_t who
);
182 int setpriority (int which
, id_t who
, int prio
);
183 int getdtablesize (void);
184 char *getusershell(void);
185 void setusershell(void);
186 void endusershell(void);
188 #if defined(__GNUC__)
190 int syscall(int, ...);
191 int gethostname(char *, int);
194 int gettimeofday(struct timeval
*tp
, void *);
199 #if defined(__osf__) /* OSF/1 */
202 /* To get type fd_set */
203 #include <sys/types.h>
204 #include <sys/time.h>
206 int select(int, fd_set
*, fd_set
*, fd_set
*, struct timeval
*);
207 int fsync(int fildes
);
208 int gethostname(char *address
, int address_len
);
209 int setreuid(int ruid
, int euid
);
210 int ioctl(int d
, unsigned long request
, void * arg
);
212 int flock(int fildes
, int operation
);
213 int syscall(int, ...);
215 unsigned short htons(unsigned short hostshort
);
216 unsigned int htonl(unsigned int hostint
);
217 unsigned short ntohs(unsigned short netshort
);
218 unsigned int ntohl(unsigned int netint
);
220 char *mktemp(char *template);
221 char *getusershell(void);
223 int rcmd(char **, unsigned short, char *, char *, char *, int *);
224 int rresvport (int *port
);
229 #include <sys/types.h>
231 char *ptsname(int fd
);
232 struct spwd
*getspuid(uid_t
);
235 #if defined(__GNUC__) && defined(_AIX) /* AIX */
239 int gettimeofday (struct timeval
*Tp
, void *Tzp
);
243 #if defined(__GNUC__) && defined(__hpux) /* HP-UX */
245 int syscall(int, ...);
249 char *ptsname(int fildes
);
251 void utmpname(const char *file
);
253 int innetgr(const char *netgroup
, const char *machine
,
254 const char *user
, const char *domain
);
256 int dn_comp(char *exp_dn
, char *comp_dn
, int length
,
257 char **dnptrs
, char **lastdnptr
);
259 int res_query(char *dname
, int class, int type
,
260 unsigned char *answer
, int anslen
);
262 int dn_expand(char *msg
, char *eomorig
, char *comp_dn
,
263 char *exp_dn
, int length
);
265 int res_search(char *dname
, int class, int type
,
266 unsigned char *answer
, int anslen
);
270 #if defined(WIN32) /* Visual C++ 4.0 (Windows95/NT) */
272 int open(const char *, int, ...);
274 int read(int, void *, unsigned int);
275 int write(int, const void *, unsigned int);