-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtrie.h
37 lines (25 loc) · 804 Bytes
/
trie.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
#ifndef __TRIE_H
#define __TRIE_H
#include <pthread.h>
typedef struct TrieNode
{
char directory[100];
struct TrieNode *firstChild;
struct TrieNode *sibling;
int isFile;
int isAccessible;
int isWriting;
int isReading;
// pthread_rw_lock_t rwlock;
// sem_t file_lock;
}TrieNode;
void PrintTrieLIkeAnActualTRee(struct TrieNode *root, int level);
TrieNode *createNode(char *directory, int checkFile, int checkAcc);
void InsertTrie(char *directory,TrieNode* root, int checkFile, int checkAcc);
TrieNode* SearchTrie(char *directory,TrieNode* root);
void DeleteTrie(char *directory,TrieNode* root);
void PrintTrie(struct TrieNode *root);
void TrieToString(struct TrieNode *root, char *str);
TrieNode* StringToTrie(char *str);
char* PathParent(char* path);
#endif