blob: d5e90c96b058527e1e8af9ddfcd4ace9bdcd4df6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
#define _GNU_SOURCE
#include "arena.h"
#include "ll.h"
#include "encryption.h"
#include "scanner.h"
#include "shared.h"
#include <errno.h>
#include <error.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <dirent.h>
int lol(const struct dirent *node) {return 1;}
int printnames(void *data) {
printf("%s\n", (data) ? ((struct dirent *)data)->d_name : "null");
return 0;
}
int main() {
// error(1, ENOTSUP, "No main file lol");
// Test code to showcase the scanner function
dlinkedlist *ll = scandirlist(".", lol, alphasort);
dlinkedlist_foreach(ll, printnames);
dlinkedlist_free(ll);
return 0;
}
|