#ifndef _H_SYSTEM
#define _H_SYSTEM

// header chaos

#include "config.h"

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

#include <sys/types.h>

#include <iostream.h>
#include <iomanip.h>
#include <fstream.h>
#include <strstream.h>

#include <limits.h>
#include <math.h>

#include <sys/wait.h>
#include <errno.h>
#include <dlfcn.h>
#include <ctype.h>
#include <signal.h>

#if HAVE_UNISTD_H
# define __USE_XOPEN
# include <unistd.h>
#endif

#if HAVE_STRING_H
# include <string.h>
#endif
#if HAVE_STRINGS_H
# include <strings.h>
#endif
#ifndef HAVE_MEMCPY
# define memcpy(d, s, n) bcopy ((s), (d), (n))
# define memmove(d, s, n) bcopy ((s), (d), (n))
#endif

#if HAVE_CRYPT_H
# include <crypt.h>
#endif

#if TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# if HAVE_SYS_TIME_H
#  include <sys/time.h>
# else
#  include <time.h>
# endif
#endif

#include <sys/stat.h>
#include <sys/socket.h>

#if HAVE_FCNTL_H
# include <fcntl.h>
#endif

#include <arpa/inet.h>
#include <netdb.h>

#if HAVE_NETINET_IN_SYSTM_H
# include <netinet/in_systm.h>
#endif

#include <netinet/in.h>
#include <netinet/ip.h>

#if HAVE_NETINET_TCP_H
# include <netinet/tcp.h>
#endif

#if HAVE_PTHREAD_H
# if HAVE_LIBPTHREAD
#  define THREADED 1
#  include <pthread.h>
# endif
#endif

typedef const char * c_char;
#define EOL (c_char)0

#endif

