
/*
 *  DEFS.H
 */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "config.h"

#define arysize(ary)    (sizeof(ary)/sizeof((ary)[0]))

#define TMPBSIZE    2048
#define FNHASHSIZE  64
#define FNHASHMASK  (FNHASHSIZE-1)

#undef NULL
#define NULL ((void *)0L)

#define CTRL(x) ((x) & 0x1F)

typedef struct Range {
    struct Range   *Next;
    short   SNo;
    short   ENo;
} Range;

typedef struct FNode {
    struct FNode *Next;
    long    MsgNo;
    char    *Id;
} FNode;

typedef struct NewsGroup {
    struct NewsGroup *Next;
    char    *Name;
    short   Enabled;
    short   Reserved;
    short   MaxNo;	/*  last article    */
    short   CurNo;	/*  current article */
    short   PrevNo[8];	/*  previous article*/
    Range   *RList;	/*  articles read   */
    Range   *MList;	/*  articles marked */
    Range   *KList;	/*  articles killed */
    FNode   **IdBase;	/*  cached message IDs	*/
    FNode   **RefBase;	/*  cached References:	*/

    void    *DispFd;	/*  XXX display descriptor  */
} NGroup;

extern char TmpBuf[TMPBSIZE];

#include "dnews_protos.h"

