-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdirectory.h
45 lines (39 loc) · 990 Bytes
/
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
/*************************************************
*
* filename: directory.h
*
* CSC 552 LFS Project Phase 1
*
* Sunghoon Kim [email protected]
*
* Hoang Van [email protected]
*
* A directory layer header definition
*************************************************/
#include <stdio.h>
#include <stdint.h>
#include "fsmeta.h"
#include <stdlib.h>
#include <string.h>
#include "file.h"
#include <fuse.h>
#include <string.h>
#include <fcntl.h>
#define FUSE_USE_VERSION 26
#ifndef DIRECTORY_H
#define DIRECTORY_H
#define char_size sizeof(char)
#define LFS_FILE_NAME_MAX_LEN 48
struct dir {
char name[LFS_FILE_NAME_MAX_LEN];
int size;
};
struct dir_entry{
char name[LFS_FILE_NAME_MAX_LEN];
uint16_t inum;
};
uint16_t get_inode_num_from_parent(char *filename, uint16_t parent_inum);
uint16_t get_inode_num_lfs(const char *path);
uint16_t get_last_dir(const char* path, char *new_dir);
void substring(char s[], char sub[], int p, int l);
#endif