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

📄 fd.h

📁 一个用C++写的模拟LINUX文件系统的程序
💻 H
字号:
/* fd.h */#ifndef _FD_H#define _FD_H 0#include "block.h"#include "inode.h"#include <math.h>#include <string.h>/* SEEK_BLK(blk_no) IMPLIES boot, super and inode_table contains in one block */#define SEEK_BLK(blk_no)  BLOCK_SIZE*(INODE_TABLE_BLOCKS + 1 + blk_no)#define NAME_LEN 14#define PATH_LEN 100struct fd_entry{    char name[NAME_LEN];	/* file or dir name */    int inode_no;		/* inode number */};struct blk_index{		/* block index in indirect addr*/    int blk_no;};struct fs_inode find_inode( FILE *fp, int ind_no);struct fd_entry find_entry( FILE *fp, int dir_ind_no, int file_inode_no);int fd_exist( FILE *fp, int ind_no, const char *fd_name);int blk_map( FILE *fp, int ind_no, long offset);int alc_blk( FILE *fp, int ind_no);int create_fd( FILE *fp, int dir_ind_no, const char *file, const char given_type, const char *f_size);int remove_fd( FILE *fp, int dir_ind_no, const char *file);#endif	/* _FD_H */

⌨️ 快捷键说明

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