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

📄 udf_167.h

📁 Sunplus 8202S source code.
💻 H
📖 第 1 页 / 共 2 页
字号:
#define EXTENT_NOT_RECORDED_ALLOCATED           0x01
#define EXTENT_NOT_RECORDED_NOT_ALLOCATED       0x02
#define EXTENT_NEXT_EXTENT_ALLOCDECS            0x03

/* Long Allocation Descriptor (ECMA 167 4/14.14.2) */
typedef struct {
	UINT32 extLength		__attribute__ ((packed));
	lb_addr extLocation	__attribute__ ((packed));
	UINT8 impUse[6]		__attribute__ ((packed));
} long_ad;
/* upper 2 bits of extLength indicate type */

/* File Set Descriptor (ECMA 167 4/14.1) */
struct FileSetDesc {
	tag descTag								__attribute__ ((packed));
	timestamp recordingDateAndTime	__attribute__ ((packed));
	UINT16 interchangeLvl				__attribute__ ((packed));
	UINT16 maxInterchangeLvl			__attribute__ ((packed));
	UINT32 charSetList					__attribute__ ((packed));
	UINT32 maxCharSetList				__attribute__ ((packed));
	UINT32 fileSetNum						__attribute__ ((packed));
	UINT32 fileSetDescNum				__attribute__ ((packed));
	charspec logicalVolIdentCharSet	__attribute__ ((packed));
	dstring logicalVolIdent[128]		__attribute__ ((packed));
	charspec fileSetCharSet				__attribute__ ((packed));
	dstring fileSetIdent[32]			__attribute__ ((packed));
	dstring copyrightFileIdent[32]	__attribute__ ((packed));
	dstring abstractFileIdent[32]		__attribute__ ((packed));
	long_ad rootDirectoryICB			__attribute__ ((packed));
	EntityID domainIdent					__attribute__ ((packed));
	long_ad nextExt						__attribute__ ((packed));
	long_ad streamDirectoryICB			__attribute__ ((packed));
	UINT8 reserved[32]					__attribute__ ((packed));
};

/* Short Allocation Descriptor (ECMA 167 4/14.14.1) */
typedef struct {
	UINT32 extLength		__attribute__ ((packed));
	UINT32 extPosition	__attribute__ ((packed));
} short_ad;

/* Partition Header Descriptor (ECMA 167 4/14.3) */
struct PartitionHeaderDesc {
	short_ad unallocatedSpaceTable	__attribute__ ((packed));
	short_ad unallocatedSpaceBitmap	__attribute__ ((packed));
	short_ad partitionIntegrityTable	__attribute__ ((packed));
	short_ad freedSpaceTable			__attribute__ ((packed));
	short_ad freedSpaceBitmap			__attribute__ ((packed));
	UINT8 reserved[88]					__attribute__ ((packed));
};

/* File Identifier Descriptor (ECMA 167 4/14.4) */
struct FileIdentDesc
{
	tag descTag						__attribute__ ((packed));
	UINT16 fileVersionNum		__attribute__ ((packed)); /* 1 */
	UINT8 fileCharacteristics	__attribute__ ((packed));
	UINT8 lengthFileIdent		__attribute__ ((packed));
	long_ad icb						__attribute__ ((packed));
	UINT16 lengthOfImpUse		__attribute__ ((packed));
};

/* File Characteristics (ECMA 167 4/14.4.3) */
#define FILE_HIDDEN		1
#define FILE_DIRECTORY	2
#define FILE_DELETED		4
#define FILE_PARENT		8
#define FILE_METADATA	0x10 /* UDF 2.0 */

/* Allocation Ext Descriptor (ECMA 167 4/14.5) */
struct AllocExtDesc
{
	tag descTag								__attribute__ ((packed));
	UINT32 previousAllocExtLocation	__attribute__ ((packed));
	UINT32 lengthAllocDescs				__attribute__ ((packed));
};

/* ICB Tag (ECMA 167 4/14.6) */
typedef struct {
	UINT32 priorRecordedNumDirectEntries	__attribute__ ((packed));
	UINT16 strategyType							__attribute__ ((packed));
	UINT16 strategyParameter					__attribute__ ((packed));
	UINT16 numEntries								__attribute__ ((packed));
	UINT8 reserved									__attribute__ ((packed));
	UINT8 fileType									__attribute__ ((packed));
	lb_addr parentICBLocation					__attribute__ ((packed));
	UINT16 flags									__attribute__ ((packed));
} icbtag;

