#ifndef _INCLUDES_H_
#define _INCLUDES_H_

#include "config.h"

#if STDC_HEADERS 
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
#endif

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

#if HAVE_SYS_WAIT_H
# include <sys/wait.h>
#endif

#if HAVE_LIBGEN_H
# include <libgen.h>
#endif

#ifndef HAVE_BASENAME
# define basename(x) (x)
#endif


#if HAVE_GETOPT_LONG
# if HAVE_GETOPT_H
#  include <getopt.h>
# endif
#else
# include "getopt/getopt.h"
#endif

#if HAVE_UTMPX_H
# include <utmpx.h>
#else
# if HAVE_UTMP_H
#  include <utmp.h>
# endif
#endif
#include "utmpx/utmpx-wrapper.h"

#if HAVE_TIME_H
# include <time.h>
#endif

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

#if HAVE_PATHS_H
# include <paths.h>
#else
# ifndef _PATH_DEV
#  define _PATH_DEV "/dev/"
# endif
#endif

#if HAVE_ERRNO_H
# include <errno.h>
#endif

#ifndef __UT_LINESIZE
# ifdef UT_LINESIZE
#  define __UT_LINESIZE UT_LINESIZE
# else
#  define __UT_LINESIZE 8
# endif
#endif

#ifndef __UT_NAMESIZE
# ifdef UT_NAMESIZE
#  define __UT_NAMESIZE UT_NAMESIZE
# else
#  define __UT_NAMESIZE 8
# endif
#endif

#ifndef _PATH_UTMP
# ifdef _UTMPX_FILE
#  define _PATH_UTMP _UTMPX_FILE
# endif
#endif

#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif

#if HAVE_PWD_H
# include <pwd.h>
#endif

#if HAVE_NETDB_H
# include <netdb.h>
#endif

#if HAVE_SYS_SOCKET_H
# include <sys/socket.h>
#endif

#if HAVE_NETINET_IN_H
# include <netinet/in.h>
#endif

#if HAVE_ARPA_INET_H
# include <arpa/inet.h>
#endif

#endif
