suwako / sp アーカイブ

このリポジトリはアーカイブされています。読むだけで、プッシュやイシューの変更は出来ません。

master
ブランチ master
sp / src / findpass.c
554 B、25行 生 Blame 履歴
1#include "common.h"
2#include "findpass.h"
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7
8List findFullpaths;
9List findDispaths;
10
11void 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}