/* ansctr.h for !DiscEx */

/*
 * This header file contains definitions of the structures common to all of
 *  scan.c, tree.c and analyse.c.
 */

#define  MAXCOMPONENTS  140   /* at most 140 components in a path name */


/* First, the "abstract data types" */

typedef struct _Stats *StatsPtr;                  /* for analyse.c */
typedef struct _Frag  *FragPtr;

typedef struct _TreeScanState *TreeScanHandle;    /* for tree.c */


/*
 * Each ScanListRec contains information about an "active" scan. Each scan
 *  starts with a "gathering" phase during which the entire disc tree is
 *  scanned. This phase is "time-sliced", allowing other operations to
 *  proceed at the same time. The second phase reads the disc map, and ties
 *  up the disc objects with fragments; this is not time-sliced.
 *
 * The "gathering" phase is implemented by tree.c, and the "analysis" phase
 *  by analysis.c; scan.c handles the UI issues.
 */

typedef struct _ScanList {

  /* these fields are of interest to all three modules */
    int FS;
    int drive;
    DiscInfoPtr di;       /* disc information record */
    BigBlockDefPtr alloc; /* allocator */

  /* this field is of interest to scan.c and to analyse.c */
    ObjectId dbox;        /* "gathering" or "analysis" window */

  /* these fields are of interest to scan.c only */
    struct _ScanList *next;
    Bool completed;       /* TRUE iff the gathering phase is complete */
    Bool paused;          /* TRUE iff gathering is temporarily paused; valid
                              only when 'completed' = FALSE */
    Bool faster;          /* TRUE iff the 'Dir' field in the gathering window
                              is not being updated; valid only when
                              'completed' = FALSE */

  /* these fields give access to data private to analyse.c */
    StatsPtr stats;       /* values for the analysis window */
    FragPtr *frag;        /* addresses fragment index when completed */

  /* this field gives access to data private to tree.c */
    TreeScanHandle tree;  /* identifies tree hierarchy (when completed), and
                              current state of scan (during gathering) */
} ScanListRec, *ScanListPtr;
