From 534a492f2c0bcceac52a287b03dc1ff5eb0b0763 Mon Sep 17 00:00:00 2001 From: "@syxhe" Date: Mon, 9 Jun 2025 15:03:19 -0500 Subject: Trim more fat, add some doxygen markup to the threadpool functions --- src/encryption.c | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'src/encryption.c') diff --git a/src/encryption.c b/src/encryption.c index b6832ed..89448e8 100644 --- a/src/encryption.c +++ b/src/encryption.c @@ -286,6 +286,45 @@ void* xsodium_malloc(size_t size) { } + +/* + +#include "threadpool.h" + +// #include +// #include +// #include +// #include +// #include + +// dlinkedlist * scandirlist(const char * const dir, int (*selector)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)) { +// if(!dir || selector == NULL || cmp == NULL) ERRRET(EINVAL, NULL); + +// struct dirent **namelist = NULL; +// dlinkedlist *list = NULL; +// int numentries = -1; + +// if((numentries = scandir(dir, &namelist, selector, cmp)) < 0) +// ERRRET(errno, NULL); + +// list = dlinkedlist_init(); +// for(int i = 0; i < numentries; i++) +// if(dlinkedlist_append(list, (void *)(namelist[i]), free) < 0) { +// dlinkedlist_free(list); +// for(int j = i; j < numentries; j++) +// free(namelist[j]); + +// free(namelist); +// ERRRET(errno, NULL); +// } +// free(namelist); + +// return list; +// } + +// TODO: Rewrite this to use the threadpool. Each newly scanned file should be pushed onto the threadpool as an encryption task +*/ + /* int main(void) { // Example code for creating a temp file, writing to it, then linking it back into the fs -- cgit v1.2.3