-
Notifications
You must be signed in to change notification settings - Fork 0
/
directory.h
61 lines (47 loc) · 1.45 KB
/
directory.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
49
50
51
52
53
54
55
56
57
58
59
60
61
/**************************************************************
* Class: CSC-415-01 Spring 2022
* Names: Shahriz Malek, Duccio Rocca, Abhiram Rishi Prattipati, Christopher Solorzano
* Student IDs: 920378989, 922254031, 921346982, 920528216
* GitHub Name: RINO-GAELICO
* Group Name: Sunset
* Project: Basic File System
*
* File: directory.h
*
* Description: Headers for directory.c
*
**************************************************************/
#ifndef _DIRECTORY_H
#define _DIRECTORY_H
#include <sys/types.h>
#include <unistd.h>
#include <time.h>
#include "fsLow.h"
#include "fat.h"
#include "fs_struct.h"
#include "mfs.h"
#define DIR_ENTRY_UNUSED 0xE5
#define IS_DIR 0x10
#define ATTR_READ_ONLY 0x01
#define ATTR_HIDDEN 0x02
#define ATTR_SYSTEM 0x04
#define ATTR_VOLUME_ID 0x08
#define ATTR_ARCHIVE 0x20
#define IS_DIR_BIT 5
typedef struct
{
int indexDE;
char * lastComponent;
char * currentComponent;
int isDir; // 1 YES , 0 NO;
DIR_ENTRY DE_element;
DIR_ENTRY parentDE;
}DE_holder;
extern DE_holder *deHolderRet;
extern fdDir * fdPtr;
int checkDirBit(char attributeValue);
DE_holder *parsePath (char * path, DE_holder *DEholder);
DIR_ENTRY* initDirectory(struct DIR_ENTRY directory[], DIR_ENTRY parentDE, int elementsCount, int locationDir);
DIR_ENTRY* initDirectoryRoot(struct DIR_ENTRY directory[], int elementsCount, int locationDir);
DIR_ENTRY* loadDirectory (int fileSize, int firstLocation, DIR_ENTRY * dirBuffer);
#endif