📄 cdfs.h
字号:
/*
* cdfs_fs_i.h
*
* This file is intended for the Linux kernel/module.
*
* CONTACTS
* E-mail regarding any portion of the Linux CDFS file system should be
* directed to the development team mailing list (run by majordomo):
* linux_cdfs@hootie.lvld.hp.com
*
* COPYRIGHT
* This file is distributed under the terms of the GNU General Public
* License (GPL). Copies of the GPL can be obtained from:
* ftp://prep.ai.mit.edu/pub/gnu/GPL
* Each contributing author retains all rights to their own work.
*/
#ifndef _CDFS_H
#define _CDFS_H
#define CDDA_DISC_TYPE 0x00 //CDDA or CD-ROM with first track MODE 1
#define CDI_DISC_TYPE 0x10 //CD-I Disc
#define CDROMXA_DISC_TYPE 0x20 //CD-ROM XA disc with first track in Mode 2
typedef enum cdfs_types_s
{
CDFS_ERROR_TYPE,
CDFS_CDDA,
CDFS_CDT,
} cdfs_types_t;
typedef struct cdfs_info_s
{
dev_t dev;
unsigned int sessionNum;
unsigned int trackNum;
unsigned int typeFlag;
disk_device *dd;
}cdfs_dev_info_t;
/*
* This structure identifies the instance of the filesystem on the
* ("cdfs-file") level.
*/
typedef struct cdfs_fs_info_s
{
cdfs_dev_info_t vol;
Chain_Control *chain; /* "list" of cdfs-file descriptors */
avfs_filesystem_file_handlers_r *directory_handlers; /*
* a set of routines
* that handles the
* nodes of directory
* type
*/
avfs_filesystem_file_handlers_r *file_handlers; /*
* a set of routines
* that handles the
* nodes of file
* type
*/
avfs_id vol_sema; /*
* semaphore
* associated with
* the volume
*/
unsigned32 num_path_table;
unsigned32 joliet_level;
unsigned32 current_obj; //object in operating Andrew
}cdfs_fs_info_t;
typedef avfs_filesystem_node_types_t cdfs_file_type_t;
#define CDFS_DIRECTORY AVFS_FILESYSTEM_DIRECTORY
#define CDFS_FILE AVFS_FILESYSTEM_MEMORY_FILE
typedef struct cdfs_dir_info_s{
unsigned32 size;
int name_len;
char * name; // for file only
unsigned32 start;
} cdfs_dir_info_t;
/*
* descriptor of a cdfs-file
*
*/
typedef struct cdfs_file_fd_s
{
Chain_Node link;
unsigned16 links_num;
cdfs_dir_info_t *dirs_files; //files in if it is dir
unsigned32 trackStart; //track start if it is a file
unsigned32 size; //track end if it is a file
unsigned32 indexInRootDir; //track index in dir
unsigned32 dir_file_num; // for dir only
cdfs_file_type_t type;
} cdfs_file_fd_t;
#ifndef RC_OK
#define RC_OK 0x00000000
#endif
#define CDFS_NAME_NOT_FOUND_ERR 0xDD000001
#define CDFS_VOLUME_SEMAPHORE_TIMEOUT AVFS_NO_TIMEOUT
#ifndef set_errno_and_return_minus_one
#define set_errno_and_return_minus_one avfs_set_errno_and_return_minus_one
#endif /* set_errno_and_return_minus_one */
extern avfs_filesystem_operations_table cdfs_ops;
extern avfs_filesystem_file_handlers_r cdfs_dir_handlers;
extern avfs_filesystem_file_handlers_r cdfs_file_handlers;
#define CDFS_MAX_FILE_INCREASE 64
#define CDFS_NAME_MAX 256
#define CDFS_DOT_NAME ". " /* ".", padded to CDFS_NAME chars */
#define CDFS_DOTDOT_NAME ".. " /* "..", padded to CDFS_NAME chars */
#define CDFS_BYTES_PER_SECTOR 2048
#define CDFS_DEFAULT_BLOCK_SHIFT 11
#define CDFS_CDDA_DEFAULT_SIZE 2352
#define CDFS_DEFAULT_BLOCK_SIZE 2048
#define CDFS_DEV_BSIZE CDFS_DEFAULT_BLOCK_SIZE
typedef enum cdfs_token_types_s
{
CDFS_NO_MORE_PATH,
CDFS_CURRENT_DIR,
CDFS_UP_DIR,
CDFS_NAME,
CDFS_INVALID_TOKEN
} cdfs_token_types_t;
#define cdfs_is_separator(_ch) avfs_filesystem_is_separator(_ch)
/* udf_initialize_support --
* udf filesystem initialization
*
* PARAMETERS:
* temp_mt_entry - mount table entry
* op_table - filesystem operations table
* file_handlers - file operations table
* directory_handlers - directory operations table
*
* RETURNS:
* RC_OK and filled temp_mt_entry on success, or -1 if error occured
* (errno set apropriately)
*
*/
int
udf_initialize_support(
avfs_filesystem_mount_table_entry_t *temp_mt_entry,
avfs_filesystem_operations_table *op_table,
avfs_filesystem_file_handlers_r *file_handlers,
avfs_filesystem_file_handlers_r *directory_handlers
);
#endif /* #ifndef _CDFS_FS_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -