#include "config.h"
#include "policy.h"
#ifndef ANSI_C
#ifdef __STDC__
#define ANSI_C 1
#else
#define ANSI_C 0
#endif
#endif
#define UUCONF_ANSI_C ANSI_C
#include <stdio.h>
#include <signal.h>
#if HAVE_STDDEF_H
#include <stddef.h>
#endif
#if ! HAVE_SIG_ATOMIC_T_IN_SIGNAL_H && HAVE_SIG_ATOMIC_T_IN_TYPES_H
#define USE_TYPES_H 1
#else
#if ! HAVE_SIZE_T_IN_STDDEF_H && HAVE_SIZE_T_IN_TYPES_H
#define USE_TYPES_H 1
#else
#if ! HAVE_TIME_T_IN_TIME_H && HAVE_TIME_T_IN_TYPES_H
#define USE_TYPES_H 1
#endif
#endif
#endif
#ifndef USE_TYPES_H
#define USE_TYPES_H 0
#endif
#if USE_TYPES_H
#include <sys/types.h>
#endif
#if ! HAVE_SIG_ATOMIC_T_IN_SIGNAL_H && ! HAVE_SIG_ATOMIC_T_IN_TYPES_H
#ifndef SIG_ATOMIC_T
#define SIG_ATOMIC_T char
#endif
typedef SIG_ATOMIC_T sig_atomic_t;
#endif
#if ! HAVE_SIZE_T_IN_STDDEF_H && ! HAVE_SIZE_T_IN_TYPES_H
#ifndef SIZE_T
#define SIZE_T unsigned
#endif
typedef SIZE_T size_t;
#endif
#if ! HAVE_TIME_T_IN_TIME_H && ! HAVE_TIME_T_IN_TYPES_H
typedef long time_t;
#endif
#if ANSI_C
#if ! HAVE_VOID || ! HAVE_UNSIGNED_CHAR || ! HAVE_PROTOTYPES
#error ANSI C compiler without void or unsigned char or prototypes
#endif
#define P(x) x
typedef void *pointer;
typedef const void *constpointer;
#define BUCHAR(b) ((unsigned char) (b))
#else
#define volatile
#if ! HAVE_VOID
#define void int
#endif
#if HAVE_PROTOTYPES
#define P(x) x
#else
#define P(x) ()
#endif
typedef char *pointer;
typedef const char *constpointer;
#if HAVE_UNSIGNED_CHAR
#define BUCHAR(b) ((unsigned char) (b))
#else
#define BUCHAR(b) ((b) & 0xff)
#endif
#endif
#ifndef offsetof
#define offsetof(type, field) \
((size_t) ((char *) &(((type *) 0)->field) - (char *) (type *) 0))
#endif
#ifndef __GNUC__
#define __inline__
#endif
#ifndef GCC_VERSION
#define GCC_VERSION (__GNUC__ * 1000 + __GNUC_MINOR__)
#endif
#if (GCC_VERSION < 2007)
# define __attribute__(x)
#endif
#ifndef ATTRIBUTE_MALLOC
# if (GCC_VERSION >= 2096)
# define ATTRIBUTE_MALLOC __attribute__ ((__malloc__))
# else
# define ATTRIBUTE_MALLOC
# endif
#endif
#ifndef ATTRIBUTE_UNUSED_LABEL
# if (GCC_VERSION >= 2093)
# define ATTRIBUTE_UNUSED_LABEL ATTRIBUTE_UNUSED
# else
# define ATTRIBUTE_UNUSED_LABEL
# endif
#endif
#ifndef ATTRIBUTE_UNUSED
#define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
#endif
#ifndef ATTRIBUTE_NORETURN
#define ATTRIBUTE_NORETURN __attribute__ ((__noreturn__))
#endif
#ifndef ATTRIBUTE_PRINTF
#define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
#define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2)
#define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3)
#define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4)
#define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5)
#define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6)
#endif
#if HAVE_MEMORY_H
#include <memory.h>
#else
extern pointer memchr ();
#endif
#if HAVE_STRING_H
#include <string.h>
#else
#if HAVE_STRINGS_H
#include <strings.h>
#else
extern char *strcpy (), *strncpy (), *strchr (), *strrchr (), *strtok ();
extern char *strcat (), *strerror (), *strstr ();
extern size_t strlen (), strspn (), strcspn ();
#if ! HAVE_MEMORY_H
extern pointer memcpy (), memchr ();
#endif
#endif
#endif
#if HAVE_STDLIB_H
#include <stdlib.h>
#else
extern pointer malloc (), realloc (), bsearch ();
extern long strtol ();
extern unsigned long strtoul ();
extern char *getenv ();
#endif
#if HAVE_LIBC_H
#include <libc.h>
#endif
#ifndef EXIT_SUCCESS
#define EXIT_SUCCESS (0)
#endif
#ifndef EXIT_FAILURE
#define EXIT_FAILURE (1)
#endif
#if ! HAVE_ERRNO_DECLARATION
extern int errno;
#endif
#define HAVE_TCP HAVE_SOCKET
#define HAVE_TLI HAVE_T_OPEN
typedef int boolean;
#undef TRUE
#undef FALSE
#define TRUE (1)
#define FALSE (0)
#if USE_STDIO
typedef FILE *openfile_t;
#define EFILECLOSED ((FILE *) NULL)
#define ffileisopen(e) ((e) != NULL)
#define ffileeof(e) feof (e)
#define cfileread(e, z, c) fread ((z), 1, (c), (e))
#define cfilewrite(e, z, c) fwrite ((z), 1, (c), (e))
#define ffileioerror(e, c) ferror (e)
#ifdef SEEK_SET
#define ffileseek(e, i) (fseek ((e), (long) (i), SEEK_SET) == 0)
#define ffilerewind(e) (fseek ((e), (long) 0, SEEK_SET) == 0)
#else
#define ffileseek(e, i) (fseek ((e), (long) (i), 0) == 0)
#define ffilerewind(e) (fseek ((e), (long) 0, 0) == 0)
#endif
#ifdef SEEK_END
#define ffileseekend(e) (fseek ((e), (long) 0, SEEK_END) == 0)
#else
#define ffileseekend(e) (fseek ((e), (long) 0, 2) == 0)
#endif
#define ffileclose(e) (fclose (e) == 0)
#define fstdiosync(e, z) (fsysdep_sync (e, z))
#else
#if ! USE_TYPES_H
#undef USE_TYPES_H
#define USE_TYPES_H 1
#include <sys/types.h>
#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef OFF_T
typedef OFF_T off_t;
#undef OFF_T
#endif
typedef int openfile_t;
#define EFILECLOSED (-1)
#define ffileisopen(e) ((e) >= 0)
#define ffileeof(e) (FALSE)
#define cfileread(e, z, c) read ((e), (z), (c))
#define cfilewrite(e, z, c) write ((e), (z), (c))
#define ffileioerror(e, c) ((c) < 0)
#ifdef SEEK_SET
#define ffileseek(e, i) (lseek ((e), (off_t) i, SEEK_SET) >= 0)
#define ffilerewind(e) (lseek ((e), (off_t) 0, SEEK_SET) >= 0)
#else
#define ffileseek(e, i) (lseek ((e), (off_t) i, 0) >= 0)
#define ffilerewind(e) (lseek ((e), (off_t) 0, 0) >= 0)
#endif
#ifdef SEEK_END
#define ffileseekend(e) (lseek ((e), (off_t) 0, SEEK_END) >= 0)
#else
#define ffileseekend(e) (lseek ((e), (off_t) 0, 2) >= 0)
#endif
#define ffileclose(e) (close (e) >= 0)
#define fstdiosync(e, z) (fsysdep_sync (fileno (e), z))
#endif
extern int main P((int argc, char **argv));
#if ! HAVE_GETLINE
extern int getline P((char **pz, size_t *pc, FILE *e));
#endif
#if ! HAVE_REMOVE
#undef remove
extern int remove P((const char *zfile));
#endif
#if ! HAVE_STRDUP
extern char *strdup P((const char *z));
#endif
#if ! HAVE_STRSTR
extern char *strstr P((const char *zouter, const char *zinner));
#endif
#if ! HAVE_STRCASECMP
#if HAVE_STRICMP
#define strcasecmp stricmp
#else
#define strcasecmp xstrcasecmp
extern int strcasecmp P((const char *z1, const char *z2));
#endif
#endif
#if ! HAVE_STRNCASECMP
#if HAVE_STRNICMP
#define strncasecmp strnicmp
#else
#define strncasecmp xstrncasecmp
extern int strncasecmp P((const char *z1, const char *z2, size_t clen));
#endif
#endif
#if ! HAVE_STRERROR
#undef strerror
extern char *strerror P((int ierr));
#endif
#if ! HAVE_MEMCMP
#if HAVE_BCMP
#define memcmp(p1, p2, c) bcmp ((p1), (p2), (c))
#else
extern int memcmp P((constpointer p1, constpointer p2, size_t c));
#endif
#endif
#if ! HAVE_MEMCPY
#if HAVE_BCOPY
#define memcpy(pto, pfrom, c) bcopy ((pfrom), (pto), (c))
#else
extern pointer memcpy P((pointer pto, constpointer pfrom, size_t c));
#endif
#endif
#if ! HAVE_MEMCHR
extern pointer memchr P((constpointer p, int b, size_t c));
#endif
#if ! HAVE_BZERO
#if HAVE_MEMSET
#define bzero(p, c) memset ((p), 0, (c))
#else
extern void bzero P((pointer p, int c));
#endif
#endif
#if ! HAVE_STRCHR
#if HAVE_INDEX
#define strchr index
extern char *index ();
#else
extern char *strchr P((const char *z, int b));
#endif
#endif
#if ! HAVE_STRRCHR
#if HAVE_RINDEX
#define strrchr rindex
extern char *rindex ();
#else
extern char *strrchr P((const char *z, int b));
#endif
#endif
#if ! HAVE_STRTOL
extern long strtol P((const char *, char **, int));
#endif
#if ! HAVE_STRTOUL
extern unsigned long strtoul P((const char *, char **, int));
#endif
#if ! HAVE_BSEARCH
extern pointer bsearch P((constpointer pkey, constpointer parray,
size_t celes, size_t cbytes,
int (*pficmp) P((constpointer, constpointer))));
#endif