Metropoli BBS
VIEWER: config.h MODE: TEXT (ASCII)
#ifndef CONFIG_H
#define CONFIG_H

#define MAX_NGNAME      255     /* max length of a ng name */
#define MAX_ITEMSIZE    2048    /* max length of a header line */
#define MAX_CFGLINE     255     /* max length of a cfg line */
#define MAX_NODENAME    32      /* max length of a node name */
#define MAX_DOMAINNAME  128     /* max length of a domain name */
#define MAX_LONGSTRING  12      /* max length of ltoa result */
#define MAX_PCKSTRING   8       /* max length of radixpack result */
#define MAX_CLPSIZE     255     /* max length of cmd line parameter */

#define PROCBUFSIZE     16384   /* size of article processing buffer */
#define COPYBUFSIZE     2048    /* size of file copy buffer */

/*----------------------------------------------------------------------*/
/*  Configuration                                                       */
/*                                                                      */
/*----------------------------------------------------------------------*/
typedef struct {
    char workdir[_MAX_PATH];
    char logfile[_MAX_PATH];
    long logflg;
    char pidfile[_MAX_PATH];
    char configfile[_MAX_PATH];     /* configuration file pathname */
    char mynode[MAX_NODENAME];      /* local node name without domain */
    char mydomain[MAX_DOMAINNAME];  /* local node name including domain */
    char activefile[_MAX_PATH];     /* active file pathname */
    char active_times[_MAX_PATH];   /* file with active creation times */
    char newsfile[_MAX_PATH];       /* article file if not stdin */
    char newsdir[_MAX_PATH];        /* news home directory */
    char historyfile[_MAX_PATH];    /* history file pathname */
} CONFIG;

extern CONFIG cfg;

extern void init_cfg(void);
extern int validate_cfg(void);

/*----------------------------------------------------------------------*/
/*  Logging flags                                                       */
/*----------------------------------------------------------------------*/
#define LOG_FLUSH   0x00000001L
#define LOG_HISTORY 0x00000008L
#define LOG_ACTIVE  0x00000010L

#define DOLOG(x)    ((cfg.logflg & (x)) != 0)

#endif
[ RETURN TO DIRECTORY ]