/* stdinclude.h
 *
 */

/*
    fics - An internet chess server.
    Copyright (C) 1993  Richard V. Nash

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
*/

/* Revision history:
   name		email		yy/mm/dd	Change
   Richard Nash	              	93/10/22	Created
*/

#ifndef _STDINCLUDE_H
#define _STDINCLUDE_H

#include <sys/types.h>

/* Set up system specific defines */
#if defined(SYSTEM_NEXT)

#define HASMALLOCSIZE
#include <sys/vfs.h>

#elif defined(SYSTEM_ULTRIX)

#include <sys/param.h>
#include <sys/mount.h>

#endif

#ifdef SYSTEM_USL
# define NO_TM_ZONE
#endif

#ifdef SYSTEM_SUN4
# define USE_VARARGS
#endif

#ifdef SGI
#define _BSD_SIGNALS
#include <fcntl.h>
#include <bstring.h>
#endif

#if defined(SYSTEM_RS6K)
#include <sys/select.h>
#include <dirent.h>
#define USE_DIRENT
#endif

/* These are included into every .c file */
#if defined(SYSTEM_SUN5)
#define USE_RLIMIT
#define USE_TIMES
#define USE_WAITPID
#define GOOD_STDIO
#define NO_TM_ZONE
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/filio.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#define direct dirent

#else
#include <strings.h>
#include <sys/dir.h>
#endif

#include <sys/stat.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <unistd.h>
#include <ctype.h>
#include <sys/errno.h>
#include <signal.h>
#include <time.h>
#include <math.h>
#include <sys/time.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/wait.h>

/* Forward declare the functions that aren't defined above */

#if defined(SGI)
#include <errno.h>
#define GOOD_STDIO
#define NO_TM_ZONE
#else
#define GOOD_STDIO
/*
extern FILE *popen(char *, char *);
extern int pclose(FILE *);
extern int fputs(char *, FILE *);
extern int fseek(FILE *, long, int);
extern int fread(char *, int, int, FILE *);
extern int fwrite(char *, int, int, FILE *);
extern int socket(int, int, int);
extern int atoi (char *nptr);
extern long atol (char *nptr);
extern int truncate(char *, off_t), ftruncate(int, off_t);
*/
#endif

#ifndef GOOD_STDIO
extern int fclose(FILE *);
extern int fscanf(FILE *, char *, ...);
extern int fprintf(FILE *, char *, ...);
extern int printf(char *, ...);
#endif


#ifndef NETBSD
extern char *crypt (char *key, char *salt);
#endif

extern time_t time(time_t *);
extern int rand(void);
extern int close(int);
extern size_t malloc_size(void *ptr);

#ifdef __STDC__
/*  extern fcntl(int fildes, int cmd, ...); */
/*  extern open(char *path, int oflag, ...); */
/*  extern int ioctl(int, long, ...); */

#else
  extern fcntl();
  extern open();
  extern int ioctl();

#endif	/* __STDC__ */
/* extern void *malloc(unsigned int size); */
/* extern void *calloc(unsigned int num, unsigned int size); */
/* extern void *realloc(void *addr, unsigned int size); */
/* extern void free(void *data); */
/* extern void malloc_good_size(unsigned int size); */
/* extern int link(); */
/* extern int unlink(); */
/* extern int rename(); */
/* extern int getpid(); */
/* extern int kill(); */
/* extern int fork(); */
/* extern int access(); */
/* extern int getdtablesize(); */
/* extern int write(); */
#if !defined(SYSTEM_ULTRIX)
/* extern int sleep(); */
/* extern int getuid(); */
extern int statfs();
#endif

#endif /* _STDINCLUDE_H */