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

📄 filenode.h

📁 老外写的一个文件系统
💻 H
字号:
#ifndef FILENODE_H
#define FILENODE_H

//	A FileNode is everything you need to know about a file
//	- starting cluster number
//	- size in bytes of this file
//	- NameNodeHandle for the filename

// this handle is made up of a DramPageIndex, and an index to an entry in that page.
typedef unsigned long FileNodeHandle;


#include "FileSystem/Fat32/FatCache.h"
#include "FileSystem/Fat32/FileTree/NameNode.h"


// if you want to refer to the fact that "no file" is selected.
#define NO_FILE_NODE	0

void FILENODE_Initialize(void);

// create a new FileNode to represent a file, and return its' handle.
FileNodeHandle FILENODE_AddFile(
	ClusterNumber startingClusterNumber,
	unsigned long sizeInBytes,
	NameNodeHandle nameOfFile);

// this is called after completing the scan of a folder.
// Then, call FILENODE_LinkFileTreeSomeMore() as documented.
// It will link the file-tree to include the new folder and
// its' files.
void FILENODE_DoneAddingFilesToFolder(void);

// After notifying the FILENODE system that you're done adding a folder of files
// (by calling FILENODE_DoneAddingFilesToFolder), then 
// call this repeatedly until it returns TRUE (done).
// (this can be a big job, so it is broken into pieces 
// internally, and will not reutrn TRUE until it's done)
char FILENODE_LinkFileTreeSomeMore(void);

// ask what the cluster number is, of the first cluster of this file.
// This is needed to open the file.
ClusterNumber FILENODE_DiscoverFirstCluster(FileNodeHandle);

// ask what the files' size is in bytes.
unsigned long FILENODE_DiscoverFileSizeInBytes(FileNodeHandle);

// returns the next FileNode in memory.
FileNodeHandle FILENODE_GetNextFileNodeSibbling(FileNodeHandle);

// returns the previous FileNode in memory.
FileNodeHandle FILENODE_GetPrevFileNodeSibbling(FileNodeHandle);

// returns the first FileNode of the next folder in memory.
FileNodeHandle FILENODE_GetFirstFileNodeOfNextFolder(FileNodeHandle);

// returns the last FileNode of the previous folder in memory.
FileNodeHandle FILENODE_GetLastFileNodeOfPrevFolder(FileNodeHandle);

// returns the NameNode containing the filename.
NameNodeHandle FILENODE_GetFilename(FileNodeHandle);

// Calling this with the first file in a folder will cause all files 
// in the folder to be sorted alphabetically.
void FILENODE_SortSibblingFiles(FileNodeHandle);

void FILENODE_Dump(FileNodeHandle);

#endif

⌨️ 快捷键说明

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