/*
 * slurp.h - common definitions for slurp
 *
 * Copyright (C) 1992/93/94 Stephen Hebditch <steveh@tqmcomms.co.uk>.
 * All rights reserved. TQM Communications, BCM Box 225, London, WC1N 3XX.
 *
 * See README for more information and disclaimers
 *
 * $Id: slurp.h,v 1.9 1995/01/10 13:07:59 root Exp $
 *
 * $Log: slurp.h,v $
 * Revision 1.9  1995/01/10  13:07:59  root
 * Moved standard includes to individual files instead.
 * Added new function prototypes and external variable definitions.
 *
 * Revision 1.7  1993/06/07  11:17:47  root
 * Removed bcopy/bzero definitions and used ANSI memcpy and memset
 * functions throughout the code instead.
 *
 * Revision 1.6  1993/04/22  18:10:09  root
 * Corrected function prototype of server_time - should have been
 * time_t instead of long.
 * Made <unistd.h> a compilation option.
 *
 * Revision 1.5  1993/03/01  17:57:44  root
 * Minor reshuffle, plus USG definition now SYSV.
 *
 * Revision 1.4  1993/02/14  14:40:55  root
 * Added no_id_load_flag.
 * Modified struct mnode to include used flag and remove msgid.
 * New process_id and set_ntime definitions.
 *
 * Revision 1.3  1992/12/15
 * Added SYS_ERRLIST definitions.
 *
 * Revision 1.1  1992/12/06
 * Added no_time flag.
 *
 * Revision 1.0  1992/10/29
 * Initial coding.
 *
 */

/* The inevitable fixes... */

#if !defined (TRUE) || ((TRUE) != 1)
	#define TRUE (1)
#endif

#if !defined (FALSE) || ((FALSE) != 0)
	#define FALSE (0)
#endif

#ifndef PATH_MAX
	#define PATH_MAX 1024
#endif

/* Structure for linked list holding message ids */

typedef struct IDNODE
	{
	char *msgid;
	int used;
	struct IDNODE *next;
	} IDNODE;


/* Command line / configuration file flags */

extern int debug_flag;		/* Write extra debugging output to screen */
extern int no_history_flag;	/* Don't check ids in the history file */
extern int no_id_read_flag;	/* Don't load any ids from slurp.<hostname> */
extern int no_id_write_flag;/* Don't write ids to slurp.<hostname> */
extern int no_time_write_flag; /* Don't write time to slurp.<hostname> */
extern int pipe_flag;		/* Pipe articles to program */
extern int progress_flag;	/* Display progress of transactions */

/* Host information */

extern char *hostname;		/* Name of current NNTP server host */

/* NEWNEWS information */

extern char *nn_newsgroups;
extern char *nn_time;
extern char *nn_distributions;

/* Misc options */

extern FILE *overflowfp;
extern char *output;
extern char hostfile [PATH_MAX];

/* Counters */

extern int waiting;			/* Number of articles waiting at server */
extern int dupart;			/* Number of duplicate articles */
extern int misart;			/* Number of missing articles */
extern int xfrart;			/* Number of transferred articles */
#ifdef SITEEXCLUDING
extern int exclart;			/* Number of excluded articles */
#endif /* SITEEXCLUDING */
extern long totalsize;		/* Total size of articles tranferred */

/* Misc variables */

extern char *pname;			/* Name of this program */
extern time_t nexttime;		/* Time for next NEWNEWS */


/* Slurp function prototypes */

extern void get_articles (void);					/* articles.c */
extern void enqueue_batch (void);

extern int add_id (const char *);					/* cache.c */
extern IDNODE *first_id (void);
extern IDNODE *next_id (void);

extern int open_history (void);						/* history.c */
extern void close_history (void);
extern int check_id (const char *);

extern void read_hostfile (void);					/* hostfiles.c */
extern void write_hostfile (void);

extern void log_ret (const char *, ...);			/* misc.c */
extern void log_sys (const char *, ...);
extern void log_msg (const char *, ...);
extern char *stradd (const char *, const char *);

extern void get_ids (void);							/* newnews.c */
extern void process_id (char *);

extern int tcp_open (const char *, const char *, const int);
extern int server_init (const char *, const int);	/* sockets.c */
extern void close_server (void);
extern void get_server (char *, const int);
extern void put_server (const char *);
extern void do_authinfo (const char *, const char *);
extern void do_mode_reader (void);

extern int space (int);								/* space.c */

extern time_t server_time (const char *);			/* time.c */

/* END-OF-FILE */


syntax highlighted by Code2HTML, v. 0.9.1