diff options
Diffstat (limited to 'src/scanner.c')
| -rw-r--r-- | src/scanner.c | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/src/scanner.c b/src/scanner.c deleted file mode 100644 index 2ffbea4..0000000 --- a/src/scanner.c +++ /dev/null | |||
| @@ -1,37 +0,0 @@ | |||
| 1 | #define _GNU_SOURCE | ||
| 2 | #include "shared.h" | ||
| 3 | |||
| 4 | #include "scanner.h" | ||
| 5 | |||
| 6 | #include <stdlib.h> | ||
| 7 | #include <dirent.h> | ||
| 8 | #include <string.h> | ||
| 9 | #include <errno.h> | ||
| 10 | #include <error.h> | ||
| 11 | |||
| 12 | // dlinkedlist * scandirlist(const char * const dir, int (*selector)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **)) { | ||
| 13 | // if(!dir || selector == NULL || cmp == NULL) ERRRET(EINVAL, NULL); | ||
| 14 | |||
| 15 | // struct dirent **namelist = NULL; | ||
| 16 | // dlinkedlist *list = NULL; | ||
| 17 | // int numentries = -1; | ||
| 18 | |||
| 19 | // if((numentries = scandir(dir, &namelist, selector, cmp)) < 0) | ||
| 20 | // ERRRET(errno, NULL); | ||
| 21 | |||
| 22 | // list = dlinkedlist_init(); | ||
| 23 | // for(int i = 0; i < numentries; i++) | ||
| 24 | // if(dlinkedlist_append(list, (void *)(namelist[i]), free) < 0) { | ||
| 25 | // dlinkedlist_free(list); | ||
| 26 | // for(int j = i; j < numentries; j++) | ||
| 27 | // free(namelist[j]); | ||
| 28 | |||
| 29 | // free(namelist); | ||
| 30 | // ERRRET(errno, NULL); | ||
| 31 | // } | ||
| 32 | // free(namelist); | ||
| 33 | |||
| 34 | // return list; | ||
| 35 | // } | ||
| 36 | |||
| 37 | // TODO: Rewrite this to use the threadpool. Each newly scanned file should be pushed onto the threadpool as an encryption task \ No newline at end of file | ||
