summaryrefslogtreecommitdiff
path: root/src/encryption.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/encryption.c')
-rw-r--r--src/encryption.c39
1 files changed, 39 insertions, 0 deletions
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) {
286} 286}
287 287
288 288
289
290/*
291
292#include "threadpool.h"
293
294// #include <stdlib.h>
295// #include <dirent.h>
296// #include <string.h>
297// #include <errno.h>
298// #include <error.h>
299
300// dlinkedlist * scandirlist(const char * const dir, int (*selector)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)) {
301// if(!dir || selector == NULL || cmp == NULL) ERRRET(EINVAL, NULL);
302
303// struct dirent **namelist = NULL;
304// dlinkedlist *list = NULL;
305// int numentries = -1;
306
307// if((numentries = scandir(dir, &namelist, selector, cmp)) < 0)
308// ERRRET(errno, NULL);
309
310// list = dlinkedlist_init();
311// for(int i = 0; i < numentries; i++)
312// if(dlinkedlist_append(list, (void *)(namelist[i]), free) < 0) {
313// dlinkedlist_free(list);
314// for(int j = i; j < numentries; j++)
315// free(namelist[j]);
316
317// free(namelist);
318// ERRRET(errno, NULL);
319// }
320// free(namelist);
321
322// return list;
323// }
324
325// TODO: Rewrite this to use the threadpool. Each newly scanned file should be pushed onto the threadpool as an encryption task
326*/
327
289/* 328/*
290int main(void) { 329int main(void) {
291 // Example code for creating a temp file, writing to it, then linking it back into the fs 330 // Example code for creating a temp file, writing to it, then linking it back into the fs