#include <sys/cdefs.h>

/* configuration parameters */
#define SRV_ROOT_DIR     "/"                   /* directory to run from */
#define SRV_UMASK        0                     /* umask to run with */
#define SRV_PORT         8008                  /* default port */
#define SRV_SOCK_BACKLOG 1                     /* length of socket queue */
#define SRV_SYSLOG_LVL   LOG_LOCAL5            /* facility (for syslog) */
#define SRV_SYSLOG_OPT   LOG_PID | LOG_ODELAY  /* syslog options */
#define SRV_BUFSIZE      1024                  /* input buffer size */
#define SRV_REPLYSIZE    2048                  /* output buffer size */

/* constants */
#define CR_CHAR (char)015  /* octal */
#define LF_CHAR (char)012  /* octal */

/*
 * types
 */
struct accept_buf {       	/* connection information */
  int fd;                     /* socket to client */
  char *host;                 /* client hostname */
  char *method, *path, *ver;  /* request */
  char *agent;                /* value of "User-Agent:" field */
  char buf[SRV_BUFSIZE];      /* buffer for read_line */
  int begin, size;            /* buffer position and end+1 */
  char *reply;                /* reply information */
};

/*  
 * New functions
 */

__BEGIN_DECLS

struct accept_buf *	accept_buf_malloc		__P((void));
void				accept_buf_free			__P((struct accept_buf *));

__END_DECLS
