| 1 | #include "common.h" |
| 2 | #include "findpass.h" |
| 3 | |
| 4 | #include <stdio.h> |
| 5 | #include <stdlib.h> |
| 6 | #include <string.h> |
| 7 | |
| 8 | List findFullpaths; |
| 9 | List findDispaths; |
| 10 | |
| 11 | void findpass(const char *dpath, const char *txt) { |
| 12 | List fpaths; |
| 13 | initList(&fpaths); |
| 14 | initList(&findFullpaths); |
| 15 | initList(&findDispaths); |
| 16 | scanDir(dpath, dpath, &fpaths, &findFullpaths, &findDispaths); |
| 17 | |
| 18 | for (size_t i = 0; i < findDispaths.size; i++) { |
| 19 | if (strcasestr(getElement(&findDispaths, i), txt) != NULL) { |
| 20 | printf("%s\n", getElement(&findDispaths, i)); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | freeList(&fpaths); |
| 25 | } |