/* ICB File Type (ECMA 167 4/14.6.6) */
#define FILE_TYPE_NONE			0x00U
#define FILE_TYPE_UNALLOC		0x01U
#define FILE_TYPE_INTEGRITY	0x02U
#define FILE_TYPE_INDIRECT		0x03U
#define FILE_TYPE_DIRECTORY	0x04U
#define FILE_TYPE_REGULAR		0x05U
#define FILE_TYPE_BLOCK			0x06U
#define FILE_TYPE_CHAR			0x07U
#define FILE_TYPE_EXTENDED		0x08U
#define FILE_TYPE_FIFO			0x09U
#define FILE_TYPE_SOCKET		0x0aU
#define FILE_TYPE_TERMINAL		0x0bU
#define FILE_TYPE_SYMLINK		0x0cU
#define FILE_TYPE_STREAMDIR	0x0dU /* ECMA 167 4/13 */

/* ICB Flags (ECMA 167 4/14.6.8) */
#define ICB_FLAG_ALLOC_MASK		0x0007U
#define ICB_FLAG_SORTED				0x0008U
#define ICB_FLAG_NONRELOCATABLE	0x0010U
#define ICB_FLAG_ARCHIVE			0x0020U
#define ICB_FLAG_SETUID				0x0040U
#define ICB_FLAG_SETGID				0x0080U
#define ICB_FLAG_STICKY				0x0100U
#define ICB_FLAG_CONTIGUOUS		0x0200U
#define ICB_FLAG_SYSTEM				0x0400U
#define ICB_FLAG_TRANSFORMED		0x0800U
#define ICB_FLAG_MULTIVERSIONS	0x1000U

/* ICB Flags Allocation type(ECMA 167 4/14.6.8) */
#define ICB_FLAG_AD_SHORT		0
#define ICB_FLAG_AD_LONG		1
#define ICB_FLAG_AD_EXTENDED	2
#define ICB_FLAG_AD_IN_ICB		3

/* Indirect Entry (ECMA 167 4/14.7) */
struct IndirectEntry {
	tag descTag				__attribute__ ((packed));
	icbtag icbTag			__attribute__ ((packed));
	long_ad indirectICB	__attribute__ ((packed));
};

/* Terminal Entry (ECMA 167 4/14.8) */
struct TerminalEntry {
	tag descTag		__attribute__ ((packed));
	icbtag icbTag	__attribute__ ((packed));
};

/* File Entry (ECMA 167 4/14.9) */
struct FileEntry {
	tag			descTag				__attribute__ ((packed));
	icbtag		icbTag				__attribute__ ((packed));
	UINT32		uid					__attribute__ ((packed));
	UINT32		gid					__attribute__ ((packed));
	UINT32		permissions			__attribute__ ((packed));
	UINT16		fileLinkCount		__attribute__ ((packed));
	UINT8			recordFormat		__attribute__ ((packed));
	UINT8			recordDisplayAttr	__attribute__ ((packed));
	UINT32		recordLength		__attribute__ ((packed));
	UINT8		   informationLength[8]	__attribute__ ((packed));
	UINT8		   logicalBlocksRecorded[8]	__attribute__ ((packed));
	timestamp	accessTime			__attribute__ ((packed));
	timestamp	modificationTime	__attribute__ ((packed));
	timestamp	attrTime				__attribute__ ((packed));
	UINT32		checkpoint			__attribute__ ((packed));
	long_ad		extendedAttrICB	__attribute__ ((packed));
	EntityID		impIdent				__attribute__ ((packed));
	UINT8		   uniqueID[8] 			__attribute__ ((packed)); /* 0= root, 16- (2^32-1) */
	UINT32		lengthExtendedAttr	__attribute__ ((packed));
	UINT32		lengthAllocDescs	__attribute__ ((packed));
};

/* File Permissions (ECMA 167 4/14.9.5) */
#define PERM_O_EXEC		0x00000001U
#define PERM_O_WRITE		0x00000002U
#define PERM_O_READ		0x00000004U
#define PERM_O_CHATTR	0x00000008U
#define PERM_O_DELETE	0x00000010U
#define PERM_G_EXEC		0x00000020U
#define PERM_G_WRITE		0x00000040U
#define PERM_G_READ		0x00000080U
#define PERM_G_CHATTR	0x00000100U
#define PERM_G_DELETE	0x00000200U
#define PERM_U_EXEC		0x00000400U
#define PERM_U_WRITE		0x00000800U
#define PERM_U_READ		0x00001000U
#define PERM_U_CHATTR	0x00002000U
#define PERM_U_DELETE	0x00004000U

