opnsense-src/contrib/ntp/include/l_stdlib.h

225 lines
4.6 KiB
C
Raw Normal View History

1999-12-09 08:01:21 -05:00
/*
* Proto types for machines that are not ANSI and POSIX compliant.
* This is optional
*/
#ifndef L_STDLIB_H
#define L_STDLIB_H
1999-12-09 08:01:21 -05:00
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#include <stdarg.h>
#include <sys/types.h>
1999-12-09 08:01:21 -05:00
/* Needed for speed_t. */
#ifdef HAVE_TERMIOS_H
# include <termios.h>
#endif
#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#include "ntp_types.h"
#include "ntp_proto.h"
/* Let's try to keep this more or less alphabetized... */
#ifdef DECL_ADJTIME_0
struct timeval;
extern int adjtime (struct timeval *, struct timeval *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_BCOPY_0
#ifndef bcopy
extern void bcopy (const char *, char *, int);
1999-12-09 08:01:21 -05:00
#endif
#endif
#ifdef DECL_BZERO_0
#ifndef bzero
extern void bzero (char *, int);
1999-12-09 08:01:21 -05:00
#endif
#endif
#ifdef DECL_CFSETISPEED_0
struct termios;
extern int cfsetispeed (struct termios *, speed_t);
extern int cfsetospeed (struct termios *, speed_t);
1999-12-09 08:01:21 -05:00
#endif
extern char * getpass (const char *);
1999-12-09 08:01:21 -05:00
2001-08-29 10:35:15 -04:00
#ifdef DECL_HSTRERROR_0
extern const char * hstrerror (int);
2001-08-29 10:35:15 -04:00
#endif
1999-12-09 08:01:21 -05:00
#ifdef DECL_INET_NTOA_0
struct in_addr;
extern char * inet_ntoa (struct in_addr);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_IOCTL_0
extern int ioctl (int, u_long, char *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_IPC_0
struct sockaddr;
extern int bind (int, struct sockaddr *, int);
extern int connect (int, struct sockaddr *, int);
extern int recv (int, char *, int, int);
extern int recvfrom (int, char *, int, int, struct sockaddr *, int *);
extern int send (int, char *, int, int);
extern int sendto (int, char *, int, int, struct sockaddr *, int);
extern int setsockopt (int, int, int, char *, int);
extern int socket (int, int, int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_MEMMOVE_0
extern void * memmove (void *, const void *, size_t);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_MEMSET_0
extern char * memset (char *, int, int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_MKSTEMP_0
extern int mkstemp (char *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_MKTEMP_0
extern char *mktemp (char *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_NLIST_0
struct nlist;
extern int nlist (const char *, struct nlist *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_PLOCK_0
extern int plock (int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_RENAME_0
extern int rename (const char *, const char *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_SELECT_0
#ifdef NTP_SELECT_H
extern int select (int, fd_set *, fd_set *, fd_set *, struct timeval *);
1999-12-09 08:01:21 -05:00
#endif
#endif
#ifdef DECL_SETITIMER_0
struct itimerval;
extern int setitimer (int , struct itimerval *, struct itimerval *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef PRIO_PROCESS
#ifdef DECL_SETPRIORITY_0
extern int setpriority (int, int, int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_SETPRIORITY_1
extern int setpriority (int, id_t, int);
1999-12-09 08:01:21 -05:00
#endif
#endif
#ifdef DECL_SIGVEC_0
struct sigvec;
extern int sigvec (int, struct sigvec *, struct sigvec *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_STDIO_0
#if defined(FILE) || defined(BUFSIZ)
extern int _flsbuf (int, FILE *);
extern int _filbuf (FILE *);
extern int fclose (FILE *);
extern int fflush (FILE *);
extern int fprintf (FILE *, const char *, ...);
extern int fscanf (FILE *, const char *, ...);
extern int fputs (const char *, FILE *);
extern int fputc (int, FILE *);
extern int fread (char *, int, int, FILE *);
extern void perror (const char *);
extern int printf (const char *, ...);
extern int setbuf (FILE *, char *);
1999-12-09 08:01:21 -05:00
# ifdef HAVE_SETLINEBUF
extern int setlinebuf (FILE *);
1999-12-09 08:01:21 -05:00
# endif
extern int setvbuf (FILE *, char *, int, int);
extern int scanf (const char *, ...);
extern int sscanf (const char *, const char *, ...);
extern int vfprintf (FILE *, const char *, ...);
extern int vsprintf (char *, const char *, ...);
1999-12-09 08:01:21 -05:00
#endif
#endif
#ifdef DECL_STIME_0
extern int stime (const time_t *);
1999-12-09 08:01:21 -05:00
#endif
2000-01-28 09:55:50 -05:00
#ifdef DECL_STIME_1
extern int stime (long *);
2000-01-28 09:55:50 -05:00
#endif
1999-12-09 08:01:21 -05:00
#ifdef DECL_STRERROR_0
extern char * strerror (int errnum);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_STRTOL_0
extern long strtol (const char *, char **, int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_SYSCALL
extern int syscall (int, ...);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_SYSLOG_0
extern void closelog (void);
1999-12-09 08:01:21 -05:00
#ifndef LOG_DAEMON
extern void openlog (const char *, int);
1999-12-09 08:01:21 -05:00
#else
extern void openlog (const char *, int, int);
1999-12-09 08:01:21 -05:00
#endif
extern int setlogmask (int);
extern void syslog (int, const char *, ...);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_TIME_0
extern time_t time (time_t *);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_TIMEOFDAY_0
#ifdef SYSV_TIMEOFDAY
extern int gettimeofday (struct timeval *);
extern int settimeofday (struct timeval *);
1999-12-09 08:01:21 -05:00
#else /* not SYSV_TIMEOFDAY */
struct timezone;
extern int gettimeofday (struct timeval *, struct timezone *);
extern int settimeofday (struct timeval *, void *);
1999-12-09 08:01:21 -05:00
#endif /* not SYSV_TIMEOFDAY */
#endif
#ifdef DECL_TOLOWER_0
extern int tolower (int);
1999-12-09 08:01:21 -05:00
#endif
#ifdef DECL_TOUPPER_0
extern int toupper (int);
1999-12-09 08:01:21 -05:00
#endif
/*
* Necessary variable declarations.
*/
#ifdef DECL_ERRNO
extern int errno;
#endif
2002-11-04 14:36:11 -05:00
#if defined(DECL_H_ERRNO) && !defined(h_errno)
1999-12-09 08:01:21 -05:00
extern int h_errno;
#endif
#endif /* L_STDLIB_H */