-
Notifications
You must be signed in to change notification settings - Fork 0
/
dir_object.h
48 lines (41 loc) · 1.51 KB
/
dir_object.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "endianess.h"
typedef struct DIR_Attr
{
short ATTR_READ_ONLY;
short ATTR_HIDDEN;
short ATTR_SYSTEM;
short ATTR_VOLUME_ID;
short ATTR_DIRECTORY;
short ATTR_ARCHIVE;
}DIR_Attr;
typedef struct DIR_info
{
unsigned int DIR_address;
unsigned int parent_DIR_address;
unsigned char DIR_Name [12] ;
// unsigned int DIR_CrtTime;
// unsigned int DIR_CrtDate;
unsigned int DIR_FstClusLo;
unsigned int DIR_FstClusHI;
unsigned int FstCluster;
unsigned int DIR_FileSize;
// int number_of_files;
DIR_Attr dir_attr;
}DIR_info;
typedef struct DIR_files
{
DIR_info * files;
int number_of_files;
}DIR_files;
typedef struct Clusters
{
unsigned int * clustersArray;
int num_of_clusters;
}Clusters;
DIR_info dir_constructor (unsigned char * buffer, unsigned int dir_address, unsigned int parent_DIR_address);
DIR_files get_dir_files (unsigned char * buffer, DIR_info dir_info, unsigned int SecPerClus, unsigned int BytesPerSec, unsigned int FirstDataSector, unsigned int FAToffset);
DIR_files get_dir_files_from_pointer (unsigned char * buffer, DIR_info * dir_info, unsigned int SecPerClus, unsigned int BytesPerSec, unsigned int FirstDataSector, unsigned int FAToffset);
DIR_info * get_file_from (DIR_files files, char * name);
unsigned int getFirstSectorofClusterN (unsigned int clusterNum, unsigned int SecPerClus, unsigned int FirstDataSector);
Clusters getAllClusters (unsigned int firstClus, unsigned char * buffer, unsigned int FAToffset);
char volume_name[12];