/*
 *	File Name:		ng.h
 *	Project:		BARN - Bah's Amiga ReadNews.
 *	Purpose:		Define newsgroup structures.
 *	Author:			Jeff Van Epps
 *	Created:		02 Sep 89
 *	Last Modified:	21 Oct 90
 *	History:
 *		02 Sep 89/JVE	Created.
 *		21 Oct 90/JVE	Added declarations for UpdateReadList, Mark.
 */

/*
 *	MARKER is used to mark either a single number or a range. If to==0,
 *	from indicates the single number to be marked. Otherwise all numbers
 *	between and including from and to should be marked.
 */

typedef struct marker_info {
	long				from, to;	/* article numbers */
	struct marker_info	*next;		/* pointer to next marker record */
	} MARKER;

/*
 *	NG_INFO records names of newsgroups and which articles have been read
 *	in each newsgroup.
 */

typedef struct ng_info {
	char			*name;			/* name of newsgroup */
	MARKER			*markers;		/* ptr to list of article #s read */
	struct ng_info	*next;			/* ptr to next newsgroup in list */
	} NG_INFO;

/*
 *	Function prototypes.
 */

# ifdef sun

NG_INFO		*GetNewsRC();
int			ReadNextMarker();
void		PutNewsRC();
void		DestroyNGList();
int			NumberCovered();
void		UpdateReadList();
MARKER *	Mark();

# else

NG_INFO		*GetNewsRC( char *filename );
int			ReadNextMarker( MARKER ***marker );
void		PutNewsRC( char *filename, NG_INFO *alreadyread );
void		DestroyNGList( NG_INFO *alreadyread );
int			NumberCovered( MARKER *marker, long number );
void		UpdateReadList( NG_INFO *ng, ARTICLE_INFO *new );
MARKER *	Mark( long begin, long end );

# endif
