filesys.h
来自「ESS3890+SL原代码(1*16内存)」· C头文件 代码 · 共 225 行
H
225 行
/* Copyright 1996, ESS Technology, Inc. *//* SCCSID @(#)filesys.h 4.13 09/28/04 *//* based on iso9660.h 3.4 09/26/01 *//* * Header file iso9660.h - assorted structure definitions and typecasts. * specific to iso9660 filesystem. Written by Eric Youngdale (1993). Copyright 1993 Yggdrasil Computing, Incorporated This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */#ifndef __FILESYS_H__#define __FILESYS_H__/*#define LONG_FILENAME_SUPP /* enable for long file names (Joliet) *//* some define used by filesys.c, MS, SD */#define LSB_GET_4BYTES(x) ((*((x)+3)) << 24) | ((*((x)+2)) << 16) | \ ((*((x)+1)) << 8) | ((*((x))))#define LSB_GET_2BYTES(x) ((*((x)+1)) << 8) | ((*((x))))#define get_bigend32(pcbuf, off) ((uchar)pcbuf[off]|((uchar)pcbuf[off+1] << 8)|\ ((uchar)pcbuf[off+2] << 16)|((uchar)pcbuf[off+3] <<24))#define get_litend32(pcbuf, off) (((uchar)pcbuf[off]<<24)|((uchar)pcbuf[off+1]\ <<16) |((uchar)pcbuf[off+2] << 8) | (uchar)pcbuf[off+3])/* * The isofs filesystem constants/structures *//* This part borrowed from the bsd386 isofs */#define ISODCL(from, to) (to - from + 1)struct iso_primary_descriptor { char type [ISODCL ( 1, 1)]; /* 711 */ char id [ISODCL ( 2, 6)]; char version [ISODCL ( 7, 7)]; /* 711 */ char unused1 [ISODCL ( 8, 8)]; char system_id [ISODCL ( 9, 40)]; /* achars */ char volume_id [ISODCL ( 41, 72)]; /* dchars */ char unused2 [ISODCL ( 73, 80)]; char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ char unused3 [ISODCL ( 89, 120)]; char volume_set_size [ISODCL (121, 124)]; /* 723 */ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ char logical_block_size [ISODCL (129, 132)]; /* 723 */ char path_table_size [ISODCL (133, 140)]; /* 733 */ char type_l_path_table [ISODCL (141, 144)]; /* 731 */ char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ char type_m_path_table [ISODCL (149, 152)]; /* 732 */ char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ char volume_set_id [ISODCL (191, 318)]; /* dchars */ char publisher_id [ISODCL (319, 446)]; /* achars */ char preparer_id [ISODCL (447, 574)]; /* achars */ char application_id [ISODCL (575, 702)]; /* achars */ char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ char file_structure_version [ISODCL (882, 882)]; /* 711 */ char unused4 [ISODCL (883, 883)]; char application_data [ISODCL (884, 1395)]; char unused5 [ISODCL (1396, 2048)];};struct iso_directory_record { uchar length [ISODCL (1, 1)]; /* 711 */ uchar ext_attr_length [ISODCL (2, 2)]; /* 711 */ uchar extent [ISODCL (3, 10)]; /* 733 */ uchar size [ISODCL (11, 18)]; /* 733 */ uchar date [ISODCL (19, 25)]; /* 7 by 711 */ uchar flags [ISODCL (26, 26)]; uchar file_unit_size [ISODCL (27, 27)]; /* 711 */ uchar intrleave [ISODCL (28, 28)]; /* 711 */ uchar volume_sequence_number [ISODCL (29, 32)]; /* 723 */ uchar name_len [ISODCL (33, 33)]; /* 711 */ char name [34]; /* Not really, but we need something here */};#ifdef UDFstruct UDF_FileIdentDesc { uchar descTag [ISODCL ( 1, 16)]; uchar fileVersionNum [ISODCL (17, 18)]; /* 1 */ uchar fileCharacteristics [ISODCL (19, 19)]; uchar lengthFileIdent [ISODCL (20, 20)]; uchar icb_extLength [ISODCL (21, 24)]; uchar icb_extLocation_LBN [ISODCL (25, 28)]; uchar icb_extLocation_PRN [ISODCL (29, 30)]; uchar icb_impUse [ISODCL (31, 36)]; uchar lengthOfImpUse [ISODCL (37, 38)]; uchar impUse[0]; char fileIdent[0]; uchar padding[0];};/* "fileCharacteristics" (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 */#endif UDF#if defined(HOST_SLAVE)#define DIR_REC_NAME_LENGTH 20#elif defined(LONG_FILENAME_SUPP)#define DIR_REC_NAME_LENGTH 21#else#define DIR_REC_NAME_LENGTH 9#endifstruct DIR_REC{ int loc; /* mmssff */ int size; /* in sectors */#if (defined(JPEG_DEC)||defined(GAMEBOY)) int bsize; /* in bytes */#endif#ifdef MP3CDG int mp3cdg_loc; int mp3cdg_size;#endif short dir;#ifdef HOST_SLAVE unsigned char parent_dir;#endif unsigned char name[DIR_REC_NAME_LENGTH+1]; /* "+1" for zero terminator */};#ifdef HOST_SLAVE struct FILE_REC{ int loc; /* mmssff */ int size; /* in sectors */ short dir; unsigned char parent_dir; unsigned char name[21]; unsigned int MP3_Packet_End[8]; unsigned int MP3_Packet_Start[8];}; #endiftypedef struct { uchar id; char suf[7];} SUF_ID;#ifdef LONG_FILENAME_SUPP #ifndef SECONDARY_VOL_TABLE #define SECONDARY_VOL_TABLE #endif#endif#define SECONDARY_VOL_TABLE #ifdef SECONDARY_VOL_TABLE #define MAX_JOLIET_STRING 64*2#else#define MAX_JOLIET_STRING 64#endif#ifdef AVI_DEC#define MAX_DIR_CNT 128#else#define MAX_DIR_CNT 256#endif#define DIR_REC_LEN sizeof(struct DIR_REC)#define ISO9660_DIR_SIZE (DIR_REC_LEN*MAX_DIR_CNT)#define MAX_FILE_CNT (4*ISO_size - ISO9660_DIR_SIZE)/DIR_REC_LEN/* NOTE: MAX_FILE_CNT = 1536, based on ISO_size = 10,752 DW */#define ISO9660_DIR_OFFSET (0x02000000 + ISO_start * 4) #define ISO9660_FILE_OFFSET (ISO9660_DIR_OFFSET + ISO9660_DIR_SIZE) GBLDEF0(int ROOT_loc);GBLDEF0(int ROOT_size);GBLDEF0(int sec_vol_table);GBLDEF(volatile int iso9660_dir_cnt, 0);GBLDEF(int iso9660_file_cnt, 0);GBLDEF(struct DIR_REC *iso9660_dir, (struct DIR_REC *)ISO9660_DIR_OFFSET);GBLDEF(struct DIR_REC *iso9660_file, (struct DIR_REC *)ISO9660_FILE_OFFSET);#ifdef JPEG_DEC#ifdef JPEG_DGSTGBLDEF0(int jpg_file_cnt);#endifGBLDEF0(int is_Kodak_pictureCD);GBLDEF0(int is_fuji_cd);#endif JPEG_DEC#ifdef MULTI_EXT_FILEGBLDEF0(int cur_file_rec);#endifextern uchar real_track[]; /* map to real track number */extern int real_track_cnt; /* how many MP3 track we find */extern int read_filesys(void);extern int read_iso9660(int);extern int ISO_multi_ext_end(void);extern int track_to_rec(int); #endif /* __FILESYS_H__ */
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?