/* <vms/lib/fchdef.h>
 *
 *	F11DEF - file characteristics bit definitions	[not in Starlet]
 */
#ifndef _FCHDEF_H
#define _FCHDEF_H

/*
   File characteristics bit definitions. These are identical to, and must
   track, the bits in FILECHAR of $FH2DEF, but are defined relative to the
   file characteristics longword instead of relative to the file header.
 */
#define FCH$V_VCC_STATE		8
#define FCH$M_VCC_STATE		0x0700
#define FCH$S_VCC_STATE		3
#define FCH$V_ASSOCIATED	11
#define FCH$V_EXISTENCE		12
#define FCH$M_ASSOCIATED	(1<<FCH$V_ASSOCIATED)	/* 0x000800 */
#define FCH$M_EXISTENCE		(1<<FCH$V_EXISTENCE)	/* 0x001000 */
#define FCH$V_WASCONTIG		0
#define FCH$V_NOBACKUP		1
#define FCH$V_WRITEBACK		2
#define FCH$V_READCHECK		3
#define FCH$V_WRITCHECK		4
#define FCH$V_CONTIGB		5
#define FCH$V_LOCKED		6
#define FCH$V_CONTIG		7
#define FCH$V_BADACL		11
#define FCH$V_SPOOL		12
#define FCH$V_DIRECTORY		13
#define FCH$V_BADBLOCK		14
#define FCH$V_MARKDEL		15
#define FCH$V_NOCHARGE		16
#define FCH$V_ERASE		17
#define FCH$V_SHELVED		19
#define FCH$V_SCRATCH		20
#define FCH$V_NOMOVE		21
#define FCH$V_NOSHELVABLE	22
#define FCH$M_WASCONTIG		(1<<FCH$V_WASCONTIG)	/* 0x01 */
#define FCH$M_NOBACKUP		(1<<FCH$V_NOBACKUP)	/* 0x02 */
#define FCH$M_WRITEBACK		(1<<FCH$V_WRITEBACK)	/* 0x04 */
#define FCH$M_READCHECK		(1<<FCH$V_READCHECK)	/* 0x08 */
#define FCH$M_WRITCHECK		(1<<FCH$V_WRITCHECK)	/* 0x10 */
#define FCH$M_CONTIGB		(1<<FCH$V_CONTIGB)	/* 0x20 */
#define FCH$M_LOCKED		(1<<FCH$V_LOCKED)	/* 0x40 */
#define FCH$M_CONTIG		(1<<FCH$V_CONTIG)	/* 0x80 */
#define FCH$M_BADACL		(1<<FCH$V_BADACL)	/* 0x0800 */
#define FCH$M_SPOOL		(1<<FCH$V_SPOOL)	/* 0x1000 */
#define FCH$M_DIRECTORY		(1<<FCH$V_DIRECTORY)	/* 0x2000 */
#define FCH$M_BADBLOCK		(1<<FCH$V_BADBLOCK)	/* 0x4000 */
#define FCH$M_MARKDEL		(1<<FCH$V_MARKDEL)	/* 0x8000 */
#define FCH$M_NOCHARGE		(1<<FCH$V_NOCHARGE)	/* 0x010000 */
#define FCH$M_ERASE		(1<<FCH$V_ERASE)	/* 0x020000 */
#define FCH$M_SHELVED		(1<<FCH$V_SHELVED)	/* 0x080000 */
#define FCH$M_SCRATCH		(1<<FCH$V_SCRATCH)	/* 0x100000 */
#define FCH$M_NOMOVE		(1<<FCH$V_NOMOVE)	/* 0x200000 */
#define FCH$M_NOSHELVABLE	(1<<FCH$V_NOSHELVABLE)	/* 0x400000 */

#define FCH$S_FCHDEF	4
struct fchdef {
    unsigned fch$v_wascontig	: 1;	/* file was (and should be) contiguous */
    unsigned fch$v_nobackup	: 1;	/* file is not to be backed up */
    unsigned fch$v_writeback	: 1;	/* file may be write-back cached */
    unsigned fch$v_readcheck	: 1;	/* verify all read operations */
    unsigned fch$v_writcheck	: 1;	/* verify all write operations */
    unsigned fch$v_contigb	: 1;	/* keep file as contiguous as possible */
    unsigned fch$v_locked	: 1;	/* file is deaccess locked */
    unsigned fch$v_contig	: 1;	/* file is contiguous */
    unsigned fch$v_vcc_state	: 3;	/* VCC state bits */
    unsigned fch$v_badacl	: 1;	/* ACL is invalid */
#define fch$v_associated  fch$v_badacl	/* ISO 9660 associated file */
    unsigned fch$v_spool	: 1;	/* intermediate spool file */
#define fch$v_existence   fch$v_spool	/* ISO 9660 existence file */
    unsigned fch$v_directory	: 1;	/* file is a directory */
    unsigned fch$v_badblock	: 1;	/* file contains bad blocks */
    unsigned fch$v_markdel	: 1;	/* file is marked for delete */
    unsigned fch$v_nocharge	: 1;	/* file space is not to be charged */
    unsigned fch$v_erase	: 1;	/* erase file contents before deletion */
    unsigned			: 1;
    unsigned fch$v_shelved	: 1;	/* file shelved */
    unsigned fch$v_scratch	: 1;	/* scratch header used by movefile */
    unsigned fch$v_nomove	: 1;	/* disable movefile on this file */
    unsigned fch$v_noshelvable	: 1;	/* file is not allowed to be shelved */
    unsigned			: 1;
    unsigned	: 8;			/* reserved to user & CSS use */
};

#endif	/*_FCHDEF_H*/