/* File Record Format (ECMA 167 4/14.9.7) */
#define RECORD_FMT_NONE				0
#define RECORD_FMT_FIXED_PAD		1
#define RECORD_FMT_FIXED			2
#define RECORD_FMT_VARIABLE8		3
#define RECORD_FMT_VARIABLE16		4
#define RECORD_FMT_VARIABLE16_MSB	5
#define RECORD_FMT_VARIABLE32		6
#define RECORD_FMT_PRINT			7
#define RECORD_FMT_LF				8
#define RECORD_FMT_CR				9
#define RECORD_FMT_CRLF				10
#define RECORD_FMT_LFCR				10

/* Extended Attribute Header Descriptor (ECMA 167 4/14.10.1) */
struct ExtendedAttrHeaderDesc {
	tag descTag					__attribute__ ((packed));
	UINT32 impAttrLocation	__attribute__ ((packed));
	UINT32 appAttrLocation	__attribute__ ((packed));
};

/* Generic Attribute Format (ECMA 4/14.10.2) */
struct GenericAttrFormat {
	UINT32 attrType	__attribute__ ((packed));
	UINT8 attrSubtype	__attribute__ ((packed));
	UINT8 reserved[3]	__attribute__ ((packed));
	UINT32 attrLength	__attribute__ ((packed));
};

/* Character Set Attribute Format (ECMA 4/14.10.3) */
struct CharSetAttrFormat {
	UINT32 attrType	__attribute__ ((packed));		/* 1 */
	UINT8 attrSubtype	__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]	__attribute__ ((packed));
	UINT32 attrLength	__attribute__ ((packed));
	UINT32 escapeSeqLength	__attribute__ ((packed));
	UINT8 charSetType	__attribute__ ((packed));
};

/* Alternate Permissions (ECMA 167 4/14.10.4) */
struct AlternatePermissionsExtendedAttr {
	UINT32 attrType	__attribute__ ((packed));		/* 3 */
	UINT8 attrSubtype	__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]	__attribute__ ((packed));
	UINT32 attrLength	__attribute__ ((packed));
	UINT16 ownerIdent	__attribute__ ((packed));
	UINT16 groupIdent	__attribute__ ((packed));
	UINT16 permission	__attribute__ ((packed));
};

/* File Times Extended Attribute (ECMA 167 4/14.10.5) */
struct FileTimesExtendedAttr {
	UINT32 attrType	__attribute__ ((packed));		/* 5 */
	UINT8 attrSubtype	__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]	__attribute__ ((packed));
	UINT32 attrLength	__attribute__ ((packed));
	UINT32 dataLength	__attribute__ ((packed));
	UINT32 fileTimeExistence	__attribute__ ((packed));
	UINT8 fileTimes	__attribute__ ((packed));
};

/* FileTimeExistence (ECMA 167 4/14.10.5.6) */
#define FTE_CREATION		0
#define FTE_DELETION		2
#define FTE_EFFECTIVE	3
#define FTE_BACKUP		5

/* Information Times Extended Attribute (ECMA 167 4/14.10.6) */
struct InfoTimesExtendedAttr {
	UINT32 attrType				__attribute__ ((packed));		/* 6 */
	UINT8 attrSubtype				__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]				__attribute__ ((packed));
	UINT32 attrLength				__attribute__ ((packed));
	UINT32 dataLength				__attribute__ ((packed));
	UINT32 infoTimeExistence	__attribute__ ((packed));
};

/* Device Specification Extended Attribute (ECMA 167 4/14.10.7) */
struct DeviceSpecificationExtendedAttr {
	UINT32 attrType			__attribute__ ((packed));		/* 12 */
	UINT8 attrSubtype			__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]			__attribute__ ((packed));
	UINT32 attrLength			__attribute__ ((packed));
	UINT32 impUseLength		__attribute__ ((packed));
	UINT32 majorDeviceIdent	__attribute__ ((packed));
	UINT32 minorDeviceIdent	__attribute__ ((packed));
};

/* Implementation Use Extended Attr (ECMA 167 4/14.10.8) */
struct ImpUseExtendedAttr {
	UINT32 attrType		__attribute__ ((packed));		/* 2048 */
	UINT8 attrSubtype		__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]		__attribute__ ((packed));
	UINT32 attrLength		__attribute__ ((packed));
	UINT32 impUseLength	__attribute__ ((packed));
	EntityID impIdent		__attribute__ ((packed));
};

