Expand PMF_FN_* macros.
[netbsd-mini2440.git] / dist / ntp / include / l_stdlib.h
blob236e3c603300c8cdeff5fdca88b06a85324c3bfd
1 /* $NetBSD: l_stdlib.h,v 1.2 2003/12/04 16:23:36 drochner Exp $ */
3 /*
4 * Proto types for machines that are not ANSI and POSIX compliant.
5 * This is optional
6 */
8 #ifndef _l_stdlib_h
9 #define _l_stdlib_h
11 #ifdef HAVE_CONFIG_H
12 #include <config.h>
13 #endif
15 #ifdef HAVE_STDLIB_H
16 # include <stdlib.h>
17 #endif
19 #if defined(__STDC__) || defined(HAVE_STDARG_H)
20 # include <stdarg.h>
21 #else
22 # include <varargs.h>
23 #endif
25 #ifdef HAVE_SYS_TYPES_H
26 # include <sys/types.h>
27 #endif
29 /* Needed for speed_t. */
30 #ifdef HAVE_TERMIOS_H
31 # include <termios.h>
32 #endif
34 #ifdef HAVE_ERRNO_H
35 # include <errno.h>
36 #endif
38 #include "ntp_types.h"
39 #include "ntp_proto.h"
41 /* Let's try to keep this more or less alphabetized... */
43 #ifdef DECL_ADJTIME_0
44 struct timeval;
45 extern int adjtime P((struct timeval *, struct timeval *));
46 #endif
48 #ifdef DECL_BCOPY_0
49 #ifndef bcopy
50 extern void bcopy P((const char *, char *, int));
51 #endif
52 #endif
54 #ifdef DECL_BZERO_0
55 #ifndef bzero
56 extern void bzero P((char *, int));
57 #endif
58 #endif
60 #ifdef DECL_CFSETISPEED_0
61 struct termios;
62 extern int cfsetispeed P((struct termios *, speed_t));
63 extern int cfsetospeed P((struct termios *, speed_t));
64 #endif
66 extern char * getpass P((const char *));
68 #ifdef DECL_HSTRERROR_0
69 extern const char * hstrerror P((int));
70 #endif
72 #ifdef DECL_INET_NTOA_0
73 struct in_addr;
74 extern char * inet_ntoa P((struct in_addr));
75 #endif
77 #ifdef DECL_IOCTL_0
78 extern int ioctl P((int, u_long, char *));
79 #endif
81 #ifdef DECL_IPC_0
82 struct sockaddr;
83 extern int bind P((int, struct sockaddr *, int));
84 extern int connect P((int, struct sockaddr *, int));
85 extern int recv P((int, char *, int, int));
86 extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
87 extern int send P((int, char *, int, int));
88 extern int sendto P((int, char *, int, int, struct sockaddr *, int));
89 extern int setsockopt P((int, int, int, char *, int));
90 extern int socket P((int, int, int));
91 #endif
93 #ifdef DECL_MEMMOVE_0
94 extern void * memmove P((void *, const void *, size_t));
95 #endif
97 #ifdef DECL_MEMSET_0
98 extern char * memset P((char *, int, int));
99 #endif
101 #ifdef DECL_MKSTEMP_0
102 extern int mkstemp P((char *));
103 #endif
105 #ifdef DECL_MKTEMP_0
106 extern char *mktemp P((char *));
107 #endif
109 #ifdef DECL_NLIST_0
110 struct nlist;
111 extern int nlist P((const char *, struct nlist *));
112 #endif
114 #ifdef DECL_PLOCK_0
115 extern int plock P((int));
116 #endif
118 #ifdef DECL_RENAME_0
119 extern int rename P((const char *, const char *));
120 #endif
122 #ifdef DECL_SELECT_0
123 #ifdef _ntp_select_h
124 extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
125 #endif
126 #endif
128 #ifdef DECL_SETITIMER_0
129 struct itimerval;
130 extern int setitimer P((int , struct itimerval *, struct itimerval *));
131 #endif
133 #ifdef PRIO_PROCESS
134 #ifdef DECL_SETPRIORITY_0
135 extern int setpriority P((int, int, int));
136 #endif
137 #ifdef DECL_SETPRIORITY_1
138 extern int setpriority P((int, id_t, int));
139 #endif
140 #endif
142 #ifdef DECL_SIGVEC_0
143 struct sigvec;
144 extern int sigvec P((int, struct sigvec *, struct sigvec *));
145 #endif
147 #ifndef HAVE_SNPRINTF
148 /* PRINTFLIKE3 */
149 extern int snprintf P((char *, size_t, const char *, ...));
150 #endif
152 /* HMS: does this need further protection? */
153 #ifndef HAVE_VSNPRINTF
154 extern int vsnprintf P((char *, size_t, const char *, va_list));
155 #endif
157 #ifdef DECL_STDIO_0
158 #if defined(FILE) || defined(BUFSIZ)
159 extern int _flsbuf P((int, FILE *));
160 extern int _filbuf P((FILE *));
161 extern int fclose P((FILE *));
162 extern int fflush P((FILE *));
163 extern int fprintf P((FILE *, const char *, ...));
164 extern int fscanf P((FILE *, const char *, ...));
165 extern int fputs P((const char *, FILE *));
166 extern int fputc P((int, FILE *));
167 extern int fread P((char *, int, int, FILE *));
168 extern void perror P((const char *));
169 extern int printf P((const char *, ...));
170 extern int setbuf P((FILE *, char *));
171 # ifdef HAVE_SETLINEBUF
172 extern int setlinebuf P((FILE *));
173 # endif
174 extern int setvbuf P((FILE *, char *, int, int));
175 extern int scanf P((const char *, ...));
176 extern int sscanf P((const char *, const char *, ...));
177 extern int vfprintf P((FILE *, const char *, ...));
178 extern int vsprintf P((char *, const char *, ...));
179 #endif
180 #endif
182 #ifdef DECL_STIME_0
183 extern int stime P((const time_t *));
184 #endif
186 #ifdef DECL_STIME_1
187 extern int stime P((long *));
188 #endif
190 #ifdef DECL_STRERROR_0
191 extern char * strerror P((int errnum));
192 #endif
194 #ifdef DECL_STRTOL_0
195 extern long strtol P((const char *, char **, int));
196 #endif
198 #ifdef DECL_SYSCALL
199 extern int syscall P((int, ...));
200 #endif
202 #ifdef DECL_SYSLOG_0
203 extern void closelog P((void));
204 #ifndef LOG_DAEMON
205 extern void openlog P((const char *, int));
206 #else
207 extern void openlog P((const char *, int, int));
208 #endif
209 extern int setlogmask P((int));
210 extern void syslog P((int, const char *, ...));
211 #endif
213 #ifdef DECL_TIME_0
214 extern time_t time P((time_t *));
215 #endif
217 #ifdef DECL_TIMEOFDAY_0
218 #ifdef SYSV_TIMEOFDAY
219 extern int gettimeofday P((struct timeval *));
220 extern int settimeofday P((struct timeval *));
221 #else /* not SYSV_TIMEOFDAY */
222 struct timezone;
223 extern int gettimeofday P((struct timeval *, struct timezone *));
224 extern int settimeofday P((struct timeval *, void *));
225 #endif /* not SYSV_TIMEOFDAY */
226 #endif
228 #ifdef DECL_TOLOWER_0
229 extern int tolower P((int));
230 #endif
232 #ifdef DECL_TOUPPER_0
233 extern int toupper P((int));
234 #endif
237 * Necessary variable declarations.
239 #ifdef DECL_ERRNO
240 extern int errno;
241 #endif
243 #if defined(DECL_H_ERRNO) && !defined(h_errno)
244 extern int h_errno;
245 #endif
247 /*******************************************************/
249 #if 0
251 * Unprotoyped library functions for SunOS 4.x.x
253 #ifdef SYS_SUNOS4
254 extern void closelog P((void));
255 extern void openlog P((char *, int, int));
256 extern void syslog P((int, char *, ...));
257 extern int setlogmask P((int));
259 extern char * getpass P((char *));
261 extern int setpriority P((int ,int ,int));
263 extern long strtol P((char *, char **, int));
265 #if !defined(NTP_POSIX_SOURCE)
266 extern int atoi P((char *));
267 extern int dup2 P((int, int));
268 extern int execve P((char *, char **,char **));
269 extern int fork P((void));
270 extern int getdtablesize P((void));
271 extern int qsort (void *, int , int,
272 int P((*compar)(void *, void *)));
273 extern int setpgrp P((int, int));
274 extern void bcopy P((const char *, char *, int));
275 #endif
277 #ifndef bzero /* XXX macro prototyping clash */
278 extern void bzero P((char *, int));
279 extern int bcmp P((char *, char *, int));
280 extern void bcopy P((const char *, char *, int));
281 #endif
282 extern char *mktemp P((char *));
284 extern int tolower P((int));
286 extern int isatty P((int));
288 extern unsigned sleep P((unsigned ));
289 extern unsigned int alarm P((unsigned int));
290 extern int pause P((void));
292 extern int getpid P((void));
293 extern int getppid P((void));
295 extern int close P((int));
296 extern int ioctl P((int, int, char *));
297 extern int rename P((char *, char *));
298 #if 0
299 extern int read P((int, void *, size_t));
300 extern int write P((int, const void *, size_t));
301 #endif
302 extern int unlink P((const char *));
303 extern int link P((const char *, const char *));
305 #ifdef FILE
306 extern int fclose P((FILE *));
307 extern int fflush P((FILE *));
308 extern int fprintf P((FILE *, char *, ...));
309 extern int fscanf P((FILE *, char *, ...));
310 extern int fputs P((char *, FILE *));
311 extern int fputc P((char, FILE *));
312 extern int fread P((char *, int, int, FILE *));
313 extern int printf P((char *, ...));
314 extern int setbuf P((FILE *, char *));
315 extern int setvbuf P((FILE *, char *, int, int));
316 extern int scanf P((char *, ...));
317 extern int sscanf P((char *, char *, ...));
318 extern int vsprintf P((char *, char *, ...));
319 extern int _flsbuf P((int, FILE *));
320 extern int _filbuf P((FILE *));
321 extern void perror P((char *));
322 #ifdef HAVE_SETLINEBUF
323 extern int setlinebuf P((FILE *));
324 #endif
325 #endif
327 #ifdef _ntp_string_h
328 #ifdef NTP_POSIX_SOURCE /* these are builtins */
329 #ifndef NTP_NEED_BOPS /* but may be emulated by bops */
330 extern char *memcpy P(());
331 extern char *memset P(());
332 extern int memcmp P(());
333 #endif
334 #endif
335 #endif
337 #ifdef _sys_socket_h
338 extern int bind P((int, struct sockaddr *, int));
339 extern int connect P((int, struct sockaddr *, int));
340 extern int sendto P((int, char *, int, int, struct sockaddr *, int));
341 extern int setsockopt P((int, int, int, char *, int));
342 extern int socket P((int, int, int));
343 extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
344 #endif /* _sys_socket_h */
346 #ifdef _ntp_select_h
347 extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
348 #endif
350 #ifdef _sys_time_h
351 extern int adjtime P((struct timeval *, struct timeval *));
352 extern int setitimer P((int , struct itimerval *, struct itimerval *));
353 #ifdef SYSV_TIMEOFDAY
354 extern int gettimeofday P((struct timeval *));
355 extern int settimeofday P((struct timeval *));
356 #else /* ! SYSV_TIMEOFDAY */
357 extern int gettimeofday P((struct timeval *, struct timezone *));
358 extern int settimeofday P((struct timeval *, struct timezone *));
359 #endif /* SYSV_TIMEOFDAY */
360 #endif /* _sys_time_h */
362 #ifdef __time_h
363 extern time_t time P((time_t *));
364 #endif
366 #ifdef __setjmp_h
367 extern int setjmp P((jmp_buf));
368 extern void longjmp P((jmp_buf, int));
369 #endif
371 #ifdef _sys_resource_h
372 extern int getrusage P((int, struct rusage *));
373 #endif
375 #ifdef _nlist_h
376 extern int nlist P((char *, struct nlist *));
377 #endif
379 #endif /* SYS_SUNOS4 */
382 * Unprototyped library functions for DEC OSF/1
384 #ifdef SYS_DECOSF1
385 #ifndef _MACHINE_ENDIAN_H_
386 #define _MACHINE_ENDIAN_H_
387 extern u_short htons P((u_short));
388 extern u_short ntohs P((u_short));
389 extern u_int32 htonl P((u_int32));
390 extern u_int32 ntohl P((u_int32));
391 #endif /* _MACHINE_ENDIAN_H_ */
394 extern char * getpass P((char *));
396 extern char * mktemp P((char *));
397 #ifndef SYS_IX86OSF1
398 extern int ioctl P((int, u_long, char *));
399 extern void bzero P((char *, int));
400 #endif
402 #ifdef SOCK_DGRAM
403 extern int bind P((int, const struct sockaddr *, int));
404 extern int connect P((int, const struct sockaddr *, int));
405 extern int socket P((int, int, int));
406 extern int sendto P((int, const void *, int, int, const struct sockaddr *, int));
407 extern int setsockopt P((int, int, int, const void *, int));
408 extern int recvfrom P((int, void *, int, int, struct sockaddr *, int *));
409 #endif /* SOCK_STREAM */
411 #ifdef _ntp_select_h
412 extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
413 #endif
415 #endif /* DECOSF1 */
418 * Unprototyped library functions for Ultrix
420 #ifdef SYS_ULTRIX
421 extern int close P((int));
422 extern char * getpass P((char *));
423 extern int getpid P((void));
424 extern int ioctl P((int, int, char *));
425 extern char *mktemp P((char *));
426 extern int unlink P((const char *));
427 extern int link P((const char *, const char *));
429 extern void closelog P((void));
430 extern void syslog P((int, char *, ...));
431 #ifndef LOG_DAEMON
432 extern void openlog P((char *, int));
433 #else
434 extern void openlog P((char *, int, int));
435 #endif
437 extern int setpriority P((int ,int ,int ));
439 #ifdef SOCK_DGRAM
440 extern int bind P((int, struct sockaddr *, int));
441 extern int connect P((int, struct sockaddr *, int));
442 extern int socket P((int, int, int));
443 extern int sendto P((int, char *, int, int, struct sockaddr *, int));
444 extern int setsockopt P((int, int, int, char *, int));
445 extern int recvfrom P((int, char *, int, int, struct sockaddr *, int *));
446 #endif /* SOCK_STREAM */
448 #ifdef _TIME_H_
449 extern int gettimeofday P((struct timeval *, struct timezone *));
450 extern int settimeofday P((struct timeval *, struct timezone *));
451 extern int adjtime P((struct timeval *, struct timeval *));
452 extern int select P((int, fd_set *, fd_set *, fd_set *, struct timeval *));
453 extern int setitimer P((int , struct itimerval *, struct itimerval *));
454 #endif /* _TIME_H_ */
456 #ifdef N_UNDF
457 extern int nlist P((char *, struct nlist *));
458 #endif
460 #ifndef bzero /* XXX macro prototyping clash */
461 extern void bzero P((char *, int));
462 extern int bcmp P((char *, char *, int));
463 extern void bcopy P((const char *, char *, int));
464 #endif
466 #ifndef NTP_POSIX_SOURCE
467 extern int atoi P((char *));
468 extern void bzero P((char *, int));
469 extern int bcmp P((char *, char *, int));
470 extern void bcopy P((const char *, char *, int));
471 extern int execve P((char *, char **,char **));
472 extern int fork P((void));
473 extern int getdtablesize P((void));
474 extern int ran P((void));
475 #ifdef _TIME_H_
476 extern int gettimeofday P((struct timeval *, struct timezone *));
477 extern int settimeofday P((struct timeval *, struct timezone *));
478 #endif
479 #endif
481 #ifdef _RESOURCE_H_
482 extern int getrusage P((int, struct rusage *));
483 #endif
485 #endif /* SYS_ULTRIX */
487 #if defined(__convex__)
488 extern char * getpass P((char *));
489 #endif
491 #ifdef SYS_IRIX4
492 extern char * getpass P((char *));
493 #endif /* IRIX4 */
495 #ifdef SYS_VAX
496 extern char * getpass P((char *));
497 #endif /* VAX */
499 #ifdef SYS_DOMAINOS
500 extern char * getpass P((char *));
501 #endif /* SYS_DOMAINOS */
503 #ifdef SYS_BSD
504 #define IN_CLASSD(i) (((long)(i) & 0xf0000000) == 0xe0000000)
505 #endif
507 #endif /* 0 */
508 #endif /* l_stdlib_h */