#ifndef _RSK_BACKUPPCD_COMMON_H
#define _RSK_BACKUPPCD_COMMON_H

#include "compat.h"

#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_INTTYPES_H
#include <inttypes.h>
#endif
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#include <string.h>
#endif
#ifdef HAVE_STRINGS_H
#include <strings.h>
#endif
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef HAVE_FCNTL_H
#include <fcntl.h>
#endif
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef HAVE_CTYPE_H
#include <ctype.h>
#endif
#ifdef HAVE_ASSERT_H
#include <assert.h>
#endif
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#ifdef HAVE_ARPA_INET_H
#include <arpa/inet.h>
#endif
#ifdef HAVE_LIBCONFIG
#include <libconfig.h>
#endif
#ifdef HAVE_LIBOPENNET
#include <opennet.h>
#endif
#ifdef HAVE_SYSLOG_H
#include <syslog.h>
#endif
#ifdef HAVE_UTIME_H
#include <utime.h>
#endif
#ifdef HAVE_TIME_H
#include <time.h>
#else
#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
#endif
#endif

#ifdef HAVE_LIBSSL
#ifndef NO_SSL
#if defined(HAVE_OPENSSL_SSL_H)
#include <openssl/ssl.h>
#elif defined(HAVE_SSL_SSL_H)
#include <ssl/ssl.h>
#elif defined(HAVE_SSL_H)
#include <ssl.h>
#else
#define NO_SSL 1
#endif
#endif
#else
#define NO_SSL 1
#endif

#ifndef NO_SSL
#define SSL 1
#else
#undef SSL
#endif

#ifndef HAVE_LINK
#include "link.h"
#endif
#ifndef HAVE_CHOWN
#include "chown.h"
#endif

#ifndef HAVE_FNMATCH
#include "fnmatch.h"
#else
#ifdef HAVE_FNMATCH_H
#include <fnmatch.h>
#endif
#endif

#ifndef BPC_TCP_PORT
#define BPC_TCP_PORT 874
#endif

int backuppc_mkdir(const char *dir);

#endif
