/* adosfs_root.h 930817 Niklas Hallqvist <niklas@appli.se> */

/* Adapted from Frank J. Edwards' Amix AmigaDOS FS implementation.  */

#ifndef _ADOSFS_ADOSFS_ROOT_H
#define _ADOSFS_ADOSFS_ROOT_H

/***
Copyright (c) 1991, 1992 by Frank J. Edwards
See the file COPYRIGHT in this distribution for copyright details.
***/

/***********************************************************************
-  Software for the AmigaDOS filesystem implementation for use         -
-  on Amiga Unix 2.0 and later.                                        -
-                                                                      -
-  Copyright (c) 1991 by Frank J. Edwards                              -
-  All rights reserved.                                                -
***********************************************************************/

/*
 *	Many of the structures and define's in this file are derived from
 *	documentation located either in the AmigaDOS Manual, 3rd Edition,
 *	or from include file(s)/comments in /usr/amiga/src directory tree.
 */

struct a_rdir {
  ados_u_long rd_type;		/* T.SHORT (2) */
  ados_u_long rd_rsvp1[2];	/* always 0 */
  ados_u_long rd_hashsz;	/* block_size (in longs) - 56 */
  ados_u_long rd_rsvp2[1];	/* always 0 */
  ados_u_long rd_chksm;		/* balance-to-zero checksum */
  ados_u_long rd_hash[NUMHASH];
  ados_u_long rd_bmflag;	/* TRUE if bmap on disk is valid */
  ados_u_long rd_bmapkey[BMAPSIZE]; /* blocks containing the bmap(s) */
  ados_u_long rd_bmapex;	/* 0, or block containing bmap extension */
  DateStamp rd_dirstmp;		/* datestamp of last DIR-modified time */
  ados_u_char rd_name[NAMESIZE]; /* volume name (BSTR) */
  DateStamp rd_dskstmp;		/* datestamp of last DISK-modified time */
  DateStamp rd_madstmp;		/* datestamp of DISK-formatted time */
  ados_u_long rd_rsvp3[2];	/* always 0 */
  ados_u_long rd_dircache;	/* Non-zero block number if DOS3 */
  ados_long rd_type2;		/* ST_ROOT (1) */
};

#define AROOT(x)	((struct a_rdir *)(x))

#endif /* _ADOSFS_ADOSFS_ROOT_H */
