⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 udf_types.h

📁 本程序为ST公司开发的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
/************************************************** * * UDF_types.h * * CVS ID:   $Id: UDF_types.h,v 1.11 2006/11/21 11:54:57 longauer Exp $ * Author:   Jiri Sedmik [JS] - STM * Date:     $Date: 2006/11/21 11:54:57 $ * Revision: $Revision: 1.11 $ * * Description: * * *************************************************** * * COPYRIGHT (C) ST Microelectronics  2005 *            All Rights Reserved * *************************************************** * * STM CVS Log: * * $Log: UDF_types.h,v $ * Revision 1.11  2006/11/21 11:54:57  longauer * *** empty log message *** * * Revision 1.10  2006/11/07 19:36:10  longauer * all songs recognized on the UDF test disk 1 and 2 * * Revision 1.9  2006/10/26 13:35:15  longauer * File Entry reorganized; VAT20 re-addressing bug found * * Revision 1.8  2006/10/20 15:08:36  longauer * VAT works; + code reorganization * * Revision 1.7  2006/09/27 15:39:16  longauer * VAT first time working * * Revision 1.6  2006/09/18 09:55:22  belardi * Corrected CVS keyword usage * * Revision 1.5  2006/09/18 09:24:02  belardi * Added Log CVS keyword into file header * * ***************************************************/#ifndef _UDF_TYPES_H_#define _UDF_TYPES_H_#define UDF_FALSE	0#define UDF_TRUE	1#define UDF_NULL	0/* constant definitions */#define UDF_LOGICAL_BLOCK_SIZE			2048	/* Logical sector size in words */#define UDF_MAX_SPARING_TABLES			4		/* Sparing tables range from 0 to 4*/#define UDF_MEDIA_ANCHOR_BLOCKNO		256		/* Logical Block number of UDF anchor */#define UDF_MEDIA_OPEN_ANCHOR_BLOCKNO	512		/* Anchor block number in a open media*//* Sparing and VAT Identifiers (return values) */typedef enum{	UDF_NO_TABLE,	UDF_FLAG_SP_TABLE,	UDF_FLAG_VAT15,	UDF_FLAG_VAT20} URESULT;/* defined by the UDF2.60 specifications - par.2, pp.14 */#define UDF_MAX_NAME_LENGTH				255		/* File Name Length */#define VOLUME_IDENTIFIER_LENGTH		32		/* in words */#define UDF_MAX_NUMBER_OF_DESCRIPTORS	64/* !!! important !! in dir_struct subdir_level carries maximm level (uint8) */#define UDF_MAX_NUMBER_OF_SUBDIRS		128/* Tag Identifiers *///ECMA 7.2.1, pp.43#define	UDF_PRIMARY_VOLUME_DESCRIPTOR_TAG1				1#define UDF_ANCHOR_VOLUME_DESCRIPTOR_POINTER_TAG2		2#define UDF_VOLUME_DESCRIPTOR_POINTER_TAG3				3#define UDF_IMPLEMENTATION_USE_VOLUME_DESCRIPTOR_TAG4	4#define UDF_PARTITION_DESCRIPTOR_TAG5					5#define UDF_LOGICAL_VOLUME_DESCRIPTOR_TAG6				6#define UDF_UNALLOCATED_SPACE_DESCRIPTOR_TAG7			7#define UDF_TERMINATING_DESCRIPTOR_TAG8					8#define UDF_LOGICAL_VOLUME_INTEGRITY_DESCRIPTOR_TAG9	9//ECMA 7.2.1, pp.74#define UDF_FILE_SET_DESCRIPTOR_TAG256					256#define UDF_FILE_IDENTIFIER_DESCRIPTOR_TAG257			257#define UDF_FILE_ENTRY_TAG261							261#define UDF_EXTENDED_FILE_ENTRY266						266/* other identifiers */#define UDF_PARTITION_MAP_TYPE1			1#define UDF_PARTITION_MAP_TYPE2			2#define	UDF_VAT_VERSION15				0x0150#define	UDF_VAT_VERSION20				0x0200#define UDF_VAT_VERSION201				0x0201#define UDF_NO_SPARING_VALUE			0xFFFFFFFF#define	UDF_IDENT_STR_LEN				23#define	UDF_IDENT_SUFFIX_LEN			8#define UDF_INCOMPLETE_FID				38#define	UDF_STR_08_COMPRESSION_ID		8#define	UDF_STR_16_COMPRESSION_ID		16/* Definition of offset Values [in words] *//*	not used#define UDF_MAIN_VOL_LENGTH_OFFSET				8U#define UDF_MAIN_VOL_LOCATION_OFFSET			10U#define UDF_RES_VOL_LENGTH_OFFSET				12U#define UDF_RES_VOL_LOCATION_OFFSET				14U#define UDF_FILE_SET_LENGTH_OFFSET				0U#define UDF_FILE_SET_LOCATION_OFFSET			2U#define UDF_LOGICAL_VOL_CONTENTS_USE_OFFSET		124U#define UDF_MAP_TABLE_LEN_OFFSET				132U#define UDF_PARTITION_MAPS_OFFSET				220U#define UDF_PARTITION_LOCATION_OFFSET			94U#define UDF_PARTITION_LENGTH_OFFSET				96U#define UDF_PARTITION_NUMBER_OFFSET				11U#define UDF_PARTITION_MAP_TYPE_OFFSET			0U// this value is 3 because the string to be compared starts from byte 5#define UDF_PARTITION_IDENTIFIER_OFFSET			3U #define UDF_ROOT_ICB_LEN_OFFSET					200U#define UDF_ROOT_ICB_LOCATION_OFFSET			202U#define UDF_ICB_FLAGS_OFFSET					17U	//File Entry#define UDF_FE_INFO_LEN_OFFSET					28U	//File Entry#define UDF_LEN_EXT_ATTR_OFFSET					84U	//File Entry#define UDF_LEN_ALLOC_DESC_OFFSET				86U	//File Entry#define UDF_EXT_ATTR_OFFSET						88U	//File Entry#define	UDF_LVDP_VERSION_OFFSET					120U		#define UDF_SIZE_SP_OFFSET						22U#define UDF_PACKET_LENGTH_OFFSET				20U#define UDF_SPARING_ENTRY_OFFSET				28U#define UDF_VAT_UDF_VAT_LEN_OF_IMP_USE_OFFSET	1U	//VAT (2 bytes)#define UDF_VAT_IMP_USE_OFFSET					76U	//VAT#define	UDF_LVDP_OFFSET_OFFSET					220U#define	UDF_SP_MAP_OFFSET						24U#define UDF_NO_SP_TABLES_OFFSET					21U#define UDF_FID_CHAR_OFFSET						9U	//FID#define UDF_FID_FE_LOC_OFFSET					12U	//FID#define UDF_FID_IMP_USE_OFFSET					18U	//FID#define	UDF_FID_IDENT_OFFSET					19U	//FID; the same like UDF_INCOMPLETE_FID#define UDF_LVID_PART_OFFSET					36U// data structure offsets#define UDF_GEN_MAP_OFFSET						18U#define UDF_PDP_OFFSET_OFFSET					256U#define UDF_LONG_AD_OFFSET						8U#define UDF_FSD_OFFSET							256U#define UDF_AVDP_OFFSET							256U*//* The incomplete FID can be of 38 + 255 + LIU * As we are not aware of the number of bytes taken  * by LIU, we define buffer size as 350 bytes and will * return error if we need to copy more than this * size. */#define UDF_INCOMPLETE_FID_BUFFER_SIZE			350#define UDF_SMALL_FILE_OFFSET					0		//[OT]/* This value helps us extract the first three bits */#define UDF_MASK_3_BITS	0x0007/* This structure is as defined by the ECMA 167 specifications */// 14.6.8, pp.96typedef enum{	UDF_SHORT_ALLOC_DESC,	UDF_LONG_ALLOC_DESC,	UDF_EXTENDED_ALLOC_DESC,	UDF_DATA_IN_EXTENT_DESC	/* TBD: more */} UDF_ALLOC_DESC_FLAG;/* flag to resolve address set */#define	UDF_SINGLE_VALUE			01#define	UDF_MULTIPLE_ADDRESS		02#define	UDF_SINGLE_ADDRESS			03/* not used#define UDF_FILE_ENTRY_FLAG0		0x0000#define UDF_FILE_ENTRY_FLAG1		0x0001#define UDF_FILE_ENTRY_FLAG2		0x0002#define UDF_FILE_ENTRY_FLAG3		0x0003#define UDF_FILE_SYSTEM_COMPLETE	0U#define UDF_MODIFIED_ATTR			1U#define	UDF_MASK_SECOND_BIT			0x0002#define	UDF_MASK_THIRD_BIT			0x0004#define PACK_DOT_MARK				0x2e2e*//* --- End of Constant definitions --- */typedef unsigned short UDF_BOOL;typedef struct _UDF_Globals {	uint32 end_LBN;	uint16 Blocksize;} Udf_Globals;typedef struct _session_struct{	uint32 end_LBN;	uint32 start_LBN;} session_struct;/* Data structure definitions *//* TAG Structure *//* This structure is as defined by the ECMA 167 specifications *///2.2.1, pp.26; 2.3.1, pp.53typedef __packed struct _UDF_Tag{	uint16		tagIdent;		//0-1	uint16		descVersion;	//2-3	uint8		tagChecksum;	//4	uint8		reserved; 		//5	uint16		tagSerialNum;	//6-7	uint16		descCRC;		//8-9	uint16		descCRCLength;	//10-11	uint32		tagLocation;	//12-15} UDF_Tag;/* Extent *//* This structure is as defined by the ECMA 167 specifications *///7.1, pp.42typedef __packed struct _UDF_ExtentAd{	uint32	extLength;		//0-3	uint32	extLocation;	//4-7} UDF_ExtentAd;/* Anchor Volume Descriptor Pointer*///2.2.3, pp.29typedef __packed struct _UDF_AnchVolDescPointer{	UDF_Tag			descTag;				//0-15	(Tag=2)	UDF_ExtentAd	mainVolDescSeqExt;		//16-23	UDF_ExtentAd	reserveVolDescSeqExt;	//24-31	uint8			reserved[480];			//32-511} UDF_AnchVolDescPointer;/* Partition and Fileset data *//* This structure is as defined by the ECMA 167 specifications */typedef struct _UDF_Partition{	UDF_ExtentAd	partition;	/* Length and location of the partition */	UDF_ExtentAd	fileSet;	/* Length and location of the FSD */} UDF_Partition;/* Entity Identifier  *//* This structure is as defined by the ECMA 167 specifications *///2.1.5, pp.20// identifierlist - 6.1, pp.112 typedef __packed struct _UDF_EntityID{	uint8	flags;								//0	uint8	ident[UDF_IDENT_STR_LEN];			//1-23	__packed union	{		uint8	identSuffix[UDF_IDENT_SUFFIX_LEN];		/* Domain Identifier Suffix format */		__packed struct		{			uint16	udfRevision;				//24-25	=#0260			uint8	flags;						//26			uint8	reserved[5];				//27-31	=#00		} DomainIdentSuffix;		/* UDF Identifier Suffix format */		__packed struct		{			uint16	udfRevision;				//24-25	=#0260			uint8	osClass;					//26			uint8	osIdent;					//27			uint8	reserved[4];				//28-31	=#00		} UdfIdentSuffix;		/* Implementation Identifier Suffix format */		__packed struct		{			uint8	osClass;					//24			uint8	osIdent;					//25			uint8	reserved[6];				//26-31		} ImplementIdentSuffix;		/* Application Identifier Suffix format */		uint8	applUseArea[UDF_IDENT_SUFFIX_LEN];	} Suffix;									//24-31} UDF_EntityID;/* Partition Descriptor *//* This structure is as defined by the ECMA 167 specifications *///2.2.14, pp.51typedef struct _UDF_PartitionDesc{	UDF_Tag		descTag;					//0-15	(Tag=5)	uint32		volDescSeqNum;				//16-19	uint16		partitionFlags;				//20-21	uint16		partitionNumber;			//22-23	UDF_EntityID	partitionContents;		//24-55	uint8		partitionContentsUse[128];	//55-183	uint32		accessType;					//184-187	uint32		partitionStartingLocation;	//188-191	uint32		partitionLength;			//192-195	UDF_EntityID	impIdent;				//196-227	uint8		implUse[128];				//228-355	uint8		reserved[156];				//356-511} UDF_PartitionDesc;/* This structure is as defined by the udf2.60 specifications *///2.1.1, pp.17typedef struct _UDF_FleIdent{	uint8		CompressionID;			//0	uint8		CompressedBitStream;	//1-	/* d-string should be the type of the CompressedBitStream */} UDF_FileIdent;/* This structure is as defined by the ECMA 167 specifications */typedef struct _UDF_CharSpec{	uint8		charSetType;		//0	uint8		charSetInfo[63];	//1-63} UDF_CharSpec;/* Logical Volume descriptor Pointer *//* This structure is as defined by the ECMA 167 specifications *///2.2.4, pp.30typedef struct _UDF_LogVolDesc_i{	/* incomplete LVD */	UDF_Tag			descTag; 					//0-15	(Tag=6)	uint32			volDescSeqNum;				//16-19	UDF_CharSpec	descCharSet;				//20-83	uint8			logicalVolIdent[128];		//84-211	uint32			logicalBlockSize;			//212-215	UDF_EntityID	domainIdent;				//216-247	uint8			logicalVolContentsUse[16];	//248-263	uint32			mapTableLength;				//264-267	(=MT_L)	uint32			numPartitionMaps;			//268-271	UDF_EntityID	impIdent;					//272-303	uint8			implUse[128];				//304-431	UDF_ExtentAd	integritySeqExt;			//432-439/*	uint8			partitionMaps[mapTableLength];	//440-*/} UDF_LogVolDesc_i;/* Recorded Address *//* This structure is as defined by the ECMA 167 specifications *///4/3 7.1, pp.73typedef __packed struct _UDF_LbAddr{	uint32	logicalBlockNum;		//0-3	uint16	partitionReferenceNum;	//4-5} UDF_LbAddr;/* Short Allocation Descriptor *//* This structure is as defined by the ECMA 167 specifications *///14.14.1, pp.115 (udf260 2.3.10, pp.65)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -