Switch to the no_helpers branch, that branch has been made for users that want just the tree, because they wanna use it for something else. I get where those people are coming from, because initially even I didn't know what I wanted to do after writing the tree generation code for a while. That tree can be used for anything.
- NOTE: people switching to the no_helpers branch should read this README too. It has all the information you need to work with the tree.
struct dnode *init_tree(char *absolute_location_of_dir)- this creates the tree.struct fnode *find_fnode_abs(struct dnode *tree, char *absolute_location_of_file)- this will return the fnode corresponding to a file.int write_abs(struct dnode *tree, char *absolute_location_of_file, char *content)- this will write to a file, wont append.struct str_blk *read_abs(struct dnode *tree, char *absolute_location_of_file)- this will return the content of a file(str_blk explained below with all the structs).
structfnode{
char*location;
structstr_blk*text; structstatst;
};- This is the structure in the tree that contains the file. Location is absolute.
structdnode{
char*location; structstatst;
structdnode*parent;
structdnode_list*dlist; structfnode_list*flist;
};- This is the structure in the tree that contains the directory. Location is absolute. dnode_list, fnode_list explained below.
structdnode_list{
structdnode*val;
structdnode_list*next;
};- This is just a linked list of sub-directories in a dnode
structfnode_list{
structfnode*val;
structfnode_list*next;
};- This is just a linked list of files in a dnode
structstr_blk{
char*content;
structstr_blk*next;
};- This is how the tree stores text, Instead of one big buffer, the program creates a linked list of blocks of text, with predefined size (BLK_SIZE defined in
str_ll.h)