📄 fscan.h
字号:
#ifndef _FAT1X_SCAN_H
#define _FAT1X_SCAN_H
//#include "fat1x.h"
struct scan_dir
{
unsigned char pathName[MAX_PATHNAME_LEN]; // the complete path name of the dir
unsigned short startCluster; // the starting cluster of the dir
};
/*************************************************************
Fuction : scanDisk
Scan the RAMDisk for errors
Input:
interactive - ECHO_ON: show progress during scanning
ECHO_OFF: show nothing during scanning
fix - 1: automatically fix error
0: report only, don't fix
Output:
0: no error is found
1: FAT tables unmatch
2
**************************************************************/
char FAT_scanDisk(char interactive, char fix);
/*************************************************************
Fuction : FAT_fat_compare
Compare the two FATs
Input:
drive: the target drive
Output:
0: match
1: unmatch and FAT1 is considered correct
2: unmatch and FAT2 is considered correct
-1: error
**************************************************************/
int FAT_fat_compare(int drive);
/*************************************************************
Fuction : FAT_fat_copy
Copy a FAT table to another
Input:
drive - the target drive
source - the starting sector number of the source FAT table
target - the starting sector number of the target FAT table
Output:
0: SUCCESS
-1: FAILURE
**************************************************************/
int FAT_fat_copy(int drive, unsigned long source, unsigned long target);
/*************************************************************
Fuction : FAT_checkEntry
Check the integrity of a dir entry
Input:
upperDir - the directory in which this file is stored
entry - the directory structure of the target file
Output:
0: SUCCESS
1: file has error
-1: FAILURE (check errno)
**************************************************************/
/*
#ifdef LFN
int checkEntry(unsigned char *upperDir, struct directory *entry, struct LFNinfo *longInfo, unsigned short *blockBuffer);
#else
int checkEntry(unsigned char *upperDir, struct directory *entry);
#endif
*/
#ifdef FAT_LFN
int FAT_checkEntry(int drive, unsigned char *upperDir, struct FAT_directory *entry, struct FAT_LFNinfo *longInfo, unsigned short *blockBuffer);
#else
int FAT_checkEntry(int drive, unsigned char *upperDir, struct FAT_directory *entry);
#endif
/*************************************************************
Fuction : FAT_checkDir
Check the integrity of a sub-directory
Input:
drive - the target drive
name - the complete pathname of the target sub-directory
head - the head cluster in the cluster chain of the target sub-directory
Output:
0: SUCCESS
1: dir has error
-1: FAILURE
**************************************************************/
//int checkDir(unsigned char *name, unsigned short head);
int FAT_checkDir(int drive, unsigned char *name, unsigned short head);
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -