#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <limits.h>
#include <errno.h>
#include <time.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/time.h>
#include <sys/stat.h>
#include <sys/wait.h>
#ifdef WIN32
# include <direct.h>
#else
# include <unistd.h>
#endif
#include <cups/cups.h>
#include <cups/string.h>
#include "mime.h"
#include <cups/http.h>
#include <cups/ipp.h>
#include <cups/language.h>
#include <cups/debug.h>
#ifndef FALSE
# define FALSE 0
# define TRUE (!FALSE)
#endif
#define MAX_BROWSERS 10
#define MAX_LISTENERS 10
#define MAX_USERPASS 33
#define MAX_FILTERS 20
#define MAX_SYSTEM_GROUPS 32
#define DEFAULT_HISTORY 1
#define DEFAULT_FILES 0
#define DEFAULT_TIMEOUT 300
#define DEFAULT_KEEPALIVE 60
#define DEFAULT_INTERVAL 30
#define DEFAULT_LANGUAGE setlocale(LC_ALL,"")
#define DEFAULT_CHARSET "utf-8"
#ifdef _MAIN_C_
# define VAR
# define VALUE(x) =x
#else
# define VAR extern
# define VALUE(x)
#endif
#include "cert.h"
#include "client.h"
#include "auth.h"
#include "printers.h"
#include "classes.h"
#include "job.h"
#include "conf.h"
#include "banners.h"
#include "dirsvc.h"
#include "network.h"
#if HAVE_DIRENT_H
# include <dirent.h>
typedef struct dirent DIRENT;
# define NAMLEN(dirent) strlen((dirent)->d_name)
#else
# if HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif
# if HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif
# if HAVE_NDIR_H
# include <ndir.h>
# endif
typedef struct direct DIRENT;
# define NAMLEN(dirent) (dirent)->d_namlen
#endif
VAR int MaxFDs;
VAR fd_set InputSet,
OutputSet;
VAR int NeedReload VALUE(TRUE);
VAR char TZ[1024] VALUE("TZ=GMT");
VAR ipp_t *Devices VALUE(NULL),
*PPDs VALUE(NULL);
extern void CatchChildSignals(void);
extern void IgnoreChildSignals(void);
extern void LoadDevices(const char *d);
extern void LoadPPDs(const char *d);
extern void StartServer(void);
extern void StopServer(void);