/* Application Use Extended Attribute (ECMA 167 4/14.10.9) */
struct AppUseExtendedAttr {
	UINT32 attrType		__attribute__ ((packed));		/* 65536 */
	UINT8 attrSubtype		__attribute__ ((packed));		/* 1 */
	UINT8 reserved[3]		__attribute__ ((packed));
	UINT32 attrLength		__attribute__ ((packed));
	UINT32 appUseLength	__attribute__ ((packed));
	EntityID appIdent		__attribute__ ((packed));
};

#define EXTATTR_CHAR_SET	1
#define EXTATTR_ALT_PERMS	3
#define EXTATTR_FILE_TIMES	5
#define EXTATTR_INFO_TIMES	6
#define EXTATTR_DEV_SPEC	12
#define EXTATTR_IMP_USE		2048
#define EXTATTR_APP_USE		65536


/* Unallocated Space Entry (ECMA 167 4/14.11) */
struct UnallocatedSpaceEntry {
	tag descTag					__attribute__ ((packed));
	icbtag icbTag				__attribute__ ((packed));
	UINT32 lengthAllocDescs	__attribute__ ((packed));
};

/* Space Bitmap Descriptor (ECMA 167 4/14.12) */
struct SpaceBitmapDesc {
	tag descTag			__attribute__ ((packed));
	UINT32 numOfBits	__attribute__ ((packed));
	UINT32 numOfBytes	__attribute__ ((packed));
};

/* Partition Integrity Entry (ECMA 167 4/14.13) */
struct PartitionIntegrityEntry {
	tag descTag								__attribute__ ((packed));
	icbtag icbTag							__attribute__ ((packed));
	timestamp recordingDateAndTime	__attribute__ ((packed));
	UINT8 integrityType					__attribute__ ((packed));
	UINT8 reserved[175]					__attribute__ ((packed));
	EntityID impIdent						__attribute__ ((packed));
	UINT8 impUse[256]						__attribute__ ((packed));
};

/* Extended Allocation Descriptor (ECMA 167 4/14.14.3) */
typedef struct { /* ECMA 167 4/14.14.3 */
	UINT32 extLength				__attribute__ ((packed));
	UINT32 recordedLength		__attribute__ ((packed));
	UINT32 informationLength	__attribute__ ((packed));
	lb_addr extLocation			__attribute__ ((packed));
} ext_ad;

/* Logical Volume Header Descriptor (ECMA 167 4/14.5) */
struct LogicalVolHeaderDesc {
	UINT8 uniqueID[8]		__attribute__ ((packed));
	UINT8 reserved[24]	__attribute__ ((packed));
};

/* Path Component (ECMA 167 4/14.16.1) */
struct PathComponent {
	UINT8 componentType					__attribute__ ((packed));
	UINT8 lengthComponentIdent			__attribute__ ((packed));
	UINT16 componentFileVersionNum	__attribute__ ((packed));
};

/* File Entry (ECMA 167 4/14.17) */
struct ExtendedFileEntry {
	tag			descTag						__attribute__ ((packed));
	icbtag		icbTag						__attribute__ ((packed));
	UINT32		uid							__attribute__ ((packed));
	UINT32		gid							__attribute__ ((packed));
	UINT32		permissions					__attribute__ ((packed));
	UINT16		fileLinkCount				__attribute__ ((packed));
	UINT8			recordFormat				__attribute__ ((packed));
	UINT8			recordDisplayAttr			__attribute__ ((packed));
	UINT32		recordLength				__attribute__ ((packed));
	UINT8		   informationLength[8]		__attribute__ ((packed));
	UINT8		   objectSize[8]				__attribute__ ((packed));
	UINT8		   logicalBlocksRecorded[8]	__attribute__ ((packed));
	timestamp	accessTime					__attribute__ ((packed));
	timestamp	modificationTime			__attribute__ ((packed));
	timestamp	createTime					__attribute__ ((packed));
	timestamp	attrTime						__attribute__ ((packed));
	UINT32		checkpoint					__attribute__ ((packed));
	UINT32		reserved						__attribute__ ((packed));
	long_ad		extendedAttrICB			__attribute__ ((packed));
	long_ad		streamDirectoryICB		__attribute__ ((packed));
	EntityID		impIdent						__attribute__ ((packed));
	UINT8		   uniqueID[8]					__attribute__ ((packed));
	UINT32		lengthExtendedAttr		__attribute__ ((packed));
	UINT32		lengthAllocDescs			__attribute__ ((packed));
};

#endif /* !defined(_UDF_167_H) */

⌨️ 快捷键说明

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