PageRenderTime 61ms CodeModel.GetById 10ms app.highlight 45ms RepoModel.GetById 2ms app.codeStats 0ms

/contrib/ntp/include/l_stdlib.h

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