Stage 0:
*basic structure
*update logging
--global variables
- *session
- *torrents
- *options
- -peers
- -add queue
- -no, run each directory in torrents through nftw
+*global variables
+-implement generic hashmap with libsodium
-setup watches
*add option to watch directories
*add option for worker_threads [default=ncores]
- -add default watch directories
+ *add default watch directories
-foreach watch directory
-walk each tree
-add each file to add queue
- -check for duplicates
- -hashmap?
- -add pointer to struct file to torrent
+ -add queue = hashmap to allow for duplicate checking
+ -add pointer to struct file to torrent->files hashmap + file_tree
+ -2 ways to access, file_tree must be sorted, hashmap allows for o(1) reads
-find all files in all directories
-functions for traversing directory
-man scandir
-https://stackoverflow.com/questions/66936692/how-to-use-scandir-in-c-to-list-sorted-subdirectories-recursively
-save to struct with file size
-multi-threaded add, spawn opt.worker_threads # of threads
+ -figure out what hashing needs to be done
-add to torrent(s)
- -sort in torrent struct after all done
+ -sort file_tree in torrent struct after all done
+ -create tree_sort method
-on modification
- -update torrents?
+ -update files
+ -call tree_sort()
-build+replace existing torrent
-create torrent
-build merkle tree
-tcp+udp functionality
-create/add torrents
-create feeds
+ -meta files, torrent names
-bring in feeds from old project
Stage 2: