notify/fscrawl: fixed up src/notify/tree, ADT, new API, new name.
This commit is contained in:
parent
9fbe9cfc23
commit
8d7b4a74c7
8 changed files with 260 additions and 277 deletions
40
test/t_fscrawl.c
Normal file
40
test/t_fscrawl.c
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
|
||||
#include <stdio.h>
|
||||
#include "../src/notify/fscrawl.h"
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
fscrawl_t crawl;
|
||||
unsigned int c_ent = 0;
|
||||
|
||||
if (argc < 2)
|
||||
return 1;
|
||||
|
||||
crawl = fsc_open(argv[1]);
|
||||
|
||||
if (crawl == NULL) {
|
||||
printf("Invalid path\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
for(;;) {
|
||||
|
||||
fs_entry *ent = fsc_read(crawl);
|
||||
|
||||
if (!ent)
|
||||
break;
|
||||
|
||||
printf("%s%s", ent->base, ent->name);
|
||||
|
||||
if (ent->dir)
|
||||
printf("/\n");
|
||||
else
|
||||
printf("\n");
|
||||
|
||||
c_ent++;
|
||||
}
|
||||
|
||||
printf("%i Entries\n", c_ent);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in a new issue