1 | /* |
---|
2 | * Proto types for machines that are not ANSI and POSIX compliant. |
---|
3 | * This is optionaly |
---|
4 | */ |
---|
5 | |
---|
6 | #ifndef _l_stdlib_h |
---|
7 | #define _l_stdlib_h |
---|
8 | |
---|
9 | #ifdef HAVE_CONFIG_H |
---|
10 | # include <config.h> |
---|
11 | #endif |
---|
12 | |
---|
13 | #ifdef HAVE_STDLIB_H |
---|
14 | # include <stdlib.h> |
---|
15 | #endif |
---|
16 | |
---|
17 | #include "ntp_proto.h" |
---|
18 | |
---|
19 | /* Let's try to keep this more or less alphabetized... */ |
---|
20 | |
---|
21 | #ifdef DECL_ADJTIME_0 |
---|
22 | struct timeval; |
---|
23 | extern int adjtime P((struct timeval *, struct timeval *)); |
---|
24 | #endif |
---|
25 | |
---|
26 | #ifdef DECL_BCOPY_0 |
---|
27 | # ifndef bcopy |
---|
28 | extern void bcopy P((char *, char *, int)); |
---|
29 | # endif |
---|
30 | #endif |
---|
31 | |
---|
32 | #ifdef DECL_BZERO_0 |
---|
33 | # ifndef bzero |
---|
34 | extern void bzero P((char *, int)); |
---|
35 | # endif |
---|
36 | #endif |
---|
37 | |
---|
38 | extern char * getpass P((const char *)); |
---|
39 | |
---|
40 | #ifdef DECL_IOCTL_0 |
---|
41 | extern int ioctl P((int, int, char *)); |
---|
42 | #endif |
---|
43 | |
---|
44 | #ifdef DECL_IPC_0 |
---|
45 | struct sockaddr; |
---|
46 | extern int bind P((int, struct sockaddr *, int)); |
---|
47 | extern int connect P((int, struct sockaddr *, int)); |
---|
48 | extern int recv P((int, char *, int, int)); |
---|
49 | extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); |
---|
50 | extern int send P((int, char *, int,int)); |
---|
51 | extern int sendto P((int, char *, int, int, struct sockaddr *, int)); |
---|
52 | extern int setsockopt P((int, int, int, char *, int)); |
---|
53 | extern int socket P((int, int, int)); |
---|
54 | #endif |
---|
55 | |
---|
56 | #ifdef DECL_MEMMOVE_0 |
---|
57 | extern void * memmove P((void *, const void *, size_t)); |
---|
58 | #endif |
---|
59 | |
---|
60 | #ifdef DECL_MEMSET_0 |
---|
61 | extern char * memset P((char *, int, int)); |
---|
62 | #endif |
---|
63 | |
---|
64 | #ifdef DECL_MKSTEMP_0 |
---|
65 | extern int mkstemp P((char *)); |
---|
66 | #endif |
---|
67 | |
---|
68 | #ifdef DECL_MKTEMP_0 |
---|
69 | extern char *mktemp P((char *)); |
---|
70 | #endif |
---|
71 | |
---|
72 | #ifdef DECL_PLOCK_0 |
---|
73 | extern int plock P((int)); |
---|
74 | #endif |
---|
75 | |
---|
76 | #ifdef DECL_RENAME_0 |
---|
77 | extern int rename P((const char *, const char *)); |
---|
78 | #endif |
---|
79 | |
---|
80 | #ifdef DECL_SELECT_0 |
---|
81 | # ifdef _ntp_select_h |
---|
82 | extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); |
---|
83 | # endif |
---|
84 | #endif |
---|
85 | |
---|
86 | #ifdef DECL_SETITIMER_0 |
---|
87 | struct itimerval; |
---|
88 | extern int setitimer P((int , struct itimerval *, struct itimerval *)); |
---|
89 | #endif |
---|
90 | |
---|
91 | #ifdef PRIO_PROCESS |
---|
92 | # ifdef DECL_SETPRIORITY_0 |
---|
93 | extern int setpriority P((int, int, int)); |
---|
94 | # endif |
---|
95 | # ifdef DECL_SETPRIORITY_1 |
---|
96 | extern int setpriority P((int, id_t, int)); |
---|
97 | # endif |
---|
98 | #endif |
---|
99 | |
---|
100 | #ifdef DECL_SIGVEC_0 |
---|
101 | struct sigvec; |
---|
102 | extern int sigvec P((int, struct sigvec *, struct sigvec*)); |
---|
103 | #endif |
---|
104 | |
---|
105 | #ifdef DECL_STDIO_0 |
---|
106 | # if defined(FILE) || defined(BUFSIZ) |
---|
107 | extern int _flsbuf P((int, FILE *)); |
---|
108 | extern int _filbuf P((FILE *)); |
---|
109 | extern int fclose P((FILE *)); |
---|
110 | extern int fflush P((FILE *)); |
---|
111 | extern int fprintf P((FILE *, const char *, ...)); |
---|
112 | extern int fscanf P((FILE *, const char *, ...)); |
---|
113 | extern int fputs P((const char *, FILE *)); |
---|
114 | extern int fputc P((int, FILE *)); |
---|
115 | extern int fread P((char *, int, int, FILE *)); |
---|
116 | extern void perror P((const char *)); |
---|
117 | extern int printf P((const char *, ...)); |
---|
118 | extern int setbuf P((FILE *, char *)); |
---|
119 | # ifdef HAVE_SETLINEBUF |
---|
120 | extern int setlinebuf P((FILE *)); |
---|
121 | # endif |
---|
122 | extern int setvbuf P((FILE *, char *, int, int)); |
---|
123 | extern int scanf P((const char *, ...)); |
---|
124 | extern int sscanf P((const char *, const char *, ...)); |
---|
125 | extern int vfprintf P((FILE *, const char *, ...)); |
---|
126 | extern int vsprintf P((char *, const char *, ...)); |
---|
127 | # endif |
---|
128 | #endif |
---|
129 | |
---|
130 | #ifdef DECL_STRTOL_0 |
---|
131 | extern long strtol P((const char *, char **, int)); |
---|
132 | #endif |
---|
133 | |
---|
134 | #ifdef DECL_SYSLOG_0 |
---|
135 | extern void closelog P((void)); |
---|
136 | extern void openlog P((char *, int, int)); |
---|
137 | extern int setlogmask P((int)); |
---|
138 | extern void syslog P((int, char *, ...)); |
---|
139 | #endif |
---|
140 | |
---|
141 | #ifdef DECL_TIME_0 |
---|
142 | extern time_t time P((time_t *)); |
---|
143 | #endif |
---|
144 | |
---|
145 | #ifdef DECL_TIMEOFDAY_0 |
---|
146 | # ifdef SYSV_TIMEOFDAY |
---|
147 | extern int gettimeofday P((struct timeval *)); |
---|
148 | extern int settimeofday P((struct timeval *)); |
---|
149 | # else /* not SYSV_TIMEOFDAY */ |
---|
150 | struct timezone; |
---|
151 | extern int gettimeofday P((struct timeval *, struct timezone *)); |
---|
152 | extern int settimeofday P((struct timeval *, struct timezone *)); |
---|
153 | # endif /* not SYSV_TIMEOFDAY */ |
---|
154 | #endif |
---|
155 | |
---|
156 | #ifdef DECL_TOLOWER_0 |
---|
157 | extern int tolower P((int)); |
---|
158 | #endif |
---|
159 | |
---|
160 | /*******************************************************/ |
---|
161 | |
---|
162 | #if 0 |
---|
163 | /* |
---|
164 | * Unprotoyped library functions for SunOS 4.x.x |
---|
165 | */ |
---|
166 | #ifdef SYS_SUNOS4 |
---|
167 | extern void closelog P((void)); |
---|
168 | extern void openlog P((char *, int, int)); |
---|
169 | extern void syslog P((int, char *, ...)); |
---|
170 | extern int setlogmask P((int)); |
---|
171 | |
---|
172 | extern char * getpass P((char *)); |
---|
173 | |
---|
174 | extern int setpriority P((int ,int ,int)); |
---|
175 | |
---|
176 | extern long strtol P((char *, char **, int)); |
---|
177 | |
---|
178 | #if !defined(NTP_POSIX_SOURCE) |
---|
179 | extern int atoi P((char *)); |
---|
180 | extern int dup2 P((int, int)); |
---|
181 | extern int execve P((char *, char **,char **)); |
---|
182 | extern int fork P((void)); |
---|
183 | extern int getdtablesize P((void)); |
---|
184 | extern int qsort P((void *, int , int, |
---|
185 | int (*compar)(void *, void *))); |
---|
186 | extern int rand P((void)); |
---|
187 | extern int setpgrp P((int, int)); |
---|
188 | extern void srand P((unsigned int)); |
---|
189 | extern void bcopy P((char *, char *, int)); |
---|
190 | #endif |
---|
191 | |
---|
192 | #ifndef bzero /* XXX macro prototyping clash */ |
---|
193 | extern void bzero P((char *, int)); |
---|
194 | extern int bcmp P((char *, char *, int)); |
---|
195 | extern void bcopy P((char *, char *, int)); |
---|
196 | #endif |
---|
197 | extern char *mktemp P((char *)); |
---|
198 | |
---|
199 | extern int tolower P((int)); |
---|
200 | |
---|
201 | extern int isatty P((int)); |
---|
202 | |
---|
203 | extern unsigned sleep P((unsigned )); |
---|
204 | extern unsigned int alarm P((unsigned int)); |
---|
205 | extern int pause P((void)); |
---|
206 | |
---|
207 | extern int getpid P((void)); |
---|
208 | extern int getppid P((void)); |
---|
209 | |
---|
210 | extern int close P((int)); |
---|
211 | extern int ioctl P((int, int, char *)); |
---|
212 | extern int rename P((char *, char *)); |
---|
213 | #if 0 |
---|
214 | extern int read P((int, void *, size_t)); |
---|
215 | extern int write P((int, const void *, size_t)); |
---|
216 | #endif |
---|
217 | extern int unlink P((const char *)); |
---|
218 | extern int link P((const char *, const char *)); |
---|
219 | |
---|
220 | #ifdef FILE |
---|
221 | extern int fclose P((FILE *)); |
---|
222 | extern int fflush P((FILE *)); |
---|
223 | extern int fprintf P((FILE *, char *, ...)); |
---|
224 | extern int fscanf P((FILE *, char *, ...)); |
---|
225 | extern int fputs P((char *, FILE *)); |
---|
226 | extern int fputc P((char, FILE *)); |
---|
227 | extern int fread P((char *, int, int, FILE *)); |
---|
228 | extern int printf P((char *, ...)); |
---|
229 | extern int setbuf P((FILE *, char *)); |
---|
230 | extern int setvbuf P((FILE *, char *, int, int)); |
---|
231 | extern int scanf P((char *, ...)); |
---|
232 | extern int sscanf P((char *, char *, ...)); |
---|
233 | extern int vsprintf P((char *, char *, ...)); |
---|
234 | extern int _flsbuf P((int, FILE *)); |
---|
235 | extern int _filbuf P((FILE *)); |
---|
236 | extern void perror P((char *)); |
---|
237 | #ifdef HAVE_SETLINEBUF |
---|
238 | extern int setlinebuf P((FILE *)); |
---|
239 | #endif |
---|
240 | #endif |
---|
241 | |
---|
242 | #ifdef _ntp_string_h |
---|
243 | #ifdef NTP_POSIX_SOURCE /* these are builtins */ |
---|
244 | #ifndef NTP_NEED_BOPS /* but may be emulated by bops */ |
---|
245 | extern char *memcpy(); |
---|
246 | extern char *memset(); |
---|
247 | extern int memcmp(); |
---|
248 | #endif |
---|
249 | #endif |
---|
250 | #endif |
---|
251 | |
---|
252 | #ifdef _sys_socket_h |
---|
253 | extern int bind P((int, struct sockaddr *, int)); |
---|
254 | extern int connect P((int, struct sockaddr *, int)); |
---|
255 | extern int sendto P((int, char *, int, int, struct sockaddr *, int)); |
---|
256 | extern int setsockopt P((int, int, int, char *, int)); |
---|
257 | extern int socket P((int, int, int)); |
---|
258 | extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); |
---|
259 | #endif /* _sys_socket_h */ |
---|
260 | |
---|
261 | #ifdef _ntp_select_h |
---|
262 | extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); |
---|
263 | #endif |
---|
264 | |
---|
265 | #ifdef _sys_time_h |
---|
266 | extern int adjtime P((struct timeval *, struct timeval *)); |
---|
267 | extern int setitimer P((int , struct itimerval *, struct itimerval *)); |
---|
268 | #ifdef SYSV_TIMEOFDAY |
---|
269 | extern int gettimeofday P((struct timeval *)); |
---|
270 | extern int settimeofday P((struct timeval *)); |
---|
271 | #else /* ! SYSV_TIMEOFDAY */ |
---|
272 | extern int gettimeofday P((struct timeval *, struct timezone *)); |
---|
273 | extern int settimeofday P((struct timeval *, struct timezone *)); |
---|
274 | #endif /* SYSV_TIMEOFDAY */ |
---|
275 | #endif /* _sys_time_h */ |
---|
276 | |
---|
277 | #ifdef __time_h |
---|
278 | extern time_t time P((time_t *)); |
---|
279 | #endif |
---|
280 | |
---|
281 | #ifdef __setjmp_h |
---|
282 | extern int setjmp P((jmp_buf)); |
---|
283 | extern void longjmp P((jmp_buf, int)); |
---|
284 | #endif |
---|
285 | |
---|
286 | #ifdef _sys_resource_h |
---|
287 | extern int getrusage P((int, struct rusage *)); |
---|
288 | #endif |
---|
289 | |
---|
290 | #ifdef _nlist_h |
---|
291 | extern int nlist P((char *, struct nlist *)); |
---|
292 | #endif |
---|
293 | |
---|
294 | #endif /* SYS_SUNOS4 */ |
---|
295 | |
---|
296 | /* |
---|
297 | * Unprototyped library functions for DEC OSF/1 |
---|
298 | */ |
---|
299 | #ifdef SYS_DECOSF1 |
---|
300 | #ifndef _MACHINE_ENDIAN_H_ |
---|
301 | #define _MACHINE_ENDIAN_H_ |
---|
302 | extern u_short htons P((u_short)); |
---|
303 | extern u_short ntohs P((u_short)); |
---|
304 | extern u_int32 htonl P((u_int32)); |
---|
305 | extern u_int32 ntohl P((u_int32)); |
---|
306 | #endif /* _MACHINE_ENDIAN_H_ */ |
---|
307 | |
---|
308 | /* |
---|
309 | extern char * getpass P((char *)); |
---|
310 | */ |
---|
311 | extern char * mktemp P((char *)); |
---|
312 | #ifndef SYS_IX86OSF1 |
---|
313 | extern int ioctl P((int, u_long, char *)); |
---|
314 | extern void bzero P((char *, int)); |
---|
315 | #endif |
---|
316 | |
---|
317 | #ifdef SOCK_DGRAM |
---|
318 | extern int bind P((int, const struct sockaddr *, int)); |
---|
319 | extern int connect P((int, const struct sockaddr *, int)); |
---|
320 | extern int socket P((int, int, int)); |
---|
321 | extern int sendto P((int, const void *, int, int, const struct sockaddr *, int)); |
---|
322 | extern int setsockopt P((int, int, int, const void *, int)); |
---|
323 | extern int recvfrom P((int, void *, int, int, struct sockaddr *, int *)); |
---|
324 | #endif /* SOCK_STREAM */ |
---|
325 | |
---|
326 | #ifdef _ntp_select_h |
---|
327 | extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); |
---|
328 | #endif |
---|
329 | |
---|
330 | #endif /* DECOSF1 */ |
---|
331 | |
---|
332 | /* |
---|
333 | * Unprototyped library functions for Ultrix |
---|
334 | */ |
---|
335 | #ifdef SYS_ULTRIX |
---|
336 | extern int close P((int)); |
---|
337 | extern char * getpass P((char *)); |
---|
338 | extern int getpid P((void)); |
---|
339 | extern int ioctl P((int, int, char *)); |
---|
340 | extern char *mktemp P((char *)); |
---|
341 | extern int unlink P((const char *)); |
---|
342 | extern int link P((const char *, const char *)); |
---|
343 | |
---|
344 | extern void closelog P((void)); |
---|
345 | extern void syslog P((int, char *, ...)); |
---|
346 | #ifndef LOG_DAEMON |
---|
347 | extern void openlog P((char *, int)); |
---|
348 | #else |
---|
349 | extern void openlog P((char *, int, int)); |
---|
350 | #endif |
---|
351 | |
---|
352 | extern int setpriority P((int ,int ,int )); |
---|
353 | |
---|
354 | #ifdef SOCK_DGRAM |
---|
355 | extern int bind P((int, struct sockaddr *, int)); |
---|
356 | extern int connect P((int, struct sockaddr *, int)); |
---|
357 | extern int socket P((int, int, int)); |
---|
358 | extern int sendto P((int, char *, int, int, struct sockaddr *, int)); |
---|
359 | extern int setsockopt P((int, int, int, char *, int)); |
---|
360 | extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *)); |
---|
361 | #endif /* SOCK_STREAM */ |
---|
362 | |
---|
363 | #ifdef _TIME_H_ |
---|
364 | extern int gettimeofday P((struct timeval *, struct timezone *)); |
---|
365 | extern int settimeofday P((struct timeval *, struct timezone *)); |
---|
366 | extern int adjtime P((struct timeval *, struct timeval *)); |
---|
367 | extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *)); |
---|
368 | extern int setitimer P((int , struct itimerval *, struct itimerval *)); |
---|
369 | #endif /* _TIME_H_ */ |
---|
370 | |
---|
371 | #ifdef N_UNDF |
---|
372 | extern int nlist P((char *, struct nlist *)); |
---|
373 | #endif |
---|
374 | |
---|
375 | #ifndef bzero /* XXX macro prototyping clash */ |
---|
376 | extern void bzero P((char *, int)); |
---|
377 | extern int bcmp P((char *, char *, int)); |
---|
378 | extern void bcopy P((char *, char *, int)); |
---|
379 | #endif |
---|
380 | |
---|
381 | #ifndef NTP_POSIX_SOURCE |
---|
382 | extern int atoi P((char *)); |
---|
383 | extern void bzero P((char *, int)); |
---|
384 | extern int bcmp P((char *, char *, int)); |
---|
385 | extern void bcopy P((char *, char *, int)); |
---|
386 | extern int execve P((char *, char **,char **)); |
---|
387 | extern int fork P((void)); |
---|
388 | extern int getdtablesize P((void)); |
---|
389 | extern int ran P((void)); |
---|
390 | extern int rand P((void)); |
---|
391 | extern void srand P((unsigned int)); |
---|
392 | #ifdef _TIME_H_ |
---|
393 | extern int gettimeofday P((struct timeval *, struct timezone *)); |
---|
394 | extern int settimeofday P((struct timeval *, struct timezone *)); |
---|
395 | #endif |
---|
396 | #endif |
---|
397 | |
---|
398 | #ifdef _RESOURCE_H_ |
---|
399 | extern int getrusage P((int, struct rusage *)); |
---|
400 | #endif |
---|
401 | |
---|
402 | #endif /* SYS_ULTRIX */ |
---|
403 | |
---|
404 | #if defined(__convex__) |
---|
405 | extern char * getpass P((char *)); |
---|
406 | #endif |
---|
407 | |
---|
408 | #ifdef SYS_IRIX4 |
---|
409 | extern char * getpass P((char *)); |
---|
410 | #endif /* IRIX4 */ |
---|
411 | |
---|
412 | #ifdef SYS_VAX |
---|
413 | extern char * getpass P((char *)); |
---|
414 | #endif /* VAX */ |
---|
415 | |
---|
416 | #ifdef SYS_DOMAINOS |
---|
417 | extern char * getpass P((char *)); |
---|
418 | #endif /* SYS_DOMAINOS */ |
---|
419 | |
---|
420 | #ifdef SYS_BSD |
---|
421 | #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000) |
---|
422 | #endif |
---|
423 | |
---|
424 | #endif /* 0 */ |
---|
425 | #endif /* l_stdlib_h */ |
---|
426 | |
---|