/* <vms/lib/fm2def.h>
 *
 *	F11DEF - file header map/retrieval area, ODS level 2	[not in Starlet]
 */
#ifndef _FM2DEF_H
#define _FM2DEF_H

/* retrieval pointer type codes */
#define FM2$C_PLACEMENT 0	/* 00 = placement control data */
#define FM2$C_FORMAT1	1	/* 01 = format 1 */
#define FM2$C_FORMAT2	2	/* 10 = format 2 */
#define FM2$C_FORMAT3	3	/* 11 = format 3 */

#define FM2$S_FORMAT	2
#define FM2$S_HIGHLBN	6
#define FM2$S_COUNT2	14

#define FM2$K_LENGTH0	2	/* length of format 0 (placement) */
#define FM2$C_LENGTH0	2
#define FM2$K_LENGTH1	4	/* length of format 1 */
#define FM2$C_LENGTH1	4
#define FM2$K_LENGTH2	6	/* length of format 2 */
#define FM2$C_LENGTH2	6
#define FM2$K_LENGTH3	8	/* length of format 3 */
#define FM2$C_LENGTH3	8
#define FM2$S_FM2DEF	4
/* format of retrieval pointer */
struct fm2def {
    union {
	unsigned short fm2$w_word0;	/* first word, of many uses */
	struct {
	    unsigned		  : 14;
	    unsigned fm2$v_format : 2;	/* format type code */
	} fm2$r_word0_bits0;
	struct {
	    unsigned fm2$v_exact : 1;	/* exact placement specified */
	    unsigned fm2$v_oncyl : 1;	/* on cylinder allocation desired */
	    unsigned		 : 10;
	    unsigned fm2$v_lbn	 : 1;	/* use LBN of next map pointer */
	    unsigned fm2$v_rvn	 : 1;	/* place on specified RVN */
	    unsigned		 : 2;
	} fm2$r_word0_bits1;
	struct {
	    unsigned		 : 8;
	    unsigned fm2$v_highlbn : 6; /* high order LBN */
	    unsigned		 : 2;
	} fm2$r_word0_bits2;
	struct {
	    unsigned fm2$v_count2 : 14; /* format 2 & 3 count field */
	    unsigned		 : 2;
	} fm2$r_word0_bits3;
	unsigned char fm2$b_count1;	/* format 1 count field */
    } fm2$r_word0_overlay;
    unsigned short fm2$w_lowlbn;	/* format 1 low order LBN */
};
#define FM2$S_FM2DEF1	6
struct fm2def1 {
    unsigned	: 16;
    unsigned long fm2$l_lbn2;		/* format 2 LBN (longword) */
};
#define FM2$S_FM2DEF2	8
struct fm2def2 {
    unsigned	: 16;
    unsigned short fm2$w_lowcount;	/* format 3 low order count */
    unsigned long fm2$l_lbn3;		/* format 3 LBN (longword) */
};

#endif	/*_FM2DEF_H*/
